@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/{chunk-WS3MT5CH.js → chunk-3REB46XD.js} +52 -2
- package/dist/chunk-3REB46XD.js.map +1 -0
- package/dist/cli.cjs +138 -23
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +92 -23
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +53 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +39 -1
- package/dist/config.d.ts +39 -1
- package/dist/config.js +5 -1
- package/dist/drzl.config.schema.json +12 -0
- package/package.json +9 -7
- package/dist/chunk-WS3MT5CH.js.map +0 -1
package/dist/config.cjs
CHANGED
|
@@ -48,10 +48,12 @@ __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,
|
|
54
55
|
graphqlOutDir: () => graphqlOutDir,
|
|
56
|
+
h3OutDir: () => h3OutDir,
|
|
55
57
|
honoOutDir: () => honoOutDir,
|
|
56
58
|
importFreshConfigModule: () => importFreshConfigModule,
|
|
57
59
|
loadConfig: () => loadConfig,
|
|
@@ -356,6 +358,8 @@ var GeneratorKindSchema = import_zod.z.enum([
|
|
|
356
358
|
"nestjs",
|
|
357
359
|
"graphql",
|
|
358
360
|
"ai",
|
|
361
|
+
"effect-http",
|
|
362
|
+
"h3",
|
|
359
363
|
"mcp",
|
|
360
364
|
"next",
|
|
361
365
|
"tanstack-start",
|
|
@@ -388,6 +392,17 @@ var GeneratorSchema = import_zod.z.object({
|
|
|
388
392
|
* refuses that combination rather than emitting a server that dies on startup.
|
|
389
393
|
*/
|
|
390
394
|
sdk: import_zod.z.enum(["v1", "v2"]).optional(),
|
|
395
|
+
/**
|
|
396
|
+
* Which h3 major the emitted route handlers are written against. `h3` only.
|
|
397
|
+
*
|
|
398
|
+
* `v1` is the default and is what released Nitro depends on: nitropack 2.13.4 names
|
|
399
|
+
* `h3: ^1.15.11`, while h3's own `latest` tag is a 2.x release candidate. v1 has no Standard
|
|
400
|
+
* Schema overload on its validation helpers, so the emitted modules carry an adapter; v2 takes a
|
|
401
|
+
* schema directly and carries none.
|
|
402
|
+
*/
|
|
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(),
|
|
391
406
|
/** The name and version the emitted MCP server reports at initialize. `mcp` only. */
|
|
392
407
|
serverName: import_zod.z.string().optional(),
|
|
393
408
|
serverVersion: import_zod.z.string().optional(),
|
|
@@ -785,7 +800,9 @@ var ROUTER_KINDS = /* @__PURE__ */ new Set([
|
|
|
785
800
|
"mcp",
|
|
786
801
|
"next",
|
|
787
802
|
"ai",
|
|
788
|
-
"tanstack-start"
|
|
803
|
+
"tanstack-start",
|
|
804
|
+
"h3",
|
|
805
|
+
"effect-http"
|
|
789
806
|
]);
|
|
790
807
|
var INJECTION_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc"]);
|
|
791
808
|
function trpcOutDir(g, cfg) {
|
|
@@ -818,6 +835,12 @@ function aiOutDir(g, cfg) {
|
|
|
818
835
|
function tanstackStartOutDir(g, cfg) {
|
|
819
836
|
return g.path ?? cfg.outDir;
|
|
820
837
|
}
|
|
838
|
+
function h3OutDir(g, cfg) {
|
|
839
|
+
return g.path ?? cfg.outDir;
|
|
840
|
+
}
|
|
841
|
+
function effectHttpOutDir(g, cfg) {
|
|
842
|
+
return g.path ?? cfg.outDir;
|
|
843
|
+
}
|
|
821
844
|
function sharedSchemaNames(opts) {
|
|
822
845
|
const resolved = (0, import_validation_core.resolveAffix)(opts);
|
|
823
846
|
return import_validation_core.NAME_MODES.map((mode) => (0, import_validation_core.schemaName)(mode, import_validation_core.AFFIX_PROBE_TABLE, resolved));
|
|
@@ -883,6 +906,31 @@ function resolveConfig(cfg) {
|
|
|
883
906
|
}
|
|
884
907
|
continue;
|
|
885
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
|
+
}
|
|
921
|
+
if (g.kind === "h3") {
|
|
922
|
+
if (g.includeRelations) {
|
|
923
|
+
warnings.push(
|
|
924
|
+
`drzl config: the "h3" generator sets includeRelations, which it does not read yet. Relation lookups are a route this generator does not emit. Remove the flag.`
|
|
925
|
+
);
|
|
926
|
+
}
|
|
927
|
+
const library2 = g.validation?.library ?? "zod";
|
|
928
|
+
if (!g.validation?.importPath && !generators.some((s) => s.kind === library2)) {
|
|
929
|
+
warnings.push(
|
|
930
|
+
`drzl config: the "h3" generator validates 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.`
|
|
931
|
+
);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
886
934
|
if (g.kind === "tanstack-start") {
|
|
887
935
|
if (g.includeRelations) {
|
|
888
936
|
warnings.push(
|
|
@@ -1074,6 +1122,8 @@ function computeGeneratorOutputDirs(cfg, cwd = process.cwd()) {
|
|
|
1074
1122
|
if (g.kind === "next") dirs.add(abs(nextOutDir(g, cfg)));
|
|
1075
1123
|
if (g.kind === "ai") dirs.add(abs(aiOutDir(g, cfg)));
|
|
1076
1124
|
if (g.kind === "tanstack-start") dirs.add(abs(tanstackStartOutDir(g, cfg)));
|
|
1125
|
+
if (g.kind === "h3") dirs.add(abs(h3OutDir(g, cfg)));
|
|
1126
|
+
if (g.kind === "effect-http") dirs.add(abs(effectHttpOutDir(g, cfg)));
|
|
1077
1127
|
if (g.kind === "service") dirs.add(abs(g.path ?? "src/services"));
|
|
1078
1128
|
if (g.kind === "zod") dirs.add(abs(g.path ?? "src/validators/zod"));
|
|
1079
1129
|
if (g.kind === "valibot") dirs.add(abs(g.path ?? "src/validators/valibot"));
|
|
@@ -1152,10 +1202,12 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
|
|
|
1152
1202
|
computeWatchTargets,
|
|
1153
1203
|
configFromKinds,
|
|
1154
1204
|
defineConfig,
|
|
1205
|
+
effectHttpOutDir,
|
|
1155
1206
|
expressOutDir,
|
|
1156
1207
|
fastifyOutDir,
|
|
1157
1208
|
filterTables,
|
|
1158
1209
|
graphqlOutDir,
|
|
1210
|
+
h3OutDir,
|
|
1159
1211
|
honoOutDir,
|
|
1160
1212
|
importFreshConfigModule,
|
|
1161
1213
|
loadConfig,
|