@formspec/build 0.1.0-alpha.38 → 0.1.0-alpha.39

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.
@@ -12,6 +12,7 @@ import { type DiscriminatorResolutionOptions, type IRClassAnalysis } from "../an
12
12
  import { type TSDocSource } from "../canonicalize/index.js";
13
13
  import { type GenerateJsonSchemaFromIROptions, type JsonSchema2020 } from "../json-schema/ir-generator.js";
14
14
  import type { ExtensionRegistry } from "../extensions/index.js";
15
+ import { type ValidationDiagnostic } from "../validate/index.js";
15
16
  export type { DiscriminatorResolutionOptions } from "../analyzer/class-analyzer.js";
16
17
  /**
17
18
  * Generated schemas for a class.
@@ -24,6 +25,63 @@ export interface ClassSchemas {
24
25
  /** JSON Forms UI Schema for rendering */
25
26
  uiSchema: UISchema;
26
27
  }
28
+ /**
29
+ * Non-throwing schema generation result with structured diagnostics.
30
+ *
31
+ * @public
32
+ */
33
+ export interface DetailedClassSchemasResult {
34
+ /** Whether schema generation completed without error-severity diagnostics. */
35
+ readonly ok: boolean;
36
+ /** Collected analysis and validation diagnostics for this target. */
37
+ readonly diagnostics: readonly ValidationDiagnostic[];
38
+ /** JSON Schema 2020-12 for validation, when generation succeeds. */
39
+ readonly jsonSchema?: JsonSchema2020 | undefined;
40
+ /** JSON Forms UI Schema for rendering, when generation succeeds. */
41
+ readonly uiSchema?: UISchema | undefined;
42
+ }
43
+ /**
44
+ * A batch target for non-throwing schema generation.
45
+ *
46
+ * @public
47
+ */
48
+ export interface SchemaGenerationTarget {
49
+ /** Path to the TypeScript source file. */
50
+ readonly filePath: string;
51
+ /** Name of the exported class, interface, or type alias to analyze. */
52
+ readonly typeName: string;
53
+ }
54
+ /**
55
+ * Batch options for non-throwing schema generation.
56
+ *
57
+ * @public
58
+ */
59
+ export interface GenerateSchemasBatchOptions extends StaticSchemaGenerationOptions {
60
+ /** Targets to analyze and generate. */
61
+ readonly targets: readonly SchemaGenerationTarget[];
62
+ }
63
+ /**
64
+ * Batch options for non-throwing schema generation using an existing program.
65
+ *
66
+ * @public
67
+ */
68
+ export interface GenerateSchemasBatchFromProgramOptions extends StaticSchemaGenerationOptions {
69
+ /** Existing TypeScript program supplied by the caller. */
70
+ readonly program: ts.Program;
71
+ /** Targets to analyze and generate. */
72
+ readonly targets: readonly SchemaGenerationTarget[];
73
+ }
74
+ /**
75
+ * Result for a single target in a batch generation request.
76
+ *
77
+ * @public
78
+ */
79
+ export interface DetailedSchemaGenerationTargetResult extends DetailedClassSchemasResult {
80
+ /** Path to the TypeScript source file. */
81
+ readonly filePath: string;
82
+ /** Name of the exported class, interface, or type alias that was analyzed. */
83
+ readonly typeName: string;
84
+ }
27
85
  /**
28
86
  * Generates JSON Schema 2020-12 and UI Schema from an IR class analysis.
29
87
  *
@@ -37,6 +95,15 @@ export interface ClassSchemas {
37
95
  export declare function generateClassSchemas(analysis: IRClassAnalysis, source?: TSDocSource, options?: GenerateJsonSchemaFromIROptions & {
38
96
  metadata?: MetadataPolicyInput | undefined;
39
97
  }): ClassSchemas;
98
+ /**
99
+ * Generates JSON Schema 2020-12 and UI Schema from an IR class analysis
100
+ * without throwing on validation diagnostics.
101
+ *
102
+ * @public
103
+ */
104
+ export declare function generateClassSchemasDetailed(analysis: IRClassAnalysis, source?: TSDocSource, options?: GenerateJsonSchemaFromIROptions & {
105
+ metadata?: MetadataPolicyInput | undefined;
106
+ }): DetailedClassSchemasResult;
40
107
  /**
41
108
  * Shared options for schema generation flows that support custom extensions.
42
109
  *
@@ -91,6 +158,10 @@ export interface GenerateSchemasFromProgramOptions extends StaticSchemaGeneratio
91
158
  readonly filePath: string;
92
159
  /** Name of the exported class, interface, or type alias to analyze */
93
160
  readonly typeName: string;
161
+ /**
162
+ * Controls whether error-severity diagnostics throw or are returned in the result.
163
+ */
164
+ readonly errorReporting: "throw" | "diagnostics";
94
165
  }
95
166
  /**
96
167
  * Generates JSON Schema and UI Schema from a decorated TypeScript class.
@@ -121,9 +192,13 @@ export declare function generateSchemasFromClass(options: GenerateFromClassOptio
121
192
  */
122
193
  export interface GenerateSchemasOptions extends StaticSchemaGenerationOptions {
123
194
  /** Path to the TypeScript source file */
124
- filePath: string;
195
+ readonly filePath: string;
125
196
  /** Name of the exported class, interface, or type alias to analyze */
126
- typeName: string;
197
+ readonly typeName: string;
198
+ /**
199
+ * Controls whether error-severity diagnostics throw or are returned in the result.
200
+ */
201
+ readonly errorReporting: "throw" | "diagnostics";
127
202
  }
128
203
  /**
129
204
  * Generates JSON Schema and UI Schema from a named TypeScript
@@ -138,26 +213,130 @@ export interface GenerateSchemasOptions extends StaticSchemaGenerationOptions {
138
213
  * const result = generateSchemas({
139
214
  * filePath: "./src/config.ts",
140
215
  * typeName: "DiscountConfig",
216
+ * errorReporting: "throw",
141
217
  * });
142
218
  * ```
219
+ */
220
+ /**
221
+ * Generates JSON Schema and UI Schema from a named type and throws when
222
+ * generation reports error-severity diagnostics.
223
+ *
224
+ * @param options - File path, type name, and explicit throw-on-error reporting
225
+ * @returns Generated JSON Schema and UI Schema
143
226
  *
227
+ * @public
228
+ */
229
+ export declare function generateSchemas(options: GenerateSchemasOptions & {
230
+ readonly errorReporting: "throw";
231
+ }): GenerateFromClassResult;
232
+ /**
233
+ * Generates JSON Schema and UI Schema from a named type and returns structured
234
+ * diagnostics instead of throwing on validation or analysis failures.
235
+ *
236
+ * @param options - File path, type name, and explicit diagnostics reporting
237
+ * @returns Structured generation result with diagnostics
238
+ *
239
+ * @public
240
+ */
241
+ export declare function generateSchemas(options: GenerateSchemasOptions & {
242
+ readonly errorReporting: "diagnostics";
243
+ }): DetailedClassSchemasResult;
244
+ /**
245
+ * Generates JSON Schema and UI Schema from a named type.
246
+ *
247
+ * @deprecated Pass `errorReporting` explicitly. Omitting it defaults to `"throw"` only for backward compatibility.
144
248
  * @param options - File path and type name
145
249
  * @returns Generated JSON Schema and UI Schema
146
250
  *
147
251
  * @public
148
252
  */
149
- export declare function generateSchemas(options: GenerateSchemasOptions): GenerateFromClassResult;
253
+ export declare function generateSchemas(options: StaticSchemaGenerationOptions & {
254
+ readonly filePath: string;
255
+ readonly typeName: string;
256
+ }): GenerateFromClassResult;
150
257
  /**
151
258
  * Generates JSON Schema and UI Schema from a named type within an existing
152
259
  * TypeScript program supplied by the caller.
153
260
  *
154
261
  * This low-level entry point lets downstream tooling reuse a host-owned
155
262
  * `Program` for both FormSpec extraction and other TypeScript analysis.
263
+ */
264
+ /**
265
+ * Generates JSON Schema and UI Schema from a named type within an existing
266
+ * TypeScript program and throws when generation reports error-severity diagnostics.
156
267
  *
157
- * @param options - Host program, file path, type name, and optional schema generation options
268
+ * @param options - Host program, file path, type name, and explicit throw-on-error reporting
158
269
  * @returns Generated JSON Schema and UI Schema
159
270
  *
160
271
  * @public
161
272
  */
162
- export declare function generateSchemasFromProgram(options: GenerateSchemasFromProgramOptions): GenerateFromClassResult;
273
+ export declare function generateSchemasFromProgram(options: GenerateSchemasFromProgramOptions & {
274
+ readonly errorReporting: "throw";
275
+ }): GenerateFromClassResult;
276
+ /**
277
+ * Generates JSON Schema and UI Schema from a named type within an existing
278
+ * TypeScript program and returns structured diagnostics instead of throwing on
279
+ * validation or analysis failures.
280
+ *
281
+ * @param options - Host program, file path, type name, and explicit diagnostics reporting
282
+ * @returns Structured generation result with diagnostics
283
+ *
284
+ * @public
285
+ */
286
+ export declare function generateSchemasFromProgram(options: GenerateSchemasFromProgramOptions & {
287
+ readonly errorReporting: "diagnostics";
288
+ }): DetailedClassSchemasResult;
289
+ /**
290
+ * Generates JSON Schema and UI Schema from a named type within an existing
291
+ * TypeScript program.
292
+ *
293
+ * @deprecated Pass `errorReporting` explicitly. Omitting it defaults to `"throw"` only for backward compatibility.
294
+ * @param options - Host program, file path, and type name
295
+ * @returns Generated JSON Schema and UI Schema
296
+ *
297
+ * @public
298
+ */
299
+ export declare function generateSchemasFromProgram(options: StaticSchemaGenerationOptions & {
300
+ readonly program: ts.Program;
301
+ readonly filePath: string;
302
+ readonly typeName: string;
303
+ }): GenerateFromClassResult;
304
+ /**
305
+ * Generates JSON Schema and UI Schema from a named type and returns structured
306
+ * diagnostics instead of throwing on validation or analysis failures.
307
+ * @deprecated Use `generateSchemas({ ...options, errorReporting: "diagnostics" })` instead.
308
+ *
309
+ * @public
310
+ */
311
+ export declare function generateSchemasDetailed(options: StaticSchemaGenerationOptions & {
312
+ readonly filePath: string;
313
+ readonly typeName: string;
314
+ }): DetailedClassSchemasResult;
315
+ /**
316
+ * Generates JSON Schema and UI Schema from a named type within an existing
317
+ * TypeScript program and returns structured diagnostics instead of throwing on
318
+ * validation or analysis failures.
319
+ * @deprecated Use `generateSchemasFromProgram({ ...options, errorReporting: "diagnostics" })` instead.
320
+ *
321
+ * @public
322
+ */
323
+ export declare function generateSchemasFromProgramDetailed(options: StaticSchemaGenerationOptions & {
324
+ readonly program: ts.Program;
325
+ readonly filePath: string;
326
+ readonly typeName: string;
327
+ }): DetailedClassSchemasResult;
328
+ /**
329
+ * Generates schemas for many targets and returns per-target diagnostics instead
330
+ * of failing on the first problem.
331
+ *
332
+ * @public
333
+ */
334
+ export declare function generateSchemasBatch(options: GenerateSchemasBatchOptions): readonly DetailedSchemaGenerationTargetResult[];
335
+ /**
336
+ * Generates schemas for many targets from an existing TypeScript program and
337
+ * returns per-target diagnostics instead of failing on the first problem.
338
+ *
339
+ * @public
340
+ */
341
+ export declare function generateSchemasBatchFromProgram(options: GenerateSchemasBatchFromProgramOptions): readonly DetailedSchemaGenerationTargetResult[];
163
342
  //# sourceMappingURL=class-schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"class-schema.d.ts","sourceRoot":"","sources":["../../src/generators/class-schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AACjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAO1D,OAA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type { UISchema } from "../ui-schema/types.js";
3
4
  import type { StaticBuildContext } from "../static-build.js";
4
5
  import { type StaticSchemaGenerationOptions } from "./class-schema.js";
@@ -16,6 +17,14 @@ export interface DiscoveredTypeSchemas {
16
17
  readonly jsonSchema: JsonSchema2020;
17
18
  /** UI Schema for object-shaped roots, or `null` when not applicable. */
18
19
  readonly uiSchema: UISchema | null;
20
+ /**
21
+ * Resolved type-level metadata used during generation, when available.
22
+ *
23
+ * This preserves explicit and inferred naming metadata such as singular and
24
+ * plural API/display names for consumers that need the resolved values in
25
+ * addition to the emitted schema artifacts.
26
+ */
27
+ readonly resolvedMetadata?: ResolvedMetadata | undefined;
19
28
  }
20
29
  /**
21
30
  * Supported declaration kinds for declaration-driven schema generation.
@@ -1 +1 @@
1
- {"version":3,"file":"discovered-schema.d.ts","sourceRoot":"","sources":["../../src/generators/discovered-schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAQjC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAU7D,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAA4B,KAAK,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAK/F;;;;;;;GAOG;AACH,MAAM,WAAW,qBAAqB;IACpC,iDAAiD;IACjD,QAAQ,CAAC,UAAU,EAAE,cAAc,CAAC;IACpC,wEAAwE;IACxE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CACpC;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAC/B,EAAE,CAAC,gBAAgB,GACnB,EAAE,CAAC,oBAAoB,GACvB,EAAE,CAAC,oBAAoB,CAAC;AAE5B;;;;GAIG;AACH,MAAM,WAAW,qCAAsC,SAAQ,6BAA6B;IAC1F,4EAA4E;IAC5E,QAAQ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