@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/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,
|
|
@@ -357,6 +358,7 @@ var GeneratorKindSchema = import_zod.z.enum([
|
|
|
357
358
|
"nestjs",
|
|
358
359
|
"graphql",
|
|
359
360
|
"ai",
|
|
361
|
+
"effect-http",
|
|
360
362
|
"h3",
|
|
361
363
|
"mcp",
|
|
362
364
|
"next",
|
|
@@ -399,6 +401,8 @@ var GeneratorSchema = import_zod.z.object({
|
|
|
399
401
|
* schema directly and carries none.
|
|
400
402
|
*/
|
|
401
403
|
h3: import_zod.z.enum(["v1", "v2"]).optional(),
|
|
404
|
+
/** The identifier the assembled `HttpApi` carries. `effect-http` only, defaults to `'api'`. */
|
|
405
|
+
apiName: import_zod.z.string().optional(),
|
|
402
406
|
/** The name and version the emitted MCP server reports at initialize. `mcp` only. */
|
|
403
407
|
serverName: import_zod.z.string().optional(),
|
|
404
408
|
serverVersion: import_zod.z.string().optional(),
|
|
@@ -797,7 +801,8 @@ var ROUTER_KINDS = /* @__PURE__ */ new Set([
|
|
|
797
801
|
"next",
|
|
798
802
|
"ai",
|
|
799
803
|
"tanstack-start",
|
|
800
|
-
"h3"
|
|
804
|
+
"h3",
|
|
805
|
+
"effect-http"
|
|
801
806
|
]);
|
|
802
807
|
var INJECTION_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc"]);
|
|
803
808
|
function trpcOutDir(g, cfg) {
|
|
@@ -833,6 +838,9 @@ function tanstackStartOutDir(g, cfg) {
|
|
|
833
838
|
function h3OutDir(g, cfg) {
|
|
834
839
|
return g.path ?? cfg.outDir;
|
|
835
840
|
}
|
|
841
|
+
function effectHttpOutDir(g, cfg) {
|
|
842
|
+
return g.path ?? cfg.outDir;
|
|
843
|
+
}
|
|
836
844
|
function sharedSchemaNames(opts) {
|
|
837
845
|
const resolved = (0, import_validation_core.resolveAffix)(opts);
|
|
838
846
|
return import_validation_core.NAME_MODES.map((mode) => (0, import_validation_core.schemaName)(mode, import_validation_core.AFFIX_PROBE_TABLE, resolved));
|
|
@@ -898,6 +906,18 @@ function resolveConfig(cfg) {
|
|
|
898
906
|
}
|
|
899
907
|
continue;
|
|
900
908
|
}
|
|
909
|
+
if (g.kind === "effect-http") {
|
|
910
|
+
if (g.validation?.library) {
|
|
911
|
+
warnings.push(
|
|
912
|
+
`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.`
|
|
913
|
+
);
|
|
914
|
+
}
|
|
915
|
+
if (!g.validation?.importPath && !generators.some((s) => s.kind === "effect")) {
|
|
916
|
+
warnings.push(
|
|
917
|
+
`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.`
|
|
918
|
+
);
|
|
919
|
+
}
|
|
920
|
+
}
|
|
901
921
|
if (g.kind === "h3") {
|
|
902
922
|
if (g.includeRelations) {
|
|
903
923
|
warnings.push(
|
|
@@ -1103,6 +1123,7 @@ function computeGeneratorOutputDirs(cfg, cwd = process.cwd()) {
|
|
|
1103
1123
|
if (g.kind === "ai") dirs.add(abs(aiOutDir(g, cfg)));
|
|
1104
1124
|
if (g.kind === "tanstack-start") dirs.add(abs(tanstackStartOutDir(g, cfg)));
|
|
1105
1125
|
if (g.kind === "h3") dirs.add(abs(h3OutDir(g, cfg)));
|
|
1126
|
+
if (g.kind === "effect-http") dirs.add(abs(effectHttpOutDir(g, cfg)));
|
|
1106
1127
|
if (g.kind === "service") dirs.add(abs(g.path ?? "src/services"));
|
|
1107
1128
|
if (g.kind === "zod") dirs.add(abs(g.path ?? "src/validators/zod"));
|
|
1108
1129
|
if (g.kind === "valibot") dirs.add(abs(g.path ?? "src/validators/valibot"));
|
|
@@ -1181,6 +1202,7 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
|
|
|
1181
1202
|
computeWatchTargets,
|
|
1182
1203
|
configFromKinds,
|
|
1183
1204
|
defineConfig,
|
|
1205
|
+
effectHttpOutDir,
|
|
1184
1206
|
expressOutDir,
|
|
1185
1207
|
fastifyOutDir,
|
|
1186
1208
|
filterTables,
|