@drzl/cli 4.25.0 → 4.27.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-J7NGXOAQ.js → chunk-O66F7W63.js} +32 -2
- package/dist/chunk-O66F7W63.js.map +1 -0
- package/dist/cli.cjs +94 -8
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +68 -8
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +33 -1
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +39 -3
- package/dist/config.d.ts +39 -3
- package/dist/config.js +5 -1
- package/dist/drzl.config.schema.json +2 -0
- package/package.json +10 -8
- package/dist/chunk-J7NGXOAQ.js.map +0 -1
package/dist/config.cjs
CHANGED
|
@@ -42,6 +42,7 @@ __export(config_exports, {
|
|
|
42
42
|
GeneratorSchema: () => GeneratorSchema,
|
|
43
43
|
ImportExtensionSchema: () => ImportExtensionSchema,
|
|
44
44
|
NamingSchema: () => NamingSchema,
|
|
45
|
+
aiOutDir: () => aiOutDir,
|
|
45
46
|
buildConfigJsonSchema: () => buildConfigJsonSchema,
|
|
46
47
|
computeGeneratorOutputDirs: () => computeGeneratorOutputDirs,
|
|
47
48
|
computeWatchTargets: () => computeWatchTargets,
|
|
@@ -56,6 +57,7 @@ __export(config_exports, {
|
|
|
56
57
|
loadConfig: () => loadConfig,
|
|
57
58
|
mcpOutDir: () => mcpOutDir,
|
|
58
59
|
nestjsOutDir: () => nestjsOutDir,
|
|
60
|
+
nextOutDir: () => nextOutDir,
|
|
59
61
|
resolveConfig: () => resolveConfig,
|
|
60
62
|
resolveTemplateDirsSync: () => resolveTemplateDirsSync,
|
|
61
63
|
tableFilterWarnings: () => tableFilterWarnings,
|
|
@@ -352,7 +354,9 @@ var GeneratorKindSchema = import_zod.z.enum([
|
|
|
352
354
|
"fastify",
|
|
353
355
|
"nestjs",
|
|
354
356
|
"graphql",
|
|
357
|
+
"ai",
|
|
355
358
|
"mcp",
|
|
359
|
+
"next",
|
|
356
360
|
"service",
|
|
357
361
|
"zod",
|
|
358
362
|
"valibot",
|
|
@@ -771,7 +775,7 @@ function buildConfigJsonSchema() {
|
|
|
771
775
|
properties
|
|
772
776
|
};
|
|
773
777
|
}
|
|
774
|
-
var ROUTER_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc", "hono", "express", "mcp"]);
|
|
778
|
+
var ROUTER_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc", "hono", "express", "mcp", "next", "ai"]);
|
|
775
779
|
var INJECTION_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc"]);
|
|
776
780
|
function trpcOutDir(g, cfg) {
|
|
777
781
|
return g.path ?? cfg.outDir;
|
|
@@ -794,6 +798,12 @@ function graphqlOutDir(g, cfg) {
|
|
|
794
798
|
function mcpOutDir(g, cfg) {
|
|
795
799
|
return g.path ?? cfg.outDir;
|
|
796
800
|
}
|
|
801
|
+
function nextOutDir(g, cfg) {
|
|
802
|
+
return g.path ?? cfg.outDir;
|
|
803
|
+
}
|
|
804
|
+
function aiOutDir(g, cfg) {
|
|
805
|
+
return g.path ?? cfg.outDir;
|
|
806
|
+
}
|
|
797
807
|
function sharedSchemaNames(opts) {
|
|
798
808
|
const resolved = (0, import_validation_core.resolveAffix)(opts);
|
|
799
809
|
return import_validation_core.NAME_MODES.map((mode) => (0, import_validation_core.schemaName)(mode, import_validation_core.AFFIX_PROBE_TABLE, resolved));
|
|
@@ -859,11 +869,29 @@ function resolveConfig(cfg) {
|
|
|
859
869
|
}
|
|
860
870
|
continue;
|
|
861
871
|
}
|
|
872
|
+
if (g.kind === "ai" && g.includeRelations) {
|
|
873
|
+
warnings.push(
|
|
874
|
+
`drzl config: the "ai" generator sets includeRelations, which it does not read. Relation lookups are routes, and this generator emits AI SDK tools rather than routes. Remove the flag.`
|
|
875
|
+
);
|
|
876
|
+
}
|
|
862
877
|
if (g.kind === "mcp" && g.includeRelations) {
|
|
863
878
|
warnings.push(
|
|
864
879
|
`drzl config: the "mcp" generator sets includeRelations, which it does not read. Relation lookups are routes, and this generator emits MCP tools rather than routes. Remove the flag.`
|
|
865
880
|
);
|
|
866
881
|
}
|
|
882
|
+
if (g.kind === "next") {
|
|
883
|
+
if (g.includeRelations) {
|
|
884
|
+
warnings.push(
|
|
885
|
+
`drzl config: the "next" generator sets includeRelations, which it does not read. Relation lookups are routes, and this generator emits server actions that parse a posted form. Remove the flag.`
|
|
886
|
+
);
|
|
887
|
+
}
|
|
888
|
+
const library2 = g.validation?.library ?? "zod";
|
|
889
|
+
if (!g.validation?.importPath && !generators.some((s) => s.kind === library2)) {
|
|
890
|
+
warnings.push(
|
|
891
|
+
`drzl config: the "next" generator parses 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.`
|
|
892
|
+
);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
867
895
|
if (!ROUTER_KINDS.has(g.kind)) continue;
|
|
868
896
|
if (g.databaseInjection?.enabled && !INJECTION_KINDS.has(g.kind)) {
|
|
869
897
|
warnings.push(
|
|
@@ -1016,6 +1044,8 @@ function computeGeneratorOutputDirs(cfg, cwd = process.cwd()) {
|
|
|
1016
1044
|
if (g.kind === "nestjs") dirs.add(abs(nestjsOutDir(g, cfg)));
|
|
1017
1045
|
if (g.kind === "graphql") dirs.add(abs(graphqlOutDir(g, cfg)));
|
|
1018
1046
|
if (g.kind === "mcp") dirs.add(abs(mcpOutDir(g, cfg)));
|
|
1047
|
+
if (g.kind === "next") dirs.add(abs(nextOutDir(g, cfg)));
|
|
1048
|
+
if (g.kind === "ai") dirs.add(abs(aiOutDir(g, cfg)));
|
|
1019
1049
|
if (g.kind === "service") dirs.add(abs(g.path ?? "src/services"));
|
|
1020
1050
|
if (g.kind === "zod") dirs.add(abs(g.path ?? "src/validators/zod"));
|
|
1021
1051
|
if (g.kind === "valibot") dirs.add(abs(g.path ?? "src/validators/valibot"));
|
|
@@ -1088,6 +1118,7 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
|
|
|
1088
1118
|
GeneratorSchema,
|
|
1089
1119
|
ImportExtensionSchema,
|
|
1090
1120
|
NamingSchema,
|
|
1121
|
+
aiOutDir,
|
|
1091
1122
|
buildConfigJsonSchema,
|
|
1092
1123
|
computeGeneratorOutputDirs,
|
|
1093
1124
|
computeWatchTargets,
|
|
@@ -1102,6 +1133,7 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
|
|
|
1102
1133
|
loadConfig,
|
|
1103
1134
|
mcpOutDir,
|
|
1104
1135
|
nestjsOutDir,
|
|
1136
|
+
nextOutDir,
|
|
1105
1137
|
resolveConfig,
|
|
1106
1138
|
resolveTemplateDirsSync,
|
|
1107
1139
|
tableFilterWarnings,
|