@drzl/cli 4.14.3 → 4.14.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +85 -64
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +85 -64
- package/dist/cli.js.map +1 -1
- package/dist/config.d.cts +2 -2
- package/dist/config.d.ts +2 -2
- package/package.json +5 -5
package/dist/cli.js
CHANGED
|
@@ -91,6 +91,30 @@ async function restoreSnapshot(before, after) {
|
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
// src/generator-loader.ts
|
|
95
|
+
var GeneratorNotInstalledError = class extends Error {
|
|
96
|
+
constructor(specifier, reason) {
|
|
97
|
+
super(`${specifier} is not installed`);
|
|
98
|
+
this.specifier = specifier;
|
|
99
|
+
this.reason = reason;
|
|
100
|
+
this.name = "GeneratorNotInstalledError";
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
function isPackageMissing(err, specifier) {
|
|
104
|
+
const code = err?.code;
|
|
105
|
+
if (code !== "ERR_MODULE_NOT_FOUND") return false;
|
|
106
|
+
const message = err?.message;
|
|
107
|
+
return typeof message === "string" && message.includes(`'${specifier}'`);
|
|
108
|
+
}
|
|
109
|
+
async function loadGenerator(specifier, load) {
|
|
110
|
+
try {
|
|
111
|
+
return await load();
|
|
112
|
+
} catch (e) {
|
|
113
|
+
if (isPackageMissing(e, specifier)) throw new GeneratorNotInstalledError(specifier, e);
|
|
114
|
+
throw e;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
94
118
|
// src/sponsor.ts
|
|
95
119
|
import chalk from "chalk";
|
|
96
120
|
import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs";
|
|
@@ -194,6 +218,17 @@ function readCliVersion() {
|
|
|
194
218
|
var CLI_VERSION = readCliVersion();
|
|
195
219
|
|
|
196
220
|
// src/cli.ts
|
|
221
|
+
function reportGeneratorFailure(kind, e) {
|
|
222
|
+
if (e instanceof GeneratorNotInstalledError) {
|
|
223
|
+
console.error(
|
|
224
|
+
chalk2.red(`The ${kind} generator is not installed.`),
|
|
225
|
+
chalk2.yellow(`
|
|
226
|
+
Install with: npm install ${e.specifier}`)
|
|
227
|
+
);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
console.error(chalk2.red(`The ${kind} generator failed:`), e?.message ?? e);
|
|
231
|
+
}
|
|
197
232
|
var program = new Command();
|
|
198
233
|
program.name("drzl").description("DRZL - Drizzle Developer Toolkit").version(CLI_VERSION);
|
|
199
234
|
program.addHelpText(
|
|
@@ -292,7 +327,10 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
292
327
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
293
328
|
} else if (g.kind === "service") {
|
|
294
329
|
try {
|
|
295
|
-
const { ServiceGenerator } = await
|
|
330
|
+
const { ServiceGenerator } = await loadGenerator(
|
|
331
|
+
"@drzl/generator-service",
|
|
332
|
+
() => import("@drzl/generator-service")
|
|
333
|
+
);
|
|
296
334
|
const gen = new ServiceGenerator(analysis);
|
|
297
335
|
const target = g.path ?? "src/services";
|
|
298
336
|
const files = await gen.generate({
|
|
@@ -309,16 +347,15 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
309
347
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
310
348
|
} catch (e) {
|
|
311
349
|
progress.stop();
|
|
312
|
-
|
|
313
|
-
chalk2.red("Service generator missing."),
|
|
314
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-service")
|
|
315
|
-
);
|
|
316
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
350
|
+
reportGeneratorFailure(g.kind, e);
|
|
317
351
|
process.exit(1);
|
|
318
352
|
}
|
|
319
353
|
} else if (g.kind === "zod") {
|
|
320
354
|
try {
|
|
321
|
-
const { ZodGenerator } = await
|
|
355
|
+
const { ZodGenerator } = await loadGenerator(
|
|
356
|
+
"@drzl/generator-zod",
|
|
357
|
+
() => import("@drzl/generator-zod")
|
|
358
|
+
);
|
|
322
359
|
const gen = new ZodGenerator(analysis);
|
|
323
360
|
const target = g.path ?? "src/validators/zod";
|
|
324
361
|
const files = await gen.generate(
|
|
@@ -329,16 +366,15 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
329
366
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
330
367
|
} catch (e) {
|
|
331
368
|
progress.stop();
|
|
332
|
-
|
|
333
|
-
chalk2.red("Zod generator missing."),
|
|
334
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-zod")
|
|
335
|
-
);
|
|
336
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
369
|
+
reportGeneratorFailure(g.kind, e);
|
|
337
370
|
process.exit(1);
|
|
338
371
|
}
|
|
339
372
|
} else if (g.kind === "valibot") {
|
|
340
373
|
try {
|
|
341
|
-
const { ValibotGenerator } = await
|
|
374
|
+
const { ValibotGenerator } = await loadGenerator(
|
|
375
|
+
"@drzl/generator-valibot",
|
|
376
|
+
() => import("@drzl/generator-valibot")
|
|
377
|
+
);
|
|
342
378
|
const gen = new ValibotGenerator(analysis);
|
|
343
379
|
const target = g.path ?? "src/validators/valibot";
|
|
344
380
|
const files = await gen.generate(
|
|
@@ -349,16 +385,15 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
349
385
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
350
386
|
} catch (e) {
|
|
351
387
|
progress.stop();
|
|
352
|
-
|
|
353
|
-
chalk2.red("Valibot generator missing."),
|
|
354
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-valibot")
|
|
355
|
-
);
|
|
356
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
388
|
+
reportGeneratorFailure(g.kind, e);
|
|
357
389
|
process.exit(1);
|
|
358
390
|
}
|
|
359
391
|
} else if (g.kind === "arktype") {
|
|
360
392
|
try {
|
|
361
|
-
const { ArkTypeGenerator } = await
|
|
393
|
+
const { ArkTypeGenerator } = await loadGenerator(
|
|
394
|
+
"@drzl/generator-arktype",
|
|
395
|
+
() => import("@drzl/generator-arktype")
|
|
396
|
+
);
|
|
362
397
|
const gen = new ArkTypeGenerator(analysis);
|
|
363
398
|
const target = g.path ?? "src/validators/arktype";
|
|
364
399
|
const files = await gen.generate(
|
|
@@ -369,16 +404,15 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
369
404
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
370
405
|
} catch (e) {
|
|
371
406
|
progress.stop();
|
|
372
|
-
|
|
373
|
-
chalk2.red("ArkType generator missing."),
|
|
374
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-arktype")
|
|
375
|
-
);
|
|
376
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
407
|
+
reportGeneratorFailure(g.kind, e);
|
|
377
408
|
process.exit(1);
|
|
378
409
|
}
|
|
379
410
|
} else if (g.kind === "json-schema") {
|
|
380
411
|
try {
|
|
381
|
-
const { JsonSchemaGenerator } = await
|
|
412
|
+
const { JsonSchemaGenerator } = await loadGenerator(
|
|
413
|
+
"@drzl/generator-json-schema",
|
|
414
|
+
() => import("./dist-UE55LTXV.js")
|
|
415
|
+
);
|
|
382
416
|
const gen = new JsonSchemaGenerator(analysis);
|
|
383
417
|
const target = g.path ?? "src/validators/json-schema";
|
|
384
418
|
const files = await gen.generate({
|
|
@@ -392,20 +426,15 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
392
426
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
393
427
|
} catch (e) {
|
|
394
428
|
progress.stop();
|
|
395
|
-
|
|
396
|
-
chalk2.red("JSON Schema generator missing."),
|
|
397
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-json-schema"),
|
|
398
|
-
// An optional dependency, unlike the other generators, until its npm trusted
|
|
399
|
-
// publisher exists. A missing optional dependency is skipped rather than failing
|
|
400
|
-
// the install, which is what keeps `npm i @drzl/cli` working meanwhile.
|
|
401
|
-
""
|
|
402
|
-
);
|
|
403
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
429
|
+
reportGeneratorFailure(g.kind, e);
|
|
404
430
|
process.exit(1);
|
|
405
431
|
}
|
|
406
432
|
} else if (g.kind === "typebox") {
|
|
407
433
|
try {
|
|
408
|
-
const { TypeBoxGenerator } = await
|
|
434
|
+
const { TypeBoxGenerator } = await loadGenerator(
|
|
435
|
+
"@drzl/generator-typebox",
|
|
436
|
+
() => import("@drzl/generator-typebox")
|
|
437
|
+
);
|
|
409
438
|
const gen = new TypeBoxGenerator(analysis);
|
|
410
439
|
const target = g.path ?? "src/validators/typebox";
|
|
411
440
|
const files = await gen.generate(
|
|
@@ -416,11 +445,7 @@ program.command("generate").description("Run configured generators (drzl.config.
|
|
|
416
445
|
files.forEach((f) => console.log(" -", chalk2.cyan(f)));
|
|
417
446
|
} catch (e) {
|
|
418
447
|
progress.stop();
|
|
419
|
-
|
|
420
|
-
chalk2.red("TypeBox generator missing."),
|
|
421
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-typebox")
|
|
422
|
-
);
|
|
423
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
448
|
+
reportGeneratorFailure(g.kind, e);
|
|
424
449
|
process.exit(1);
|
|
425
450
|
}
|
|
426
451
|
}
|
|
@@ -604,7 +629,10 @@ program.command("watch").description("Watch schema and regenerate on changes").o
|
|
|
604
629
|
newFiles.push(...files);
|
|
605
630
|
} else if (g.kind === "service") {
|
|
606
631
|
try {
|
|
607
|
-
const { ServiceGenerator } = await
|
|
632
|
+
const { ServiceGenerator } = await loadGenerator(
|
|
633
|
+
"@drzl/generator-service",
|
|
634
|
+
() => import("@drzl/generator-service")
|
|
635
|
+
);
|
|
608
636
|
const gen = new ServiceGenerator(analysis);
|
|
609
637
|
const target = g.path ?? "src/services";
|
|
610
638
|
const files = await gen.generate({
|
|
@@ -622,16 +650,15 @@ program.command("watch").description("Watch schema and regenerate on changes").o
|
|
|
622
650
|
);
|
|
623
651
|
newFiles.push(...files);
|
|
624
652
|
} catch (e) {
|
|
625
|
-
|
|
626
|
-
chalk2.red("Service generator missing."),
|
|
627
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-service")
|
|
628
|
-
);
|
|
629
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
653
|
+
reportGeneratorFailure(g.kind, e);
|
|
630
654
|
return;
|
|
631
655
|
}
|
|
632
656
|
} else if (g.kind === "zod") {
|
|
633
657
|
try {
|
|
634
|
-
const { ZodGenerator } = await
|
|
658
|
+
const { ZodGenerator } = await loadGenerator(
|
|
659
|
+
"@drzl/generator-zod",
|
|
660
|
+
() => import("@drzl/generator-zod")
|
|
661
|
+
);
|
|
635
662
|
const gen = new ZodGenerator(analysis);
|
|
636
663
|
const target = g.path ?? "src/validators/zod";
|
|
637
664
|
const files = await gen.generate({
|
|
@@ -649,16 +676,15 @@ program.command("watch").description("Watch schema and regenerate on changes").o
|
|
|
649
676
|
);
|
|
650
677
|
newFiles.push(...files);
|
|
651
678
|
} catch (e) {
|
|
652
|
-
|
|
653
|
-
chalk2.red("Zod generator missing."),
|
|
654
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-zod")
|
|
655
|
-
);
|
|
656
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
679
|
+
reportGeneratorFailure(g.kind, e);
|
|
657
680
|
return;
|
|
658
681
|
}
|
|
659
682
|
} else if (g.kind === "valibot") {
|
|
660
683
|
try {
|
|
661
|
-
const { ValibotGenerator } = await
|
|
684
|
+
const { ValibotGenerator } = await loadGenerator(
|
|
685
|
+
"@drzl/generator-valibot",
|
|
686
|
+
() => import("@drzl/generator-valibot")
|
|
687
|
+
);
|
|
662
688
|
const gen = new ValibotGenerator(analysis);
|
|
663
689
|
const target = g.path ?? "src/validators/valibot";
|
|
664
690
|
const files = await gen.generate({
|
|
@@ -676,16 +702,15 @@ program.command("watch").description("Watch schema and regenerate on changes").o
|
|
|
676
702
|
);
|
|
677
703
|
newFiles.push(...files);
|
|
678
704
|
} catch (e) {
|
|
679
|
-
|
|
680
|
-
chalk2.red("Valibot generator missing."),
|
|
681
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-valibot")
|
|
682
|
-
);
|
|
683
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
705
|
+
reportGeneratorFailure(g.kind, e);
|
|
684
706
|
return;
|
|
685
707
|
}
|
|
686
708
|
} else if (g.kind === "arktype") {
|
|
687
709
|
try {
|
|
688
|
-
const { ArkTypeGenerator } = await
|
|
710
|
+
const { ArkTypeGenerator } = await loadGenerator(
|
|
711
|
+
"@drzl/generator-arktype",
|
|
712
|
+
() => import("@drzl/generator-arktype")
|
|
713
|
+
);
|
|
689
714
|
const gen = new ArkTypeGenerator(analysis);
|
|
690
715
|
const target = g.path ?? "src/validators/arktype";
|
|
691
716
|
const files = await gen.generate({
|
|
@@ -703,11 +728,7 @@ program.command("watch").description("Watch schema and regenerate on changes").o
|
|
|
703
728
|
);
|
|
704
729
|
newFiles.push(...files);
|
|
705
730
|
} catch (e) {
|
|
706
|
-
|
|
707
|
-
chalk2.red("ArkType generator missing."),
|
|
708
|
-
chalk2.yellow("\nInstall with: npm install @drzl/generator-arktype")
|
|
709
|
-
);
|
|
710
|
-
console.error(chalk2.gray("Error details:"), e?.message ?? e);
|
|
731
|
+
reportGeneratorFailure(g.kind, e);
|
|
711
732
|
return;
|
|
712
733
|
}
|
|
713
734
|
}
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli.ts","../src/validation-options.ts","../src/drift.ts","../src/sponsor.ts","../src/version.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { SchemaAnalyzer } from '@drzl/analyzer';\nimport { ORPCGenerator } from '@drzl/generator-orpc';\nimport chalk from 'chalk';\nimport chokidar from 'chokidar';\nimport cliProgress from 'cli-progress';\nimport { Command } from 'commander';\nimport * as path from 'node:path';\nimport ora from 'ora';\nimport { validationOptions } from './validation-options';\nimport {\n computeGeneratorOutputDirs,\n computeWatchTargets,\n DrzlConfig,\n filterTables,\n loadConfig,\n} from './config.js';\nimport { diffSnapshots, restoreSnapshot, snapshotAll } from './drift.js';\nimport { maybeShowSponsorMessage } from './sponsor.js';\nimport { CLI_VERSION } from './version.js';\n\nconst program = new Command();\nprogram.name('drzl').description('DRZL - Drizzle Developer Toolkit').version(CLI_VERSION);\nprogram.addHelpText(\n 'afterAll',\n `\\nNeed a template, adapter, or generator DRZL doesn't ship yet?\\n→ DM @omardulaimidev on X: https://x.com/omardulaimidev\\n`\n);\n\nprogram\n .command('analyze')\n .argument('<schema>', 'path to drizzle schema (TS)')\n .option('--relations', 'include relations', true)\n .option('--validate', 'validate constraints', true)\n .option('--out <file>', 'write analysis JSON to file')\n .option('--json', 'print JSON to stdout (overrides --out)', false)\n .action(async (schema: string, opts: any) => {\n try {\n const analyzer = new SchemaAnalyzer(schema);\n const spinner = !opts.json ? ora('Analyzing schema...').start() : null;\n const start = Date.now();\n const res = await analyzer.analyze({\n includeRelations: !!opts.relations,\n validateConstraints: !!opts.validate,\n });\n const ms = Date.now() - start;\n const json = JSON.stringify(res, null, 2);\n if (opts.json) {\n console.log(json);\n } else if (opts.out) {\n const fs = await import('node:fs/promises');\n await fs.writeFile(opts.out, json, 'utf8');\n spinner?.succeed(chalk.green(`Analysis written to ${opts.out} in ${ms}ms`));\n } else {\n spinner?.succeed(chalk.green(`Analyzed in ${ms}ms`));\n console.log(json);\n }\n process.exit(res.issues.some((i) => i.level === 'error') ? 2 : 0);\n } catch (e: any) {\n const msg = e?.message ?? String(e);\n if (opts.json)\n console.log(JSON.stringify({ event: 'error', code: 'DRZL_CLI_ANALYZE', message: msg }));\n else\n console.error(\n chalk.red('Analyze failed (DRZL_CLI_ANALYZE):'),\n msg,\n '\\nTip: run with --json for structured output.'\n );\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .description('Run configured generators (drzl.config.*)')\n .option('-c, --config <path>', 'path to drzl.config')\n .option(\n '--check',\n 'regenerate and fail if the result differs from what is on disk, without changing it'\n )\n .action(async (opts: any) => {\n try {\n const cfg = await loadConfig(opts.config);\n if (!cfg) {\n console.error(\n chalk.red('No config found (DRZL_CFG_001). Create drzl.config.ts or pass --config.')\n );\n process.exit(2);\n return;\n }\n const analyzer = new SchemaAnalyzer(cfg.schema);\n const spinner = ora('Analyzing...').start();\n const t0 = Date.now();\n const analysis = await analyzer.analyze({\n includeRelations: cfg.analyzer.includeRelations,\n validateConstraints: cfg.analyzer.validateConstraints,\n includeHeuristicRelations: cfg.analyzer.includeHeuristicRelations,\n });\n // Applied before any generator sees the analysis, so every one of them honours it without\n // needing to know the option exists.\n analysis.tables = filterTables(analysis.tables, cfg);\n spinner.succeed(`Analysis complete in ${Date.now() - t0}ms`);\n reportWideColumns(analysis.issues);\n // Under --check the existing output is captured before anything overwrites it, so the\n // regenerated result can be compared against it and the tree put back either way.\n const driftDirs = computeGeneratorOutputDirs(cfg);\n const driftBefore = opts.check ? await snapshotAll(driftDirs) : null;\n const progress = new cliProgress.SingleBar(\n { hideCursor: true },\n cliProgress.Presets.shades_classic\n );\n const total = analysis.tables.length || 1;\n progress.start(total, 0);\n // Where the service generator is actually writing, so a router template that imports\n // services spells a path that exists. Templates default this to 'src/services', and with\n // nothing passed that default was used no matter where the services really went, emitting\n // an import of a module that was never created. Must match the `g.path ?? 'src/services'`\n // used by the service branch below.\n const servicesDir =\n cfg.generators.find((x: { kind: string }) => x.kind === 'service')?.path ?? 'src/services';\n for (const g of cfg.generators) {\n if (g.kind === 'orpc') {\n const gen = new ORPCGenerator(analysis);\n const { files } = await gen.generate({\n outputDir: cfg.outDir,\n template: g.template,\n includeRelations: g.includeRelations,\n naming: g.naming,\n outputHeader: g.outputHeader,\n format: g.format,\n templateOptions: g.templateOptions,\n importExtension: g.importExtension,\n validation: g.validation,\n servicesDir,\n onProgress: ({ index }) => progress.update(index),\n });\n progress.stop();\n ora().succeed(chalk.green(`Generated (${g.kind}): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } else if (g.kind === 'service') {\n try {\n const { ServiceGenerator } = await import('@drzl/generator-service');\n const gen = new ServiceGenerator(analysis);\n const target = g.path ?? 'src/services';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n dataAccess: g.dataAccess,\n dbImportPath: g.dbImportPath,\n schemaImportPath: g.schemaImportPath,\n importExtension: g.importExtension,\n });\n progress.stop();\n ora().succeed(chalk.green(`Generated (service): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n console.error(\n chalk.red('Service generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-service')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n process.exit(1);\n }\n } else if (g.kind === 'zod') {\n try {\n const { ZodGenerator } = await import('@drzl/generator-zod');\n const gen = new ZodGenerator(analysis);\n const target = g.path ?? 'src/validators/zod';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: true }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (zod): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n console.error(\n chalk.red('Zod generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-zod')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n process.exit(1);\n }\n } else if (g.kind === 'valibot') {\n try {\n const { ValibotGenerator } = await import('@drzl/generator-valibot');\n const gen = new ValibotGenerator(analysis);\n const target = g.path ?? 'src/validators/valibot';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: true }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (valibot): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n console.error(\n chalk.red('Valibot generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-valibot')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n process.exit(1);\n }\n } else if (g.kind === 'arktype') {\n try {\n const { ArkTypeGenerator } = await import('@drzl/generator-arktype');\n const gen = new ArkTypeGenerator(analysis);\n const target = g.path ?? 'src/validators/arktype';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: false }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (arktype): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n console.error(\n chalk.red('ArkType generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-arktype')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n process.exit(1);\n }\n } else if (g.kind === 'json-schema') {\n try {\n const { JsonSchemaGenerator } = await import('@drzl/generator-json-schema');\n const gen = new JsonSchemaGenerator(analysis);\n const target = g.path ?? 'src/validators/json-schema';\n const files = await gen.generate({\n // JSON Schema is data, so nothing here references a type from the schema module.\n ...(validationOptions(g, cfg, target, { schemaTypes: false }) as object),\n target: g.target,\n components: g.components,\n } as never);\n progress.stop();\n ora().succeed(chalk.green(`Generated (json-schema): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n console.error(\n chalk.red('JSON Schema generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-json-schema'),\n // An optional dependency, unlike the other generators, until its npm trusted\n // publisher exists. A missing optional dependency is skipped rather than failing\n // the install, which is what keeps `npm i @drzl/cli` working meanwhile.\n ''\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n process.exit(1);\n }\n } else if (g.kind === 'typebox') {\n try {\n const { TypeBoxGenerator } = await import('@drzl/generator-typebox');\n const gen = new TypeBoxGenerator(analysis);\n const target = g.path ?? 'src/validators/typebox';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: true }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (typebox): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n console.error(\n chalk.red('TypeBox generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-typebox')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n process.exit(1);\n }\n }\n }\n if (driftBefore) {\n const after = await snapshotAll(driftDirs);\n const drift = diffSnapshots(driftBefore, after);\n // Restored whether or not anything drifted, so `--check` never leaves the tree altered.\n await restoreSnapshot(driftBefore, after);\n\n if (drift.length) {\n console.error(chalk.red(`\\nGenerated output is out of date (${drift.length} file(s)):`));\n for (const d of drift) {\n const mark = d.status === 'added' ? '+' : d.status === 'removed' ? '-' : '~';\n console.error(\n ` ${mark} ${chalk.yellow(d.status.padEnd(8))} ${path.relative(process.cwd(), d.file)}`\n );\n }\n console.error(\n chalk.dim(\n '\\nRun `drzl generate` and commit the result. Nothing was written by this check.'\n )\n );\n process.exit(1);\n }\n console.log(chalk.green('Generated output is up to date.'));\n return;\n }\n\n if (cfg.generators.length) {\n maybeShowSponsorMessage({ reason: 'generate' });\n }\n } catch (e: any) {\n console.error(\n chalk.red('Generate failed (DRZL_GEN_001):'),\n e?.message ?? e,\n '\\nTip: check your drzl.config.ts and template path.'\n );\n process.exit(1);\n }\n });\n\nprogram\n .command('generate:orpc')\n .argument('<schema>', 'path to drizzle schema (TS)')\n .option('-o, --outDir <dir>', 'output directory', 'src/api')\n .option('--template <name>', 'template name', 'standard')\n .option('--includeRelations', 'include relation endpoints')\n .action(async (schema: string, opts: any) => {\n try {\n const analyzer = new SchemaAnalyzer(schema);\n const analysis = await analyzer.analyze({\n includeRelations: !!opts.includeRelations,\n validateConstraints: true,\n });\n const gen = new ORPCGenerator(analysis);\n const { files } = await gen.generate({\n outputDir: opts.outDir,\n template: opts.template,\n includeRelations: !!opts.includeRelations,\n });\n console.log(chalk.green(`Generated:`), files.map((f) => chalk.cyan(f)).join(', '));\n maybeShowSponsorMessage({ reason: 'generate:orpc' });\n } catch (e: any) {\n console.error(chalk.red('Generate orpc failed:'), e?.message ?? e);\n process.exit(1);\n }\n });\n\nprogram\n .command('watch')\n .description('Watch schema and regenerate on changes')\n .option('-c, --config <path>', 'path to drzl.config')\n .option('--pipeline <name>', 'all | analyze | generate-orpc', 'all')\n .option('--debounce <ms>', 'debounce ms', '200')\n .option('--json', 'emit JSON logs', false)\n .option('--poll', 'force polling (helps WSL/Docker/remote FS)', false)\n .action(async (opts: any) => {\n let cfg = await loadConfig(opts.config);\n if (!cfg) {\n console.error(chalk.red('No config found. Create drzl.config.ts or pass --config.'));\n process.exit(2);\n return;\n }\n\n const abs = (p: string) => path.resolve(process.cwd(), p);\n const isInside = (child: string, parent: string) => {\n const rel = path.relative(parent, child);\n return !!rel && !rel.startsWith('..') && !path.isAbsolute(rel);\n };\n\n const ignoredOutDirs = new Set<string>(computeGeneratorOutputDirs(cfg).map(abs));\n const currentTargets = new Set<string>(computeWatchTargets(cfg).map(abs));\n\n const syncWatcherTargets = (watcher: import('chokidar').FSWatcher, next: Set<string>) => {\n const add: string[] = [];\n const del: string[] = [];\n for (const p of next) if (!currentTargets.has(p)) add.push(p);\n for (const p of currentTargets) if (!next.has(p)) del.push(p);\n if (add.length) watcher.add(add);\n if (del.length) watcher.unwatch(del);\n currentTargets.clear();\n next.forEach((p) => currentTargets.add(p));\n };\n\n const rebuildIgnoreDirsFrom = (cfgNow: DrzlConfig) => {\n ignoredOutDirs.clear();\n for (const d of computeGeneratorOutputDirs(cfgNow)) ignoredOutDirs.add(abs(d));\n };\n\n // Watch targets are directories now, because chokidar v4 dropped glob support. The\n // extensions the old `**/*.{ts,tsx,js}` glob selected therefore have to be filtered here\n // instead, or every unrelated file in the schema's directory would trigger a rebuild.\n const WATCHED_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.mjs', '.cjs']);\n\n const ignoredFn = (p: string, stats?: { isDirectory(): boolean }) => {\n const full = abs(p);\n for (const dir of ignoredOutDirs) {\n if (full === dir || isInside(full, dir)) return true;\n }\n // A directory is never ignored: chokidar has to descend into it to reach the files.\n if (stats?.isDirectory()) return false;\n const ext = path.extname(full);\n // Without stats chokidar is asking about a path it has not resolved yet. An extensionless\n // one is almost certainly a directory, so let it through and decide once it is known.\n if (!ext) return false;\n return !WATCHED_EXTENSIONS.has(ext);\n };\n\n const watcher = chokidar.watch(Array.from(currentTargets), {\n ignoreInitial: true,\n awaitWriteFinish: { stabilityThreshold: 400, pollInterval: 50 },\n usePolling: !!opts.poll,\n ignored: ignoredFn,\n });\n\n const logTrigger = (type: 'add' | 'change' | 'unlink', file: string) => {\n if (opts.json) console.log(JSON.stringify({ event: 'trigger', type, file }));\n };\n\n watcher\n .on('add', (p) => {\n logTrigger('add', p);\n trigger(p);\n })\n .on('change', (p) => {\n logTrigger('change', p);\n trigger(p);\n })\n .on('unlink', (p) => {\n logTrigger('unlink', p);\n trigger(p);\n });\n\n let lastFiles: string[] = [];\n\n const run = async () => {\n try {\n const reloaded = await loadConfig(opts.config);\n if (!reloaded) throw new Error('Config disappeared during watch.');\n cfg = reloaded;\n\n rebuildIgnoreDirsFrom(cfg);\n const nextTargets = new Set<string>(computeWatchTargets(cfg).map(abs));\n syncWatcherTargets(watcher, nextTargets);\n\n if (!opts.json) console.clear();\n\n if (opts.json) {\n console.log(\n JSON.stringify({\n event: 'watch_config_applied',\n targets: Array.from(currentTargets),\n ignored: Array.from(ignoredOutDirs),\n })\n );\n }\n\n const analyzer = new SchemaAnalyzer(cfg.schema);\n const analysis = await analyzer.analyze({\n includeRelations: cfg.analyzer.includeRelations,\n validateConstraints: cfg.analyzer.validateConstraints,\n includeHeuristicRelations: cfg.analyzer.includeHeuristicRelations,\n });\n analysis.tables = filterTables(analysis.tables, cfg);\n if (!opts.json) reportWideColumns(analysis.issues);\n\n if (opts.pipeline === 'analyze') {\n if (opts.json) {\n console.log(\n JSON.stringify({\n event: 'analyze_complete',\n issues: analysis.issues,\n tables: analysis.tables.length,\n })\n );\n } else {\n console.log(chalk.green('Analyze complete.'));\n }\n return;\n }\n\n const newFiles: string[] = [];\n\n for (const g of cfg.generators) {\n if (\n opts.pipeline !== 'all' &&\n !(opts.pipeline === 'generate-orpc' && g.kind === 'orpc')\n ) {\n continue;\n }\n\n if (g.kind === 'orpc') {\n const gen = new ORPCGenerator(analysis);\n const { files } = await gen.generate({\n outputDir: cfg.outDir,\n template: g.template,\n includeRelations: g.includeRelations,\n naming: g.naming,\n outputHeader: g.outputHeader,\n format: g.format,\n templateOptions: g.templateOptions,\n importExtension: g.importExtension,\n validation: g.validation,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (${g.kind}):`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } else if (g.kind === 'service') {\n try {\n const { ServiceGenerator } = await import('@drzl/generator-service');\n const gen = new ServiceGenerator(analysis);\n const target = g.path ?? 'src/services';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n dataAccess: g.dataAccess,\n dbImportPath: g.dbImportPath,\n schemaImportPath: g.schemaImportPath,\n importExtension: g.importExtension,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (service): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n console.error(\n chalk.red('Service generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-service')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n return;\n }\n } else if (g.kind === 'zod') {\n try {\n const { ZodGenerator } = await import('@drzl/generator-zod');\n const gen = new ZodGenerator(analysis);\n const target = g.path ?? 'src/validators/zod';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (zod): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n console.error(\n chalk.red('Zod generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-zod')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n return;\n }\n } else if (g.kind === 'valibot') {\n try {\n const { ValibotGenerator } = await import('@drzl/generator-valibot');\n const gen = new ValibotGenerator(analysis);\n const target = g.path ?? 'src/validators/valibot';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (valibot): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n console.error(\n chalk.red('Valibot generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-valibot')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n return;\n }\n } else if (g.kind === 'arktype') {\n try {\n const { ArkTypeGenerator } = await import('@drzl/generator-arktype');\n const gen = new ArkTypeGenerator(analysis);\n const target = g.path ?? 'src/validators/arktype';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (arktype): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n console.error(\n chalk.red('ArkType generator missing.'),\n chalk.yellow('\\nInstall with: npm install @drzl/generator-arktype')\n );\n console.error(chalk.gray('Error details:'), e?.message ?? e);\n return;\n }\n }\n }\n\n const added = newFiles.filter((f) => !lastFiles.includes(f));\n const removed = lastFiles.filter((f) => !newFiles.includes(f));\n opts.json\n ? console.log(JSON.stringify({ event: 'diff', added, removed }))\n : (() => {\n if (added.length) console.log(chalk.blue(`Added: ${added.join(', ')}`));\n if (removed.length) console.log(chalk.yellow(`Removed: ${removed.join(', ')}`));\n })();\n if (newFiles.length && !opts.json) {\n const reason =\n opts.pipeline && opts.pipeline !== 'all' ? `watch:${opts.pipeline}` : 'watch';\n maybeShowSponsorMessage({ reason });\n }\n lastFiles = newFiles;\n } catch (e: any) {\n opts.json\n ? console.log(JSON.stringify({ event: 'error', message: String(e?.message ?? e) }))\n : console.error(chalk.red('Watch pipeline failed:'), e?.message ?? e);\n }\n };\n\n const debounced = Number(opts.debounce) || 200;\n let timer: NodeJS.Timeout | null = null;\n const trigger = (file?: string) => {\n if (file) {\n const full = abs(file);\n for (const dir of ignoredOutDirs) {\n if (full === dir || isInside(full, dir)) return;\n }\n }\n if (timer) clearTimeout(timer);\n timer = setTimeout(run, debounced);\n };\n\n if (opts.json) {\n console.log(\n JSON.stringify({\n event: 'watching',\n targets: Array.from(currentTargets),\n ignored: Array.from(ignoredOutDirs),\n })\n );\n } else {\n console.log(\n chalk.gray(\n 'Watching:\\n ' +\n Array.from(currentTargets)\n .map((p) => path.relative(process.cwd(), p))\n .join('\\n ')\n )\n );\n }\n\n watcher\n .on('add', (p) => trigger(p))\n .on('change', (p) => trigger(p))\n .on('unlink', (p) => trigger(p))\n .on('error', (err) => console.error(chalk.red('Watcher error:'), err));\n\n await run();\n });\n\nprogram\n .command('init')\n .description('Scaffold a drzl.config.ts')\n .option('-y, --yes', 'accept defaults')\n .action(async (_opts: any) => {\n const fs = await import('node:fs/promises');\n const path = await import('node:path');\n const target = path.resolve(process.cwd(), 'drzl.config.ts');\n const template = `export default {\n schema: 'src/db/schema.ts',\n outDir: 'src/api',\n analyzer: { includeRelations: true, validateConstraints: true },\n generators: [\n { kind: 'orpc', template: 'standard', includeRelations: true }\n ]\n} as const\\n`;\n try {\n await fs.writeFile(target, template, { flag: 'wx' });\n console.log(chalk.green(`Created ${target}`));\n } catch (e: any) {\n console.error(chalk.red('Init failed:'), e?.message ?? e);\n process.exit(1);\n }\n });\n\n/**\n * Tell the user which columns got a validator that accepts anything.\n *\n * This is the user-facing half of a check `verify-packed.sh` runs on this repository. Two real\n * bugs took exactly this shape, `.array()` and `pgEnum` columns coming back untyped on\n * drizzle-orm 0.4x, and the only way anyone noticed was reading the generated file. A user whose\n * schema uses a type nobody here has modelled gets the same silence, and no gate of ours helps\n * them.\n *\n * Printed once with a count rather than a line per column, so a schema with fifty custom types\n * stays readable.\n */\nfunction reportWideColumns(issues: Array<{ code?: string; message?: string; hint?: string }>) {\n const wide = issues.filter((i) => i.code === 'DRZL_ANL_UNKNOWN_COLUMN');\n if (!wide.length) return;\n console.warn(\n chalk.yellow(`\\n${wide.length} column${wide.length === 1 ? '' : 's'} could not be typed:`)\n );\n for (const i of wide.slice(0, 10)) console.warn(chalk.gray(` - ${i.message}`));\n if (wide.length > 10) console.warn(chalk.gray(` ... and ${wide.length - 10} more`));\n // One hint for the set, since they are almost always the same two.\n const hints = [...new Set(wide.map((i) => i.hint).filter(Boolean))];\n for (const h of hints) console.warn(chalk.gray(` ${h}`));\n}\n\nprogram.parseAsync(process.argv);\n","/**\n * The options every validation generator receives, built in one place.\n *\n * Each of the four branches used to assemble this by hand, and three documented options were\n * found silently dead as a result: `typedJson` never reached typebox, and `coerceDates` and\n * `applyDefaults` never reached anything but zod. The config parsed them, the CLI dropped them,\n * and the feature simply did nothing while nothing said so. Building it once removes the class\n * rather than fixing each instance.\n *\n * What stays per-generator is a real capability rather than an oversight, which is why it is\n * named as one.\n */\n\n/** A generator entry from the config, loosely typed because the config schema owns its shape. */\ntype GeneratorConfig = {\n outputHeader?: unknown;\n format?: unknown;\n schemaSuffix?: unknown;\n fileSuffix?: unknown;\n importExtension?: unknown;\n affix?: unknown;\n coerceDates?: unknown;\n applyDefaults?: unknown;\n typedJson?: unknown;\n typedColumns?: unknown;\n duplicateFinder?: unknown;\n};\n\nexport interface GeneratorCapabilities {\n /**\n * Whether the generator can reference a type from the schema module.\n *\n * `typedJson` and `typedColumns` both work by importing the table back and reading\n * `typeof table.$inferSelect['col']`, so a generator that cannot embed a TypeScript type in its\n * output cannot use either. ArkType is the case: it emits one string per field, and a type\n * reference has nowhere to live inside a string DSL.\n */\n schemaTypes?: boolean;\n}\n\nexport function validationOptions(\n g: GeneratorConfig,\n cfg: { schema?: unknown },\n outDir: string,\n caps: GeneratorCapabilities = {}\n): Record<string, unknown> {\n return {\n outDir,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n coerceDates: g.coerceDates,\n applyDefaults: g.applyDefaults,\n duplicateFinder: g.duplicateFinder,\n // Only where the generator can act on them, so an unsupported option is absent rather than\n // present and ignored.\n ...(caps.schemaTypes\n ? {\n // Needed by both: the reference is resolved relative to the emitted file.\n schemaPath: cfg.schema,\n typedJson: g.typedJson,\n typedColumns: g.typedColumns,\n }\n : {}),\n };\n}\n","/**\n * Drift detection for generated output.\n *\n * No runtime validator can offer this. `drizzle-orm/zod` and friends derive schemas in memory at\n * import time, so there is nothing on disk to have drifted and nothing for CI to compare. It is\n * only available to a code generator, which makes it one of the few things DRZL can do that the\n * first-party modules structurally cannot.\n *\n * The check is: regenerate, and require the result to equal what is committed. That catches the\n * two failures that actually happen, someone editing generated files by hand and someone\n * changing the schema without regenerating, and it catches them in CI rather than in review.\n *\n * Content-neutral by construction. Redirecting output to a temporary directory would not work:\n * generated files contain paths computed relative to their own location, so a different output\n * directory produces legitimately different bytes and every file would report as drifted. So the\n * real directories are snapshotted first, regeneration is allowed to overwrite them, and the\n * snapshot is put back if anything changed. Either way the tree ends as it began.\n */\nimport { promises as fs } from 'node:fs';\nimport path from 'node:path';\n\nexport interface DriftEntry {\n file: string;\n status: 'changed' | 'added' | 'removed';\n}\n\n/** Every file under `dir`, keyed by its path relative to `dir`. Missing directory means empty. */\nexport async function snapshotDir(dir: string): Promise<Map<string, string>> {\n const out = new Map<string, string>();\n async function walk(current: string) {\n let entries;\n try {\n entries = await fs.readdir(current, { withFileTypes: true });\n } catch {\n return; // Nothing generated there yet, which a first run should report as additions.\n }\n for (const e of entries) {\n const full = path.join(current, e.name);\n if (e.isDirectory()) await walk(full);\n else out.set(path.relative(dir, full), await fs.readFile(full, 'utf8'));\n }\n }\n await walk(dir);\n return out;\n}\n\n/** Snapshot several directories at once, keys prefixed by directory so they cannot collide. */\nexport async function snapshotAll(dirs: string[]): Promise<Map<string, string>> {\n const all = new Map<string, string>();\n for (const dir of dirs) {\n for (const [rel, content] of await snapshotDir(dir)) {\n all.set(path.join(dir, rel), content);\n }\n }\n return all;\n}\n\n/** What changed between two snapshots. */\nexport function diffSnapshots(\n before: Map<string, string>,\n after: Map<string, string>\n): DriftEntry[] {\n const out: DriftEntry[] = [];\n for (const [file, content] of after) {\n if (!before.has(file)) out.push({ file, status: 'added' });\n else if (before.get(file) !== content) out.push({ file, status: 'changed' });\n }\n for (const file of before.keys()) {\n if (!after.has(file)) out.push({ file, status: 'removed' });\n }\n return out.sort((a, b) => a.file.localeCompare(b.file));\n}\n\n/**\n * Put a snapshot back, so a failed check leaves the tree exactly as it found it.\n *\n * A file that regeneration created and the snapshot does not know about is deleted, since it was\n * not there before the check ran.\n */\nexport async function restoreSnapshot(\n before: Map<string, string>,\n after: Map<string, string>\n): Promise<void> {\n for (const [file, content] of before) {\n await fs.mkdir(path.dirname(file), { recursive: true });\n await fs.writeFile(file, content, 'utf8');\n }\n for (const file of after.keys()) {\n if (!before.has(file)) await fs.rm(file, { force: true });\n }\n}\n","import chalk from 'chalk';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nexport interface SponsorMessageOptions {\n reason?: string;\n minIntervalMs?: number;\n force?: boolean;\n}\n\ninterface SponsorCachePayload {\n runs: number;\n lastShownAt?: number;\n lastReason?: string;\n}\n\nconst CACHE_DIR = path.join(process.cwd(), 'node_modules', '.cache', '@drzl');\nconst CACHE_FILE = path.join(CACHE_DIR, 'sponsor-message.json');\nconst DEFAULT_INTERVAL_MS = 1000 * 60 * 15; // 15 minutes\nlet shownThisProcess = false;\n\nconst tips = [\n 'Pair DRZL watch mode with drizzle-kit to keep schema & API synced.',\n 'Templatize your ORPC routers to roll out new endpoints safely.',\n 'Need typed validators? Enable the zod, valibot, arktype, or typebox generators.',\n 'Need JSON Schema or OpenAPI? The json-schema generator emits both, with no runtime dependency.',\n 'Use output headers to track generated files and trim noisy diffs.',\n];\n\nconst green = (msg: string) => chalk.hex('#6ee7b7')(msg);\nconst cyan = (msg: string) => chalk.cyan(msg);\nconst gray = (msg: string) => chalk.gray(msg);\n\nexport function maybeShowSponsorMessage({\n reason = 'generate',\n minIntervalMs = DEFAULT_INTERVAL_MS,\n force = false,\n}: SponsorMessageOptions = {}) {\n const hideViaEnv = process.env.DRZL_HIDE_SPONSOR?.toLowerCase();\n const hideRequested = hideViaEnv === '1' || hideViaEnv === 'true';\n if (hideRequested || (process.env.CI && !force) || (shownThisProcess && !force)) return;\n\n try {\n mkdirSync(CACHE_DIR, { recursive: true });\n const payload = readCache();\n payload.runs += 1;\n\n const now = Date.now();\n const shouldShow = force || now - (payload.lastShownAt ?? 0) >= minIntervalMs;\n\n if (shouldShow) {\n payload.lastShownAt = now;\n payload.lastReason = reason;\n }\n\n writeCache(payload);\n\n if (!shouldShow) return;\n\n shownThisProcess = true;\n const tip = tips[payload.runs % tips.length];\n\n console.log(\n `\\n${cyan(`🚀 DRZL finished a ${reason} run (#${payload.runs.toLocaleString()}).`)}\\n\\n` +\n `${green('✨ Sponsors keep DRZL shipping. Consider supporting ongoing dev:')}\\n` +\n ` ${green('GitHub Sponsors')} ${gray('→ https://github.com/sponsors/omar-dulaimi')}\\n\\n` +\n `${green('Pro tip:')} ${tip}\\n`\n );\n } catch {\n // Swallow to avoid impacting generator success paths\n }\n}\n\nfunction readCache(): SponsorCachePayload {\n if (!existsSync(CACHE_FILE)) {\n return { runs: 0 };\n }\n try {\n const data = JSON.parse(readFileSync(CACHE_FILE, 'utf8')) as SponsorCachePayload;\n if (typeof data.runs !== 'number') return { runs: 0 };\n return data;\n } catch {\n return { runs: 0 };\n }\n}\n\nfunction writeCache(payload: SponsorCachePayload) {\n writeFileSync(CACHE_FILE, JSON.stringify(payload, null, 2), 'utf8');\n}\n","/**\n * The version `drzl --version` prints, read from the manifest that ships beside the build.\n *\n * It used to be the literal `'0.0.1'`, passed to `program.version()` when the CLI was scaffolded\n * and never touched again. That was true of exactly one release, the first: the registry lists 29\n * versions of `@drzl/cli`, and the other 28 printed `0.0.1` as well. Reading the manifest is the\n * only form that cannot drift, because it is the same file the registry took the version from.\n *\n * Nothing here falls back. A build that cannot find its own manifest, or finds someone else's, has\n * resolved somewhere it did not intend to, and a placeholder standing in for that is how the\n * original defect stayed invisible for 28 releases.\n */\nimport { readFileSync } from 'node:fs';\nimport * as path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/** The name the manifest beside this build must carry, which is what makes it ours. */\nconst PACKAGE_NAME = '@drzl/cli';\n\n/**\n * The directory holding the file this code ends up in, in every form it is reached.\n *\n * Three of them: `dist/cli.js`, `dist/cli.cjs`, and this file unbundled under ts-node, all three\n * run and checked. Only the CommonJS bundle has no `import.meta`; `tsup.config.ts` gives that\n * build a real value for `import.meta.url` rather than esbuild's empty one, so this needs no\n * branch. If that config is ever dropped, `fileURLToPath(undefined)` throws on load, so the\n * CommonJS bundle stops working loudly instead of reporting the wrong directory.\n */\nfunction moduleDir(): string {\n return path.dirname(fileURLToPath(import.meta.url));\n}\n\n/**\n * The `version` a named manifest declares, or a throw naming what was wrong with it.\n *\n * Split out from the caller below only so the three ways it refuses can be exercised without a\n * build. Nothing in the CLI passes a path.\n */\nexport function readVersionFrom(manifestPath: string): string {\n let raw: string;\n try {\n raw = readFileSync(manifestPath, 'utf8');\n } catch (e: any) {\n throw new Error(\n `${PACKAGE_NAME} cannot read its own version: no manifest at ${manifestPath} ` +\n `(${e?.message ?? String(e)}).`\n );\n }\n\n const manifest = JSON.parse(raw) as { name?: unknown; version?: unknown };\n\n if (manifest.name !== PACKAGE_NAME) {\n throw new Error(\n `${PACKAGE_NAME} looked for its own version in ${manifestPath} and found ` +\n `${JSON.stringify(manifest.name)}, so this build is not sitting where it thinks it is.`\n );\n }\n\n if (typeof manifest.version !== 'string' || manifest.version.length === 0) {\n throw new Error(`${manifestPath} declares no version, so there is nothing to report.`);\n }\n\n return manifest.version;\n}\n\n/**\n * The `version` field of this package's own manifest.\n *\n * Both bundles sit one level below it, in `dist/`, and so does `src/` when this file is run\n * unbundled, so one `..` covers every way it is reached. All three were run.\n */\nexport function readCliVersion(): string {\n return readVersionFrom(path.join(moduleDir(), '..', 'package.json'));\n}\n\nexport const CLI_VERSION = readCliVersion();\n"],"mappings":";;;;;;;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,OAAOA,YAAW;AAClB,OAAO,cAAc;AACrB,OAAO,iBAAiB;AACxB,SAAS,eAAe;AACxB,YAAYC,WAAU;AACtB,OAAO,SAAS;;;ACgCT,SAAS,kBACd,GACA,KACA,QACA,OAA8B,CAAC,GACN;AACzB,SAAO;AAAA,IACL;AAAA,IACA,cAAc,EAAE;AAAA,IAChB,QAAQ,EAAE;AAAA,IACV,cAAc,EAAE;AAAA,IAChB,YAAY,EAAE;AAAA,IACd,iBAAiB,EAAE;AAAA,IACnB,OAAO,EAAE;AAAA,IACT,aAAa,EAAE;AAAA,IACf,eAAe,EAAE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;AAC1C,QAAMG,QAAO,MAAM,OAAO,MAAW;AACrC,QAAM,SAASA,MAAK,QAAQ,QAAQ,IAAI,GAAG,gBAAgB;AAC3D,QAAM,WAAW;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAQjB,MAAI;AACF,UAAMH,IAAG,UAAU,QAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AACnD,YAAQ,IAAIC,OAAM,MAAM,WAAW,MAAM,EAAE,CAAC;AAAA,EAC9C,SAAS,GAAQ;AACf,YAAQ,MAAMA,OAAM,IAAI,cAAc,GAAG,GAAG,WAAW,CAAC;AACxD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF,CAAC;AAcH,SAAS,kBAAkB,QAAmE;AAC5F,QAAM,OAAO,OAAO,OAAO,CAAC,MAAM,EAAE,SAAS,yBAAyB;AACtE,MAAI,CAAC,KAAK,OAAQ;AAClB,UAAQ;AAAA,IACNA,OAAM,OAAO;AAAA,EAAK,KAAK,MAAM,UAAU,KAAK,WAAW,IAAI,KAAK,GAAG,sBAAsB;AAAA,EAC3F;AACA,aAAW,KAAK,KAAK,MAAM,GAAG,EAAE,EAAG,SAAQ,KAAKA,OAAM,KAAK,OAAO,EAAE,OAAO,EAAE,CAAC;AAC9E,MAAI,KAAK,SAAS,GAAI,SAAQ,KAAKA,OAAM,KAAK,aAAa,KAAK,SAAS,EAAE,OAAO,CAAC;AAEnF,QAAM,QAAQ,CAAC,GAAG,IAAI,IAAI,KAAK,IAAI,CAAC,MAAM,EAAE,IAAI,EAAE,OAAO,OAAO,CAAC,CAAC;AAClE,aAAW,KAAK,MAAO,SAAQ,KAAKA,OAAM,KAAK,KAAK,CAAC,EAAE,CAAC;AAC1D;AAEA,QAAQ,WAAW,QAAQ,IAAI;","names":["chalk","path","path","readFileSync","path","fs","chalk","watcher","path"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli.ts","../src/validation-options.ts","../src/drift.ts","../src/generator-loader.ts","../src/sponsor.ts","../src/version.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { SchemaAnalyzer } from '@drzl/analyzer';\nimport { ORPCGenerator } from '@drzl/generator-orpc';\nimport chalk from 'chalk';\nimport chokidar from 'chokidar';\nimport cliProgress from 'cli-progress';\nimport { Command } from 'commander';\nimport * as path from 'node:path';\nimport ora from 'ora';\nimport { validationOptions } from './validation-options';\nimport {\n computeGeneratorOutputDirs,\n computeWatchTargets,\n DrzlConfig,\n filterTables,\n loadConfig,\n} from './config.js';\nimport { diffSnapshots, restoreSnapshot, snapshotAll } from './drift.js';\nimport { GeneratorNotInstalledError, loadGenerator } from './generator-loader.js';\nimport { maybeShowSponsorMessage } from './sponsor.js';\nimport { CLI_VERSION } from './version.js';\n\n/**\n * Say what went wrong with a generator, distinguishing the two things that can.\n *\n * Every branch below used to print \"<name> generator missing. Install with: npm install\n * @drzl/generator-<name>\" for anything at all that threw, with the real reason on a trailing\n * \"Error details\" line. A generator that was installed and merely failed therefore sent its user\n * to reinstall a package they already had, and the sentence that would have told them what\n * actually happened was the one written as a footnote.\n *\n * `loadGenerator` marks the one case that is an install problem, so the package name comes off the\n * error rather than being repeated here beside the `import()` that already spells it.\n */\nfunction reportGeneratorFailure(kind: string, e: unknown): void {\n if (e instanceof GeneratorNotInstalledError) {\n console.error(\n chalk.red(`The ${kind} generator is not installed.`),\n chalk.yellow(`\\nInstall with: npm install ${e.specifier}`)\n );\n return;\n }\n console.error(chalk.red(`The ${kind} generator failed:`), (e as any)?.message ?? e);\n}\n\nconst program = new Command();\nprogram.name('drzl').description('DRZL - Drizzle Developer Toolkit').version(CLI_VERSION);\nprogram.addHelpText(\n 'afterAll',\n `\\nNeed a template, adapter, or generator DRZL doesn't ship yet?\\n→ DM @omardulaimidev on X: https://x.com/omardulaimidev\\n`\n);\n\nprogram\n .command('analyze')\n .argument('<schema>', 'path to drizzle schema (TS)')\n .option('--relations', 'include relations', true)\n .option('--validate', 'validate constraints', true)\n .option('--out <file>', 'write analysis JSON to file')\n .option('--json', 'print JSON to stdout (overrides --out)', false)\n .action(async (schema: string, opts: any) => {\n try {\n const analyzer = new SchemaAnalyzer(schema);\n const spinner = !opts.json ? ora('Analyzing schema...').start() : null;\n const start = Date.now();\n const res = await analyzer.analyze({\n includeRelations: !!opts.relations,\n validateConstraints: !!opts.validate,\n });\n const ms = Date.now() - start;\n const json = JSON.stringify(res, null, 2);\n if (opts.json) {\n console.log(json);\n } else if (opts.out) {\n const fs = await import('node:fs/promises');\n await fs.writeFile(opts.out, json, 'utf8');\n spinner?.succeed(chalk.green(`Analysis written to ${opts.out} in ${ms}ms`));\n } else {\n spinner?.succeed(chalk.green(`Analyzed in ${ms}ms`));\n console.log(json);\n }\n process.exit(res.issues.some((i) => i.level === 'error') ? 2 : 0);\n } catch (e: any) {\n const msg = e?.message ?? String(e);\n if (opts.json)\n console.log(JSON.stringify({ event: 'error', code: 'DRZL_CLI_ANALYZE', message: msg }));\n else\n console.error(\n chalk.red('Analyze failed (DRZL_CLI_ANALYZE):'),\n msg,\n '\\nTip: run with --json for structured output.'\n );\n process.exit(1);\n }\n });\n\nprogram\n .command('generate')\n .description('Run configured generators (drzl.config.*)')\n .option('-c, --config <path>', 'path to drzl.config')\n .option(\n '--check',\n 'regenerate and fail if the result differs from what is on disk, without changing it'\n )\n .action(async (opts: any) => {\n try {\n const cfg = await loadConfig(opts.config);\n if (!cfg) {\n console.error(\n chalk.red('No config found (DRZL_CFG_001). Create drzl.config.ts or pass --config.')\n );\n process.exit(2);\n return;\n }\n const analyzer = new SchemaAnalyzer(cfg.schema);\n const spinner = ora('Analyzing...').start();\n const t0 = Date.now();\n const analysis = await analyzer.analyze({\n includeRelations: cfg.analyzer.includeRelations,\n validateConstraints: cfg.analyzer.validateConstraints,\n includeHeuristicRelations: cfg.analyzer.includeHeuristicRelations,\n });\n // Applied before any generator sees the analysis, so every one of them honours it without\n // needing to know the option exists.\n analysis.tables = filterTables(analysis.tables, cfg);\n spinner.succeed(`Analysis complete in ${Date.now() - t0}ms`);\n reportWideColumns(analysis.issues);\n // Under --check the existing output is captured before anything overwrites it, so the\n // regenerated result can be compared against it and the tree put back either way.\n const driftDirs = computeGeneratorOutputDirs(cfg);\n const driftBefore = opts.check ? await snapshotAll(driftDirs) : null;\n const progress = new cliProgress.SingleBar(\n { hideCursor: true },\n cliProgress.Presets.shades_classic\n );\n const total = analysis.tables.length || 1;\n progress.start(total, 0);\n // Where the service generator is actually writing, so a router template that imports\n // services spells a path that exists. Templates default this to 'src/services', and with\n // nothing passed that default was used no matter where the services really went, emitting\n // an import of a module that was never created. Must match the `g.path ?? 'src/services'`\n // used by the service branch below.\n const servicesDir =\n cfg.generators.find((x: { kind: string }) => x.kind === 'service')?.path ?? 'src/services';\n for (const g of cfg.generators) {\n if (g.kind === 'orpc') {\n const gen = new ORPCGenerator(analysis);\n const { files } = await gen.generate({\n outputDir: cfg.outDir,\n template: g.template,\n includeRelations: g.includeRelations,\n naming: g.naming,\n outputHeader: g.outputHeader,\n format: g.format,\n templateOptions: g.templateOptions,\n importExtension: g.importExtension,\n validation: g.validation,\n servicesDir,\n onProgress: ({ index }) => progress.update(index),\n });\n progress.stop();\n ora().succeed(chalk.green(`Generated (${g.kind}): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } else if (g.kind === 'service') {\n try {\n const { ServiceGenerator } = await loadGenerator(\n '@drzl/generator-service',\n () => import('@drzl/generator-service')\n );\n const gen = new ServiceGenerator(analysis);\n const target = g.path ?? 'src/services';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n dataAccess: g.dataAccess,\n dbImportPath: g.dbImportPath,\n schemaImportPath: g.schemaImportPath,\n importExtension: g.importExtension,\n });\n progress.stop();\n ora().succeed(chalk.green(`Generated (service): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n reportGeneratorFailure(g.kind, e);\n process.exit(1);\n }\n } else if (g.kind === 'zod') {\n try {\n const { ZodGenerator } = await loadGenerator(\n '@drzl/generator-zod',\n () => import('@drzl/generator-zod')\n );\n const gen = new ZodGenerator(analysis);\n const target = g.path ?? 'src/validators/zod';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: true }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (zod): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n reportGeneratorFailure(g.kind, e);\n process.exit(1);\n }\n } else if (g.kind === 'valibot') {\n try {\n const { ValibotGenerator } = await loadGenerator(\n '@drzl/generator-valibot',\n () => import('@drzl/generator-valibot')\n );\n const gen = new ValibotGenerator(analysis);\n const target = g.path ?? 'src/validators/valibot';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: true }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (valibot): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n reportGeneratorFailure(g.kind, e);\n process.exit(1);\n }\n } else if (g.kind === 'arktype') {\n try {\n const { ArkTypeGenerator } = await loadGenerator(\n '@drzl/generator-arktype',\n () => import('@drzl/generator-arktype')\n );\n const gen = new ArkTypeGenerator(analysis);\n const target = g.path ?? 'src/validators/arktype';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: false }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (arktype): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n reportGeneratorFailure(g.kind, e);\n process.exit(1);\n }\n } else if (g.kind === 'json-schema') {\n try {\n // An optional dependency, unlike the other generators, until its npm trusted publisher\n // exists. A missing optional dependency is skipped rather than failing the install,\n // which is what keeps `npm i @drzl/cli` working meanwhile, and is why this one really\n // can be absent on a normal install.\n const { JsonSchemaGenerator } = await loadGenerator(\n '@drzl/generator-json-schema',\n () => import('@drzl/generator-json-schema')\n );\n const gen = new JsonSchemaGenerator(analysis);\n const target = g.path ?? 'src/validators/json-schema';\n const files = await gen.generate({\n // JSON Schema is data, so nothing here references a type from the schema module.\n ...(validationOptions(g, cfg, target, { schemaTypes: false }) as object),\n target: g.target,\n components: g.components,\n } as never);\n progress.stop();\n ora().succeed(chalk.green(`Generated (json-schema): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n reportGeneratorFailure(g.kind, e);\n process.exit(1);\n }\n } else if (g.kind === 'typebox') {\n try {\n const { TypeBoxGenerator } = await loadGenerator(\n '@drzl/generator-typebox',\n () => import('@drzl/generator-typebox')\n );\n const gen = new TypeBoxGenerator(analysis);\n const target = g.path ?? 'src/validators/typebox';\n const files = await gen.generate(\n validationOptions(g, cfg, target, { schemaTypes: true }) as never\n );\n progress.stop();\n ora().succeed(chalk.green(`Generated (typebox): ${files.length} files`));\n files.forEach((f: string) => console.log(' -', chalk.cyan(f)));\n } catch (e: any) {\n progress.stop();\n reportGeneratorFailure(g.kind, e);\n process.exit(1);\n }\n }\n }\n if (driftBefore) {\n const after = await snapshotAll(driftDirs);\n const drift = diffSnapshots(driftBefore, after);\n // Restored whether or not anything drifted, so `--check` never leaves the tree altered.\n await restoreSnapshot(driftBefore, after);\n\n if (drift.length) {\n console.error(chalk.red(`\\nGenerated output is out of date (${drift.length} file(s)):`));\n for (const d of drift) {\n const mark = d.status === 'added' ? '+' : d.status === 'removed' ? '-' : '~';\n console.error(\n ` ${mark} ${chalk.yellow(d.status.padEnd(8))} ${path.relative(process.cwd(), d.file)}`\n );\n }\n console.error(\n chalk.dim(\n '\\nRun `drzl generate` and commit the result. Nothing was written by this check.'\n )\n );\n process.exit(1);\n }\n console.log(chalk.green('Generated output is up to date.'));\n return;\n }\n\n if (cfg.generators.length) {\n maybeShowSponsorMessage({ reason: 'generate' });\n }\n } catch (e: any) {\n console.error(\n chalk.red('Generate failed (DRZL_GEN_001):'),\n e?.message ?? e,\n '\\nTip: check your drzl.config.ts and template path.'\n );\n process.exit(1);\n }\n });\n\nprogram\n .command('generate:orpc')\n .argument('<schema>', 'path to drizzle schema (TS)')\n .option('-o, --outDir <dir>', 'output directory', 'src/api')\n .option('--template <name>', 'template name', 'standard')\n .option('--includeRelations', 'include relation endpoints')\n .action(async (schema: string, opts: any) => {\n try {\n const analyzer = new SchemaAnalyzer(schema);\n const analysis = await analyzer.analyze({\n includeRelations: !!opts.includeRelations,\n validateConstraints: true,\n });\n const gen = new ORPCGenerator(analysis);\n const { files } = await gen.generate({\n outputDir: opts.outDir,\n template: opts.template,\n includeRelations: !!opts.includeRelations,\n });\n console.log(chalk.green(`Generated:`), files.map((f) => chalk.cyan(f)).join(', '));\n maybeShowSponsorMessage({ reason: 'generate:orpc' });\n } catch (e: any) {\n console.error(chalk.red('Generate orpc failed:'), e?.message ?? e);\n process.exit(1);\n }\n });\n\nprogram\n .command('watch')\n .description('Watch schema and regenerate on changes')\n .option('-c, --config <path>', 'path to drzl.config')\n .option('--pipeline <name>', 'all | analyze | generate-orpc', 'all')\n .option('--debounce <ms>', 'debounce ms', '200')\n .option('--json', 'emit JSON logs', false)\n .option('--poll', 'force polling (helps WSL/Docker/remote FS)', false)\n .action(async (opts: any) => {\n let cfg = await loadConfig(opts.config);\n if (!cfg) {\n console.error(chalk.red('No config found. Create drzl.config.ts or pass --config.'));\n process.exit(2);\n return;\n }\n\n const abs = (p: string) => path.resolve(process.cwd(), p);\n const isInside = (child: string, parent: string) => {\n const rel = path.relative(parent, child);\n return !!rel && !rel.startsWith('..') && !path.isAbsolute(rel);\n };\n\n const ignoredOutDirs = new Set<string>(computeGeneratorOutputDirs(cfg).map(abs));\n const currentTargets = new Set<string>(computeWatchTargets(cfg).map(abs));\n\n const syncWatcherTargets = (watcher: import('chokidar').FSWatcher, next: Set<string>) => {\n const add: string[] = [];\n const del: string[] = [];\n for (const p of next) if (!currentTargets.has(p)) add.push(p);\n for (const p of currentTargets) if (!next.has(p)) del.push(p);\n if (add.length) watcher.add(add);\n if (del.length) watcher.unwatch(del);\n currentTargets.clear();\n next.forEach((p) => currentTargets.add(p));\n };\n\n const rebuildIgnoreDirsFrom = (cfgNow: DrzlConfig) => {\n ignoredOutDirs.clear();\n for (const d of computeGeneratorOutputDirs(cfgNow)) ignoredOutDirs.add(abs(d));\n };\n\n // Watch targets are directories now, because chokidar v4 dropped glob support. The\n // extensions the old `**/*.{ts,tsx,js}` glob selected therefore have to be filtered here\n // instead, or every unrelated file in the schema's directory would trigger a rebuild.\n const WATCHED_EXTENSIONS = new Set(['.ts', '.tsx', '.js', '.mjs', '.cjs']);\n\n const ignoredFn = (p: string, stats?: { isDirectory(): boolean }) => {\n const full = abs(p);\n for (const dir of ignoredOutDirs) {\n if (full === dir || isInside(full, dir)) return true;\n }\n // A directory is never ignored: chokidar has to descend into it to reach the files.\n if (stats?.isDirectory()) return false;\n const ext = path.extname(full);\n // Without stats chokidar is asking about a path it has not resolved yet. An extensionless\n // one is almost certainly a directory, so let it through and decide once it is known.\n if (!ext) return false;\n return !WATCHED_EXTENSIONS.has(ext);\n };\n\n const watcher = chokidar.watch(Array.from(currentTargets), {\n ignoreInitial: true,\n awaitWriteFinish: { stabilityThreshold: 400, pollInterval: 50 },\n usePolling: !!opts.poll,\n ignored: ignoredFn,\n });\n\n const logTrigger = (type: 'add' | 'change' | 'unlink', file: string) => {\n if (opts.json) console.log(JSON.stringify({ event: 'trigger', type, file }));\n };\n\n watcher\n .on('add', (p) => {\n logTrigger('add', p);\n trigger(p);\n })\n .on('change', (p) => {\n logTrigger('change', p);\n trigger(p);\n })\n .on('unlink', (p) => {\n logTrigger('unlink', p);\n trigger(p);\n });\n\n let lastFiles: string[] = [];\n\n const run = async () => {\n try {\n const reloaded = await loadConfig(opts.config);\n if (!reloaded) throw new Error('Config disappeared during watch.');\n cfg = reloaded;\n\n rebuildIgnoreDirsFrom(cfg);\n const nextTargets = new Set<string>(computeWatchTargets(cfg).map(abs));\n syncWatcherTargets(watcher, nextTargets);\n\n if (!opts.json) console.clear();\n\n if (opts.json) {\n console.log(\n JSON.stringify({\n event: 'watch_config_applied',\n targets: Array.from(currentTargets),\n ignored: Array.from(ignoredOutDirs),\n })\n );\n }\n\n const analyzer = new SchemaAnalyzer(cfg.schema);\n const analysis = await analyzer.analyze({\n includeRelations: cfg.analyzer.includeRelations,\n validateConstraints: cfg.analyzer.validateConstraints,\n includeHeuristicRelations: cfg.analyzer.includeHeuristicRelations,\n });\n analysis.tables = filterTables(analysis.tables, cfg);\n if (!opts.json) reportWideColumns(analysis.issues);\n\n if (opts.pipeline === 'analyze') {\n if (opts.json) {\n console.log(\n JSON.stringify({\n event: 'analyze_complete',\n issues: analysis.issues,\n tables: analysis.tables.length,\n })\n );\n } else {\n console.log(chalk.green('Analyze complete.'));\n }\n return;\n }\n\n const newFiles: string[] = [];\n\n for (const g of cfg.generators) {\n if (\n opts.pipeline !== 'all' &&\n !(opts.pipeline === 'generate-orpc' && g.kind === 'orpc')\n ) {\n continue;\n }\n\n if (g.kind === 'orpc') {\n const gen = new ORPCGenerator(analysis);\n const { files } = await gen.generate({\n outputDir: cfg.outDir,\n template: g.template,\n includeRelations: g.includeRelations,\n naming: g.naming,\n outputHeader: g.outputHeader,\n format: g.format,\n templateOptions: g.templateOptions,\n importExtension: g.importExtension,\n validation: g.validation,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (${g.kind}):`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } else if (g.kind === 'service') {\n try {\n const { ServiceGenerator } = await loadGenerator(\n '@drzl/generator-service',\n () => import('@drzl/generator-service')\n );\n const gen = new ServiceGenerator(analysis);\n const target = g.path ?? 'src/services';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n dataAccess: g.dataAccess,\n dbImportPath: g.dbImportPath,\n schemaImportPath: g.schemaImportPath,\n importExtension: g.importExtension,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (service): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n reportGeneratorFailure(g.kind, e);\n return;\n }\n } else if (g.kind === 'zod') {\n try {\n const { ZodGenerator } = await loadGenerator(\n '@drzl/generator-zod',\n () => import('@drzl/generator-zod')\n );\n const gen = new ZodGenerator(analysis);\n const target = g.path ?? 'src/validators/zod';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (zod): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n reportGeneratorFailure(g.kind, e);\n return;\n }\n } else if (g.kind === 'valibot') {\n try {\n const { ValibotGenerator } = await loadGenerator(\n '@drzl/generator-valibot',\n () => import('@drzl/generator-valibot')\n );\n const gen = new ValibotGenerator(analysis);\n const target = g.path ?? 'src/validators/valibot';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (valibot): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n reportGeneratorFailure(g.kind, e);\n return;\n }\n } else if (g.kind === 'arktype') {\n try {\n const { ArkTypeGenerator } = await loadGenerator(\n '@drzl/generator-arktype',\n () => import('@drzl/generator-arktype')\n );\n const gen = new ArkTypeGenerator(analysis);\n const target = g.path ?? 'src/validators/arktype';\n const files = await gen.generate({\n outDir: target,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n });\n opts.json\n ? console.log(JSON.stringify({ event: 'generate_complete', kind: g.kind, files }))\n : console.log(\n chalk.green(`Generated (arktype): ${files.length} files`),\n files.map((f: string) => chalk.cyan(f)).join(', ')\n );\n newFiles.push(...files);\n } catch (e: any) {\n reportGeneratorFailure(g.kind, e);\n return;\n }\n }\n }\n\n const added = newFiles.filter((f) => !lastFiles.includes(f));\n const removed = lastFiles.filter((f) => !newFiles.includes(f));\n opts.json\n ? console.log(JSON.stringify({ event: 'diff', added, removed }))\n : (() => {\n if (added.length) console.log(chalk.blue(`Added: ${added.join(', ')}`));\n if (removed.length) console.log(chalk.yellow(`Removed: ${removed.join(', ')}`));\n })();\n if (newFiles.length && !opts.json) {\n const reason =\n opts.pipeline && opts.pipeline !== 'all' ? `watch:${opts.pipeline}` : 'watch';\n maybeShowSponsorMessage({ reason });\n }\n lastFiles = newFiles;\n } catch (e: any) {\n opts.json\n ? console.log(JSON.stringify({ event: 'error', message: String(e?.message ?? e) }))\n : console.error(chalk.red('Watch pipeline failed:'), e?.message ?? e);\n }\n };\n\n const debounced = Number(opts.debounce) || 200;\n let timer: NodeJS.Timeout | null = null;\n const trigger = (file?: string) => {\n if (file) {\n const full = abs(file);\n for (const dir of ignoredOutDirs) {\n if (full === dir || isInside(full, dir)) return;\n }\n }\n if (timer) clearTimeout(timer);\n timer = setTimeout(run, debounced);\n };\n\n if (opts.json) {\n console.log(\n JSON.stringify({\n event: 'watching',\n targets: Array.from(currentTargets),\n ignored: Array.from(ignoredOutDirs),\n })\n );\n } else {\n console.log(\n chalk.gray(\n 'Watching:\\n ' +\n Array.from(currentTargets)\n .map((p) => path.relative(process.cwd(), p))\n .join('\\n ')\n )\n );\n }\n\n watcher\n .on('add', (p) => trigger(p))\n .on('change', (p) => trigger(p))\n .on('unlink', (p) => trigger(p))\n .on('error', (err) => console.error(chalk.red('Watcher error:'), err));\n\n await run();\n });\n\nprogram\n .command('init')\n .description('Scaffold a drzl.config.ts')\n .option('-y, --yes', 'accept defaults')\n .action(async (_opts: any) => {\n const fs = await import('node:fs/promises');\n const path = await import('node:path');\n const target = path.resolve(process.cwd(), 'drzl.config.ts');\n const template = `export default {\n schema: 'src/db/schema.ts',\n outDir: 'src/api',\n analyzer: { includeRelations: true, validateConstraints: true },\n generators: [\n { kind: 'orpc', template: 'standard', includeRelations: true }\n ]\n} as const\\n`;\n try {\n await fs.writeFile(target, template, { flag: 'wx' });\n console.log(chalk.green(`Created ${target}`));\n } catch (e: any) {\n console.error(chalk.red('Init failed:'), e?.message ?? e);\n process.exit(1);\n }\n });\n\n/**\n * Tell the user which columns got a validator that accepts anything.\n *\n * This is the user-facing half of a check `verify-packed.sh` runs on this repository. Two real\n * bugs took exactly this shape, `.array()` and `pgEnum` columns coming back untyped on\n * drizzle-orm 0.4x, and the only way anyone noticed was reading the generated file. A user whose\n * schema uses a type nobody here has modelled gets the same silence, and no gate of ours helps\n * them.\n *\n * Printed once with a count rather than a line per column, so a schema with fifty custom types\n * stays readable.\n */\nfunction reportWideColumns(issues: Array<{ code?: string; message?: string; hint?: string }>) {\n const wide = issues.filter((i) => i.code === 'DRZL_ANL_UNKNOWN_COLUMN');\n if (!wide.length) return;\n console.warn(\n chalk.yellow(`\\n${wide.length} column${wide.length === 1 ? '' : 's'} could not be typed:`)\n );\n for (const i of wide.slice(0, 10)) console.warn(chalk.gray(` - ${i.message}`));\n if (wide.length > 10) console.warn(chalk.gray(` ... and ${wide.length - 10} more`));\n // One hint for the set, since they are almost always the same two.\n const hints = [...new Set(wide.map((i) => i.hint).filter(Boolean))];\n for (const h of hints) console.warn(chalk.gray(` ${h}`));\n}\n\nprogram.parseAsync(process.argv);\n","/**\n * The options every validation generator receives, built in one place.\n *\n * Each of the four branches used to assemble this by hand, and three documented options were\n * found silently dead as a result: `typedJson` never reached typebox, and `coerceDates` and\n * `applyDefaults` never reached anything but zod. The config parsed them, the CLI dropped them,\n * and the feature simply did nothing while nothing said so. Building it once removes the class\n * rather than fixing each instance.\n *\n * What stays per-generator is a real capability rather than an oversight, which is why it is\n * named as one.\n */\n\n/** A generator entry from the config, loosely typed because the config schema owns its shape. */\ntype GeneratorConfig = {\n outputHeader?: unknown;\n format?: unknown;\n schemaSuffix?: unknown;\n fileSuffix?: unknown;\n importExtension?: unknown;\n affix?: unknown;\n coerceDates?: unknown;\n applyDefaults?: unknown;\n typedJson?: unknown;\n typedColumns?: unknown;\n duplicateFinder?: unknown;\n};\n\nexport interface GeneratorCapabilities {\n /**\n * Whether the generator can reference a type from the schema module.\n *\n * `typedJson` and `typedColumns` both work by importing the table back and reading\n * `typeof table.$inferSelect['col']`, so a generator that cannot embed a TypeScript type in its\n * output cannot use either. ArkType is the case: it emits one string per field, and a type\n * reference has nowhere to live inside a string DSL.\n */\n schemaTypes?: boolean;\n}\n\nexport function validationOptions(\n g: GeneratorConfig,\n cfg: { schema?: unknown },\n outDir: string,\n caps: GeneratorCapabilities = {}\n): Record<string, unknown> {\n return {\n outDir,\n outputHeader: g.outputHeader,\n format: g.format,\n schemaSuffix: g.schemaSuffix,\n fileSuffix: g.fileSuffix,\n importExtension: g.importExtension,\n affix: g.affix,\n coerceDates: g.coerceDates,\n applyDefaults: g.applyDefaults,\n duplicateFinder: g.duplicateFinder,\n // Only where the generator can act on them, so an unsupported option is absent rather than\n // present and ignored.\n ...(caps.schemaTypes\n ? {\n // Needed by both: the reference is resolved relative to the emitted file.\n schemaPath: cfg.schema,\n typedJson: g.typedJson,\n typedColumns: g.typedColumns,\n }\n : {}),\n };\n}\n","/**\n * Drift detection for generated output.\n *\n * No runtime validator can offer this. `drizzle-orm/zod` and friends derive schemas in memory at\n * import time, so there is nothing on disk to have drifted and nothing for CI to compare. It is\n * only available to a code generator, which makes it one of the few things DRZL can do that the\n * first-party modules structurally cannot.\n *\n * The check is: regenerate, and require the result to equal what is committed. That catches the\n * two failures that actually happen, someone editing generated files by hand and someone\n * changing the schema without regenerating, and it catches them in CI rather than in review.\n *\n * Content-neutral by construction. Redirecting output to a temporary directory would not work:\n * generated files contain paths computed relative to their own location, so a different output\n * directory produces legitimately different bytes and every file would report as drifted. So the\n * real directories are snapshotted first, regeneration is allowed to overwrite them, and the\n * snapshot is put back if anything changed. Either way the tree ends as it began.\n */\nimport { promises as fs } from 'node:fs';\nimport path from 'node:path';\n\nexport interface DriftEntry {\n file: string;\n status: 'changed' | 'added' | 'removed';\n}\n\n/** Every file under `dir`, keyed by its path relative to `dir`. Missing directory means empty. */\nexport async function snapshotDir(dir: string): Promise<Map<string, string>> {\n const out = new Map<string, string>();\n async function walk(current: string) {\n let entries;\n try {\n entries = await fs.readdir(current, { withFileTypes: true });\n } catch {\n return; // Nothing generated there yet, which a first run should report as additions.\n }\n for (const e of entries) {\n const full = path.join(current, e.name);\n if (e.isDirectory()) await walk(full);\n else out.set(path.relative(dir, full), await fs.readFile(full, 'utf8'));\n }\n }\n await walk(dir);\n return out;\n}\n\n/** Snapshot several directories at once, keys prefixed by directory so they cannot collide. */\nexport async function snapshotAll(dirs: string[]): Promise<Map<string, string>> {\n const all = new Map<string, string>();\n for (const dir of dirs) {\n for (const [rel, content] of await snapshotDir(dir)) {\n all.set(path.join(dir, rel), content);\n }\n }\n return all;\n}\n\n/** What changed between two snapshots. */\nexport function diffSnapshots(\n before: Map<string, string>,\n after: Map<string, string>\n): DriftEntry[] {\n const out: DriftEntry[] = [];\n for (const [file, content] of after) {\n if (!before.has(file)) out.push({ file, status: 'added' });\n else if (before.get(file) !== content) out.push({ file, status: 'changed' });\n }\n for (const file of before.keys()) {\n if (!after.has(file)) out.push({ file, status: 'removed' });\n }\n return out.sort((a, b) => a.file.localeCompare(b.file));\n}\n\n/**\n * Put a snapshot back, so a failed check leaves the tree exactly as it found it.\n *\n * A file that regeneration created and the snapshot does not know about is deleted, since it was\n * not there before the check ran.\n */\nexport async function restoreSnapshot(\n before: Map<string, string>,\n after: Map<string, string>\n): Promise<void> {\n for (const [file, content] of before) {\n await fs.mkdir(path.dirname(file), { recursive: true });\n await fs.writeFile(file, content, 'utf8');\n }\n for (const file of after.keys()) {\n if (!before.has(file)) await fs.rm(file, { force: true });\n }\n}\n","/**\n * Loading an optional generator package, and telling absence apart from failure.\n *\n * Every validation generator is loaded on demand, because a project that only wants zod should not\n * have to install five. That makes \"the package is not installed\" a real, expected outcome worth a\n * helpful message. It does not make it the only outcome: a generator that is installed and running\n * can throw for any reason a program can throw, and the CLI reported all of those as a missing npm\n * package too, with the true reason printed underneath as a detail.\n *\n * Node reports an unresolvable import as `ERR_MODULE_NOT_FOUND`, and reports the same code when\n * the module resolved and something *it* imported did not. The code alone therefore does not\n * separate the two; the message does, because it names the specifier that failed to resolve.\n */\n\n/** A generator package that is not installed. Everything else is somebody's real error. */\nexport class GeneratorNotInstalledError extends Error {\n constructor(\n readonly specifier: string,\n /** What Node threw, kept so nothing is discarded on the way to the message. */\n readonly reason: unknown\n ) {\n super(`${specifier} is not installed`);\n this.name = 'GeneratorNotInstalledError';\n }\n}\n\n/**\n * Whether `err` is Node refusing to resolve `specifier` itself.\n *\n * Measured on Node 22, from an ESM entry and from a CJS one, since the CLI ships both builds and\n * the bundler leaves `import()` as `import()` in each:\n *\n * absent package ERR_MODULE_NOT_FOUND, `Cannot find package '<specifier>' imported…`\n * present, inner dep absent ERR_MODULE_NOT_FOUND, naming the *inner* specifier instead\n * present, main file gone ERR_MODULE_NOT_FOUND, naming the resolved file path\n * throws while evaluating no `code` at all, and whatever message the generator threw\n *\n * Only the first is an install problem, and only the first quotes the specifier that was asked\n * for, which is what this matches on.\n */\nexport function isPackageMissing(err: unknown, specifier: string): boolean {\n const code = (err as { code?: unknown } | null | undefined)?.code;\n if (code !== 'ERR_MODULE_NOT_FOUND') return false;\n const message = (err as { message?: unknown } | null | undefined)?.message;\n return typeof message === 'string' && message.includes(`'${specifier}'`);\n}\n\n/**\n * Run `load` and re-throw a missing package as `GeneratorNotInstalledError`.\n *\n * `load` is a thunk rather than a specifier so the caller keeps a literal `import('@drzl/…')` in\n * its own source, which is what lets the bundler see the dependency. Anything it throws that is\n * not this package's own absence comes out unchanged.\n */\nexport async function loadGenerator<T>(specifier: string, load: () => Promise<T>): Promise<T> {\n try {\n return await load();\n } catch (e) {\n if (isPackageMissing(e, specifier)) throw new GeneratorNotInstalledError(specifier, e);\n throw e;\n }\n}\n","import chalk from 'chalk';\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';\nimport path from 'node:path';\n\nexport interface SponsorMessageOptions {\n reason?: string;\n minIntervalMs?: number;\n force?: boolean;\n}\n\ninterface SponsorCachePayload {\n runs: number;\n lastShownAt?: number;\n lastReason?: string;\n}\n\nconst CACHE_DIR = path.join(process.cwd(), 'node_modules', '.cache', '@drzl');\nconst CACHE_FILE = path.join(CACHE_DIR, 'sponsor-message.json');\nconst DEFAULT_INTERVAL_MS = 1000 * 60 * 15; // 15 minutes\nlet shownThisProcess = false;\n\nconst tips = [\n 'Pair DRZL watch mode with drizzle-kit to keep schema & API synced.',\n 'Templatize your ORPC routers to roll out new endpoints safely.',\n 'Need typed validators? Enable the zod, valibot, arktype, or typebox generators.',\n 'Need JSON Schema or OpenAPI? The json-schema generator emits both, with no runtime dependency.',\n 'Use output headers to track generated files and trim noisy diffs.',\n];\n\nconst green = (msg: string) => chalk.hex('#6ee7b7')(msg);\nconst cyan = (msg: string) => chalk.cyan(msg);\nconst gray = (msg: string) => chalk.gray(msg);\n\nexport function maybeShowSponsorMessage({\n reason = 'generate',\n minIntervalMs = DEFAULT_INTERVAL_MS,\n force = false,\n}: SponsorMessageOptions = {}) {\n const hideViaEnv = process.env.DRZL_HIDE_SPONSOR?.toLowerCase();\n const hideRequested = hideViaEnv === '1' || hideViaEnv === 'true';\n if (hideRequested || (process.env.CI && !force) || (shownThisProcess && !force)) return;\n\n try {\n mkdirSync(CACHE_DIR, { recursive: true });\n const payload = readCache();\n payload.runs += 1;\n\n const now = Date.now();\n const shouldShow = force || now - (payload.lastShownAt ?? 0) >= minIntervalMs;\n\n if (shouldShow) {\n payload.lastShownAt = now;\n payload.lastReason = reason;\n }\n\n writeCache(payload);\n\n if (!shouldShow) return;\n\n shownThisProcess = true;\n const tip = tips[payload.runs % tips.length];\n\n console.log(\n `\\n${cyan(`🚀 DRZL finished a ${reason} run (#${payload.runs.toLocaleString()}).`)}\\n\\n` +\n `${green('✨ Sponsors keep DRZL shipping. Consider supporting ongoing dev:')}\\n` +\n ` ${green('GitHub Sponsors')} ${gray('→ https://github.com/sponsors/omar-dulaimi')}\\n\\n` +\n `${green('Pro tip:')} ${tip}\\n`\n );\n } catch {\n // Swallow to avoid impacting generator success paths\n }\n}\n\nfunction readCache(): SponsorCachePayload {\n if (!existsSync(CACHE_FILE)) {\n return { runs: 0 };\n }\n try {\n const data = JSON.parse(readFileSync(CACHE_FILE, 'utf8')) as SponsorCachePayload;\n if (typeof data.runs !== 'number') return { runs: 0 };\n return data;\n } catch {\n return { runs: 0 };\n }\n}\n\nfunction writeCache(payload: SponsorCachePayload) {\n writeFileSync(CACHE_FILE, JSON.stringify(payload, null, 2), 'utf8');\n}\n","/**\n * The version `drzl --version` prints, read from the manifest that ships beside the build.\n *\n * It used to be the literal `'0.0.1'`, passed to `program.version()` when the CLI was scaffolded\n * and never touched again. That was true of exactly one release, the first: the registry lists 29\n * versions of `@drzl/cli`, and the other 28 printed `0.0.1` as well. Reading the manifest is the\n * only form that cannot drift, because it is the same file the registry took the version from.\n *\n * Nothing here falls back. A build that cannot find its own manifest, or finds someone else's, has\n * resolved somewhere it did not intend to, and a placeholder standing in for that is how the\n * original defect stayed invisible for 28 releases.\n */\nimport { readFileSync } from 'node:fs';\nimport * as path from 'node:path';\nimport { fileURLToPath } from 'node:url';\n\n/** The name the manifest beside this build must carry, which is what makes it ours. */\nconst PACKAGE_NAME = '@drzl/cli';\n\n/**\n * The directory holding the file this code ends up in, in every form it is reached.\n *\n * Three of them: `dist/cli.js`, `dist/cli.cjs`, and this file unbundled under ts-node, all three\n * run and checked. Only the CommonJS bundle has no `import.meta`; `tsup.config.ts` gives that\n * build a real value for `import.meta.url` rather than esbuild's empty one, so this needs no\n * branch. If that config is ever dropped, `fileURLToPath(undefined)` throws on load, so the\n * CommonJS bundle stops working loudly instead of reporting the wrong directory.\n */\nfunction moduleDir(): string {\n return path.dirname(fileURLToPath(import.meta.url));\n}\n\n/**\n * The `version` a named manifest declares, or a throw naming what was wrong with it.\n *\n * Split out from the caller below only so the three ways it refuses can be exercised without a\n * build. Nothing in the CLI passes a path.\n */\nexport function readVersionFrom(manifestPath: string): string {\n let raw: string;\n try {\n raw = readFileSync(manifestPath, 'utf8');\n } catch (e: any) {\n throw new Error(\n `${PACKAGE_NAME} cannot read its own version: no manifest at ${manifestPath} ` +\n `(${e?.message ?? String(e)}).`\n );\n }\n\n const manifest = JSON.parse(raw) as { name?: unknown; version?: unknown };\n\n if (manifest.name !== PACKAGE_NAME) {\n throw new Error(\n `${PACKAGE_NAME} looked for its own version in ${manifestPath} and found ` +\n `${JSON.stringify(manifest.name)}, so this build is not sitting where it thinks it is.`\n );\n }\n\n if (typeof manifest.version !== 'string' || manifest.version.length === 0) {\n throw new Error(`${manifestPath} declares no version, so there is nothing to report.`);\n }\n\n return manifest.version;\n}\n\n/**\n * The `version` field of this package's own manifest.\n *\n * Both bundles sit one level below it, in `dist/`, and so does `src/` when this file is run\n * unbundled, so one `..` covers every way it is reached. All three were run.\n */\nexport function readCliVersion(): string {\n return readVersionFrom(path.join(moduleDir(), '..', 'package.json'));\n}\n\nexport const CLI_VERSION = readCliVersion();\n"],"mappings":";;;;;;;;;AACA,SAAS,sBAAsB;AAC/B,SAAS,qBAAqB;AAC9B,OAAOA,YAAW;AAClB,OAAO,cAAc;AACrB,OAAO,iBAAiB;AACxB,SAAS,eAAe;AACxB,YAAY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AAM,KAAK,KAAK,CAAC,EAAE,CAAC;AAC1D;AAEA,QAAQ,WAAW,QAAQ,IAAI;","names":["chalk","path","path","readFileSync","path","chalk","fs","watcher","path"]}
|
package/dist/config.d.cts
CHANGED
|
@@ -69,9 +69,9 @@ declare const GeneratorSchema: z.ZodObject<{
|
|
|
69
69
|
template: z.ZodOptional<z.ZodString>;
|
|
70
70
|
includeRelations: z.ZodOptional<z.ZodBoolean>;
|
|
71
71
|
coerceDates: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
all: "all";
|
|
72
73
|
none: "none";
|
|
73
74
|
input: "input";
|
|
74
|
-
all: "all";
|
|
75
75
|
}>>;
|
|
76
76
|
typedJson: z.ZodOptional<z.ZodBoolean>;
|
|
77
77
|
typedColumns: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -223,9 +223,9 @@ declare const ConfigSchema: z.ZodObject<{
|
|
|
223
223
|
template: z.ZodOptional<z.ZodString>;
|
|
224
224
|
includeRelations: z.ZodOptional<z.ZodBoolean>;
|
|
225
225
|
coerceDates: z.ZodOptional<z.ZodEnum<{
|
|
226
|
+
all: "all";
|
|
226
227
|
none: "none";
|
|
227
228
|
input: "input";
|
|
228
|
-
all: "all";
|
|
229
229
|
}>>;
|
|
230
230
|
typedJson: z.ZodOptional<z.ZodBoolean>;
|
|
231
231
|
typedColumns: z.ZodOptional<z.ZodBoolean>;
|