@drzl/cli 4.31.0 → 4.34.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-FURPHLQS.js → chunk-S5JWTWWU.js} +61 -3
- package/dist/chunk-S5JWTWWU.js.map +1 -0
- package/dist/cli.cjs +158 -21
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +105 -20
- package/dist/cli.js.map +1 -1
- package/dist/config.cjs +63 -2
- package/dist/config.cjs.map +1 -1
- package/dist/config.d.cts +52 -1
- package/dist/config.d.ts +52 -1
- package/dist/config.js +7 -1
- package/dist/drzl.config.schema.json +16 -1
- package/package.json +7 -4
- package/dist/chunk-FURPHLQS.js.map +0 -1
package/dist/config.cjs
CHANGED
|
@@ -49,7 +49,9 @@ __export(config_exports, {
|
|
|
49
49
|
configFromKinds: () => configFromKinds,
|
|
50
50
|
defineConfig: () => defineConfig,
|
|
51
51
|
effectHttpOutDir: () => effectHttpOutDir,
|
|
52
|
+
elysiaOutDir: () => elysiaOutDir,
|
|
52
53
|
expressOutDir: () => expressOutDir,
|
|
54
|
+
fastCheckOutDir: () => fastCheckOutDir,
|
|
53
55
|
fastifyOutDir: () => fastifyOutDir,
|
|
54
56
|
filterTables: () => filterTables,
|
|
55
57
|
graphqlOutDir: () => graphqlOutDir,
|
|
@@ -62,6 +64,7 @@ __export(config_exports, {
|
|
|
62
64
|
nextOutDir: () => nextOutDir,
|
|
63
65
|
resolveConfig: () => resolveConfig,
|
|
64
66
|
resolveTemplateDirsSync: () => resolveTemplateDirsSync,
|
|
67
|
+
seedOutDir: () => seedOutDir,
|
|
65
68
|
tableFilterWarnings: () => tableFilterWarnings,
|
|
66
69
|
tanstackStartOutDir: () => tanstackStartOutDir,
|
|
67
70
|
trpcOutDir: () => trpcOutDir,
|
|
@@ -360,11 +363,14 @@ var GeneratorKindSchema = import_zod.z.enum([
|
|
|
360
363
|
"graphql",
|
|
361
364
|
"ai",
|
|
362
365
|
"effect-http",
|
|
366
|
+
"elysia",
|
|
363
367
|
"h3",
|
|
364
368
|
"mcp",
|
|
365
369
|
"next",
|
|
366
370
|
"tanstack-start",
|
|
367
371
|
"ts-rest",
|
|
372
|
+
"seed",
|
|
373
|
+
"fast-check",
|
|
368
374
|
"service",
|
|
369
375
|
"zod",
|
|
370
376
|
"valibot",
|
|
@@ -407,6 +413,18 @@ var GeneratorSchema = import_zod.z.object({
|
|
|
407
413
|
apiName: import_zod.z.string().optional(),
|
|
408
414
|
/** The identifier the assembled root contract carries. `ts-rest` only, defaults to `'contract'`. */
|
|
409
415
|
contractName: import_zod.z.string().optional(),
|
|
416
|
+
/** The identifier the assembled Elysia app is exported as. `elysia` only, defaults to `'app'`. */
|
|
417
|
+
appName: import_zod.z.string().optional(),
|
|
418
|
+
/** How many rows each generated seed function returns by default. `seed` only, defaults to 10. */
|
|
419
|
+
count: import_zod.z.number().int().positive().optional(),
|
|
420
|
+
/**
|
|
421
|
+
* Prefixed to every table's mount point. `elysia` only.
|
|
422
|
+
*
|
|
423
|
+
* Passed to Elysia's own `new Elysia({ prefix })` on the assembled app rather than folded into
|
|
424
|
+
* each module's prefix, because Elysia lifts it into the app's type: the full path is what Eden
|
|
425
|
+
* Treaty reports.
|
|
426
|
+
*/
|
|
427
|
+
prefix: import_zod.z.string().optional(),
|
|
410
428
|
/**
|
|
411
429
|
* Prefixed to every path in the emitted contract. `ts-rest` only.
|
|
412
430
|
*
|
|
@@ -642,7 +660,16 @@ var GeneratorSchema = import_zod.z.object({
|
|
|
642
660
|
// router validation sharing (orpc, trpc)
|
|
643
661
|
validation: import_zod.z.object({
|
|
644
662
|
useShared: import_zod.z.boolean().default(false).optional(),
|
|
645
|
-
|
|
663
|
+
/**
|
|
664
|
+
* Which validation generator's schemas this generator imports.
|
|
665
|
+
*
|
|
666
|
+
* `typebox` is accepted here and works for exactly one kind, `elysia`, whose validator slot
|
|
667
|
+
* takes a TypeBox schema natively because Elysia's own `t` is TypeBox. Every other router
|
|
668
|
+
* types its validators as a Standard Schema, which TypeBox does not implement, so a router
|
|
669
|
+
* wired to one would type against `any` and validate nothing. Naming it on any other kind is
|
|
670
|
+
* reported below rather than accepted, which is why the enum can be this wide.
|
|
671
|
+
*/
|
|
672
|
+
library: import_zod.z.enum(["zod", "valibot", "arktype", "typebox"]).default("zod").optional(),
|
|
646
673
|
importPath: import_zod.z.string().optional(),
|
|
647
674
|
schemaSuffix: import_zod.z.string().optional(),
|
|
648
675
|
/**
|
|
@@ -816,7 +843,8 @@ var ROUTER_KINDS = /* @__PURE__ */ new Set([
|
|
|
816
843
|
"tanstack-start",
|
|
817
844
|
"h3",
|
|
818
845
|
"effect-http",
|
|
819
|
-
"ts-rest"
|
|
846
|
+
"ts-rest",
|
|
847
|
+
"elysia"
|
|
820
848
|
]);
|
|
821
849
|
var INJECTION_KINDS = /* @__PURE__ */ new Set(["orpc", "trpc"]);
|
|
822
850
|
function trpcOutDir(g, cfg) {
|
|
@@ -858,6 +886,15 @@ function effectHttpOutDir(g, cfg) {
|
|
|
858
886
|
function tsRestOutDir(g, cfg) {
|
|
859
887
|
return g.path ?? cfg.outDir;
|
|
860
888
|
}
|
|
889
|
+
function elysiaOutDir(g, cfg) {
|
|
890
|
+
return g.path ?? cfg.outDir;
|
|
891
|
+
}
|
|
892
|
+
function seedOutDir(g, cfg) {
|
|
893
|
+
return g.path ?? cfg.outDir;
|
|
894
|
+
}
|
|
895
|
+
function fastCheckOutDir(g, cfg) {
|
|
896
|
+
return g.path ?? cfg.outDir;
|
|
897
|
+
}
|
|
861
898
|
function sharedSchemaNames(opts) {
|
|
862
899
|
const resolved = (0, import_validation_core.resolveAffix)(opts);
|
|
863
900
|
return import_validation_core.NAME_MODES.map((mode) => (0, import_validation_core.schemaName)(mode, import_validation_core.AFFIX_PROBE_TABLE, resolved));
|
|
@@ -923,6 +960,24 @@ function resolveConfig(cfg) {
|
|
|
923
960
|
}
|
|
924
961
|
continue;
|
|
925
962
|
}
|
|
963
|
+
if (g.validation?.library === "typebox" && g.kind !== "elysia") {
|
|
964
|
+
warnings.push(
|
|
965
|
+
`drzl config: the "${g.kind}" generator sets validation.library to "typebox", which it cannot validate with. TypeBox does not implement Standard Schema, so the schemas would be accepted and never checked. Use "zod", "valibot" or "arktype". The "elysia" generator is the one that takes TypeBox, because Elysia's own "t" is TypeBox.`
|
|
966
|
+
);
|
|
967
|
+
}
|
|
968
|
+
if (g.kind === "elysia") {
|
|
969
|
+
if (g.includeRelations) {
|
|
970
|
+
warnings.push(
|
|
971
|
+
`drzl config: the "elysia" generator sets includeRelations, which it does not read. Relation lookups are a route this generator does not emit. Remove the flag.`
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
const library2 = g.validation?.library ?? "zod";
|
|
975
|
+
if (!g.validation?.importPath && !generators.some((s) => s.kind === library2)) {
|
|
976
|
+
warnings.push(
|
|
977
|
+
`drzl config: the "elysia" 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.`
|
|
978
|
+
);
|
|
979
|
+
}
|
|
980
|
+
}
|
|
926
981
|
if (g.kind === "effect-http") {
|
|
927
982
|
if (g.validation?.library) {
|
|
928
983
|
warnings.push(
|
|
@@ -1155,6 +1210,9 @@ function computeGeneratorOutputDirs(cfg, cwd = process.cwd()) {
|
|
|
1155
1210
|
if (g.kind === "h3") dirs.add(abs(h3OutDir(g, cfg)));
|
|
1156
1211
|
if (g.kind === "effect-http") dirs.add(abs(effectHttpOutDir(g, cfg)));
|
|
1157
1212
|
if (g.kind === "ts-rest") dirs.add(abs(tsRestOutDir(g, cfg)));
|
|
1213
|
+
if (g.kind === "elysia") dirs.add(abs(elysiaOutDir(g, cfg)));
|
|
1214
|
+
if (g.kind === "seed") dirs.add(abs(seedOutDir(g, cfg)));
|
|
1215
|
+
if (g.kind === "fast-check") dirs.add(abs(fastCheckOutDir(g, cfg)));
|
|
1158
1216
|
if (g.kind === "service") dirs.add(abs(g.path ?? "src/services"));
|
|
1159
1217
|
if (g.kind === "zod") dirs.add(abs(g.path ?? "src/validators/zod"));
|
|
1160
1218
|
if (g.kind === "valibot") dirs.add(abs(g.path ?? "src/validators/valibot"));
|
|
@@ -1234,7 +1292,9 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
|
|
|
1234
1292
|
configFromKinds,
|
|
1235
1293
|
defineConfig,
|
|
1236
1294
|
effectHttpOutDir,
|
|
1295
|
+
elysiaOutDir,
|
|
1237
1296
|
expressOutDir,
|
|
1297
|
+
fastCheckOutDir,
|
|
1238
1298
|
fastifyOutDir,
|
|
1239
1299
|
filterTables,
|
|
1240
1300
|
graphqlOutDir,
|
|
@@ -1247,6 +1307,7 @@ function computeWatchTargets(cfg, cwd = process.cwd(), source) {
|
|
|
1247
1307
|
nextOutDir,
|
|
1248
1308
|
resolveConfig,
|
|
1249
1309
|
resolveTemplateDirsSync,
|
|
1310
|
+
seedOutDir,
|
|
1250
1311
|
tableFilterWarnings,
|
|
1251
1312
|
tanstackStartOutDir,
|
|
1252
1313
|
trpcOutDir,
|