@drzl/cli 4.27.0 → 4.28.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
@@ -26,8 +26,9 @@ import {
26
26
  nextOutDir,
27
27
  tableAliases,
28
28
  tableFilterWarnings,
29
+ tanstackStartOutDir,
29
30
  trpcOutDir
30
- } from "./chunk-O66F7W63.js";
31
+ } from "./chunk-WS3MT5CH.js";
31
32
 
32
33
  // src/cli.ts
33
34
  import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
@@ -395,6 +396,34 @@ function nextOptions(g, cfg) {
395
396
  };
396
397
  }
397
398
 
399
+ // src/tanstack-start-options.ts
400
+ var VALIDATOR_DEFAULT_DIRS2 = {
401
+ zod: "src/validators/zod",
402
+ valibot: "src/validators/valibot",
403
+ arktype: "src/validators/arktype"
404
+ };
405
+ function projectRelative2(p) {
406
+ return p.startsWith("./") ? p.slice(2) : p;
407
+ }
408
+ function tanstackStartOptions(g, cfg) {
409
+ const library = g.validation?.library ?? "zod";
410
+ const siblings = cfg.generators.filter((s) => s.kind === library);
411
+ const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
412
+ return {
413
+ outputDir: tanstackStartOutDir(g, cfg),
414
+ naming: g.naming,
415
+ outputHeader: g.outputHeader,
416
+ format: g.format,
417
+ importExtension: g.importExtension,
418
+ validation: {
419
+ ...g.validation,
420
+ library,
421
+ useShared: true,
422
+ importPath: g.validation?.importPath ?? derived
423
+ }
424
+ };
425
+ }
426
+
398
427
  // src/nestjs-options.ts
399
428
  function nestjsOptions(g, cfg) {
400
429
  return {
@@ -463,7 +492,7 @@ function trpcOptions(g, cfg, servicesDir) {
463
492
  }
464
493
 
465
494
  // src/generator-registry.ts
466
- var VALIDATOR_DEFAULT_DIRS2 = {
495
+ var VALIDATOR_DEFAULT_DIRS3 = {
467
496
  zod: "src/validators/zod",
468
497
  valibot: "src/validators/valibot",
469
498
  arktype: "src/validators/arktype",
@@ -578,6 +607,15 @@ var GENERATORS = [
578
607
  outputDir: (g, cfg) => aiOutDir(g, cfg),
579
608
  options: (g, cfg) => aiOptions(g, cfg)
580
609
  },
610
+ {
611
+ kind: "tanstack-start",
612
+ // Optional for the same reason as the three above, and for the same one release only.
613
+ specifier: "@drzl/generator-tanstack-start",
614
+ load: () => import("@drzl/generator-tanstack-start"),
615
+ construct: (m, analysis) => new m.TanStackStartGenerator(analysis),
616
+ outputDir: (g, cfg) => tanstackStartOutDir(g, cfg),
617
+ options: (g, cfg) => tanstackStartOptions(g, cfg)
618
+ },
581
619
  {
582
620
  kind: "service",
583
621
  specifier: "@drzl/generator-service",
@@ -591,7 +629,7 @@ var GENERATORS = [
591
629
  specifier: "@drzl/generator-zod",
592
630
  load: () => import("@drzl/generator-zod"),
593
631
  construct: (m, analysis) => new m.ZodGenerator(analysis),
594
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS2.zod,
632
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.zod,
595
633
  // `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
596
634
  // four rather than being passed and ignored.
597
635
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
@@ -605,7 +643,7 @@ var GENERATORS = [
605
643
  specifier: "@drzl/generator-valibot",
606
644
  load: () => import("@drzl/generator-valibot"),
607
645
  construct: (m, analysis) => new m.ValibotGenerator(analysis),
608
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS2.valibot,
646
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.valibot,
609
647
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
610
648
  },
611
649
  {
@@ -613,7 +651,7 @@ var GENERATORS = [
613
651
  specifier: "@drzl/generator-arktype",
614
652
  load: () => import("@drzl/generator-arktype"),
615
653
  construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
616
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS2.arktype,
654
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.arktype,
617
655
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
618
656
  },
619
657
  {
@@ -621,7 +659,7 @@ var GENERATORS = [
621
659
  specifier: "@drzl/generator-typebox",
622
660
  load: () => import("@drzl/generator-typebox"),
623
661
  construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
624
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS2.typebox,
662
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.typebox,
625
663
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
626
664
  },
627
665
  {
@@ -629,7 +667,7 @@ var GENERATORS = [
629
667
  specifier: "@drzl/generator-effect",
630
668
  load: () => import("@drzl/generator-effect"),
631
669
  construct: (m, analysis) => new m.EffectGenerator(analysis),
632
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS2.effect,
670
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.effect,
633
671
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
634
672
  },
635
673
  {
@@ -637,7 +675,7 @@ var GENERATORS = [
637
675
  specifier: "@drzl/generator-json-schema",
638
676
  load: () => import("@drzl/generator-json-schema"),
639
677
  construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
640
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS2["json-schema"],
678
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3["json-schema"],
641
679
  options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
642
680
  }
643
681
  ];