@drzl/cli 4.27.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-O66F7W63.js → chunk-WZQV2WVN.js} +59 -2
- package/dist/chunk-WZQV2WVN.js.map +1 -0
- package/dist/cli.cjs +145 -19
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +92 -19
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +60 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +39 -3
- package/dist/config.d.ts +39 -3
- package/dist/config.js +5 -1
- package/dist/drzl.config.schema.json +9 -0
- package/package.json +11 -9
- package/dist/chunk-O66F7W63.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,
|
|
@@ -26,8 +27,9 @@ import {
|
|
|
26
27
|
nextOutDir,
|
|
27
28
|
tableAliases,
|
|
28
29
|
tableFilterWarnings,
|
|
30
|
+
tanstackStartOutDir,
|
|
29
31
|
trpcOutDir
|
|
30
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-WZQV2WVN.js";
|
|
31
33
|
|
|
32
34
|
// src/cli.ts
|
|
33
35
|
import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
|
|
@@ -351,6 +353,35 @@ function aiOptions(g, cfg) {
|
|
|
351
353
|
};
|
|
352
354
|
}
|
|
353
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
|
+
|
|
354
385
|
// src/mcp-options.ts
|
|
355
386
|
function mcpOptions(g, cfg) {
|
|
356
387
|
return {
|
|
@@ -368,18 +399,18 @@ function mcpOptions(g, cfg) {
|
|
|
368
399
|
}
|
|
369
400
|
|
|
370
401
|
// src/next-options.ts
|
|
371
|
-
var
|
|
402
|
+
var VALIDATOR_DEFAULT_DIRS2 = {
|
|
372
403
|
zod: "src/validators/zod",
|
|
373
404
|
valibot: "src/validators/valibot",
|
|
374
405
|
arktype: "src/validators/arktype"
|
|
375
406
|
};
|
|
376
|
-
function
|
|
407
|
+
function projectRelative2(p) {
|
|
377
408
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
378
409
|
}
|
|
379
410
|
function nextOptions(g, cfg) {
|
|
380
411
|
const library = g.validation?.library ?? "zod";
|
|
381
412
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
382
|
-
const derived = siblings.length === 1 ?
|
|
413
|
+
const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
|
|
383
414
|
return {
|
|
384
415
|
outputDir: nextOutDir(g, cfg),
|
|
385
416
|
naming: g.naming,
|
|
@@ -395,6 +426,34 @@ function nextOptions(g, cfg) {
|
|
|
395
426
|
};
|
|
396
427
|
}
|
|
397
428
|
|
|
429
|
+
// src/tanstack-start-options.ts
|
|
430
|
+
var VALIDATOR_DEFAULT_DIRS3 = {
|
|
431
|
+
zod: "src/validators/zod",
|
|
432
|
+
valibot: "src/validators/valibot",
|
|
433
|
+
arktype: "src/validators/arktype"
|
|
434
|
+
};
|
|
435
|
+
function projectRelative3(p) {
|
|
436
|
+
return p.startsWith("./") ? p.slice(2) : p;
|
|
437
|
+
}
|
|
438
|
+
function tanstackStartOptions(g, cfg) {
|
|
439
|
+
const library = g.validation?.library ?? "zod";
|
|
440
|
+
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
441
|
+
const derived = siblings.length === 1 ? projectRelative3(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS3[library]) : void 0;
|
|
442
|
+
return {
|
|
443
|
+
outputDir: tanstackStartOutDir(g, cfg),
|
|
444
|
+
naming: g.naming,
|
|
445
|
+
outputHeader: g.outputHeader,
|
|
446
|
+
format: g.format,
|
|
447
|
+
importExtension: g.importExtension,
|
|
448
|
+
validation: {
|
|
449
|
+
...g.validation,
|
|
450
|
+
library,
|
|
451
|
+
useShared: true,
|
|
452
|
+
importPath: g.validation?.importPath ?? derived
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
|
|
398
457
|
// src/nestjs-options.ts
|
|
399
458
|
function nestjsOptions(g, cfg) {
|
|
400
459
|
return {
|
|
@@ -463,7 +522,7 @@ function trpcOptions(g, cfg, servicesDir) {
|
|
|
463
522
|
}
|
|
464
523
|
|
|
465
524
|
// src/generator-registry.ts
|
|
466
|
-
var
|
|
525
|
+
var VALIDATOR_DEFAULT_DIRS4 = {
|
|
467
526
|
zod: "src/validators/zod",
|
|
468
527
|
valibot: "src/validators/valibot",
|
|
469
528
|
arktype: "src/validators/arktype",
|
|
@@ -548,12 +607,12 @@ var GENERATORS = [
|
|
|
548
607
|
},
|
|
549
608
|
{
|
|
550
609
|
kind: "mcp",
|
|
551
|
-
//
|
|
552
|
-
// has never existed cannot publish through npm's trusted-publisher OIDC flow
|
|
553
|
-
// a hard dependency in the release that introduces it breaks `npm i @drzl/cli`
|
|
554
|
-
// until the first publish lands.
|
|
555
|
-
//
|
|
556
|
-
//
|
|
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.
|
|
557
616
|
specifier: "@drzl/generator-mcp",
|
|
558
617
|
load: () => import("@drzl/generator-mcp"),
|
|
559
618
|
construct: (m, analysis) => new m.MCPGenerator(analysis),
|
|
@@ -562,7 +621,6 @@ var GENERATORS = [
|
|
|
562
621
|
},
|
|
563
622
|
{
|
|
564
623
|
kind: "next",
|
|
565
|
-
// Optional for the same reason as `mcp` above, and for the same one release only.
|
|
566
624
|
specifier: "@drzl/generator-next",
|
|
567
625
|
load: () => import("@drzl/generator-next"),
|
|
568
626
|
construct: (m, analysis) => new m.NextGenerator(analysis),
|
|
@@ -571,13 +629,28 @@ var GENERATORS = [
|
|
|
571
629
|
},
|
|
572
630
|
{
|
|
573
631
|
kind: "ai",
|
|
574
|
-
// Optional for the same reason as `mcp` and `next` above, and for the same one release only.
|
|
575
632
|
specifier: "@drzl/generator-ai",
|
|
576
633
|
load: () => import("@drzl/generator-ai"),
|
|
577
634
|
construct: (m, analysis) => new m.AIGenerator(analysis),
|
|
578
635
|
outputDir: (g, cfg) => aiOutDir(g, cfg),
|
|
579
636
|
options: (g, cfg) => aiOptions(g, cfg)
|
|
580
637
|
},
|
|
638
|
+
{
|
|
639
|
+
kind: "tanstack-start",
|
|
640
|
+
specifier: "@drzl/generator-tanstack-start",
|
|
641
|
+
load: () => import("@drzl/generator-tanstack-start"),
|
|
642
|
+
construct: (m, analysis) => new m.TanStackStartGenerator(analysis),
|
|
643
|
+
outputDir: (g, cfg) => tanstackStartOutDir(g, cfg),
|
|
644
|
+
options: (g, cfg) => tanstackStartOptions(g, cfg)
|
|
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
|
+
},
|
|
581
654
|
{
|
|
582
655
|
kind: "service",
|
|
583
656
|
specifier: "@drzl/generator-service",
|
|
@@ -591,7 +664,7 @@ var GENERATORS = [
|
|
|
591
664
|
specifier: "@drzl/generator-zod",
|
|
592
665
|
load: () => import("@drzl/generator-zod"),
|
|
593
666
|
construct: (m, analysis) => new m.ZodGenerator(analysis),
|
|
594
|
-
outputDir: (g) => g.path ??
|
|
667
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.zod,
|
|
595
668
|
// `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
|
|
596
669
|
// four rather than being passed and ignored.
|
|
597
670
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
|
|
@@ -605,7 +678,7 @@ var GENERATORS = [
|
|
|
605
678
|
specifier: "@drzl/generator-valibot",
|
|
606
679
|
load: () => import("@drzl/generator-valibot"),
|
|
607
680
|
construct: (m, analysis) => new m.ValibotGenerator(analysis),
|
|
608
|
-
outputDir: (g) => g.path ??
|
|
681
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.valibot,
|
|
609
682
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
|
|
610
683
|
},
|
|
611
684
|
{
|
|
@@ -613,7 +686,7 @@ var GENERATORS = [
|
|
|
613
686
|
specifier: "@drzl/generator-arktype",
|
|
614
687
|
load: () => import("@drzl/generator-arktype"),
|
|
615
688
|
construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
|
|
616
|
-
outputDir: (g) => g.path ??
|
|
689
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.arktype,
|
|
617
690
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
|
|
618
691
|
},
|
|
619
692
|
{
|
|
@@ -621,7 +694,7 @@ var GENERATORS = [
|
|
|
621
694
|
specifier: "@drzl/generator-typebox",
|
|
622
695
|
load: () => import("@drzl/generator-typebox"),
|
|
623
696
|
construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
|
|
624
|
-
outputDir: (g) => g.path ??
|
|
697
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.typebox,
|
|
625
698
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
|
|
626
699
|
},
|
|
627
700
|
{
|
|
@@ -629,7 +702,7 @@ var GENERATORS = [
|
|
|
629
702
|
specifier: "@drzl/generator-effect",
|
|
630
703
|
load: () => import("@drzl/generator-effect"),
|
|
631
704
|
construct: (m, analysis) => new m.EffectGenerator(analysis),
|
|
632
|
-
outputDir: (g) => g.path ??
|
|
705
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4.effect,
|
|
633
706
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
|
|
634
707
|
},
|
|
635
708
|
{
|
|
@@ -637,7 +710,7 @@ var GENERATORS = [
|
|
|
637
710
|
specifier: "@drzl/generator-json-schema",
|
|
638
711
|
load: () => import("@drzl/generator-json-schema"),
|
|
639
712
|
construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
|
|
640
|
-
outputDir: (g) => g.path ??
|
|
713
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS4["json-schema"],
|
|
641
714
|
options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
|
|
642
715
|
}
|
|
643
716
|
];
|