@drzl/cli 4.29.0 → 4.30.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-WZQV2WVN.js → chunk-3REB46XD.js} +23 -2
- package/dist/chunk-3REB46XD.js.map +1 -0
- package/dist/cli.cjs +70 -17
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +51 -17
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +23 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +17 -1
- package/dist/config.d.ts +17 -1
- package/dist/config.js +3 -1
- package/dist/drzl.config.schema.json +4 -0
- package/package.json +10 -9
- package/dist/chunk-WZQV2WVN.js.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
computeWatchTargets,
|
|
11
11
|
configFromKinds,
|
|
12
12
|
displayTableName,
|
|
13
|
+
effectHttpOutDir,
|
|
13
14
|
expressOutDir,
|
|
14
15
|
fastifyOutDir,
|
|
15
16
|
filterTables,
|
|
@@ -29,7 +30,7 @@ import {
|
|
|
29
30
|
tableFilterWarnings,
|
|
30
31
|
tanstackStartOutDir,
|
|
31
32
|
trpcOutDir
|
|
32
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-3REB46XD.js";
|
|
33
34
|
|
|
34
35
|
// src/cli.ts
|
|
35
36
|
import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
|
|
@@ -353,19 +354,44 @@ function aiOptions(g, cfg) {
|
|
|
353
354
|
};
|
|
354
355
|
}
|
|
355
356
|
|
|
357
|
+
// src/effect-http-options.ts
|
|
358
|
+
var VALIDATOR_DEFAULT_DIRS = { effect: "src/validators/effect" };
|
|
359
|
+
function projectRelative(p) {
|
|
360
|
+
return p.startsWith("./") ? p.slice(2) : p;
|
|
361
|
+
}
|
|
362
|
+
function effectHttpOptions(g, cfg) {
|
|
363
|
+
const library = "effect";
|
|
364
|
+
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
365
|
+
const derived = siblings.length === 1 ? projectRelative(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS[library]) : void 0;
|
|
366
|
+
return {
|
|
367
|
+
outputDir: effectHttpOutDir(g, cfg),
|
|
368
|
+
apiName: g.apiName,
|
|
369
|
+
naming: g.naming,
|
|
370
|
+
outputHeader: g.outputHeader,
|
|
371
|
+
format: g.format,
|
|
372
|
+
importExtension: g.importExtension,
|
|
373
|
+
validation: {
|
|
374
|
+
...g.validation,
|
|
375
|
+
library,
|
|
376
|
+
useShared: true,
|
|
377
|
+
importPath: g.validation?.importPath ?? derived
|
|
378
|
+
}
|
|
379
|
+
};
|
|
380
|
+
}
|
|
381
|
+
|
|
356
382
|
// src/h3-options.ts
|
|
357
|
-
var
|
|
383
|
+
var VALIDATOR_DEFAULT_DIRS2 = {
|
|
358
384
|
zod: "src/validators/zod",
|
|
359
385
|
valibot: "src/validators/valibot",
|
|
360
386
|
arktype: "src/validators/arktype"
|
|
361
387
|
};
|
|
362
|
-
function
|
|
388
|
+
function projectRelative2(p) {
|
|
363
389
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
364
390
|
}
|
|
365
391
|
function h3Options(g, cfg) {
|
|
366
392
|
const library = g.validation?.library ?? "zod";
|
|
367
393
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
368
|
-
const derived = siblings.length === 1 ?
|
|
394
|
+
const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
|
|
369
395
|
return {
|
|
370
396
|
outputDir: h3OutDir(g, cfg),
|
|
371
397
|
h3: g.h3,
|
|
@@ -399,18 +425,18 @@ function mcpOptions(g, cfg) {
|
|
|
399
425
|
}
|
|
400
426
|
|
|
401
427
|
// src/next-options.ts
|
|
402
|
-
var
|
|
428
|
+
var VALIDATOR_DEFAULT_DIRS3 = {
|
|
403
429
|
zod: "src/validators/zod",
|
|
404
430
|
valibot: "src/validators/valibot",
|
|
405
431
|
arktype: "src/validators/arktype"
|
|
406
432
|
};
|
|
407
|
-
function
|
|
433
|
+
function projectRelative3(p) {
|
|
408
434
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
409
435
|
}
|
|
410
436
|
function nextOptions(g, cfg) {
|
|
411
437
|
const library = g.validation?.library ?? "zod";
|
|
412
438
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
413
|
-
const derived = siblings.length === 1 ?
|
|
439
|
+
const derived = siblings.length === 1 ? projectRelative3(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS3[library]) : void 0;
|
|
414
440
|
return {
|
|
415
441
|
outputDir: nextOutDir(g, cfg),
|
|
416
442
|
naming: g.naming,
|
|
@@ -427,18 +453,18 @@ function nextOptions(g, cfg) {
|
|
|
427
453
|
}
|
|
428
454
|
|
|
429
455
|
// src/tanstack-start-options.ts
|
|
430
|
-
var
|
|
456
|
+
var VALIDATOR_DEFAULT_DIRS4 = {
|
|
431
457
|
zod: "src/validators/zod",
|
|
432
458
|
valibot: "src/validators/valibot",
|
|
433
459
|
arktype: "src/validators/arktype"
|
|
434
460
|
};
|
|
435
|
-
function
|
|
461
|
+
function projectRelative4(p) {
|
|
436
462
|
return p.startsWith("./") ? p.slice(2) : p;
|
|
437
463
|
}
|
|
438
464
|
function tanstackStartOptions(g, cfg) {
|
|
439
465
|
const library = g.validation?.library ?? "zod";
|
|
440
466
|
const siblings = cfg.generators.filter((s) => s.kind === library);
|
|
441
|
-
const derived = siblings.length === 1 ?
|
|
467
|
+
const derived = siblings.length === 1 ? projectRelative4(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS4[library]) : void 0;
|
|
442
468
|
return {
|
|
443
469
|
outputDir: tanstackStartOutDir(g, cfg),
|
|
444
470
|
naming: g.naming,
|
|
@@ -522,7 +548,7 @@ function trpcOptions(g, cfg, servicesDir) {
|
|
|
522
548
|
}
|
|
523
549
|
|
|
524
550
|
// src/generator-registry.ts
|
|
525
|
-
var
|
|
551
|
+
var VALIDATOR_DEFAULT_DIRS5 = {
|
|
526
552
|
zod: "src/validators/zod",
|
|
527
553
|
valibot: "src/validators/valibot",
|
|
528
554
|
arktype: "src/validators/arktype",
|
|
@@ -651,6 +677,14 @@ var GENERATORS = [
|
|
|
651
677
|
outputDir: (g, cfg) => h3OutDir(g, cfg),
|
|
652
678
|
options: (g, cfg) => h3Options(g, cfg)
|
|
653
679
|
},
|
|
680
|
+
{
|
|
681
|
+
kind: "effect-http",
|
|
682
|
+
specifier: "@drzl/generator-effect-http",
|
|
683
|
+
load: () => import("@drzl/generator-effect-http"),
|
|
684
|
+
construct: (m, analysis) => new m.EffectHttpGenerator(analysis),
|
|
685
|
+
outputDir: (g, cfg) => effectHttpOutDir(g, cfg),
|
|
686
|
+
options: (g, cfg) => effectHttpOptions(g, cfg)
|
|
687
|
+
},
|
|
654
688
|
{
|
|
655
689
|
kind: "service",
|
|
656
690
|
specifier: "@drzl/generator-service",
|
|
@@ -664,7 +698,7 @@ var GENERATORS = [
|
|
|
664
698
|
specifier: "@drzl/generator-zod",
|
|
665
699
|
load: () => import("@drzl/generator-zod"),
|
|
666
700
|
construct: (m, analysis) => new m.ZodGenerator(analysis),
|
|
667
|
-
outputDir: (g) => g.path ??
|
|
701
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.zod,
|
|
668
702
|
// `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
|
|
669
703
|
// four rather than being passed and ignored.
|
|
670
704
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
|
|
@@ -678,7 +712,7 @@ var GENERATORS = [
|
|
|
678
712
|
specifier: "@drzl/generator-valibot",
|
|
679
713
|
load: () => import("@drzl/generator-valibot"),
|
|
680
714
|
construct: (m, analysis) => new m.ValibotGenerator(analysis),
|
|
681
|
-
outputDir: (g) => g.path ??
|
|
715
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.valibot,
|
|
682
716
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
|
|
683
717
|
},
|
|
684
718
|
{
|
|
@@ -686,7 +720,7 @@ var GENERATORS = [
|
|
|
686
720
|
specifier: "@drzl/generator-arktype",
|
|
687
721
|
load: () => import("@drzl/generator-arktype"),
|
|
688
722
|
construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
|
|
689
|
-
outputDir: (g) => g.path ??
|
|
723
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.arktype,
|
|
690
724
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
|
|
691
725
|
},
|
|
692
726
|
{
|
|
@@ -694,7 +728,7 @@ var GENERATORS = [
|
|
|
694
728
|
specifier: "@drzl/generator-typebox",
|
|
695
729
|
load: () => import("@drzl/generator-typebox"),
|
|
696
730
|
construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
|
|
697
|
-
outputDir: (g) => g.path ??
|
|
731
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.typebox,
|
|
698
732
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
|
|
699
733
|
},
|
|
700
734
|
{
|
|
@@ -702,7 +736,7 @@ var GENERATORS = [
|
|
|
702
736
|
specifier: "@drzl/generator-effect",
|
|
703
737
|
load: () => import("@drzl/generator-effect"),
|
|
704
738
|
construct: (m, analysis) => new m.EffectGenerator(analysis),
|
|
705
|
-
outputDir: (g) => g.path ??
|
|
739
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.effect,
|
|
706
740
|
options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
|
|
707
741
|
},
|
|
708
742
|
{
|
|
@@ -710,7 +744,7 @@ var GENERATORS = [
|
|
|
710
744
|
specifier: "@drzl/generator-json-schema",
|
|
711
745
|
load: () => import("@drzl/generator-json-schema"),
|
|
712
746
|
construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
|
|
713
|
-
outputDir: (g) => g.path ??
|
|
747
|
+
outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5["json-schema"],
|
|
714
748
|
options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
|
|
715
749
|
}
|
|
716
750
|
];
|