@drzl/cli 4.29.0 → 4.31.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/config.cjs CHANGED
@@ -48,6 +48,7 @@ __export(config_exports, {
48
48
  computeWatchTargets: () => computeWatchTargets,
49
49
  configFromKinds: () => configFromKinds,
50
50
  defineConfig: () => defineConfig,
51
+ effectHttpOutDir: () => effectHttpOutDir,
51
52
  expressOutDir: () => expressOutDir,
52
53
  fastifyOutDir: () => fastifyOutDir,
53
54
  filterTables: () => filterTables,
@@ -63,7 +64,8 @@ __export(config_exports, {
63
64
  resolveTemplateDirsSync: () => resolveTemplateDirsSync,
64
65
  tableFilterWarnings: () => tableFilterWarnings,
65
66
  tanstackStartOutDir: () => tanstackStartOutDir,
66
- trpcOutDir: () => trpcOutDir
67
+ trpcOutDir: () => trpcOutDir,
68
+ tsRestOutDir: () => tsRestOutDir
67
69
  });
68
70
  module.exports = __toCommonJS(config_exports);
69
71
  var import_validation_core = require("@drzl/validation-core");
@@ -357,10 +359,12 @@ var GeneratorKindSchema = import_zod.z.enum([
357
359
  "nestjs",
358
360
  "graphql",
359
361
  "ai",
362
+ "effect-http",
360
363
  "h3",
361
364
  "mcp",
362
365
  "next",
363
366
  "tanstack-start",
367
+ "ts-rest",
364
368
  "service",
365
369
  "zod",
366
370
  "valibot",
@@ -399,6 +403,19 @@ var GeneratorSchema = import_zod.z.object({
399
403
  * schema directly and carries none.
400
404
  */
401
405
  h3: import_zod.z.enum(["v1", "v2"]).optional(),
406
+ /** The identifier the assembled `HttpApi` carries. `effect-http` only, defaults to `'api'`. */
407
+ apiName: import_zod.z.string().optional(),
408
+ /** The identifier the assembled root contract carries. `ts-rest` only, defaults to `'contract'`. */
409
+ contractName: import_zod.z.string().optional(),
410
+ /**
411
+ * Prefixed to every path in the emitted contract. `ts-rest` only.
412
+ *
413
+ * Passed through to ts-rest's own `c.router(..., { pathPrefix })` rather than written into each
414
+ * path, because ts-rest lifts the prefix into the contract's type: a client derived from the
415
+ * result reports the full path. Writing it into the strings by hand would produce the same
416
+ * requests and a different type.
417
+ */
418
+ pathPrefix: import_zod.z.string().optional(),
402
419
  /** The name and version the emitted MCP server reports at initialize. `mcp` only. */
403
420
  serverName: import_zod.z.string().optional(),
404
421
  serverVersion: import_zod.z.string().optional(),
@@ -797,7 +814,9 @@ var ROUTER_KINDS = /* @__PURE__ */ new Set([
797
814
  "next",
798
815
  "ai",
799
816
  "tanstack-start",
800
- "h3"
817
+ "h3",
818
+ "effect-http",
819
+ "ts-rest"
801
820
  ]);
802
821
  var INJECTION_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc"]);
803
822
  function trpcOutDir(g, cfg) {
@@ -833,6 +852,12 @@ function tanstackStartOutDir(g, cfg) {
833
852
  function h3OutDir(g, cfg) {
834
853
  return g.path ?? cfg.outDir;
835
854
  }
855
+ function effectHttpOutDir(g, cfg) {
856
+ return g.path ?? cfg.outDir;
857
+ }
858
+ function tsRestOutDir(g, cfg) {
859
+ return g.path ?? cfg.outDir;
860
+ }
836
861
  function sharedSchemaNames(opts) {
837
862
  const resolved = (0, import_validation_core.resolveAffix)(opts);
838
863
  return import_validation_core.NAME_MODES.map((mode) => (0, import_validation_core.schemaName)(mode, import_validation_core.AFFIX_PROBE_TABLE, resolved));
@@ -898,6 +923,31 @@ function resolveConfig(cfg) {
898
923
  }
899
924
  continue;
900
925
  }
926
+ if (g.kind === "effect-http") {
927
+ if (g.validation?.library) {
928
+ warnings.push(
929
+ `drzl config: the "effect-http" generator sets validation.library, which it does not read. HttpApi declares its payloads as Effect Schema and takes nothing else, so there is no library to choose. Remove the key.`
930
+ );
931
+ }
932
+ if (!g.validation?.importPath && !generators.some((s) => s.kind === "effect")) {
933
+ warnings.push(
934
+ `drzl config: the "effect-http" generator declares the Effect Schema modules a validation generator writes, and this config has no "effect" generator for it to import from. Add { kind: "effect" }, or set validation.importPath to wherever those schemas live.`
935
+ );
936
+ }
937
+ }
938
+ if (g.kind === "ts-rest") {
939
+ if (g.includeRelations) {
940
+ warnings.push(
941
+ `drzl config: the "ts-rest" generator sets includeRelations, which it does not read. Relation lookups are a route this generator does not declare. Remove the flag.`
942
+ );
943
+ }
944
+ const library2 = g.validation?.library ?? "zod";
945
+ if (!g.validation?.importPath && !generators.some((s) => s.kind === library2)) {
946
+ warnings.push(
947
+ `drzl config: the "ts-rest" generator declares its contract with the schemas a validation generator writes, and this config has no "${library2}" generator for it to import from. Add { kind: "${library2}" }, or set validation.importPath to wherever those schemas live.`
948
+ );
949
+ }
950
+ }
901
951
  if (g.kind === "h3") {
902
952
  if (g.includeRelations) {
903
953
  warnings.push(
@@ -1103,6 +1153,8 @@ function computeGeneratorOutputDirs(cfg, cwd = process.cwd()) {
1103
1153
  if (g.kind === "ai") dirs.add(abs(aiOutDir(g, cfg)));
1104
1154
  if (g.kind === "tanstack-start") dirs.add(abs(tanstackStartOutDir(g, cfg)));
1105
1155
  if (g.kind === "h3") dirs.add(abs(h3OutDir(g, cfg)));
1156
+ if (g.kind === "effect-http") dirs.add(abs(effectHttpOutDir(g, cfg)));
1157
+ if (g.kind === "ts-rest") dirs.add(abs(tsRestOutDir(g, cfg)));
1106
1158
  if (g.kind === "service") dirs.add(abs(g.path ?? "src/services"));
1107
1159
  if (g.kind === "zod") dirs.add(abs(g.path ?? "src/validators/zod"));
1108
1160
  if (g.kind === "valibot") dirs.add(abs(g.path ?? "src/validators/valibot"));
@@ -1181,6 +1233,7 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
1181
1233
  computeWatchTargets,
1182
1234
  configFromKinds,
1183
1235
  defineConfig,
1236
+ effectHttpOutDir,
1184
1237
  expressOutDir,
1185
1238
  fastifyOutDir,
1186
1239
  filterTables,
@@ -1196,6 +1249,7 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
1196
1249
  resolveTemplateDirsSync,
1197
1250
  tableFilterWarnings,
1198
1251
  tanstackStartOutDir,
1199
- trpcOutDir
1252
+ trpcOutDir,
1253
+ tsRestOutDir
1200
1254
  });
1201
1255
  //# sourceMappingURL=config.cjs.map