@drzl/cli 4.31.0 → 4.32.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/cli.js CHANGED
@@ -11,6 +11,7 @@ import {
11
11
  configFromKinds,
12
12
  displayTableName,
13
13
  effectHttpOutDir,
14
+ elysiaOutDir,
14
15
  expressOutDir,
15
16
  fastifyOutDir,
16
17
  filterTables,
@@ -31,7 +32,7 @@ import {
31
32
  tanstackStartOutDir,
32
33
  trpcOutDir,
33
34
  tsRestOutDir
34
- } from "./chunk-FURPHLQS.js";
35
+ } from "./chunk-BDIJ6WMG.js";
35
36
 
36
37
  // src/cli.ts
37
38
  import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
@@ -390,7 +391,8 @@ function projectRelative2(p) {
390
391
  return p.startsWith("./") ? p.slice(2) : p;
391
392
  }
392
393
  function tsRestOptions(g, cfg) {
393
- const library = g.validation?.library ?? "zod";
394
+ const configured = g.validation?.library ?? "zod";
395
+ const library = configured === "typebox" ? "zod" : configured;
394
396
  const siblings = cfg.generators.filter((s) => s.kind === library);
395
397
  const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
396
398
  return {
@@ -410,19 +412,51 @@ function tsRestOptions(g, cfg) {
410
412
  };
411
413
  }
412
414
 
413
- // src/h3-options.ts
415
+ // src/elysia-options.ts
414
416
  var VALIDATOR_DEFAULT_DIRS3 = {
415
417
  zod: "src/validators/zod",
416
418
  valibot: "src/validators/valibot",
417
- arktype: "src/validators/arktype"
419
+ arktype: "src/validators/arktype",
420
+ typebox: "src/validators/typebox"
418
421
  };
419
422
  function projectRelative3(p) {
420
423
  return p.startsWith("./") ? p.slice(2) : p;
421
424
  }
422
- function h3Options(g, cfg) {
425
+ function elysiaOptions(g, cfg) {
423
426
  const library = g.validation?.library ?? "zod";
424
427
  const siblings = cfg.generators.filter((s) => s.kind === library);
425
428
  const derived = siblings.length === 1 ? projectRelative3(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS3[library]) : void 0;
429
+ return {
430
+ outputDir: elysiaOutDir(g, cfg),
431
+ appName: g.appName,
432
+ prefix: g.prefix,
433
+ naming: g.naming,
434
+ outputHeader: g.outputHeader,
435
+ format: g.format,
436
+ importExtension: g.importExtension,
437
+ validation: {
438
+ ...g.validation,
439
+ library,
440
+ useShared: true,
441
+ importPath: g.validation?.importPath ?? derived
442
+ }
443
+ };
444
+ }
445
+
446
+ // src/h3-options.ts
447
+ var VALIDATOR_DEFAULT_DIRS4 = {
448
+ zod: "src/validators/zod",
449
+ valibot: "src/validators/valibot",
450
+ arktype: "src/validators/arktype"
451
+ };
452
+ function projectRelative4(p) {
453
+ return p.startsWith("./") ? p.slice(2) : p;
454
+ }
455
+ function h3Options(g, cfg) {
456
+ const configured = g.validation?.library ?? "zod";
457
+ const library = configured === "typebox" ? "zod" : configured;
458
+ const siblings = cfg.generators.filter((s) => s.kind === library);
459
+ const derived = siblings.length === 1 ? projectRelative4(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS4[library]) : void 0;
426
460
  return {
427
461
  outputDir: h3OutDir(g, cfg),
428
462
  h3: g.h3,
@@ -456,18 +490,19 @@ function mcpOptions(g, cfg) {
456
490
  }
457
491
 
458
492
  // src/next-options.ts
459
- var VALIDATOR_DEFAULT_DIRS4 = {
493
+ var VALIDATOR_DEFAULT_DIRS5 = {
460
494
  zod: "src/validators/zod",
461
495
  valibot: "src/validators/valibot",
462
496
  arktype: "src/validators/arktype"
463
497
  };
464
- function projectRelative4(p) {
498
+ function projectRelative5(p) {
465
499
  return p.startsWith("./") ? p.slice(2) : p;
466
500
  }
467
501
  function nextOptions(g, cfg) {
468
- const library = g.validation?.library ?? "zod";
502
+ const configured = g.validation?.library ?? "zod";
503
+ const library = configured === "typebox" ? "zod" : configured;
469
504
  const siblings = cfg.generators.filter((s) => s.kind === library);
470
- const derived = siblings.length === 1 ? projectRelative4(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS4[library]) : void 0;
505
+ const derived = siblings.length === 1 ? projectRelative5(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS5[library]) : void 0;
471
506
  return {
472
507
  outputDir: nextOutDir(g, cfg),
473
508
  naming: g.naming,
@@ -484,18 +519,19 @@ function nextOptions(g, cfg) {
484
519
  }
485
520
 
486
521
  // src/tanstack-start-options.ts
487
- var VALIDATOR_DEFAULT_DIRS5 = {
522
+ var VALIDATOR_DEFAULT_DIRS6 = {
488
523
  zod: "src/validators/zod",
489
524
  valibot: "src/validators/valibot",
490
525
  arktype: "src/validators/arktype"
491
526
  };
492
- function projectRelative5(p) {
527
+ function projectRelative6(p) {
493
528
  return p.startsWith("./") ? p.slice(2) : p;
494
529
  }
495
530
  function tanstackStartOptions(g, cfg) {
496
- const library = g.validation?.library ?? "zod";
531
+ const configured = g.validation?.library ?? "zod";
532
+ const library = configured === "typebox" ? "zod" : configured;
497
533
  const siblings = cfg.generators.filter((s) => s.kind === library);
498
- const derived = siblings.length === 1 ? projectRelative5(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS5[library]) : void 0;
534
+ const derived = siblings.length === 1 ? projectRelative6(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS6[library]) : void 0;
499
535
  return {
500
536
  outputDir: tanstackStartOutDir(g, cfg),
501
537
  naming: g.naming,
@@ -579,7 +615,7 @@ function trpcOptions(g, cfg, servicesDir) {
579
615
  }
580
616
 
581
617
  // src/generator-registry.ts
582
- var VALIDATOR_DEFAULT_DIRS6 = {
618
+ var VALIDATOR_DEFAULT_DIRS7 = {
583
619
  zod: "src/validators/zod",
584
620
  valibot: "src/validators/valibot",
585
621
  arktype: "src/validators/arktype",
@@ -724,6 +760,14 @@ var GENERATORS = [
724
760
  outputDir: (g, cfg) => tsRestOutDir(g, cfg),
725
761
  options: (g, cfg) => tsRestOptions(g, cfg)
726
762
  },
763
+ {
764
+ kind: "elysia",
765
+ specifier: "@drzl/generator-elysia",
766
+ load: () => import("@drzl/generator-elysia"),
767
+ construct: (m, analysis) => new m.ElysiaGenerator(analysis),
768
+ outputDir: (g, cfg) => elysiaOutDir(g, cfg),
769
+ options: (g, cfg) => elysiaOptions(g, cfg)
770
+ },
727
771
  {
728
772
  kind: "service",
729
773
  specifier: "@drzl/generator-service",
@@ -737,7 +781,7 @@ var GENERATORS = [
737
781
  specifier: "@drzl/generator-zod",
738
782
  load: () => import("@drzl/generator-zod"),
739
783
  construct: (m, analysis) => new m.ZodGenerator(analysis),
740
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS6.zod,
784
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.zod,
741
785
  // `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
742
786
  // four rather than being passed and ignored.
743
787
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
@@ -751,7 +795,7 @@ var GENERATORS = [
751
795
  specifier: "@drzl/generator-valibot",
752
796
  load: () => import("@drzl/generator-valibot"),
753
797
  construct: (m, analysis) => new m.ValibotGenerator(analysis),
754
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS6.valibot,
798
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.valibot,
755
799
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
756
800
  },
757
801
  {
@@ -759,7 +803,7 @@ var GENERATORS = [
759
803
  specifier: "@drzl/generator-arktype",
760
804
  load: () => import("@drzl/generator-arktype"),
761
805
  construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
762
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS6.arktype,
806
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.arktype,
763
807
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
764
808
  },
765
809
  {
@@ -767,7 +811,7 @@ var GENERATORS = [
767
811
  specifier: "@drzl/generator-typebox",
768
812
  load: () => import("@drzl/generator-typebox"),
769
813
  construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
770
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS6.typebox,
814
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.typebox,
771
815
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
772
816
  },
773
817
  {
@@ -775,7 +819,7 @@ var GENERATORS = [
775
819
  specifier: "@drzl/generator-effect",
776
820
  load: () => import("@drzl/generator-effect"),
777
821
  construct: (m, analysis) => new m.EffectGenerator(analysis),
778
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS6.effect,
822
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7.effect,
779
823
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
780
824
  },
781
825
  {
@@ -783,7 +827,7 @@ var GENERATORS = [
783
827
  specifier: "@drzl/generator-json-schema",
784
828
  load: () => import("@drzl/generator-json-schema"),
785
829
  construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
786
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS6["json-schema"],
830
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS7["json-schema"],
787
831
  options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
788
832
  }
789
833
  ];