@drzl/cli 4.18.0 → 4.19.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/cli.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  filterTables,
6
6
  loadConfig,
7
7
  trpcOutDir
8
- } from "./chunk-I4KMDCQR.js";
8
+ } from "./chunk-V2IXXAC2.js";
9
9
 
10
10
  // src/cli.ts
11
11
  import { SchemaAnalyzer } from "@drzl/analyzer";
@@ -420,7 +420,7 @@ var shownThisProcess = false;
420
420
  var tips = [
421
421
  "Pair DRZL watch mode with drizzle-kit to keep schema & API synced.",
422
422
  "Templatize your ORPC routers to roll out new endpoints safely.",
423
- "Need typed validators? Enable the zod, valibot, arktype, or typebox generators.",
423
+ "Need typed validators? Enable the zod, valibot, arktype, typebox, or effect generators.",
424
424
  "Need JSON Schema or OpenAPI? The json-schema generator emits both, with no runtime dependency.",
425
425
  "Use output headers to track generated files and trim noisy diffs."
426
426
  ];
@@ -805,6 +805,25 @@ program.command("generate").description("Run configured generators (drzl.config.
805
805
  reportGeneratorFailure(g.kind, e);
806
806
  process.exit(1);
807
807
  }
808
+ } else if (g.kind === "effect") {
809
+ try {
810
+ const { EffectGenerator } = await loadGenerator(
811
+ "@drzl/generator-effect",
812
+ () => import("./dist-CZDVFYFW.js")
813
+ );
814
+ const gen = new EffectGenerator(analysis);
815
+ const target = g.path ?? "src/validators/effect";
816
+ const files = await gen.generate(
817
+ validationOptions(g, cfg, target, { schemaTypes: true })
818
+ );
819
+ progress.stop();
820
+ ora().succeed(chalk3.green(`Generated (effect): ${files.length} files`));
821
+ files.forEach((f) => console.log(" -", chalk3.cyan(f)));
822
+ } catch (e) {
823
+ progress.stop();
824
+ reportGeneratorFailure(g.kind, e);
825
+ process.exit(1);
826
+ }
808
827
  }
809
828
  }
810
829
  if (driftBefore) {
@@ -1142,6 +1161,26 @@ program.command("watch").description("Watch schema and regenerate on changes").o
1142
1161
  reportGeneratorFailure(g.kind, e);
1143
1162
  return;
1144
1163
  }
1164
+ } else if (g.kind === "effect") {
1165
+ try {
1166
+ const { EffectGenerator } = await loadGenerator(
1167
+ "@drzl/generator-effect",
1168
+ () => import("./dist-CZDVFYFW.js")
1169
+ );
1170
+ const gen = new EffectGenerator(analysis);
1171
+ const target = g.path ?? "src/validators/effect";
1172
+ const files = await gen.generate(
1173
+ validationOptions(g, cfg, target, { schemaTypes: true })
1174
+ );
1175
+ opts.json ? console.log(JSON.stringify({ event: "generate_complete", kind: g.kind, files })) : console.log(
1176
+ chalk3.green(`Generated (effect): ${files.length} files`),
1177
+ files.map((f) => chalk3.cyan(f)).join(", ")
1178
+ );
1179
+ newFiles.push(...files);
1180
+ } catch (e) {
1181
+ reportGeneratorFailure(g.kind, e);
1182
+ return;
1183
+ }
1145
1184
  } else if (g.kind === "json-schema") {
1146
1185
  try {
1147
1186
  const { JsonSchemaGenerator } = await loadGenerator(