single-source-of-truth
Version:
Use Zod schemas to your generate Prisma schema
22 lines (17 loc) • 597 B
text/typescript
import 'tsx';
import { pathToFileURL } from 'node:url';
import { Command } from 'commander';
import type { ConfigFn } from './config.js';
import { Registry } from './registry.js';
const program = new Command('truth').action(async () => {
const configPath = pathToFileURL('truth.config.ts').toString();
const configFn = await import(configPath) //
.then((m) => m.default as ConfigFn);
return configFn({
registry: new Registry(),
'zod/v4': await import('./zod/v4/config'),
prisma: await import('./prisma/config'),
});
});
program.parse(process.argv);