@formspec/build 0.1.0-alpha.15 → 0.1.0-alpha.16

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.
Files changed (42) hide show
  1. package/dist/__tests__/fixtures/edge-cases.d.ts +11 -0
  2. package/dist/__tests__/fixtures/edge-cases.d.ts.map +1 -1
  3. package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts +30 -0
  4. package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts.map +1 -0
  5. package/dist/__tests__/mixed-authoring.test.d.ts +2 -0
  6. package/dist/__tests__/mixed-authoring.test.d.ts.map +1 -0
  7. package/dist/__tests__/parity/utils.d.ts +5 -3
  8. package/dist/__tests__/parity/utils.d.ts.map +1 -1
  9. package/dist/analyzer/class-analyzer.d.ts +4 -2
  10. package/dist/analyzer/class-analyzer.d.ts.map +1 -1
  11. package/dist/analyzer/tsdoc-parser.d.ts +20 -2
  12. package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
  13. package/dist/browser.cjs +172 -17
  14. package/dist/browser.cjs.map +1 -1
  15. package/dist/browser.d.ts.map +1 -1
  16. package/dist/browser.js +172 -17
  17. package/dist/browser.js.map +1 -1
  18. package/dist/build.d.ts +39 -1
  19. package/dist/canonicalize/tsdoc-canonicalizer.d.ts.map +1 -1
  20. package/dist/cli.cjs +634 -88
  21. package/dist/cli.cjs.map +1 -1
  22. package/dist/cli.js +634 -88
  23. package/dist/cli.js.map +1 -1
  24. package/dist/generators/mixed-authoring.d.ts +45 -0
  25. package/dist/generators/mixed-authoring.d.ts.map +1 -0
  26. package/dist/index.cjs +622 -87
  27. package/dist/index.cjs.map +1 -1
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +621 -87
  31. package/dist/index.js.map +1 -1
  32. package/dist/internals.cjs +526 -91
  33. package/dist/internals.cjs.map +1 -1
  34. package/dist/internals.js +526 -91
  35. package/dist/internals.js.map +1 -1
  36. package/dist/json-schema/ir-generator.d.ts +3 -2
  37. package/dist/json-schema/ir-generator.d.ts.map +1 -1
  38. package/dist/ui-schema/ir-generator.d.ts.map +1 -1
  39. package/dist/validate/constraint-validator.d.ts.map +1 -1
  40. package/package.json +3 -3
  41. package/dist/__tests__/jsdoc-constraints.test.d.ts +0 -9
  42. package/dist/__tests__/jsdoc-constraints.test.d.ts.map +0 -1
package/dist/build.d.ts CHANGED
@@ -30,6 +30,7 @@ import type { ExtensionDefinition } from '@formspec/core';
30
30
  import type { FormElement } from '@formspec/core';
31
31
  import type { FormIR } from '@formspec/core';
32
32
  import type { FormSpec } from '@formspec/core';
33
+ import type { JsonValue } from '@formspec/core';
33
34
  import { z } from 'zod';
34
35
 
35
36
  /**
@@ -69,6 +70,32 @@ export declare function buildFormSchemas<E extends readonly FormElement[]>(form:
69
70
  */
70
71
  export declare type BuildFormSchemasOptions = GenerateJsonSchemaOptions;
71
72
 
73
+ /**
74
+ * Builds JSON Schema and UI Schema from a TSDoc-derived model with ChainDSL
75
+ * field overlays.
76
+ *
77
+ * Overlays are matched by field name. The static model wins for structure,
78
+ * ordering, and constraints; ChainDSL overlays may contribute dynamic runtime
79
+ * field metadata such as dynamic enum or dynamic schema keywords, and may fill
80
+ * in missing annotations.
81
+ */
82
+ export declare function buildMixedAuthoringSchemas(options: BuildMixedAuthoringSchemasOptions): MixedAuthoringSchemas;
83
+
84
+ /**
85
+ * Options for generating mixed-authoring schemas.
86
+ *
87
+ * The `typeName` can resolve to a class, interface, or object type alias, just
88
+ * like `generateSchemas()`.
89
+ */
90
+ export declare interface BuildMixedAuthoringSchemasOptions extends GenerateJsonSchemaFromIROptions {
91
+ /** Path to the TypeScript source file. */
92
+ readonly filePath: string;
93
+ /** Name of the class, interface, or type alias to analyze. */
94
+ readonly typeName: string;
95
+ /** ChainDSL overlays to apply to the static model. Groups and conditionals are flattened by field name. */
96
+ readonly overlays: FormSpec<readonly FormElement[]>;
97
+ }
98
+
72
99
  /**
73
100
  * Result of building form schemas.
74
101
  */
@@ -538,7 +565,7 @@ export declare interface JsonSchema2020 {
538
565
  items?: JsonSchema2020;
539
566
  additionalProperties?: boolean | JsonSchema2020;
540
567
  enum?: readonly (string | number)[];
541
- const?: string | number | boolean | null;
568
+ const?: JsonValue;
542
569
  allOf?: readonly JsonSchema2020[];
543
570
  oneOf?: readonly JsonSchema2020[];
544
571
  anyOf?: readonly JsonSchema2020[];
@@ -553,6 +580,7 @@ export declare interface JsonSchema2020 {
553
580
  maxItems?: number;
554
581
  pattern?: string;
555
582
  uniqueItems?: boolean;
583
+ format?: string;
556
584
  title?: string;
557
585
  description?: string;
558
586
  default?: unknown;
@@ -726,6 +754,16 @@ export declare const labelElementSchema: z.ZodObject<{
726
754
  options: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
727
755
  }, z.ZodTypeAny, "passthrough">>;
728
756
 
757
+ /**
758
+ * Result of generating schemas from a mixed-authoring composition.
759
+ */
760
+ export declare interface MixedAuthoringSchemas {
761
+ /** JSON Schema 2020-12 for validation. */
762
+ readonly jsonSchema: JsonSchema2020;
763
+ /** JSON Forms UI Schema for rendering. */
764
+ readonly uiSchema: UISchema;
765
+ }
766
+
729
767
  /**
730
768
  * Rule for conditional element visibility/enablement.
731
769
  */
@@ -1 +1 @@
1
- {"version":3,"file":"tsdoc-canonicalizer.d.ts","sourceRoot":"","sources":["../../src/canonicalize/tsdoc-canonicalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,MAAM,EAMP,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,+BAA+B,CAAC;AAE1F;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAmBzF"}
1
+ {"version":3,"file":"tsdoc-canonicalizer.d.ts","sourceRoot":"","sources":["../../src/canonicalize/tsdoc-canonicalizer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EACV,MAAM,EAMP,MAAM,gBAAgB,CAAC;AAExB,OAAO,KAAK,EAAE,eAAe,EAAuB,MAAM,+BAA+B,CAAC;AAE1F;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,wCAAwC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,MAAM,CAqBzF"}