UNPKG

@t1mmen/srtd

Version:

Supabase Repeatable Template Definitions (srtd): ๐Ÿช„ Live-reloading SQL templates for Supabase DX. Make your database changes reviewable and migrations maintainable! ๐Ÿš€

52 lines โ€ข 2.17 kB
// commands/index.tsx import { Select } from '@inkjs/ui'; import { Box } from 'ink'; import React from 'react'; import Branding from '../components/Branding.js'; import Quittable from '../components/Quittable.js'; import Apply from './apply.js'; import Build from './build.js'; import Clear from './clear.js'; import Promote from './promote.js'; import Register from './register.js'; import Watch from './watch.js'; export default function UI() { const [selectedCommand, setSelectedCommand] = React.useState(null); const handleOnChange = async (value) => { setSelectedCommand(value); }; if (selectedCommand === 'register') { return React.createElement(Register, { args: undefined }); } if (selectedCommand === 'apply') { return React.createElement(Apply, { options: { force: false } }); } if (selectedCommand === 'build') { return React.createElement(Build, { options: { force: false } }); } if (selectedCommand === 'watch') { return React.createElement(Watch, null); } if (selectedCommand === 'clear') { return React.createElement(Clear, null); } if (selectedCommand === 'promote') { return React.createElement(Promote, null); } const menuItems = [ { label: '๐Ÿ‘€ watch - Watch for changes, apply directly to db', value: 'watch', }, { label: 'โ–ถ๏ธ apply - Apply templates directly to db', value: 'apply' }, { label: '๐Ÿ—๏ธ build - Build templates as Supabase migrations', value: 'build' }, { label: 'โœ๏ธ register - Register templates as already built', value: 'register' }, { label: '๐Ÿš€ promote - Promote WIP template to buildable templates', value: 'promote' }, { label: '๐Ÿงน maintenance - Clear build logs and reset config', value: 'clear' }, ]; return (React.createElement(Box, { flexDirection: "column" }, React.createElement(Branding, null), React.createElement(Select, { visibleOptionCount: 10, options: menuItems, onChange: handleOnChange }), React.createElement(Quittable, null))); } //# sourceMappingURL=index.js.map