@t1mmen/srtd
Version:
Supabase Repeatable Template Definitions (srtd): 🪄 Live-reloading SQL templates for Supabase DX. Make your database changes reviewable and migrations maintainable! 🚀
27 lines • 1.18 kB
JavaScript
// src/commands/apply.tsx
import { Spinner } from '@inkjs/ui';
import { Box, useApp } from 'ink';
import { option } from 'pastel';
import React from 'react';
import zod from 'zod';
import Branding from '../components/Branding.js';
import { ProcessingResults } from '../components/ProcessingResults.js';
import { useTemplateProcessor } from '../hooks/useTemplateProcessor.js';
export const options = zod.object({
force: zod.boolean().describe(option({
description: 'Force apply of all templates, irrespective of changes',
alias: 'f',
})),
});
export default function Apply({ options }) {
const { exit } = useApp();
const { result, isProcessing } = useTemplateProcessor({
force: options.force,
apply: true,
onComplete: () => exit(), // Move exit here
});
return (React.createElement(Box, { flexDirection: "column", gap: 1 },
React.createElement(Branding, { subtitle: "\u25B6\uFE0F Apply migrations" }),
isProcessing ? (React.createElement(Spinner, { label: "Applying templates..." })) : (React.createElement(ProcessingResults, { result: result, showApply: true }))));
}
//# sourceMappingURL=apply.js.map