@drzl/cli 4.31.0 → 4.34.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-FURPHLQS.js → chunk-S5JWTWWU.js} +61 -3
- package/dist/chunk-S5JWTWWU.js.map +1 -0
- package/dist/cli.cjs +158 -21
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +105 -20
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +63 -2
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +52 -1
- package/dist/config.d.ts +52 -1
- package/dist/config.js +7 -1
- package/dist/drzl.config.schema.json +16 -1
- package/package.json +7 -4
- package/dist/chunk-FURPHLQS.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
configFromKinds,
|
|
12
12
|
displayTableName,
|
|
13
13
|
effectHttpOutDir,
|
|
14
|
+
elysiaOutDir,
|
|
14
15
|
expressOutDir,
|
|
16
|
+
fastCheckOutDir,
|
|
15
17
|
fastifyOutDir,
|
|
16
18
|
filterTables,
|
|
17
19
|
graphqlOutDir,
|
|
@@ -26,12 +28,13 @@ import {
|
|
|
26
28
|
nearestKey,
|
|
27
29
|
nestjsOutDir,
|
|
28
30
|
nextOutDir,
|
|
31
|
+
seedOutDir,
|
|
29
32
|
tableAliases,
|
|
30
33
|
tableFilterWarnings,
|
|
31
34
|
tanstackStartOutDir,
|
|
32
35
|
trpcOutDir,
|
|
33
36
|
tsRestOutDir
|
|
34
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-S5JWTWWU.js";
|
|
35
38
|
|
|
36
39
|
// src/cli.ts
|
|
37
40
|
import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
|
|
@@ -390,7 +393,8 @@ function projectRelative2(p) {
|
|
|
390
393
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
391
394
|
}
|
|
392
395
|
function tsRestOptions(g, cfg) {
|
|
393
|
-
const
|
|
396
|
+
const configured = g.validation?.library ?? "zod";
|
|
397
|
+
const library = configured === "typebox" ? "zod" : configured;
|
|
394
398
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
395
399
|
const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
|
|
396
400
|
return {
|
|
@@ -410,19 +414,74 @@ function tsRestOptions(g, cfg) {
|
|
|
410
414
|
};
|
|
411
415
|
}
|
|
412
416
|
|
|
413
|
-
// src/
|
|
417
|
+
// src/elysia-options.ts
|
|
414
418
|
var VALIDATOR_DEFAULT_DIRS3 = {
|
|
415
419
|
zod: "src/validators/zod",
|
|
416
420
|
valibot: "src/validators/valibot",
|
|
417
|
-
arktype: "src/validators/arktype"
|
|
421
|
+
arktype: "src/validators/arktype",
|
|
422
|
+
typebox: "src/validators/typebox"
|
|
418
423
|
};
|
|
419
424
|
function projectRelative3(p) {
|
|
420
425
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
421
426
|
}
|
|
422
|
-
function
|
|
427
|
+
function elysiaOptions(g, cfg) {
|
|
423
428
|
const library = g.validation?.library ?? "zod";
|
|
424
429
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
425
430
|
const derived = siblings.length === 1 ? projectRelative3(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS3[library]) : void 0;
|
|
431
|
+
return {
|
|
432
|
+
outputDir: elysiaOutDir(g, cfg),
|
|
433
|
+
appName: g.appName,
|
|
434
|
+
prefix: g.prefix,
|
|
435
|
+
naming: g.naming,
|
|
436
|
+
outputHeader: g.outputHeader,
|
|
437
|
+
format: g.format,
|
|
438
|
+
importExtension: g.importExtension,
|
|
439
|
+
validation: {
|
|
440
|
+
...g.validation,
|
|
441
|
+
library,
|
|
442
|
+
useShared: true,
|
|
443
|
+
importPath: g.validation?.importPath ?? derived
|
|
444
|
+
}
|
|
445
|
+
};
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// src/seed-options.ts
|
|
449
|
+
function seedOptions(g, cfg) {
|
|
450
|
+
return {
|
|
451
|
+
outputDir: seedOutDir(g, cfg),
|
|
452
|
+
defaultCount: g.count,
|
|
453
|
+
naming: g.naming,
|
|
454
|
+
outputHeader: g.outputHeader,
|
|
455
|
+
format: g.format,
|
|
456
|
+
importExtension: g.importExtension
|
|
457
|
+
};
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
// src/fast-check-options.ts
|
|
461
|
+
function fastCheckOptions(g, cfg) {
|
|
462
|
+
return {
|
|
463
|
+
outputDir: fastCheckOutDir(g, cfg),
|
|
464
|
+
naming: g.naming,
|
|
465
|
+
outputHeader: g.outputHeader,
|
|
466
|
+
format: g.format,
|
|
467
|
+
importExtension: g.importExtension
|
|
468
|
+
};
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
// src/h3-options.ts
|
|
472
|
+
var VALIDATOR_DEFAULT_DIRS4 = {
|
|
473
|
+
zod: "src/validators/zod",
|
|
474
|
+
valibot: "src/validators/valibot",
|
|
475
|
+
arktype: "src/validators/arktype"
|
|
476
|
+
};
|
|
477
|
+
function projectRelative4(p) {
|
|
478
|
+
return p.startsWith("./") ? p.slice(2) : p;
|
|
479
|
+
}
|
|
480
|
+
function h3Options(g, cfg) {
|
|
481
|
+
const configured = g.validation?.library ?? "zod";
|
|
482
|
+
const library = configured === "typebox" ? "zod" : configured;
|
|
483
|
+
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
484
|
+
const derived = siblings.length === 1 ? projectRelative4(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS4[library]) : void 0;
|
|
426
485
|
return {
|
|
427
486
|
outputDir: h3OutDir(g, cfg),
|
|
428
487
|
h3: g.h3,
|
|
@@ -456,18 +515,19 @@ function mcpOptions(g, cfg) {
|
|
|
456
515
|
}
|
|
457
516
|
|
|
458
517
|
// src/next-options.ts
|
|
459
|
-
var
|
|
518
|
+
var VALIDATOR_DEFAULT_DIRS5 = {
|
|
460
519
|
zod: "src/validators/zod",
|
|
461
520
|
valibot: "src/validators/valibot",
|
|
462
521
|
arktype: "src/validators/arktype"
|
|
463
522
|
};
|
|
464
|
-
function
|
|
523
|
+
function projectRelative5(p) {
|
|
465
524
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
466
525
|
}
|
|
467
526
|
function nextOptions(g, cfg) {
|
|
468
|
-
const
|
|
527
|
+
const configured = g.validation?.library ?? "zod";
|
|
528
|
+
const library = configured === "typebox" ? "zod" : configured;
|
|
469
529
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
470
|
-
const derived = siblings.length === 1 ?
|
|
530
|
+
const derived = siblings.length === 1 ? projectRelative5(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS5[library]) : void 0;
|
|
471
531
|
return {
|
|
472
532
|
outputDir: nextOutDir(g, cfg),
|
|
473
533
|
naming: g.naming,
|
|
@@ -484,18 +544,19 @@ function nextOptions(g, cfg) {
|
|
|
484
544
|
}
|
|
485
545
|
|
|
486
546
|
// src/tanstack-start-options.ts
|
|
487
|
-
var
|
|
547
|
+
var VALIDATOR_DEFAULT_DIRS6 = {
|
|
488
548
|
zod: "src/validators/zod",
|
|
489
549
|
valibot: "src/validators/valibot",
|
|
490
550
|
arktype: "src/validators/arktype"
|
|
491
551
|
};
|
|
492
|
-
function
|
|
552
|
+
function projectRelative6(p) {
|
|
493
553
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
494
554
|
}
|
|
495
555
|
function tanstackStartOptions(g, cfg) {
|
|
496
|
-
const
|
|
556
|
+
const configured = g.validation?.library ?? "zod";
|
|
557
|
+
const library = configured === "typebox" ? "zod" : configured;
|
|
497
558
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
498
|
-
const derived = siblings.length === 1 ?
|
|
559
|
+
const derived = siblings.length === 1 ? projectRelative6(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS6[library]) : void 0;
|
|
499
560
|
return {
|
|
500
561
|
outputDir: tanstackStartOutDir(g, cfg),
|
|
501
562
|
naming: g.naming,
|
|
@@ -579,7 +640,7 @@ function trpcOptions(g, cfg, servicesDir) {
|
|
|
579
640
|
}
|
|
580
641
|
|
|
581
642
|
// src/generator-registry.ts
|
|
582
|
-
var
|
|
643
|
+
var VALIDATOR_DEFAULT_DIRS7 = {
|
|
583
644
|
zod: "src/validators/zod",
|
|
584
645
|
valibot: "src/validators/valibot",
|
|
585
646
|
arktype: "src/validators/arktype",
|
|
@@ -724,6 +785,30 @@ var GENERATORS = [
|
|
|
724
785
|
outputDir: (g, cfg) => tsRestOutDir(g, cfg),
|
|
725
786
|
options: (g, cfg) => tsRestOptions(g, cfg)
|
|
726
787
|
},
|
|
788
|
+
{
|
|
789
|
+
kind: "elysia",
|
|
790
|
+
specifier: "@drzl/generator-elysia",
|
|
791
|
+
load: () => import("@drzl/generator-elysia"),
|
|
792
|
+
construct: (m, analysis) => new m.ElysiaGenerator(analysis),
|
|
793
|
+
outputDir: (g, cfg) => elysiaOutDir(g, cfg),
|
|
794
|
+
options: (g, cfg) => elysiaOptions(g, cfg)
|
|
795
|
+
},
|
|
796
|
+
{
|
|
797
|
+
kind: "seed",
|
|
798
|
+
specifier: "@drzl/generator-seed",
|
|
799
|
+
load: () => import("@drzl/generator-seed"),
|
|
800
|
+
construct: (m, analysis) => new m.SeedGenerator(analysis),
|
|
801
|
+
outputDir: (g, cfg) => seedOutDir(g, cfg),
|
|
802
|
+
options: (g, cfg) => seedOptions(g, cfg)
|
|
803
|
+
},
|
|
804
|
+
{
|
|
805
|
+
kind: "fast-check",
|
|
806
|
+
specifier: "@drzl/generator-fast-check",
|
|
807
|
+
load: () => import("@drzl/generator-fast-check"),
|
|
808
|
+
construct: (m, analysis) => new m.FastCheckGenerator(analysis),
|
|
809
|
+
outputDir: (g, cfg) => fastCheckOutDir(g, cfg),
|
|
810
|
+
options: (g, cfg) => fastCheckOptions(g, cfg)
|
|
811
|
+
},
|
|
727
812
|
{
|
|
728
813
|
kind: "service",
|
|
729
814
|
specifier: "@drzl/generator-service",
|
|
@@ -737,7 +822,7 @@ var GENERATORS = [
|
|
|
737
822
|
specifier: "@drzl/generator-zod",
|
|
738
823
|
load: () => import("@drzl/generator-zod"),
|
|
739
824
|
construct: (m, analysis) => new m.ZodGenerator(analysis),
|
|
740
|
-
outputDir: (g) => g.path ??
|
|
825
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.zod,
|
|
741
826
|
// `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
|
|
742
827
|
// four rather than being passed and ignored.
|
|
743
828
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
|
|
@@ -751,7 +836,7 @@ var GENERATORS = [
|
|
|
751
836
|
specifier: "@drzl/generator-valibot",
|
|
752
837
|
load: () => import("@drzl/generator-valibot"),
|
|
753
838
|
construct: (m, analysis) => new m.ValibotGenerator(analysis),
|
|
754
|
-
outputDir: (g) => g.path ??
|
|
839
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.valibot,
|
|
755
840
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
|
|
756
841
|
},
|
|
757
842
|
{
|
|
@@ -759,7 +844,7 @@ var GENERATORS = [
|
|
|
759
844
|
specifier: "@drzl/generator-arktype",
|
|
760
845
|
load: () => import("@drzl/generator-arktype"),
|
|
761
846
|
construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
|
|
762
|
-
outputDir: (g) => g.path ??
|
|
847
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.arktype,
|
|
763
848
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
|
|
764
849
|
},
|
|
765
850
|
{
|
|
@@ -767,7 +852,7 @@ var GENERATORS = [
|
|
|
767
852
|
specifier: "@drzl/generator-typebox",
|
|
768
853
|
load: () => import("@drzl/generator-typebox"),
|
|
769
854
|
construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
|
|
770
|
-
outputDir: (g) => g.path ??
|
|
855
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.typebox,
|
|
771
856
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
|
|
772
857
|
},
|
|
773
858
|
{
|
|
@@ -775,7 +860,7 @@ var GENERATORS = [
|
|
|
775
860
|
specifier: "@drzl/generator-effect",
|
|
776
861
|
load: () => import("@drzl/generator-effect"),
|
|
777
862
|
construct: (m, analysis) => new m.EffectGenerator(analysis),
|
|
778
|
-
outputDir: (g) => g.path ??
|
|
863
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.effect,
|
|
779
864
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
|
|
780
865
|
},
|
|
781
866
|
{
|
|
@@ -783,7 +868,7 @@ var GENERATORS = [
|
|
|
783
868
|
specifier: "@drzl/generator-json-schema",
|
|
784
869
|
load: () => import("@drzl/generator-json-schema"),
|
|
785
870
|
construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
|
|
786
|
-
outputDir: (g) => g.path ??
|
|
871
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7["json-schema"],
|
|
787
872
|
options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
|
|
788
873
|
}
|
|
789
874
|
];
|