@formspec/build 0.1.0-alpha.14 → 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.
- package/dist/__tests__/extension-runtime.integration.test.d.ts +2 -0
- package/dist/__tests__/extension-runtime.integration.test.d.ts.map +1 -0
- package/dist/__tests__/fixtures/edge-cases.d.ts +22 -0
- package/dist/__tests__/fixtures/edge-cases.d.ts.map +1 -1
- package/dist/__tests__/fixtures/example-a-builtins.d.ts +6 -6
- package/dist/__tests__/fixtures/example-interface-types.d.ts +26 -26
- package/dist/__tests__/fixtures/example-interface-types.d.ts.map +1 -1
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts +30 -0
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts.map +1 -0
- package/dist/__tests__/mixed-authoring.test.d.ts +2 -0
- package/dist/__tests__/mixed-authoring.test.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts +19 -0
- package/dist/__tests__/parity/fixtures/plan-status/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts +6 -0
- package/dist/__tests__/parity/fixtures/plan-status/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts +17 -0
- package/dist/__tests__/parity/fixtures/plan-status/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts +9 -0
- package/dist/__tests__/parity/fixtures/usd-cents/chain-dsl.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts +6 -0
- package/dist/__tests__/parity/fixtures/usd-cents/expected-ir.d.ts.map +1 -0
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts +19 -0
- package/dist/__tests__/parity/fixtures/usd-cents/tsdoc.d.ts.map +1 -0
- package/dist/__tests__/parity/utils.d.ts +11 -4
- package/dist/__tests__/parity/utils.d.ts.map +1 -1
- package/dist/analyzer/class-analyzer.d.ts +5 -3
- package/dist/analyzer/class-analyzer.d.ts.map +1 -1
- package/dist/analyzer/jsdoc-constraints.d.ts +7 -51
- package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts +25 -9
- package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
- package/dist/browser.cjs +546 -102
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.d.ts +15 -2
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +544 -102
- package/dist/browser.js.map +1 -1
- package/dist/build.d.ts +170 -6
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts +3 -3
- package/dist/canonicalize/tsdoc-canonicalizer.d.ts.map +1 -1
- package/dist/cli.cjs +877 -128
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +876 -131
- package/dist/cli.js.map +1 -1
- package/dist/generators/mixed-authoring.d.ts +45 -0
- package/dist/generators/mixed-authoring.d.ts.map +1 -0
- package/dist/index.cjs +850 -125
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +22 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +847 -129
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +946 -187
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.js +944 -189
- package/dist/internals.js.map +1 -1
- package/dist/json-schema/generator.d.ts +8 -2
- package/dist/json-schema/generator.d.ts.map +1 -1
- package/dist/json-schema/ir-generator.d.ts +27 -4
- package/dist/json-schema/ir-generator.d.ts.map +1 -1
- package/dist/json-schema/types.d.ts +1 -1
- package/dist/json-schema/types.d.ts.map +1 -1
- package/dist/ui-schema/ir-generator.d.ts.map +1 -1
- package/dist/validate/constraint-validator.d.ts +3 -7
- package/dist/validate/constraint-validator.d.ts.map +1 -1
- package/package.json +3 -3
- package/dist/__tests__/jsdoc-constraints.test.d.ts +0 -10
- package/dist/__tests__/jsdoc-constraints.test.d.ts.map +0 -1
|
@@ -10,14 +10,13 @@
|
|
|
10
10
|
* 1. **Constraint tags** (all alphanumeric, TSDoc-compliant):
|
|
11
11
|
* `@minimum`, `@maximum`, `@exclusiveMinimum`, `@exclusiveMaximum`,
|
|
12
12
|
* `@multipleOf`, `@minLength`, `@maxLength`, `@minItems`, `@maxItems`,
|
|
13
|
-
* `@pattern`, `@enumOptions`
|
|
13
|
+
* `@uniqueItems`, `@pattern`, `@enumOptions`, `@const`
|
|
14
14
|
* — Parsed via TSDocParser as custom block tags.
|
|
15
15
|
* Both camelCase and PascalCase forms are accepted (e.g., `@Minimum`).
|
|
16
16
|
*
|
|
17
|
-
* 2. **Annotation tags** (`@
|
|
18
|
-
* These
|
|
19
|
-
*
|
|
20
|
-
* until a future migration to underscore-free tag names.
|
|
17
|
+
* 2. **Annotation tags** (`@displayName`, `@description`, `@format`, `@placeholder`):
|
|
18
|
+
* These are parsed as structured custom block tags and mapped directly
|
|
19
|
+
* onto annotation IR nodes.
|
|
21
20
|
*
|
|
22
21
|
* The `@deprecated` tag is a standard TSDoc block tag, parsed structurally.
|
|
23
22
|
*
|
|
@@ -36,18 +35,28 @@ import { type ConstraintNode, type AnnotationNode, type PathTarget } from "@form
|
|
|
36
35
|
export interface TSDocParseResult {
|
|
37
36
|
/** Constraint IR nodes extracted from custom block tags. */
|
|
38
37
|
readonly constraints: readonly ConstraintNode[];
|
|
39
|
-
/** Annotation IR nodes extracted from
|
|
38
|
+
/** Annotation IR nodes extracted from canonical TSDoc block tags. */
|
|
40
39
|
readonly annotations: readonly AnnotationNode[];
|
|
41
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Display-name metadata extracted from a node's JSDoc tags.
|
|
43
|
+
*
|
|
44
|
+
* The root display name is returned separately from member-target labels so
|
|
45
|
+
* callers can apply the former to the enclosing type/form and the latter to
|
|
46
|
+
* enum members.
|
|
47
|
+
*/
|
|
48
|
+
export interface DisplayNameMetadata {
|
|
49
|
+
readonly displayName?: string;
|
|
50
|
+
readonly memberDisplayNames: ReadonlyMap<string, string>;
|
|
51
|
+
}
|
|
42
52
|
/**
|
|
43
53
|
* Parses the JSDoc comment attached to a TypeScript AST node using the
|
|
44
54
|
* official TSDoc parser and returns canonical IR constraint and annotation
|
|
45
55
|
* nodes.
|
|
46
56
|
*
|
|
47
57
|
* For constraint tags (`@minimum`, `@pattern`, `@enumOptions`, etc.),
|
|
48
|
-
* the structured TSDoc parser is used.
|
|
49
|
-
*
|
|
50
|
-
* compiler JSDoc API is used as a fallback.
|
|
58
|
+
* the structured TSDoc parser is used. Canonical annotation tags
|
|
59
|
+
* (`@displayName`, `@description`) are also parsed structurally.
|
|
51
60
|
*
|
|
52
61
|
* @param node - The TS AST node to inspect (PropertyDeclaration, PropertySignature, etc.)
|
|
53
62
|
* @param file - Absolute source file path for provenance
|
|
@@ -60,6 +69,13 @@ export declare function parseTSDocTags(node: ts.Node, file?: string): TSDocParse
|
|
|
60
69
|
* Falls back to the TS compiler API for nodes without doc comments.
|
|
61
70
|
*/
|
|
62
71
|
export declare function hasDeprecatedTagTSDoc(node: ts.Node): boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Extracts root and member-target display-name metadata from a node's JSDoc tags.
|
|
74
|
+
*
|
|
75
|
+
* Member-target display-name tags use the syntax `@displayName :member Label`.
|
|
76
|
+
* The first non-target `@displayName` is returned as the root display name.
|
|
77
|
+
*/
|
|
78
|
+
export declare function extractDisplayNameMetadata(node: ts.Node): DisplayNameMetadata;
|
|
63
79
|
/**
|
|
64
80
|
* Extracts a path-target prefix (`:fieldName`) from constraint tag text.
|
|
65
81
|
* Returns the parsed PathTarget and remaining text, or null if no path target.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tsdoc-parser.d.ts","sourceRoot":"","sources":["../../src/analyzer/tsdoc-parser.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"tsdoc-parser.d.ts","sourceRoot":"","sources":["../../src/analyzer/tsdoc-parser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAYjC,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,cAAc,EAInB,KAAK,UAAU,EAEhB,MAAM,gBAAgB,CAAC;AAyFxB;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,4DAA4D;IAC5D,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;IAChD,qEAAqE;IACrE,QAAQ,CAAC,WAAW,EAAE,SAAS,cAAc,EAAE,CAAC;CACjD;AAED;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1D;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE,IAAI,SAAK,GAAG,gBAAgB,CAiKzE;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,OAAO,CAsB5D;AAED;;;;;GAKG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,GAAG,mBAAmB,CA2B7E;AAMD;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,GACX;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAQpD"}
|