@drzl/cli 1.1.0 → 2.0.1

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/config.d.cts CHANGED
@@ -8,6 +8,49 @@ declare const NamingSchema: z.ZodObject<{
8
8
  snake: "snake";
9
9
  }>>>;
10
10
  }, z.core.$strip>;
11
+ declare const AffixSchema: z.ZodObject<{
12
+ tableCase: z.ZodOptional<z.ZodEnum<{
13
+ preserve: "preserve";
14
+ pascal: "pascal";
15
+ }>>;
16
+ schema: z.ZodOptional<z.ZodObject<{
17
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
18
+ insert: z.ZodOptional<z.ZodString>;
19
+ update: z.ZodOptional<z.ZodString>;
20
+ select: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strict>]>>;
22
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
23
+ insert: z.ZodOptional<z.ZodString>;
24
+ update: z.ZodOptional<z.ZodString>;
25
+ select: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strict>]>>;
27
+ }, z.core.$strict>>;
28
+ type: z.ZodOptional<z.ZodObject<{
29
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
30
+ insert: z.ZodOptional<z.ZodString>;
31
+ update: z.ZodOptional<z.ZodString>;
32
+ select: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strict>]>>;
34
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
35
+ insert: z.ZodOptional<z.ZodString>;
36
+ update: z.ZodOptional<z.ZodString>;
37
+ select: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strict>]>>;
39
+ }, z.core.$strict>>;
40
+ }, z.core.$strict>;
41
+ /**
42
+ * How every relative specifier drzl invents spells its extension.
43
+ *
44
+ * The generated files land in the consumer's own source tree, so the consumer's
45
+ * `moduleResolution` decides which forms resolve. `js` is the only one that resolves under
46
+ * all of `bundler`, `node10`, `node16` and `nodenext` with no compiler flag, so it is the
47
+ * default. See the `ImportExtension` docs in `@drzl/validation-core` for the measured grid.
48
+ */
49
+ declare const ImportExtensionSchema: z.ZodEnum<{
50
+ js: "js";
51
+ none: "none";
52
+ ts: "ts";
53
+ }>;
11
54
  declare const GeneratorSchema: z.ZodObject<{
12
55
  kind: z.ZodEnum<{
13
56
  orpc: "orpc";
@@ -16,6 +59,11 @@ declare const GeneratorSchema: z.ZodObject<{
16
59
  valibot: "valibot";
17
60
  arktype: "arktype";
18
61
  }>;
62
+ importExtension: z.ZodOptional<z.ZodEnum<{
63
+ js: "js";
64
+ none: "none";
65
+ ts: "ts";
66
+ }>>;
19
67
  template: z.ZodOptional<z.ZodString>;
20
68
  includeRelations: z.ZodOptional<z.ZodBoolean>;
21
69
  naming: z.ZodOptional<z.ZodObject<{
@@ -48,6 +96,36 @@ declare const GeneratorSchema: z.ZodObject<{
48
96
  schemaImportPath: z.ZodOptional<z.ZodString>;
49
97
  schemaSuffix: z.ZodOptional<z.ZodString>;
50
98
  fileSuffix: z.ZodOptional<z.ZodString>;
99
+ affix: z.ZodOptional<z.ZodObject<{
100
+ tableCase: z.ZodOptional<z.ZodEnum<{
101
+ preserve: "preserve";
102
+ pascal: "pascal";
103
+ }>>;
104
+ schema: z.ZodOptional<z.ZodObject<{
105
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
106
+ insert: z.ZodOptional<z.ZodString>;
107
+ update: z.ZodOptional<z.ZodString>;
108
+ select: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strict>]>>;
110
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
111
+ insert: z.ZodOptional<z.ZodString>;
112
+ update: z.ZodOptional<z.ZodString>;
113
+ select: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strict>]>>;
115
+ }, z.core.$strict>>;
116
+ type: z.ZodOptional<z.ZodObject<{
117
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
118
+ insert: z.ZodOptional<z.ZodString>;
119
+ update: z.ZodOptional<z.ZodString>;
120
+ select: z.ZodOptional<z.ZodString>;
121
+ }, z.core.$strict>]>>;
122
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
123
+ insert: z.ZodOptional<z.ZodString>;
124
+ update: z.ZodOptional<z.ZodString>;
125
+ select: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strict>]>>;
127
+ }, z.core.$strict>>;
128
+ }, z.core.$strict>>;
51
129
  validation: z.ZodOptional<z.ZodObject<{
52
130
  useShared: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
53
131
  library: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
@@ -57,6 +135,36 @@ declare const GeneratorSchema: z.ZodObject<{
57
135
  }>>>;
58
136
  importPath: z.ZodOptional<z.ZodString>;
59
137
  schemaSuffix: z.ZodOptional<z.ZodString>;
138
+ affix: z.ZodOptional<z.ZodObject<{
139
+ tableCase: z.ZodOptional<z.ZodEnum<{
140
+ preserve: "preserve";
141
+ pascal: "pascal";
142
+ }>>;
143
+ schema: z.ZodOptional<z.ZodObject<{
144
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
145
+ insert: z.ZodOptional<z.ZodString>;
146
+ update: z.ZodOptional<z.ZodString>;
147
+ select: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strict>]>>;
149
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
150
+ insert: z.ZodOptional<z.ZodString>;
151
+ update: z.ZodOptional<z.ZodString>;
152
+ select: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strict>]>>;
154
+ }, z.core.$strict>>;
155
+ type: z.ZodOptional<z.ZodObject<{
156
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
157
+ insert: z.ZodOptional<z.ZodString>;
158
+ update: z.ZodOptional<z.ZodString>;
159
+ select: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$strict>]>>;
161
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
162
+ insert: z.ZodOptional<z.ZodString>;
163
+ update: z.ZodOptional<z.ZodString>;
164
+ select: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strict>]>>;
166
+ }, z.core.$strict>>;
167
+ }, z.core.$strict>>;
60
168
  }, z.core.$strip>>;
61
169
  templateOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
62
170
  }, z.core.$strip>;
@@ -68,6 +176,11 @@ declare const AnalyzerSchema: z.ZodObject<{
68
176
  declare const ConfigSchema: z.ZodObject<{
69
177
  schema: z.ZodString;
70
178
  outDir: z.ZodDefault<z.ZodString>;
179
+ importExtension: z.ZodDefault<z.ZodEnum<{
180
+ js: "js";
181
+ none: "none";
182
+ ts: "ts";
183
+ }>>;
71
184
  analyzer: z.ZodDefault<z.ZodObject<{
72
185
  includeRelations: z.ZodDefault<z.ZodBoolean>;
73
186
  validateConstraints: z.ZodDefault<z.ZodBoolean>;
@@ -81,6 +194,11 @@ declare const ConfigSchema: z.ZodObject<{
81
194
  valibot: "valibot";
82
195
  arktype: "arktype";
83
196
  }>;
197
+ importExtension: z.ZodOptional<z.ZodEnum<{
198
+ js: "js";
199
+ none: "none";
200
+ ts: "ts";
201
+ }>>;
84
202
  template: z.ZodOptional<z.ZodString>;
85
203
  includeRelations: z.ZodOptional<z.ZodBoolean>;
86
204
  naming: z.ZodOptional<z.ZodObject<{
@@ -113,6 +231,36 @@ declare const ConfigSchema: z.ZodObject<{
113
231
  schemaImportPath: z.ZodOptional<z.ZodString>;
114
232
  schemaSuffix: z.ZodOptional<z.ZodString>;
115
233
  fileSuffix: z.ZodOptional<z.ZodString>;
234
+ affix: z.ZodOptional<z.ZodObject<{
235
+ tableCase: z.ZodOptional<z.ZodEnum<{
236
+ preserve: "preserve";
237
+ pascal: "pascal";
238
+ }>>;
239
+ schema: z.ZodOptional<z.ZodObject<{
240
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
241
+ insert: z.ZodOptional<z.ZodString>;
242
+ update: z.ZodOptional<z.ZodString>;
243
+ select: z.ZodOptional<z.ZodString>;
244
+ }, z.core.$strict>]>>;
245
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
246
+ insert: z.ZodOptional<z.ZodString>;
247
+ update: z.ZodOptional<z.ZodString>;
248
+ select: z.ZodOptional<z.ZodString>;
249
+ }, z.core.$strict>]>>;
250
+ }, z.core.$strict>>;
251
+ type: z.ZodOptional<z.ZodObject<{
252
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
253
+ insert: z.ZodOptional<z.ZodString>;
254
+ update: z.ZodOptional<z.ZodString>;
255
+ select: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$strict>]>>;
257
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
258
+ insert: z.ZodOptional<z.ZodString>;
259
+ update: z.ZodOptional<z.ZodString>;
260
+ select: z.ZodOptional<z.ZodString>;
261
+ }, z.core.$strict>]>>;
262
+ }, z.core.$strict>>;
263
+ }, z.core.$strict>>;
116
264
  validation: z.ZodOptional<z.ZodObject<{
117
265
  useShared: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
118
266
  library: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
@@ -122,6 +270,36 @@ declare const ConfigSchema: z.ZodObject<{
122
270
  }>>>;
123
271
  importPath: z.ZodOptional<z.ZodString>;
124
272
  schemaSuffix: z.ZodOptional<z.ZodString>;
273
+ affix: z.ZodOptional<z.ZodObject<{
274
+ tableCase: z.ZodOptional<z.ZodEnum<{
275
+ preserve: "preserve";
276
+ pascal: "pascal";
277
+ }>>;
278
+ schema: z.ZodOptional<z.ZodObject<{
279
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
280
+ insert: z.ZodOptional<z.ZodString>;
281
+ update: z.ZodOptional<z.ZodString>;
282
+ select: z.ZodOptional<z.ZodString>;
283
+ }, z.core.$strict>]>>;
284
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
285
+ insert: z.ZodOptional<z.ZodString>;
286
+ update: z.ZodOptional<z.ZodString>;
287
+ select: z.ZodOptional<z.ZodString>;
288
+ }, z.core.$strict>]>>;
289
+ }, z.core.$strict>>;
290
+ type: z.ZodOptional<z.ZodObject<{
291
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
292
+ insert: z.ZodOptional<z.ZodString>;
293
+ update: z.ZodOptional<z.ZodString>;
294
+ select: z.ZodOptional<z.ZodString>;
295
+ }, z.core.$strict>]>>;
296
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
297
+ insert: z.ZodOptional<z.ZodString>;
298
+ update: z.ZodOptional<z.ZodString>;
299
+ select: z.ZodOptional<z.ZodString>;
300
+ }, z.core.$strict>]>>;
301
+ }, z.core.$strict>>;
302
+ }, z.core.$strict>>;
125
303
  }, z.core.$strip>>;
126
304
  templateOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
127
305
  }, z.core.$strip>>>;
@@ -129,6 +307,27 @@ declare const ConfigSchema: z.ZodObject<{
129
307
  type DrzlConfigInput = z.input<typeof ConfigSchema>;
130
308
  type DrzlConfig = z.output<typeof ConfigSchema>;
131
309
  declare function defineConfig<T extends DrzlConfigInput>(cfg: T): T;
310
+ /**
311
+ * Fill in cross-generator defaults and refuse configs whose generators would disagree.
312
+ *
313
+ * An oRPC router that imports shared schemas has to spell the exact names the validation
314
+ * generator exported. Both sides used to be configured independently, so they could silently
315
+ * drift into a router that does not compile. When an oRPC generator uses shared validation
316
+ * and exactly one sibling generator produces that library, its `affix` is copied across.
317
+ *
318
+ * Deliberately conservative about the pre-existing flat `schemaSuffix`: a disagreement there
319
+ * is only reported, never repaired, because repairing it would change the bytes an existing
320
+ * config emits.
321
+ *
322
+ * `importExtension` is pushed down here too. A consumer compiles the whole generated tree
323
+ * with one tsconfig, so the setting that has to hold is the same for every generator, and
324
+ * every call site downstream can then read it off the generator without knowing about the
325
+ * top-level default.
326
+ */
327
+ declare function resolveConfig(cfg: DrzlConfig): {
328
+ config: DrzlConfig;
329
+ warnings: string[];
330
+ };
132
331
  declare function loadConfig(customPath?: string): Promise<DrzlConfig | null>;
133
332
  /** Absolute output dirs for all generators (to ignore in watcher). */
134
333
  declare function computeGeneratorOutputDirs(cfg: DrzlConfig, cwd?: string): string[];
@@ -137,4 +336,4 @@ declare function resolveTemplateDirsSync(cfg: DrzlConfig, cwd?: string): string[
137
336
  /** Build watch targets (exclude output dirs; watcher will ignore those). */
138
337
  declare function computeWatchTargets(cfg: DrzlConfig, cwd?: string): string[];
139
338
 
140
- export { AnalyzerSchema, ConfigSchema, type DrzlConfig, type DrzlConfigInput, GeneratorSchema, NamingSchema, computeGeneratorOutputDirs, computeWatchTargets, defineConfig, loadConfig, resolveTemplateDirsSync };
339
+ export { AffixSchema, AnalyzerSchema, ConfigSchema, type DrzlConfig, type DrzlConfigInput, GeneratorSchema, ImportExtensionSchema, NamingSchema, computeGeneratorOutputDirs, computeWatchTargets, defineConfig, loadConfig, resolveConfig, resolveTemplateDirsSync };
package/dist/config.d.ts CHANGED
@@ -8,6 +8,49 @@ declare const NamingSchema: z.ZodObject<{
8
8
  snake: "snake";
9
9
  }>>>;
10
10
  }, z.core.$strip>;
11
+ declare const AffixSchema: z.ZodObject<{
12
+ tableCase: z.ZodOptional<z.ZodEnum<{
13
+ preserve: "preserve";
14
+ pascal: "pascal";
15
+ }>>;
16
+ schema: z.ZodOptional<z.ZodObject<{
17
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
18
+ insert: z.ZodOptional<z.ZodString>;
19
+ update: z.ZodOptional<z.ZodString>;
20
+ select: z.ZodOptional<z.ZodString>;
21
+ }, z.core.$strict>]>>;
22
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
23
+ insert: z.ZodOptional<z.ZodString>;
24
+ update: z.ZodOptional<z.ZodString>;
25
+ select: z.ZodOptional<z.ZodString>;
26
+ }, z.core.$strict>]>>;
27
+ }, z.core.$strict>>;
28
+ type: z.ZodOptional<z.ZodObject<{
29
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
30
+ insert: z.ZodOptional<z.ZodString>;
31
+ update: z.ZodOptional<z.ZodString>;
32
+ select: z.ZodOptional<z.ZodString>;
33
+ }, z.core.$strict>]>>;
34
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
35
+ insert: z.ZodOptional<z.ZodString>;
36
+ update: z.ZodOptional<z.ZodString>;
37
+ select: z.ZodOptional<z.ZodString>;
38
+ }, z.core.$strict>]>>;
39
+ }, z.core.$strict>>;
40
+ }, z.core.$strict>;
41
+ /**
42
+ * How every relative specifier drzl invents spells its extension.
43
+ *
44
+ * The generated files land in the consumer's own source tree, so the consumer's
45
+ * `moduleResolution` decides which forms resolve. `js` is the only one that resolves under
46
+ * all of `bundler`, `node10`, `node16` and `nodenext` with no compiler flag, so it is the
47
+ * default. See the `ImportExtension` docs in `@drzl/validation-core` for the measured grid.
48
+ */
49
+ declare const ImportExtensionSchema: z.ZodEnum<{
50
+ js: "js";
51
+ none: "none";
52
+ ts: "ts";
53
+ }>;
11
54
  declare const GeneratorSchema: z.ZodObject<{
12
55
  kind: z.ZodEnum<{
13
56
  orpc: "orpc";
@@ -16,6 +59,11 @@ declare const GeneratorSchema: z.ZodObject<{
16
59
  valibot: "valibot";
17
60
  arktype: "arktype";
18
61
  }>;
62
+ importExtension: z.ZodOptional<z.ZodEnum<{
63
+ js: "js";
64
+ none: "none";
65
+ ts: "ts";
66
+ }>>;
19
67
  template: z.ZodOptional<z.ZodString>;
20
68
  includeRelations: z.ZodOptional<z.ZodBoolean>;
21
69
  naming: z.ZodOptional<z.ZodObject<{
@@ -48,6 +96,36 @@ declare const GeneratorSchema: z.ZodObject<{
48
96
  schemaImportPath: z.ZodOptional<z.ZodString>;
49
97
  schemaSuffix: z.ZodOptional<z.ZodString>;
50
98
  fileSuffix: z.ZodOptional<z.ZodString>;
99
+ affix: z.ZodOptional<z.ZodObject<{
100
+ tableCase: z.ZodOptional<z.ZodEnum<{
101
+ preserve: "preserve";
102
+ pascal: "pascal";
103
+ }>>;
104
+ schema: z.ZodOptional<z.ZodObject<{
105
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
106
+ insert: z.ZodOptional<z.ZodString>;
107
+ update: z.ZodOptional<z.ZodString>;
108
+ select: z.ZodOptional<z.ZodString>;
109
+ }, z.core.$strict>]>>;
110
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
111
+ insert: z.ZodOptional<z.ZodString>;
112
+ update: z.ZodOptional<z.ZodString>;
113
+ select: z.ZodOptional<z.ZodString>;
114
+ }, z.core.$strict>]>>;
115
+ }, z.core.$strict>>;
116
+ type: z.ZodOptional<z.ZodObject<{
117
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
118
+ insert: z.ZodOptional<z.ZodString>;
119
+ update: z.ZodOptional<z.ZodString>;
120
+ select: z.ZodOptional<z.ZodString>;
121
+ }, z.core.$strict>]>>;
122
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
123
+ insert: z.ZodOptional<z.ZodString>;
124
+ update: z.ZodOptional<z.ZodString>;
125
+ select: z.ZodOptional<z.ZodString>;
126
+ }, z.core.$strict>]>>;
127
+ }, z.core.$strict>>;
128
+ }, z.core.$strict>>;
51
129
  validation: z.ZodOptional<z.ZodObject<{
52
130
  useShared: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
53
131
  library: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
@@ -57,6 +135,36 @@ declare const GeneratorSchema: z.ZodObject<{
57
135
  }>>>;
58
136
  importPath: z.ZodOptional<z.ZodString>;
59
137
  schemaSuffix: z.ZodOptional<z.ZodString>;
138
+ affix: z.ZodOptional<z.ZodObject<{
139
+ tableCase: z.ZodOptional<z.ZodEnum<{
140
+ preserve: "preserve";
141
+ pascal: "pascal";
142
+ }>>;
143
+ schema: z.ZodOptional<z.ZodObject<{
144
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
145
+ insert: z.ZodOptional<z.ZodString>;
146
+ update: z.ZodOptional<z.ZodString>;
147
+ select: z.ZodOptional<z.ZodString>;
148
+ }, z.core.$strict>]>>;
149
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
150
+ insert: z.ZodOptional<z.ZodString>;
151
+ update: z.ZodOptional<z.ZodString>;
152
+ select: z.ZodOptional<z.ZodString>;
153
+ }, z.core.$strict>]>>;
154
+ }, z.core.$strict>>;
155
+ type: z.ZodOptional<z.ZodObject<{
156
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
157
+ insert: z.ZodOptional<z.ZodString>;
158
+ update: z.ZodOptional<z.ZodString>;
159
+ select: z.ZodOptional<z.ZodString>;
160
+ }, z.core.$strict>]>>;
161
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
162
+ insert: z.ZodOptional<z.ZodString>;
163
+ update: z.ZodOptional<z.ZodString>;
164
+ select: z.ZodOptional<z.ZodString>;
165
+ }, z.core.$strict>]>>;
166
+ }, z.core.$strict>>;
167
+ }, z.core.$strict>>;
60
168
  }, z.core.$strip>>;
61
169
  templateOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
62
170
  }, z.core.$strip>;
@@ -68,6 +176,11 @@ declare const AnalyzerSchema: z.ZodObject<{
68
176
  declare const ConfigSchema: z.ZodObject<{
69
177
  schema: z.ZodString;
70
178
  outDir: z.ZodDefault<z.ZodString>;
179
+ importExtension: z.ZodDefault<z.ZodEnum<{
180
+ js: "js";
181
+ none: "none";
182
+ ts: "ts";
183
+ }>>;
71
184
  analyzer: z.ZodDefault<z.ZodObject<{
72
185
  includeRelations: z.ZodDefault<z.ZodBoolean>;
73
186
  validateConstraints: z.ZodDefault<z.ZodBoolean>;
@@ -81,6 +194,11 @@ declare const ConfigSchema: z.ZodObject<{
81
194
  valibot: "valibot";
82
195
  arktype: "arktype";
83
196
  }>;
197
+ importExtension: z.ZodOptional<z.ZodEnum<{
198
+ js: "js";
199
+ none: "none";
200
+ ts: "ts";
201
+ }>>;
84
202
  template: z.ZodOptional<z.ZodString>;
85
203
  includeRelations: z.ZodOptional<z.ZodBoolean>;
86
204
  naming: z.ZodOptional<z.ZodObject<{
@@ -113,6 +231,36 @@ declare const ConfigSchema: z.ZodObject<{
113
231
  schemaImportPath: z.ZodOptional<z.ZodString>;
114
232
  schemaSuffix: z.ZodOptional<z.ZodString>;
115
233
  fileSuffix: z.ZodOptional<z.ZodString>;
234
+ affix: z.ZodOptional<z.ZodObject<{
235
+ tableCase: z.ZodOptional<z.ZodEnum<{
236
+ preserve: "preserve";
237
+ pascal: "pascal";
238
+ }>>;
239
+ schema: z.ZodOptional<z.ZodObject<{
240
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
241
+ insert: z.ZodOptional<z.ZodString>;
242
+ update: z.ZodOptional<z.ZodString>;
243
+ select: z.ZodOptional<z.ZodString>;
244
+ }, z.core.$strict>]>>;
245
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
246
+ insert: z.ZodOptional<z.ZodString>;
247
+ update: z.ZodOptional<z.ZodString>;
248
+ select: z.ZodOptional<z.ZodString>;
249
+ }, z.core.$strict>]>>;
250
+ }, z.core.$strict>>;
251
+ type: z.ZodOptional<z.ZodObject<{
252
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
253
+ insert: z.ZodOptional<z.ZodString>;
254
+ update: z.ZodOptional<z.ZodString>;
255
+ select: z.ZodOptional<z.ZodString>;
256
+ }, z.core.$strict>]>>;
257
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
258
+ insert: z.ZodOptional<z.ZodString>;
259
+ update: z.ZodOptional<z.ZodString>;
260
+ select: z.ZodOptional<z.ZodString>;
261
+ }, z.core.$strict>]>>;
262
+ }, z.core.$strict>>;
263
+ }, z.core.$strict>>;
116
264
  validation: z.ZodOptional<z.ZodObject<{
117
265
  useShared: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
118
266
  library: z.ZodOptional<z.ZodDefault<z.ZodEnum<{
@@ -122,6 +270,36 @@ declare const ConfigSchema: z.ZodObject<{
122
270
  }>>>;
123
271
  importPath: z.ZodOptional<z.ZodString>;
124
272
  schemaSuffix: z.ZodOptional<z.ZodString>;
273
+ affix: z.ZodOptional<z.ZodObject<{
274
+ tableCase: z.ZodOptional<z.ZodEnum<{
275
+ preserve: "preserve";
276
+ pascal: "pascal";
277
+ }>>;
278
+ schema: z.ZodOptional<z.ZodObject<{
279
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
280
+ insert: z.ZodOptional<z.ZodString>;
281
+ update: z.ZodOptional<z.ZodString>;
282
+ select: z.ZodOptional<z.ZodString>;
283
+ }, z.core.$strict>]>>;
284
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
285
+ insert: z.ZodOptional<z.ZodString>;
286
+ update: z.ZodOptional<z.ZodString>;
287
+ select: z.ZodOptional<z.ZodString>;
288
+ }, z.core.$strict>]>>;
289
+ }, z.core.$strict>>;
290
+ type: z.ZodOptional<z.ZodObject<{
291
+ prefix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
292
+ insert: z.ZodOptional<z.ZodString>;
293
+ update: z.ZodOptional<z.ZodString>;
294
+ select: z.ZodOptional<z.ZodString>;
295
+ }, z.core.$strict>]>>;
296
+ suffix: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodObject<{
297
+ insert: z.ZodOptional<z.ZodString>;
298
+ update: z.ZodOptional<z.ZodString>;
299
+ select: z.ZodOptional<z.ZodString>;
300
+ }, z.core.$strict>]>>;
301
+ }, z.core.$strict>>;
302
+ }, z.core.$strict>>;
125
303
  }, z.core.$strip>>;
126
304
  templateOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
127
305
  }, z.core.$strip>>>;
@@ -129,6 +307,27 @@ declare const ConfigSchema: z.ZodObject<{
129
307
  type DrzlConfigInput = z.input<typeof ConfigSchema>;
130
308
  type DrzlConfig = z.output<typeof ConfigSchema>;
131
309
  declare function defineConfig<T extends DrzlConfigInput>(cfg: T): T;
310
+ /**
311
+ * Fill in cross-generator defaults and refuse configs whose generators would disagree.
312
+ *
313
+ * An oRPC router that imports shared schemas has to spell the exact names the validation
314
+ * generator exported. Both sides used to be configured independently, so they could silently
315
+ * drift into a router that does not compile. When an oRPC generator uses shared validation
316
+ * and exactly one sibling generator produces that library, its `affix` is copied across.
317
+ *
318
+ * Deliberately conservative about the pre-existing flat `schemaSuffix`: a disagreement there
319
+ * is only reported, never repaired, because repairing it would change the bytes an existing
320
+ * config emits.
321
+ *
322
+ * `importExtension` is pushed down here too. A consumer compiles the whole generated tree
323
+ * with one tsconfig, so the setting that has to hold is the same for every generator, and
324
+ * every call site downstream can then read it off the generator without knowing about the
325
+ * top-level default.
326
+ */
327
+ declare function resolveConfig(cfg: DrzlConfig): {
328
+ config: DrzlConfig;
329
+ warnings: string[];
330
+ };
132
331
  declare function loadConfig(customPath?: string): Promise<DrzlConfig | null>;
133
332
  /** Absolute output dirs for all generators (to ignore in watcher). */
134
333
  declare function computeGeneratorOutputDirs(cfg: DrzlConfig, cwd?: string): string[];
@@ -137,4 +336,4 @@ declare function resolveTemplateDirsSync(cfg: DrzlConfig, cwd?: string): string[
137
336
  /** Build watch targets (exclude output dirs; watcher will ignore those). */
138
337
  declare function computeWatchTargets(cfg: DrzlConfig, cwd?: string): string[];
139
338
 
140
- export { AnalyzerSchema, ConfigSchema, type DrzlConfig, type DrzlConfigInput, GeneratorSchema, NamingSchema, computeGeneratorOutputDirs, computeWatchTargets, defineConfig, loadConfig, resolveTemplateDirsSync };
339
+ export { AffixSchema, AnalyzerSchema, ConfigSchema, type DrzlConfig, type DrzlConfigInput, GeneratorSchema, ImportExtensionSchema, NamingSchema, computeGeneratorOutputDirs, computeWatchTargets, defineConfig, loadConfig, resolveConfig, resolveTemplateDirsSync };
package/dist/config.js CHANGED
@@ -1,23 +1,29 @@
1
1
  import {
2
+ AffixSchema,
2
3
  AnalyzerSchema,
3
4
  ConfigSchema,
4
5
  GeneratorSchema,
6
+ ImportExtensionSchema,
5
7
  NamingSchema,
6
8
  computeGeneratorOutputDirs,
7
9
  computeWatchTargets,
8
10
  defineConfig,
9
11
  loadConfig,
12
+ resolveConfig,
10
13
  resolveTemplateDirsSync
11
- } from "./chunk-MEPFGJIF.js";
14
+ } from "./chunk-HHT7INUJ.js";
12
15
  export {
16
+ AffixSchema,
13
17
  AnalyzerSchema,
14
18
  ConfigSchema,
15
19
  GeneratorSchema,
20
+ ImportExtensionSchema,
16
21
  NamingSchema,
17
22
  computeGeneratorOutputDirs,
18
23
  computeWatchTargets,
19
24
  defineConfig,
20
25
  loadConfig,
26
+ resolveConfig,
21
27
  resolveTemplateDirsSync
22
28
  };
23
29
  //# sourceMappingURL=config.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drzl/cli",
3
- "version": "1.1.0",
3
+ "version": "2.0.1",
4
4
  "private": false,
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -29,17 +29,19 @@
29
29
  "cli-progress": "^3.12.0",
30
30
  "zod": "^4.1.5",
31
31
  "jiti": "^2.5.1",
32
- "@drzl/analyzer": "^1.2.0",
33
- "@drzl/generator-orpc": "^1.1.0",
34
- "@drzl/generator-zod": "^1.1.0",
35
- "@drzl/generator-service": "^1.1.0",
36
- "@drzl/generator-valibot": "^1.1.0",
37
- "@drzl/generator-arktype": "^1.2.0"
32
+ "@drzl/analyzer": "^1.4.0",
33
+ "@drzl/generator-orpc": "^2.2.0",
34
+ "@drzl/generator-zod": "^2.0.0",
35
+ "@drzl/generator-service": "^2.0.1",
36
+ "@drzl/generator-valibot": "^2.0.0",
37
+ "@drzl/generator-arktype": "^2.0.0",
38
+ "@drzl/validation-core": "^2.0.0"
38
39
  },
39
40
  "devDependencies": {
41
+ "drizzle-orm": "^0.45.2",
42
+ "ts-node": "^10.9.2",
40
43
  "tsup": "^8.5.0",
41
- "typescript": "^5.9.2",
42
- "ts-node": "^10.9.2"
44
+ "typescript": "^5.9.2"
43
45
  },
44
46
  "engines": {
45
47
  "node": ">=18.17.0"