@formspec/build 0.1.0-alpha.22 → 0.1.0-alpha.23
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/README.md +9 -4
- package/dist/analyzer/class-analyzer.d.ts +1 -1
- package/dist/analyzer/class-analyzer.d.ts.map +1 -1
- package/dist/analyzer/jsdoc-constraints.d.ts +1 -1
- package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
- package/dist/browser.cjs +5 -4
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +4 -3
- package/dist/browser.js.map +1 -1
- package/dist/build-alpha.d.ts +836 -0
- package/dist/build-beta.d.ts +836 -0
- package/dist/build-internal.d.ts +836 -0
- package/dist/build.d.ts +157 -538
- package/dist/canonicalize/chain-dsl-canonicalizer.d.ts +2 -1
- package/dist/canonicalize/chain-dsl-canonicalizer.d.ts.map +1 -1
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts +1 -1
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts.map +1 -1
- package/dist/cli.cjs +82 -126
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +72 -116
- package/dist/cli.js.map +1 -1
- package/dist/generators/class-schema.d.ts +20 -3
- package/dist/generators/class-schema.d.ts.map +1 -1
- package/dist/generators/mixed-authoring.d.ts +3 -2
- package/dist/generators/mixed-authoring.d.ts.map +1 -1
- package/dist/index.cjs +79 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +4 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +72 -101
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +77 -15
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.d.ts +2 -1
- package/dist/internals.d.ts.map +1 -1
- package/dist/internals.js +69 -7
- package/dist/internals.js.map +1 -1
- package/dist/json-schema/generator.d.ts +8 -4
- package/dist/json-schema/generator.d.ts.map +1 -1
- package/dist/json-schema/ir-generator.d.ts +4 -4
- package/dist/json-schema/ir-generator.d.ts.map +1 -1
- package/dist/json-schema/schema.d.ts +2 -2
- package/dist/json-schema/types.d.ts +6 -6
- package/dist/ui-schema/ir-generator.d.ts +1 -1
- package/dist/ui-schema/ir-generator.d.ts.map +1 -1
- package/dist/ui-schema/schema.d.ts +28 -28
- package/dist/ui-schema/types.d.ts +152 -3
- package/dist/ui-schema/types.d.ts.map +1 -1
- package/dist/validate/constraint-validator.d.ts +1 -1
- package/dist/validate/constraint-validator.d.ts.map +1 -1
- package/package.json +8 -8
- package/dist/__tests__/alias-chain-propagation.test.d.ts +0 -9
- package/dist/__tests__/alias-chain-propagation.test.d.ts.map +0 -1
- package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts +0 -2
- package/dist/__tests__/chain-dsl-canonicalizer.test.d.ts.map +0 -1
- package/dist/__tests__/class-schema.test.d.ts +0 -2
- package/dist/__tests__/class-schema.test.d.ts.map +0 -1
- package/dist/__tests__/cli.test.d.ts +0 -2
- package/dist/__tests__/cli.test.d.ts.map +0 -1
- package/dist/__tests__/constraint-validator.test.d.ts +0 -2
- package/dist/__tests__/constraint-validator.test.d.ts.map +0 -1
- package/dist/__tests__/date-extension.integration.test.d.ts +0 -2
- package/dist/__tests__/date-extension.integration.test.d.ts.map +0 -1
- package/dist/__tests__/edge-cases.test.d.ts +0 -7
- package/dist/__tests__/edge-cases.test.d.ts.map +0 -1
- package/dist/__tests__/extension-api.test.d.ts +0 -2
- package/dist/__tests__/extension-api.test.d.ts.map +0 -1
- package/dist/__tests__/extension-runtime.integration.test.d.ts +0 -2
- package/dist/__tests__/extension-runtime.integration.test.d.ts.map +0 -1
- package/dist/__tests__/fixtures/alias-chains.d.ts +0 -37
- package/dist/__tests__/fixtures/alias-chains.d.ts.map +0 -1
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts +0 -86
- package/dist/__tests__/fixtures/class-schema-regressions.d.ts.map +0 -1
- package/dist/__tests__/fixtures/edge-cases.d.ts +0 -132
- package/dist/__tests__/fixtures/edge-cases.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-a-builtins.d.ts +0 -31
- package/dist/__tests__/fixtures/example-a-builtins.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-date-extension.d.ts +0 -12
- package/dist/__tests__/fixtures/example-date-extension.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-interface-types.d.ts +0 -107
- package/dist/__tests__/fixtures/example-interface-types.d.ts.map +0 -1
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts +0 -20
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts.map +0 -1
- package/dist/__tests__/fixtures/extension-forms.d.ts +0 -7
- package/dist/__tests__/fixtures/extension-forms.d.ts.map +0 -1
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts +0 -31
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts.map +0 -1
- package/dist/__tests__/fixtures/named-primitive-aliases.d.ts +0 -15
- package/dist/__tests__/fixtures/named-primitive-aliases.d.ts.map +0 -1
- package/dist/__tests__/fixtures/nested-array-path-constraints.d.ts +0 -14
- package/dist/__tests__/fixtures/nested-array-path-constraints.d.ts.map +0 -1
- package/dist/__tests__/fixtures/sample-forms.d.ts +0 -65
- package/dist/__tests__/fixtures/sample-forms.d.ts.map +0 -1
- package/dist/__tests__/generate-schemas.test.d.ts +0 -2
- package/dist/__tests__/generate-schemas.test.d.ts.map +0 -1
- package/dist/__tests__/generator.test.d.ts +0 -2
- package/dist/__tests__/generator.test.d.ts.map +0 -1
- package/dist/__tests__/guards.test.d.ts +0 -2
- package/dist/__tests__/guards.test.d.ts.map +0 -1
- package/dist/__tests__/integration.test.d.ts +0 -8
- package/dist/__tests__/integration.test.d.ts.map +0 -1
- package/dist/__tests__/ir-analyzer.test.d.ts +0 -11
- package/dist/__tests__/ir-analyzer.test.d.ts.map +0 -1
- package/dist/__tests__/ir-jsdoc-constraints.test.d.ts +0 -12
- package/dist/__tests__/ir-jsdoc-constraints.test.d.ts.map +0 -1
- package/dist/__tests__/ir-json-schema-generator.test.d.ts +0 -11
- package/dist/__tests__/ir-json-schema-generator.test.d.ts.map +0 -1
- package/dist/__tests__/ir-ui-schema-generator.test.d.ts +0 -2
- package/dist/__tests__/ir-ui-schema-generator.test.d.ts.map +0 -1
- package/dist/__tests__/mixed-authoring.test.d.ts +0 -2
- package/dist/__tests__/mixed-authoring.test.d.ts.map +0 -1
- package/dist/__tests__/numeric-extension.integration.test.d.ts +0 -2
- package/dist/__tests__/numeric-extension.integration.test.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/address/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/address/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/address/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts +0 -6
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts +0 -17
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts +0 -13
- package/dist/__tests__/parity/fixtures/product-config/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/product-config/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts +0 -28
- package/dist/__tests__/parity/fixtures/product-config/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts +0 -6
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts +0 -12
- package/dist/__tests__/parity/fixtures/user-registration/chain-dsl.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts +0 -9
- package/dist/__tests__/parity/fixtures/user-registration/expected-ir.d.ts.map +0 -1
- package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts +0 -19
- package/dist/__tests__/parity/fixtures/user-registration/tsdoc.d.ts.map +0 -1
- package/dist/__tests__/parity/parity.test.d.ts +0 -18
- package/dist/__tests__/parity/parity.test.d.ts.map +0 -1
- package/dist/__tests__/parity/utils.d.ts +0 -152
- package/dist/__tests__/parity/utils.d.ts.map +0 -1
- package/dist/__tests__/path-target-parser.test.d.ts +0 -9
- package/dist/__tests__/path-target-parser.test.d.ts.map +0 -1
- package/dist/__tests__/write-schemas.test.d.ts +0 -2
- package/dist/__tests__/write-schemas.test.d.ts.map +0 -1
|
@@ -4,15 +4,19 @@
|
|
|
4
4
|
* Routes through the canonical IR pipeline: Chain DSL → FormIR → JSON Schema 2020-12.
|
|
5
5
|
*/
|
|
6
6
|
import type { FormElement, FormSpec } from "@formspec/core";
|
|
7
|
-
import { type
|
|
7
|
+
import { type JsonSchema2020 } from "./ir-generator.js";
|
|
8
8
|
/**
|
|
9
9
|
* Options for generating JSON Schema from a Chain DSL form.
|
|
10
10
|
*
|
|
11
|
-
* These options are forwarded to the IR-based JSON Schema generator.
|
|
12
|
-
*
|
|
13
11
|
* @public
|
|
14
12
|
*/
|
|
15
|
-
export
|
|
13
|
+
export interface GenerateJsonSchemaOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Vendor prefix for emitted extension keywords.
|
|
16
|
+
* @defaultValue "x-formspec"
|
|
17
|
+
*/
|
|
18
|
+
readonly vendorPrefix?: string | undefined;
|
|
19
|
+
}
|
|
16
20
|
/**
|
|
17
21
|
* Generates a JSON Schema 2020-12 from a FormSpec.
|
|
18
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/json-schema/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,
|
|
1
|
+
{"version":3,"file":"generator.d.ts","sourceRoot":"","sources":["../../src/json-schema/generator.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE5D,OAAO,EAGL,KAAK,cAAc,EACpB,MAAM,mBAAmB,CAAC;AAE3B;;;;GAIG;AACH,MAAM,WAAW,yBAAyB;IACxC;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,SAAS,WAAW,EAAE,EACjE,IAAI,EAAE,QAAQ,CAAC,CAAC,CAAC,EACjB,OAAO,CAAC,EAAE,yBAAyB,GAClC,cAAc,CAKhB"}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* @see https://json-schema.org/draft/2020-12/schema
|
|
8
8
|
* @see https://json-schema.org/draft/2020-12/schema
|
|
9
9
|
*/
|
|
10
|
-
import type { FormIR
|
|
10
|
+
import type { FormIR } from "@formspec/core/internals";
|
|
11
11
|
import type { ExtensionRegistry } from "../extensions/index.js";
|
|
12
12
|
/**
|
|
13
13
|
* A JSON Schema 2020-12 document, sub-schema, or keyword collection.
|
|
@@ -27,7 +27,7 @@ export interface JsonSchema2020 {
|
|
|
27
27
|
items?: JsonSchema2020;
|
|
28
28
|
additionalProperties?: boolean | JsonSchema2020;
|
|
29
29
|
enum?: readonly (string | number)[];
|
|
30
|
-
const?:
|
|
30
|
+
const?: unknown;
|
|
31
31
|
allOf?: readonly JsonSchema2020[];
|
|
32
32
|
oneOf?: readonly JsonSchema2020[];
|
|
33
33
|
anyOf?: readonly JsonSchema2020[];
|
|
@@ -52,7 +52,7 @@ export interface JsonSchema2020 {
|
|
|
52
52
|
/**
|
|
53
53
|
* Options for generating JSON Schema from a canonical FormIR.
|
|
54
54
|
*
|
|
55
|
-
* @
|
|
55
|
+
* @internal
|
|
56
56
|
*/
|
|
57
57
|
export interface GenerateJsonSchemaFromIROptions {
|
|
58
58
|
/**
|
|
@@ -108,7 +108,7 @@ export interface GenerateJsonSchemaFromIROptions {
|
|
|
108
108
|
* @param ir - The canonical FormIR produced by a canonicalizer
|
|
109
109
|
* @returns A plain JSON-serializable JSON Schema 2020-12 object
|
|
110
110
|
*
|
|
111
|
-
* @
|
|
111
|
+
* @internal
|
|
112
112
|
*/
|
|
113
113
|
export declare function generateJsonSchemaFromIR(ir: FormIR, options?: GenerateJsonSchemaFromIROptions): JsonSchema2020;
|
|
114
114
|
//# sourceMappingURL=ir-generator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-generator.d.ts","sourceRoot":"","sources":["../../src/json-schema/ir-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,MAAM,
|
|
1
|
+
{"version":3,"file":"ir-generator.d.ts","sourceRoot":"","sources":["../../src/json-schema/ir-generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK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,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IAGrB,CAAC,GAAG,EAAE,KAAK,MAAM,EAAE,GAAG,OAAO,CAAC;CAC/B;AAqBD;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C;;;;;OAKG;IACH,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,GAAG,SAAS,CAAC;IAC3D;;;OAGG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC5C;AAqBD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,MAAM,EACV,OAAO,CAAC,EAAE,+BAA+B,GACxC,cAAc,CAwChB"}
|
|
@@ -11,13 +11,13 @@ import type { JSONSchema7 } from "./types.js";
|
|
|
11
11
|
/**
|
|
12
12
|
* Zod schema for JSON Schema primitive type strings.
|
|
13
13
|
*
|
|
14
|
-
* @
|
|
14
|
+
* @internal
|
|
15
15
|
*/
|
|
16
16
|
export declare const jsonSchemaTypeSchema: z.ZodEnum<["string", "number", "integer", "boolean", "object", "array", "null"]>;
|
|
17
17
|
/**
|
|
18
18
|
* Zod schema for the legacy JSON Schema 7 subset used by `@formspec/build`.
|
|
19
19
|
*
|
|
20
|
-
* @
|
|
20
|
+
* @internal
|
|
21
21
|
*/
|
|
22
22
|
export declare const jsonSchema7Schema: z.ZodType<JSONSchema7>;
|
|
23
23
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
/**
|
|
7
7
|
* JSON Schema primitive types.
|
|
8
8
|
*
|
|
9
|
-
* @
|
|
9
|
+
* @beta
|
|
10
10
|
*/
|
|
11
11
|
export type JSONSchemaType = "string" | "number" | "integer" | "boolean" | "object" | "array" | "null";
|
|
12
12
|
/**
|
|
13
13
|
* A JSON Schema definition (legacy subset used by Zod validator and types.ts).
|
|
14
14
|
*
|
|
15
|
-
* @
|
|
15
|
+
* @beta
|
|
16
16
|
*/
|
|
17
17
|
export interface JSONSchema7 {
|
|
18
18
|
$schema?: string;
|
|
@@ -65,13 +65,13 @@ export interface JSONSchema7 {
|
|
|
65
65
|
/**
|
|
66
66
|
* Extension properties for custom FormSpec constraint tags.
|
|
67
67
|
*
|
|
68
|
-
* @
|
|
68
|
+
* @beta
|
|
69
69
|
*/
|
|
70
70
|
export type FormSpecSchemaExtensions = Record<`x-formspec-${string}`, unknown>;
|
|
71
71
|
/**
|
|
72
72
|
* JSON Schema with FormSpec extension properties for arbitrary `x-formspec-*` keys.
|
|
73
73
|
*
|
|
74
|
-
* @
|
|
74
|
+
* @beta
|
|
75
75
|
*/
|
|
76
76
|
export type ExtendedJSONSchema7 = JSONSchema7 & FormSpecSchemaExtensions;
|
|
77
77
|
/**
|
|
@@ -85,7 +85,7 @@ export type ExtendedJSONSchema7 = JSONSchema7 & FormSpecSchemaExtensions;
|
|
|
85
85
|
* @param key - Extension key (must start with `x-formspec-`)
|
|
86
86
|
* @param value - Extension value
|
|
87
87
|
*
|
|
88
|
-
* @
|
|
88
|
+
* @internal
|
|
89
89
|
*/
|
|
90
90
|
export declare function setSchemaExtension(schema: object, key: `x-formspec-${string}`, value: unknown): void;
|
|
91
91
|
/**
|
|
@@ -97,7 +97,7 @@ export declare function setSchemaExtension(schema: object, key: `x-formspec-${st
|
|
|
97
97
|
* @param key - Extension key (must start with `x-formspec-`)
|
|
98
98
|
* @returns The extension value, or `undefined` if not present
|
|
99
99
|
*
|
|
100
|
-
* @
|
|
100
|
+
* @internal
|
|
101
101
|
*/
|
|
102
102
|
export declare function getSchemaExtension(schema: object, key: `x-formspec-${string}`): unknown;
|
|
103
103
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* produces a JSON Forms UI Schema. All downstream UI Schema generation
|
|
6
6
|
* should use this module for UI Schema generation.
|
|
7
7
|
*/
|
|
8
|
-
import type { FormIR } from "@formspec/core";
|
|
8
|
+
import type { FormIR } from "@formspec/core/internals";
|
|
9
9
|
import type { UISchema } from "./types.js";
|
|
10
10
|
/**
|
|
11
11
|
* Generates a JSON Forms UI Schema from a canonical `FormIR`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ir-generator.d.ts","sourceRoot":"","sources":["../../src/ui-schema/ir-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAA6C,MAAM,
|
|
1
|
+
{"version":3,"file":"ir-generator.d.ts","sourceRoot":"","sources":["../../src/ui-schema/ir-generator.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,MAAM,EAA6C,MAAM,0BAA0B,CAAC;AAClG,OAAO,KAAK,EACV,QAAQ,EAMT,MAAM,YAAY,CAAC;AAuLpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyCG;AACH,wBAAgB,sBAAsB,CAAC,EAAE,EAAE,MAAM,GAAG,QAAQ,CAO3D"}
|
|
@@ -10,31 +10,31 @@ import { z } from "zod";
|
|
|
10
10
|
/**
|
|
11
11
|
* Zod schema for rule effect values.
|
|
12
12
|
*
|
|
13
|
-
* @
|
|
13
|
+
* @internal
|
|
14
14
|
*/
|
|
15
15
|
export declare const ruleEffectSchema: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
16
16
|
/**
|
|
17
17
|
* Rule effect types for conditional visibility.
|
|
18
18
|
*
|
|
19
|
-
* @
|
|
19
|
+
* @internal
|
|
20
20
|
*/
|
|
21
21
|
export type RuleEffect = z.infer<typeof ruleEffectSchema>;
|
|
22
22
|
/**
|
|
23
23
|
* Zod schema for UI Schema element type strings.
|
|
24
24
|
*
|
|
25
|
-
* @
|
|
25
|
+
* @internal
|
|
26
26
|
*/
|
|
27
27
|
export declare const uiSchemaElementTypeSchema: z.ZodEnum<["Control", "VerticalLayout", "HorizontalLayout", "Group", "Categorization", "Category", "Label"]>;
|
|
28
28
|
/**
|
|
29
29
|
* UI Schema element types.
|
|
30
30
|
*
|
|
31
|
-
* @
|
|
31
|
+
* @internal
|
|
32
32
|
*/
|
|
33
33
|
export type UISchemaElementType = z.infer<typeof uiSchemaElementTypeSchema>;
|
|
34
34
|
/**
|
|
35
35
|
* JSON Schema subset used in rule conditions.
|
|
36
36
|
*
|
|
37
|
-
* @
|
|
37
|
+
* @internal
|
|
38
38
|
*/
|
|
39
39
|
export interface RuleConditionSchema {
|
|
40
40
|
const?: unknown;
|
|
@@ -53,13 +53,13 @@ export interface RuleConditionSchema {
|
|
|
53
53
|
/**
|
|
54
54
|
* Zod schema for the rule-condition JSON Schema subset.
|
|
55
55
|
*
|
|
56
|
-
* @
|
|
56
|
+
* @internal
|
|
57
57
|
*/
|
|
58
58
|
export declare const ruleConditionSchema: z.ZodType<RuleConditionSchema>;
|
|
59
59
|
/**
|
|
60
60
|
* Zod schema for a schema-based rule condition.
|
|
61
61
|
*
|
|
62
|
-
* @
|
|
62
|
+
* @internal
|
|
63
63
|
*/
|
|
64
64
|
export declare const schemaBasedConditionSchema: z.ZodObject<{
|
|
65
65
|
scope: z.ZodString;
|
|
@@ -74,13 +74,13 @@ export declare const schemaBasedConditionSchema: z.ZodObject<{
|
|
|
74
74
|
/**
|
|
75
75
|
* Condition for a rule.
|
|
76
76
|
*
|
|
77
|
-
* @
|
|
77
|
+
* @internal
|
|
78
78
|
*/
|
|
79
79
|
export type SchemaBasedCondition = z.infer<typeof schemaBasedConditionSchema>;
|
|
80
80
|
/**
|
|
81
81
|
* Zod schema for a UI Schema rule.
|
|
82
82
|
*
|
|
83
|
-
* @
|
|
83
|
+
* @internal
|
|
84
84
|
*/
|
|
85
85
|
export declare const ruleSchema: z.ZodObject<{
|
|
86
86
|
effect: z.ZodEnum<["SHOW", "HIDE", "ENABLE", "DISABLE"]>;
|
|
@@ -110,25 +110,25 @@ export declare const ruleSchema: z.ZodObject<{
|
|
|
110
110
|
/**
|
|
111
111
|
* Rule for conditional element visibility/enablement.
|
|
112
112
|
*
|
|
113
|
-
* @
|
|
113
|
+
* @internal
|
|
114
114
|
*/
|
|
115
115
|
export type Rule = z.infer<typeof ruleSchema>;
|
|
116
116
|
/**
|
|
117
117
|
* Union of all UI Schema element types.
|
|
118
118
|
*
|
|
119
|
-
* @
|
|
119
|
+
* @internal
|
|
120
120
|
*/
|
|
121
121
|
export type UISchemaElement = ControlElement | VerticalLayout | HorizontalLayout | GroupLayout | Categorization | Category | LabelElement;
|
|
122
122
|
/**
|
|
123
123
|
* Zod schema for any UI Schema element.
|
|
124
124
|
*
|
|
125
|
-
* @
|
|
125
|
+
* @internal
|
|
126
126
|
*/
|
|
127
127
|
export declare const uiSchemaElementSchema: z.ZodType<UISchemaElement>;
|
|
128
128
|
/**
|
|
129
129
|
* Zod schema for a Control element.
|
|
130
130
|
*
|
|
131
|
-
* @
|
|
131
|
+
* @internal
|
|
132
132
|
*/
|
|
133
133
|
export declare const controlSchema: z.ZodObject<{
|
|
134
134
|
type: z.ZodLiteral<"Control">;
|
|
@@ -224,13 +224,13 @@ export declare const controlSchema: z.ZodObject<{
|
|
|
224
224
|
/**
|
|
225
225
|
* A Control element that binds to a JSON Schema property.
|
|
226
226
|
*
|
|
227
|
-
* @
|
|
227
|
+
* @internal
|
|
228
228
|
*/
|
|
229
229
|
export type ControlElement = z.infer<typeof controlSchema>;
|
|
230
230
|
/**
|
|
231
231
|
* A vertical layout element.
|
|
232
232
|
*
|
|
233
|
-
* @
|
|
233
|
+
* @internal
|
|
234
234
|
*/
|
|
235
235
|
export interface VerticalLayout {
|
|
236
236
|
type: "VerticalLayout";
|
|
@@ -242,13 +242,13 @@ export interface VerticalLayout {
|
|
|
242
242
|
/**
|
|
243
243
|
* Zod schema for a vertical layout element.
|
|
244
244
|
*
|
|
245
|
-
* @
|
|
245
|
+
* @internal
|
|
246
246
|
*/
|
|
247
247
|
export declare const verticalLayoutSchema: z.ZodType<VerticalLayout>;
|
|
248
248
|
/**
|
|
249
249
|
* A horizontal layout element.
|
|
250
250
|
*
|
|
251
|
-
* @
|
|
251
|
+
* @internal
|
|
252
252
|
*/
|
|
253
253
|
export interface HorizontalLayout {
|
|
254
254
|
type: "HorizontalLayout";
|
|
@@ -260,13 +260,13 @@ export interface HorizontalLayout {
|
|
|
260
260
|
/**
|
|
261
261
|
* Zod schema for a horizontal layout element.
|
|
262
262
|
*
|
|
263
|
-
* @
|
|
263
|
+
* @internal
|
|
264
264
|
*/
|
|
265
265
|
export declare const horizontalLayoutSchema: z.ZodType<HorizontalLayout>;
|
|
266
266
|
/**
|
|
267
267
|
* A group element with a label.
|
|
268
268
|
*
|
|
269
|
-
* @
|
|
269
|
+
* @internal
|
|
270
270
|
*/
|
|
271
271
|
export interface GroupLayout {
|
|
272
272
|
type: "Group";
|
|
@@ -279,13 +279,13 @@ export interface GroupLayout {
|
|
|
279
279
|
/**
|
|
280
280
|
* Zod schema for a group layout element.
|
|
281
281
|
*
|
|
282
|
-
* @
|
|
282
|
+
* @internal
|
|
283
283
|
*/
|
|
284
284
|
export declare const groupLayoutSchema: z.ZodType<GroupLayout>;
|
|
285
285
|
/**
|
|
286
286
|
* A Category element, used inside a Categorization layout.
|
|
287
287
|
*
|
|
288
|
-
* @
|
|
288
|
+
* @internal
|
|
289
289
|
*/
|
|
290
290
|
export interface Category {
|
|
291
291
|
type: "Category";
|
|
@@ -298,13 +298,13 @@ export interface Category {
|
|
|
298
298
|
/**
|
|
299
299
|
* Zod schema for a category element.
|
|
300
300
|
*
|
|
301
|
-
* @
|
|
301
|
+
* @internal
|
|
302
302
|
*/
|
|
303
303
|
export declare const categorySchema: z.ZodType<Category>;
|
|
304
304
|
/**
|
|
305
305
|
* A Categorization element (tab-based layout).
|
|
306
306
|
*
|
|
307
|
-
* @
|
|
307
|
+
* @internal
|
|
308
308
|
*/
|
|
309
309
|
export interface Categorization {
|
|
310
310
|
type: "Categorization";
|
|
@@ -317,13 +317,13 @@ export interface Categorization {
|
|
|
317
317
|
/**
|
|
318
318
|
* Zod schema for a categorization element.
|
|
319
319
|
*
|
|
320
|
-
* @
|
|
320
|
+
* @internal
|
|
321
321
|
*/
|
|
322
322
|
export declare const categorizationSchema: z.ZodType<Categorization>;
|
|
323
323
|
/**
|
|
324
324
|
* Zod schema for a Label element.
|
|
325
325
|
*
|
|
326
|
-
* @
|
|
326
|
+
* @internal
|
|
327
327
|
*/
|
|
328
328
|
export declare const labelElementSchema: z.ZodObject<{
|
|
329
329
|
type: z.ZodLiteral<"Label">;
|
|
@@ -416,19 +416,19 @@ export declare const labelElementSchema: z.ZodObject<{
|
|
|
416
416
|
/**
|
|
417
417
|
* A Label element for displaying static text.
|
|
418
418
|
*
|
|
419
|
-
* @
|
|
419
|
+
* @internal
|
|
420
420
|
*/
|
|
421
421
|
export type LabelElement = z.infer<typeof labelElementSchema>;
|
|
422
422
|
/**
|
|
423
423
|
* Root UI Schema (always a layout — not a Control, Category, or Label).
|
|
424
424
|
*
|
|
425
|
-
* @
|
|
425
|
+
* @internal
|
|
426
426
|
*/
|
|
427
427
|
export type UISchema = VerticalLayout | HorizontalLayout | GroupLayout | Categorization;
|
|
428
428
|
/**
|
|
429
429
|
* Zod schema for the root UI Schema (layout types only).
|
|
430
430
|
*
|
|
431
|
-
* @
|
|
431
|
+
* @internal
|
|
432
432
|
*/
|
|
433
433
|
export declare const uiSchema: z.ZodType<UISchema>;
|
|
434
434
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1,11 +1,160 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* JSON Forms UI Schema type definitions.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* These are the consumer-facing TypeScript shapes. Runtime validation remains
|
|
5
|
+
* defined separately in `./schema.ts`.
|
|
6
|
+
*
|
|
5
7
|
* See: https://jsonforms.io/docs/uischema/
|
|
6
8
|
*/
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* Rule effect types for conditional visibility.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export type RuleEffect = "SHOW" | "HIDE" | "ENABLE" | "DISABLE";
|
|
15
|
+
/**
|
|
16
|
+
* UI Schema element types.
|
|
17
|
+
*
|
|
18
|
+
* @public
|
|
19
|
+
*/
|
|
20
|
+
export type UISchemaElementType = "Control" | "VerticalLayout" | "HorizontalLayout" | "Group" | "Categorization" | "Category" | "Label";
|
|
21
|
+
/**
|
|
22
|
+
* JSON Schema subset used in rule conditions.
|
|
23
|
+
*
|
|
24
|
+
* @public
|
|
25
|
+
*/
|
|
26
|
+
export interface RuleConditionSchema {
|
|
27
|
+
const?: unknown;
|
|
28
|
+
enum?: readonly unknown[];
|
|
29
|
+
type?: string;
|
|
30
|
+
not?: RuleConditionSchema;
|
|
31
|
+
minimum?: number;
|
|
32
|
+
maximum?: number;
|
|
33
|
+
exclusiveMinimum?: number;
|
|
34
|
+
exclusiveMaximum?: number;
|
|
35
|
+
minLength?: number;
|
|
36
|
+
properties?: Record<string, RuleConditionSchema>;
|
|
37
|
+
required?: string[];
|
|
38
|
+
allOf?: RuleConditionSchema[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Condition for a rule.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export interface SchemaBasedCondition {
|
|
46
|
+
readonly scope: string;
|
|
47
|
+
readonly schema: RuleConditionSchema;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Rule for conditional element visibility/enablement.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export interface Rule {
|
|
55
|
+
readonly effect: RuleEffect;
|
|
56
|
+
readonly condition: SchemaBasedCondition;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A Control element that binds to a JSON Schema property.
|
|
60
|
+
*
|
|
61
|
+
* @public
|
|
62
|
+
*/
|
|
63
|
+
export interface ControlElement {
|
|
64
|
+
readonly type: "Control";
|
|
65
|
+
readonly scope: string;
|
|
66
|
+
readonly label?: string | false | undefined;
|
|
67
|
+
readonly rule?: Rule | undefined;
|
|
68
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
69
|
+
readonly [k: string]: unknown;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* A vertical layout element.
|
|
73
|
+
*
|
|
74
|
+
* @public
|
|
75
|
+
*/
|
|
76
|
+
export interface VerticalLayout {
|
|
77
|
+
readonly type: "VerticalLayout";
|
|
78
|
+
readonly elements: UISchemaElement[];
|
|
79
|
+
readonly rule?: Rule | undefined;
|
|
80
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
81
|
+
readonly [k: string]: unknown;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A horizontal layout element.
|
|
85
|
+
*
|
|
86
|
+
* @public
|
|
87
|
+
*/
|
|
88
|
+
export interface HorizontalLayout {
|
|
89
|
+
readonly type: "HorizontalLayout";
|
|
90
|
+
readonly elements: UISchemaElement[];
|
|
91
|
+
readonly rule?: Rule | undefined;
|
|
92
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
93
|
+
readonly [k: string]: unknown;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* A group element with a label.
|
|
97
|
+
*
|
|
98
|
+
* @public
|
|
99
|
+
*/
|
|
100
|
+
export interface GroupLayout {
|
|
101
|
+
readonly type: "Group";
|
|
102
|
+
readonly label: string;
|
|
103
|
+
readonly elements: UISchemaElement[];
|
|
104
|
+
readonly rule?: Rule | undefined;
|
|
105
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
106
|
+
readonly [k: string]: unknown;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* A Category element, used inside a Categorization layout.
|
|
110
|
+
*
|
|
111
|
+
* @public
|
|
112
|
+
*/
|
|
113
|
+
export interface Category {
|
|
114
|
+
readonly type: "Category";
|
|
115
|
+
readonly label: string;
|
|
116
|
+
readonly elements: UISchemaElement[];
|
|
117
|
+
readonly rule?: Rule | undefined;
|
|
118
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
119
|
+
readonly [k: string]: unknown;
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A Categorization element (tab-based layout).
|
|
123
|
+
*
|
|
124
|
+
* @public
|
|
125
|
+
*/
|
|
126
|
+
export interface Categorization {
|
|
127
|
+
readonly type: "Categorization";
|
|
128
|
+
readonly elements: Category[];
|
|
129
|
+
readonly label?: string | undefined;
|
|
130
|
+
readonly rule?: Rule | undefined;
|
|
131
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
132
|
+
readonly [k: string]: unknown;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* A Label element for displaying static text.
|
|
136
|
+
*
|
|
137
|
+
* @public
|
|
138
|
+
*/
|
|
139
|
+
export interface LabelElement {
|
|
140
|
+
readonly type: "Label";
|
|
141
|
+
readonly text: string;
|
|
142
|
+
readonly rule?: Rule | undefined;
|
|
143
|
+
readonly options?: Record<string, unknown> | undefined;
|
|
144
|
+
readonly [k: string]: unknown;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Union of all UI Schema element types.
|
|
148
|
+
*
|
|
149
|
+
* @public
|
|
150
|
+
*/
|
|
151
|
+
export type UISchemaElement = ControlElement | VerticalLayout | HorizontalLayout | GroupLayout | Categorization | Category | LabelElement;
|
|
152
|
+
/**
|
|
153
|
+
* Root UI Schema (always a layout — not a Control, Category, or Label).
|
|
154
|
+
*
|
|
155
|
+
* @public
|
|
156
|
+
*/
|
|
157
|
+
export type UISchema = VerticalLayout | HorizontalLayout | GroupLayout | Categorization;
|
|
9
158
|
/**
|
|
10
159
|
* Base interface for all UI Schema elements.
|
|
11
160
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui-schema/types.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/ui-schema/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEhE;;;;GAIG;AACH,MAAM,MAAM,mBAAmB,GAC3B,SAAS,GACT,gBAAgB,GAChB,kBAAkB,GAClB,OAAO,GACP,gBAAgB,GAChB,UAAU,GACV,OAAO,CAAC;AAEZ;;;;GAIG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,mBAAmB,CAAC;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,mBAAmB,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;CACtC;AAED;;;;GAIG;AACH,MAAM,WAAW,IAAI;IACnB,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,oBAAoB,CAAC;CAC1C;AAED;;;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EAAE,IAAI,GAAG,SAAS,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,CAAC;IACvD,QAAQ,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;CAC/B;AAED;;;;GAIG;AACH,MAAM,MAAM,eAAe,GACvB,cAAc,GACd,cAAc,GACd,gBAAgB,GAChB,WAAW,GACX,cAAc,GACd,QAAQ,GACR,YAAY,CAAC;AAEjB;;;;GAIG;AACH,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,gBAAgB,GAAG,WAAW,GAAG,cAAc,CAAC;AAExF;;;;;;;;;GASG;AACH,MAAM,WAAW,mBAAmB;IAClC,IAAI,EAAE,mBAAmB,CAAC;IAC1B,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACnC"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
10
|
import { type ConstraintSemanticDiagnostic } from "@formspec/analysis/internal";
|
|
11
|
-
import type { FormIR } from "@formspec/core";
|
|
11
|
+
import type { FormIR } from "@formspec/core/internals";
|
|
12
12
|
import type { ExtensionRegistry } from "../extensions/index.js";
|
|
13
13
|
export type ValidationDiagnostic = ConstraintSemanticDiagnostic;
|
|
14
14
|
export interface ValidationResult {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constraint-validator.d.ts","sourceRoot":"","sources":["../../src/validate/constraint-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAA4C,MAAM,
|
|
1
|
+
{"version":3,"file":"constraint-validator.d.ts","sourceRoot":"","sources":["../../src/validate/constraint-validator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAGL,KAAK,4BAA4B,EAClC,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,MAAM,EAA4C,MAAM,0BAA0B,CAAC;AACjG,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhE,MAAM,MAAM,oBAAoB,GAAG,4BAA4B,CAAC;AAEhE,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,WAAW,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACtD,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CAChD;AA6ED,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAepF"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formspec/build",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.23",
|
|
4
4
|
"description": "Build tools to compile FormSpec forms to JSON Schema and UI Schema",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -34,15 +34,15 @@
|
|
|
34
34
|
"@microsoft/tsdoc": "^0.16.0",
|
|
35
35
|
"@microsoft/tsdoc-config": "^0.18.1",
|
|
36
36
|
"zod": "^3.25.0",
|
|
37
|
-
"@formspec/analysis": "0.1.0-alpha.
|
|
38
|
-
"@formspec/core": "0.1.0-alpha.
|
|
37
|
+
"@formspec/analysis": "0.1.0-alpha.23",
|
|
38
|
+
"@formspec/core": "0.1.0-alpha.23"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"typescript": "^5.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"vitest": "^3.0.0",
|
|
45
|
-
"@formspec/dsl": "0.1.0-alpha.
|
|
45
|
+
"@formspec/dsl": "0.1.0-alpha.23"
|
|
46
46
|
},
|
|
47
47
|
"publishConfig": {
|
|
48
48
|
"access": "public"
|
|
@@ -50,12 +50,12 @@
|
|
|
50
50
|
"keywords": [],
|
|
51
51
|
"license": "UNLICENSED",
|
|
52
52
|
"scripts": {
|
|
53
|
-
"build": "tsup && tsc --emitDeclarationOnly && api-extractor
|
|
53
|
+
"build": "tsup && tsc --emitDeclarationOnly && pnpm run api-extractor:local",
|
|
54
54
|
"clean": "rm -rf dist temp",
|
|
55
55
|
"typecheck": "tsc --noEmit",
|
|
56
56
|
"test": "pnpm run build && vitest run",
|
|
57
|
-
"api-extractor": "api-extractor run",
|
|
58
|
-
"api-extractor:local": "api-extractor run --local",
|
|
59
|
-
"api-documenter": "api-documenter markdown -i temp -o docs"
|
|
57
|
+
"api-extractor": "api-extractor run && node ../../scripts/normalize-generated-markdown.mjs api-report",
|
|
58
|
+
"api-extractor:local": "api-extractor run --local && node ../../scripts/normalize-generated-markdown.mjs api-report",
|
|
59
|
+
"api-documenter": "api-documenter markdown -i temp -o docs && node ../../scripts/normalize-generated-markdown.mjs docs"
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Tests for transitive type alias constraint propagation.
|
|
3
|
-
*
|
|
4
|
-
* Verifies that constraints declared on type aliases propagate transitively
|
|
5
|
-
* through alias chains (e.g., Integer → Percentage → field), and that
|
|
6
|
-
* excessively deep chains throw a clear error.
|
|
7
|
-
*/
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=alias-chain-propagation.test.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"alias-chain-propagation.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/alias-chain-propagation.test.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chain-dsl-canonicalizer.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/chain-dsl-canonicalizer.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"class-schema.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/class-schema.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cli.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/cli.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constraint-validator.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/constraint-validator.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"date-extension.integration.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/date-extension.integration.test.ts"],"names":[],"mappings":""}
|