@drzl/cli 4.28.0 → 4.29.0
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/{chunk-WS3MT5CH.js → chunk-WZQV2WVN.js} +31 -2
- package/dist/chunk-WZQV2WVN.js.map +1 -0
- package/dist/cli.cjs +85 -23
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +58 -23
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +31 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +23 -1
- package/dist/config.d.ts +23 -1
- package/dist/config.js +3 -1
- package/dist/drzl.config.schema.json +8 -0
- package/package.json +13 -12
- package/dist/chunk-WS3MT5CH.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
fastifyOutDir,
|
|
15
15
|
filterTables,
|
|
16
16
|
graphqlOutDir,
|
|
17
|
+
h3OutDir,
|
|
17
18
|
hasNamedSchemas,
|
|
18
19
|
honoOutDir,
|
|
19
20
|
importFreshConfigModule,
|
|
@@ -28,7 +29,7 @@ import {
|
|
|
28
29
|
tableFilterWarnings,
|
|
29
30
|
tanstackStartOutDir,
|
|
30
31
|
trpcOutDir
|
|
31
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WZQV2WVN.js";
|
|
32
33
|
|
|
33
34
|
// src/cli.ts
|
|
34
35
|
import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
|
|
@@ -352,6 +353,35 @@ function aiOptions(g, cfg) {
|
|
|
352
353
|
};
|
|
353
354
|
}
|
|
354
355
|
|
|
356
|
+
// src/h3-options.ts
|
|
357
|
+
var VALIDATOR_DEFAULT_DIRS = {
|
|
358
|
+
zod: "src/validators/zod",
|
|
359
|
+
valibot: "src/validators/valibot",
|
|
360
|
+
arktype: "src/validators/arktype"
|
|
361
|
+
};
|
|
362
|
+
function projectRelative(p) {
|
|
363
|
+
return p.startsWith("./") ? p.slice(2) : p;
|
|
364
|
+
}
|
|
365
|
+
function h3Options(g, cfg) {
|
|
366
|
+
const library = g.validation?.library ?? "zod";
|
|
367
|
+
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
368
|
+
const derived = siblings.length === 1 ? projectRelative(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS[library]) : void 0;
|
|
369
|
+
return {
|
|
370
|
+
outputDir: h3OutDir(g, cfg),
|
|
371
|
+
h3: g.h3,
|
|
372
|
+
naming: g.naming,
|
|
373
|
+
outputHeader: g.outputHeader,
|
|
374
|
+
format: g.format,
|
|
375
|
+
importExtension: g.importExtension,
|
|
376
|
+
validation: {
|
|
377
|
+
...g.validation,
|
|
378
|
+
library,
|
|
379
|
+
useShared: true,
|
|
380
|
+
importPath: g.validation?.importPath ?? derived
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
|
|
355
385
|
// src/mcp-options.ts
|
|
356
386
|
function mcpOptions(g, cfg) {
|
|
357
387
|
return {
|
|
@@ -369,18 +399,18 @@ function mcpOptions(g, cfg) {
|
|
|
369
399
|
}
|
|
370
400
|
|
|
371
401
|
// src/next-options.ts
|
|
372
|
-
var
|
|
402
|
+
var VALIDATOR_DEFAULT_DIRS2 = {
|
|
373
403
|
zod: "src/validators/zod",
|
|
374
404
|
valibot: "src/validators/valibot",
|
|
375
405
|
arktype: "src/validators/arktype"
|
|
376
406
|
};
|
|
377
|
-
function
|
|
407
|
+
function projectRelative2(p) {
|
|
378
408
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
379
409
|
}
|
|
380
410
|
function nextOptions(g, cfg) {
|
|
381
411
|
const library = g.validation?.library ?? "zod";
|
|
382
412
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
383
|
-
const derived = siblings.length === 1 ?
|
|
413
|
+
const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
|
|
384
414
|
return {
|
|
385
415
|
outputDir: nextOutDir(g, cfg),
|
|
386
416
|
naming: g.naming,
|
|
@@ -397,18 +427,18 @@ function nextOptions(g, cfg) {
|
|
|
397
427
|
}
|
|
398
428
|
|
|
399
429
|
// src/tanstack-start-options.ts
|
|
400
|
-
var
|
|
430
|
+
var VALIDATOR_DEFAULT_DIRS3 = {
|
|
401
431
|
zod: "src/validators/zod",
|
|
402
432
|
valibot: "src/validators/valibot",
|
|
403
433
|
arktype: "src/validators/arktype"
|
|
404
434
|
};
|
|
405
|
-
function
|
|
435
|
+
function projectRelative3(p) {
|
|
406
436
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
407
437
|
}
|
|
408
438
|
function tanstackStartOptions(g, cfg) {
|
|
409
439
|
const library = g.validation?.library ?? "zod";
|
|
410
440
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
411
|
-
const derived = siblings.length === 1 ?
|
|
441
|
+
const derived = siblings.length === 1 ? projectRelative3(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS3[library]) : void 0;
|
|
412
442
|
return {
|
|
413
443
|
outputDir: tanstackStartOutDir(g, cfg),
|
|
414
444
|
naming: g.naming,
|
|
@@ -492,7 +522,7 @@ function trpcOptions(g, cfg, servicesDir) {
|
|
|
492
522
|
}
|
|
493
523
|
|
|
494
524
|
// src/generator-registry.ts
|
|
495
|
-
var
|
|
525
|
+
var VALIDATOR_DEFAULT_DIRS4 = {
|
|
496
526
|
zod: "src/validators/zod",
|
|
497
527
|
valibot: "src/validators/valibot",
|
|
498
528
|
arktype: "src/validators/arktype",
|
|
@@ -577,12 +607,12 @@ var GENERATORS = [
|
|
|
577
607
|
},
|
|
578
608
|
{
|
|
579
609
|
kind: "mcp",
|
|
580
|
-
//
|
|
581
|
-
// has never existed cannot publish through npm's trusted-publisher OIDC flow
|
|
582
|
-
// a hard dependency in the release that introduces it breaks `npm i @drzl/cli`
|
|
583
|
-
// until the first publish lands.
|
|
584
|
-
//
|
|
585
|
-
//
|
|
610
|
+
// This one and the three below spent one release each in `optionalDependencies`, because a
|
|
611
|
+
// package that has never existed cannot publish through npm's trusted-publisher OIDC flow and
|
|
612
|
+
// naming it as a hard dependency in the release that introduces it breaks `npm i @drzl/cli`
|
|
613
|
+
// for everyone until the first publish lands. All four are on the registry now, so all four
|
|
614
|
+
// are ordinary dependencies. `scripts/verify/stages/33-registry-deps.sh` gates both halves of
|
|
615
|
+
// that rule and is what reported the promotion was due.
|
|
586
616
|
specifier: "@drzl/generator-mcp",
|
|
587
617
|
load: () => import("@drzl/generator-mcp"),
|
|
588
618
|
construct: (m, analysis) => new m.MCPGenerator(analysis),
|
|
@@ -591,7 +621,6 @@ var GENERATORS = [
|
|
|
591
621
|
},
|
|
592
622
|
{
|
|
593
623
|
kind: "next",
|
|
594
|
-
// Optional for the same reason as `mcp` above, and for the same one release only.
|
|
595
624
|
specifier: "@drzl/generator-next",
|
|
596
625
|
load: () => import("@drzl/generator-next"),
|
|
597
626
|
construct: (m, analysis) => new m.NextGenerator(analysis),
|
|
@@ -600,7 +629,6 @@ var GENERATORS = [
|
|
|
600
629
|
},
|
|
601
630
|
{
|
|
602
631
|
kind: "ai",
|
|
603
|
-
// Optional for the same reason as `mcp` and `next` above, and for the same one release only.
|
|
604
632
|
specifier: "@drzl/generator-ai",
|
|
605
633
|
load: () => import("@drzl/generator-ai"),
|
|
606
634
|
construct: (m, analysis) => new m.AIGenerator(analysis),
|
|
@@ -609,13 +637,20 @@ var GENERATORS = [
|
|
|
609
637
|
},
|
|
610
638
|
{
|
|
611
639
|
kind: "tanstack-start",
|
|
612
|
-
// Optional for the same reason as the three above, and for the same one release only.
|
|
613
640
|
specifier: "@drzl/generator-tanstack-start",
|
|
614
641
|
load: () => import("@drzl/generator-tanstack-start"),
|
|
615
642
|
construct: (m, analysis) => new m.TanStackStartGenerator(analysis),
|
|
616
643
|
outputDir: (g, cfg) => tanstackStartOutDir(g, cfg),
|
|
617
644
|
options: (g, cfg) => tanstackStartOptions(g, cfg)
|
|
618
645
|
},
|
|
646
|
+
{
|
|
647
|
+
kind: "h3",
|
|
648
|
+
specifier: "@drzl/generator-h3",
|
|
649
|
+
load: () => import("@drzl/generator-h3"),
|
|
650
|
+
construct: (m, analysis) => new m.H3Generator(analysis),
|
|
651
|
+
outputDir: (g, cfg) => h3OutDir(g, cfg),
|
|
652
|
+
options: (g, cfg) => h3Options(g, cfg)
|
|
653
|
+
},
|
|
619
654
|
{
|
|
620
655
|
kind: "service",
|
|
621
656
|
specifier: "@drzl/generator-service",
|
|
@@ -629,7 +664,7 @@ var GENERATORS = [
|
|
|
629
664
|
specifier: "@drzl/generator-zod",
|
|
630
665
|
load: () => import("@drzl/generator-zod"),
|
|
631
666
|
construct: (m, analysis) => new m.ZodGenerator(analysis),
|
|
632
|
-
outputDir: (g) => g.path ??
|
|
667
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.zod,
|
|
633
668
|
// `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
|
|
634
669
|
// four rather than being passed and ignored.
|
|
635
670
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
|
|
@@ -643,7 +678,7 @@ var GENERATORS = [
|
|
|
643
678
|
specifier: "@drzl/generator-valibot",
|
|
644
679
|
load: () => import("@drzl/generator-valibot"),
|
|
645
680
|
construct: (m, analysis) => new m.ValibotGenerator(analysis),
|
|
646
|
-
outputDir: (g) => g.path ??
|
|
681
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.valibot,
|
|
647
682
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
|
|
648
683
|
},
|
|
649
684
|
{
|
|
@@ -651,7 +686,7 @@ var GENERATORS = [
|
|
|
651
686
|
specifier: "@drzl/generator-arktype",
|
|
652
687
|
load: () => import("@drzl/generator-arktype"),
|
|
653
688
|
construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
|
|
654
|
-
outputDir: (g) => g.path ??
|
|
689
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.arktype,
|
|
655
690
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
|
|
656
691
|
},
|
|
657
692
|
{
|
|
@@ -659,7 +694,7 @@ var GENERATORS = [
|
|
|
659
694
|
specifier: "@drzl/generator-typebox",
|
|
660
695
|
load: () => import("@drzl/generator-typebox"),
|
|
661
696
|
construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
|
|
662
|
-
outputDir: (g) => g.path ??
|
|
697
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.typebox,
|
|
663
698
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
|
|
664
699
|
},
|
|
665
700
|
{
|
|
@@ -667,7 +702,7 @@ var GENERATORS = [
|
|
|
667
702
|
specifier: "@drzl/generator-effect",
|
|
668
703
|
load: () => import("@drzl/generator-effect"),
|
|
669
704
|
construct: (m, analysis) => new m.EffectGenerator(analysis),
|
|
670
|
-
outputDir: (g) => g.path ??
|
|
705
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.effect,
|
|
671
706
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
|
|
672
707
|
},
|
|
673
708
|
{
|
|
@@ -675,7 +710,7 @@ var GENERATORS = [
|
|
|
675
710
|
specifier: "@drzl/generator-json-schema",
|
|
676
711
|
load: () => import("@drzl/generator-json-schema"),
|
|
677
712
|
construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
|
|
678
|
-
outputDir: (g) => g.path ??
|
|
713
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4["json-schema"],
|
|
679
714
|
options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
|
|
680
715
|
}
|
|
681
716
|
];
|