@drzl/cli 4.28.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/cli.js CHANGED
@@ -10,10 +10,12 @@ import {
10
10
  computeWatchTargets,
11
11
  configFromKinds,
12
12
  displayTableName,
13
+ effectHttpOutDir,
13
14
  expressOutDir,
14
15
  fastifyOutDir,
15
16
  filterTables,
16
17
  graphqlOutDir,
18
+ h3OutDir,
17
19
  hasNamedSchemas,
18
20
  honoOutDir,
19
21
  importFreshConfigModule,
@@ -28,7 +30,7 @@ import {
28
30
  tableFilterWarnings,
29
31
  tanstackStartOutDir,
30
32
  trpcOutDir
31
- } from "./chunk-WS3MT5CH.js";
33
+ } from "./chunk-3REB46XD.js";
32
34
 
33
35
  // src/cli.ts
34
36
  import { qualifiedTableName as qualifiedTableName2, SchemaAnalyzer as SchemaAnalyzer2 } from "@drzl/analyzer";
@@ -352,6 +354,60 @@ function aiOptions(g, cfg) {
352
354
  };
353
355
  }
354
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
+
382
+ // src/h3-options.ts
383
+ var VALIDATOR_DEFAULT_DIRS2 = {
384
+ zod: "src/validators/zod",
385
+ valibot: "src/validators/valibot",
386
+ arktype: "src/validators/arktype"
387
+ };
388
+ function projectRelative2(p) {
389
+ return p.startsWith("./") ? p.slice(2) : p;
390
+ }
391
+ function h3Options(g, cfg) {
392
+ const library = g.validation?.library ?? "zod";
393
+ const siblings = cfg.generators.filter((s) => s.kind === library);
394
+ const derived = siblings.length === 1 ? projectRelative2(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS2[library]) : void 0;
395
+ return {
396
+ outputDir: h3OutDir(g, cfg),
397
+ h3: g.h3,
398
+ naming: g.naming,
399
+ outputHeader: g.outputHeader,
400
+ format: g.format,
401
+ importExtension: g.importExtension,
402
+ validation: {
403
+ ...g.validation,
404
+ library,
405
+ useShared: true,
406
+ importPath: g.validation?.importPath ?? derived
407
+ }
408
+ };
409
+ }
410
+
355
411
  // src/mcp-options.ts
356
412
  function mcpOptions(g, cfg) {
357
413
  return {
@@ -369,18 +425,18 @@ function mcpOptions(g, cfg) {
369
425
  }
370
426
 
371
427
  // src/next-options.ts
372
- var VALIDATOR_DEFAULT_DIRS = {
428
+ var VALIDATOR_DEFAULT_DIRS3 = {
373
429
  zod: "src/validators/zod",
374
430
  valibot: "src/validators/valibot",
375
431
  arktype: "src/validators/arktype"
376
432
  };
377
- function projectRelative(p) {
433
+ function projectRelative3(p) {
378
434
  return p.startsWith("./") ? p.slice(2) : p;
379
435
  }
380
436
  function nextOptions(g, cfg) {
381
437
  const library = g.validation?.library ?? "zod";
382
438
  const siblings = cfg.generators.filter((s) => s.kind === library);
383
- const derived = siblings.length === 1 ? projectRelative(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS[library]) : void 0;
439
+ const derived = siblings.length === 1 ? projectRelative3(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS3[library]) : void 0;
384
440
  return {
385
441
  outputDir: nextOutDir(g, cfg),
386
442
  naming: g.naming,
@@ -397,18 +453,18 @@ function nextOptions(g, cfg) {
397
453
  }
398
454
 
399
455
  // src/tanstack-start-options.ts
400
- var VALIDATOR_DEFAULT_DIRS2 = {
456
+ var VALIDATOR_DEFAULT_DIRS4 = {
401
457
  zod: "src/validators/zod",
402
458
  valibot: "src/validators/valibot",
403
459
  arktype: "src/validators/arktype"
404
460
  };
405
- function projectRelative2(p) {
461
+ function projectRelative4(p) {
406
462
  return p.startsWith("./") ? p.slice(2) : p;
407
463
  }
408
464
  function tanstackStartOptions(g, cfg) {
409
465
  const library = g.validation?.library ?? "zod";
410
466
  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;
467
+ const derived = siblings.length === 1 ? projectRelative4(siblings[0].path ?? VALIDATOR_DEFAULT_DIRS4[library]) : void 0;
412
468
  return {
413
469
  outputDir: tanstackStartOutDir(g, cfg),
414
470
  naming: g.naming,
@@ -492,7 +548,7 @@ function trpcOptions(g, cfg, servicesDir) {
492
548
  }
493
549
 
494
550
  // src/generator-registry.ts
495
- var VALIDATOR_DEFAULT_DIRS3 = {
551
+ var VALIDATOR_DEFAULT_DIRS5 = {
496
552
  zod: "src/validators/zod",
497
553
  valibot: "src/validators/valibot",
498
554
  arktype: "src/validators/arktype",
@@ -577,12 +633,12 @@ var GENERATORS = [
577
633
  },
578
634
  {
579
635
  kind: "mcp",
580
- // The one `optionalDependency` in this package's manifest, and temporarily so. A package that
581
- // has never existed cannot publish through npm's trusted-publisher OIDC flow, so naming it as
582
- // a hard dependency in the release that introduces it breaks `npm i @drzl/cli` for everyone
583
- // until the first publish lands. `scripts/verify/stages/33-registry-deps.sh` gates that rule.
584
- // It moves into `dependencies` beside the other fourteen once it is on the registry; tsup
585
- // externalises all three dependency fields, so nothing about what runs changes when it does.
636
+ // This one and the three below spent one release each in `optionalDependencies`, because a
637
+ // package that has never existed cannot publish through npm's trusted-publisher OIDC flow and
638
+ // naming it as a hard dependency in the release that introduces it breaks `npm i @drzl/cli`
639
+ // for everyone until the first publish lands. All four are on the registry now, so all four
640
+ // are ordinary dependencies. `scripts/verify/stages/33-registry-deps.sh` gates both halves of
641
+ // that rule and is what reported the promotion was due.
586
642
  specifier: "@drzl/generator-mcp",
587
643
  load: () => import("@drzl/generator-mcp"),
588
644
  construct: (m, analysis) => new m.MCPGenerator(analysis),
@@ -591,7 +647,6 @@ var GENERATORS = [
591
647
  },
592
648
  {
593
649
  kind: "next",
594
- // Optional for the same reason as `mcp` above, and for the same one release only.
595
650
  specifier: "@drzl/generator-next",
596
651
  load: () => import("@drzl/generator-next"),
597
652
  construct: (m, analysis) => new m.NextGenerator(analysis),
@@ -600,7 +655,6 @@ var GENERATORS = [
600
655
  },
601
656
  {
602
657
  kind: "ai",
603
- // Optional for the same reason as `mcp` and `next` above, and for the same one release only.
604
658
  specifier: "@drzl/generator-ai",
605
659
  load: () => import("@drzl/generator-ai"),
606
660
  construct: (m, analysis) => new m.AIGenerator(analysis),
@@ -609,13 +663,28 @@ var GENERATORS = [
609
663
  },
610
664
  {
611
665
  kind: "tanstack-start",
612
- // Optional for the same reason as the three above, and for the same one release only.
613
666
  specifier: "@drzl/generator-tanstack-start",
614
667
  load: () => import("@drzl/generator-tanstack-start"),
615
668
  construct: (m, analysis) => new m.TanStackStartGenerator(analysis),
616
669
  outputDir: (g, cfg) => tanstackStartOutDir(g, cfg),
617
670
  options: (g, cfg) => tanstackStartOptions(g, cfg)
618
671
  },
672
+ {
673
+ kind: "h3",
674
+ specifier: "@drzl/generator-h3",
675
+ load: () => import("@drzl/generator-h3"),
676
+ construct: (m, analysis) => new m.H3Generator(analysis),
677
+ outputDir: (g, cfg) => h3OutDir(g, cfg),
678
+ options: (g, cfg) => h3Options(g, cfg)
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
+ },
619
688
  {
620
689
  kind: "service",
621
690
  specifier: "@drzl/generator-service",
@@ -629,7 +698,7 @@ var GENERATORS = [
629
698
  specifier: "@drzl/generator-zod",
630
699
  load: () => import("@drzl/generator-zod"),
631
700
  construct: (m, analysis) => new m.ZodGenerator(analysis),
632
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.zod,
701
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.zod,
633
702
  // `meta` is zod-only; see `GeneratorCapabilities.meta` for why it is not passed to the other
634
703
  // four rather than being passed and ignored.
635
704
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, {
@@ -643,7 +712,7 @@ var GENERATORS = [
643
712
  specifier: "@drzl/generator-valibot",
644
713
  load: () => import("@drzl/generator-valibot"),
645
714
  construct: (m, analysis) => new m.ValibotGenerator(analysis),
646
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.valibot,
715
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.valibot,
647
716
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, constraints: true })
648
717
  },
649
718
  {
@@ -651,7 +720,7 @@ var GENERATORS = [
651
720
  specifier: "@drzl/generator-arktype",
652
721
  load: () => import("@drzl/generator-arktype"),
653
722
  construct: (m, analysis) => new m.ArkTypeGenerator(analysis),
654
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.arktype,
723
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.arktype,
655
724
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: false })
656
725
  },
657
726
  {
@@ -659,7 +728,7 @@ var GENERATORS = [
659
728
  specifier: "@drzl/generator-typebox",
660
729
  load: () => import("@drzl/generator-typebox"),
661
730
  construct: (m, analysis) => new m.TypeBoxGenerator(analysis),
662
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.typebox,
731
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.typebox,
663
732
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true, standardSchema: true })
664
733
  },
665
734
  {
@@ -667,7 +736,7 @@ var GENERATORS = [
667
736
  specifier: "@drzl/generator-effect",
668
737
  load: () => import("@drzl/generator-effect"),
669
738
  construct: (m, analysis) => new m.EffectGenerator(analysis),
670
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3.effect,
739
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5.effect,
671
740
  options: (g, cfg, ctx) => validationOptions(g, cfg, ctx.outDir, { schemaTypes: true })
672
741
  },
673
742
  {
@@ -675,7 +744,7 @@ var GENERATORS = [
675
744
  specifier: "@drzl/generator-json-schema",
676
745
  load: () => import("@drzl/generator-json-schema"),
677
746
  construct: (m, analysis) => new m.JsonSchemaGenerator(analysis),
678
- outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS3["json-schema"],
747
+ outputDir: (g) => g.path ?? VALIDATOR_DEFAULT_DIRS5["json-schema"],
679
748
  options: (g, cfg, ctx) => jsonSchemaOptions(g, cfg, ctx.outDir)
680
749
  }
681
750
  ];