@formspec/build 0.1.0-alpha.16 → 0.1.0-alpha.17
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__/fixtures/example-numeric-extension.d.ts +20 -0
- package/dist/__tests__/fixtures/example-numeric-extension.d.ts.map +1 -0
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts +1 -0
- package/dist/__tests__/fixtures/mixed-authoring-shipping-address.d.ts.map +1 -1
- package/dist/__tests__/numeric-extension.integration.test.d.ts +2 -0
- package/dist/__tests__/numeric-extension.integration.test.d.ts.map +1 -0
- package/dist/analyzer/class-analyzer.d.ts +5 -4
- package/dist/analyzer/class-analyzer.d.ts.map +1 -1
- package/dist/analyzer/jsdoc-constraints.d.ts +3 -2
- package/dist/analyzer/jsdoc-constraints.d.ts.map +1 -1
- package/dist/analyzer/tsdoc-parser.d.ts +18 -2
- package/dist/analyzer/tsdoc-parser.d.ts.map +1 -1
- package/dist/browser.cjs +199 -4
- package/dist/browser.cjs.map +1 -1
- package/dist/browser.js +199 -4
- package/dist/browser.js.map +1 -1
- package/dist/build.d.ts +28 -2
- package/dist/cli.cjs +547 -84
- package/dist/cli.cjs.map +1 -1
- package/dist/cli.js +547 -84
- package/dist/cli.js.map +1 -1
- package/dist/extensions/registry.d.ts +25 -1
- package/dist/extensions/registry.d.ts.map +1 -1
- package/dist/generators/class-schema.d.ts +4 -4
- package/dist/generators/class-schema.d.ts.map +1 -1
- package/dist/index.cjs +546 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +546 -84
- package/dist/index.js.map +1 -1
- package/dist/internals.cjs +645 -73
- package/dist/internals.cjs.map +1 -1
- package/dist/internals.js +643 -71
- package/dist/internals.js.map +1 -1
- package/dist/validate/constraint-validator.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*
|
|
8
8
|
* @packageDocumentation
|
|
9
9
|
*/
|
|
10
|
-
import type { ExtensionDefinition, CustomTypeRegistration, CustomConstraintRegistration, CustomAnnotationRegistration } from "@formspec/core";
|
|
10
|
+
import type { ExtensionDefinition, CustomTypeRegistration, CustomConstraintRegistration, CustomAnnotationRegistration, ConstraintTagRegistration, BuiltinConstraintBroadeningRegistration } from "@formspec/core";
|
|
11
11
|
/**
|
|
12
12
|
* A registry of extensions that provides lookup by fully-qualified ID.
|
|
13
13
|
*
|
|
@@ -25,6 +25,16 @@ export interface ExtensionRegistry {
|
|
|
25
25
|
* @returns The registration if found, otherwise `undefined`.
|
|
26
26
|
*/
|
|
27
27
|
findType(typeId: string): CustomTypeRegistration | undefined;
|
|
28
|
+
/**
|
|
29
|
+
* Look up a custom type registration by a TypeScript-facing type name.
|
|
30
|
+
*
|
|
31
|
+
* This is used during TSDoc/class analysis to resolve extension-defined
|
|
32
|
+
* custom types from source-level declarations.
|
|
33
|
+
*/
|
|
34
|
+
findTypeByName(typeName: string): {
|
|
35
|
+
readonly extensionId: string;
|
|
36
|
+
readonly registration: CustomTypeRegistration;
|
|
37
|
+
} | undefined;
|
|
28
38
|
/**
|
|
29
39
|
* Look up a custom constraint registration by its fully-qualified constraint ID.
|
|
30
40
|
*
|
|
@@ -32,6 +42,20 @@ export interface ExtensionRegistry {
|
|
|
32
42
|
* @returns The registration if found, otherwise `undefined`.
|
|
33
43
|
*/
|
|
34
44
|
findConstraint(constraintId: string): CustomConstraintRegistration | undefined;
|
|
45
|
+
/**
|
|
46
|
+
* Look up a TSDoc custom constraint-tag registration by tag name.
|
|
47
|
+
*/
|
|
48
|
+
findConstraintTag(tagName: string): {
|
|
49
|
+
readonly extensionId: string;
|
|
50
|
+
readonly registration: ConstraintTagRegistration;
|
|
51
|
+
} | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Look up built-in tag broadening for a given custom type ID.
|
|
54
|
+
*/
|
|
55
|
+
findBuiltinConstraintBroadening(typeId: string, tagName: string): {
|
|
56
|
+
readonly extensionId: string;
|
|
57
|
+
readonly registration: BuiltinConstraintBroadeningRegistration;
|
|
58
|
+
} | undefined;
|
|
35
59
|
/**
|
|
36
60
|
* Look up a custom annotation registration by its fully-qualified annotation ID.
|
|
37
61
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/extensions/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EACV,mBAAmB,EACnB,sBAAsB,EACtB,4BAA4B,EAC5B,4BAA4B,EAC5B,yBAAyB,EACzB,uCAAuC,EACxC,MAAM,gBAAgB,CAAC;AAMxB;;;;;;GAMG;AACH,MAAM,WAAW,iBAAiB;IAChC,0EAA0E;IAC1E,QAAQ,CAAC,UAAU,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAEpD;;;;;OAKG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,GAAG,SAAS,CAAC;IAC7D;;;;;OAKG;IACH,cAAc,CACZ,QAAQ,EAAE,MAAM,GACf;QAAE,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,YAAY,EAAE,sBAAsB,CAAA;KAAE,GAAG,SAAS,CAAC;IAE/F;;;;;OAKG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,4BAA4B,GAAG,SAAS,CAAC;IAC/E;;OAEG;IACH,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;QAClC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,YAAY,EAAE,yBAAyB,CAAC;KAClD,GAAG,SAAS,CAAC;IACd;;OAEG;IACH,+BAA+B,CAC7B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,GACd;QACD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;QAC7B,QAAQ,CAAC,YAAY,EAAE,uCAAuC,CAAC;KAChE,GAAG,SAAS,CAAC;IAEd;;;;;OAKG;IACH,cAAc,CAAC,YAAY,EAAE,MAAM,GAAG,4BAA4B,GAAG,SAAS,CAAC;CAChF;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,SAAS,mBAAmB,EAAE,GACzC,iBAAiB,CA8FnB"}
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
import type { UISchema } from "../ui-schema/types.js";
|
|
9
9
|
import { type IRClassAnalysis } from "../analyzer/class-analyzer.js";
|
|
10
10
|
import { type TSDocSource } from "../canonicalize/index.js";
|
|
11
|
-
import { type JsonSchema2020 } from "../json-schema/ir-generator.js";
|
|
11
|
+
import { type GenerateJsonSchemaFromIROptions, type JsonSchema2020 } from "../json-schema/ir-generator.js";
|
|
12
12
|
/**
|
|
13
13
|
* Generated schemas for a class.
|
|
14
14
|
*/
|
|
@@ -28,11 +28,11 @@ export interface ClassSchemas {
|
|
|
28
28
|
* @param source - Optional source file metadata for provenance
|
|
29
29
|
* @returns Generated JSON Schema and UI Schema
|
|
30
30
|
*/
|
|
31
|
-
export declare function generateClassSchemas(analysis: IRClassAnalysis, source?: TSDocSource): ClassSchemas;
|
|
31
|
+
export declare function generateClassSchemas(analysis: IRClassAnalysis, source?: TSDocSource, options?: GenerateJsonSchemaFromIROptions): ClassSchemas;
|
|
32
32
|
/**
|
|
33
33
|
* Options for generating schemas from a decorated class.
|
|
34
34
|
*/
|
|
35
|
-
export interface GenerateFromClassOptions {
|
|
35
|
+
export interface GenerateFromClassOptions extends GenerateJsonSchemaFromIROptions {
|
|
36
36
|
/** Path to the TypeScript source file */
|
|
37
37
|
filePath: string;
|
|
38
38
|
/** Class name to analyze */
|
|
@@ -70,7 +70,7 @@ export declare function generateSchemasFromClass(options: GenerateFromClassOptio
|
|
|
70
70
|
/**
|
|
71
71
|
* Options for generating schemas from a named type (class, interface, or type alias).
|
|
72
72
|
*/
|
|
73
|
-
export interface GenerateSchemasOptions {
|
|
73
|
+
export interface GenerateSchemasOptions extends GenerateJsonSchemaFromIROptions {
|
|
74
74
|
/** Path to the TypeScript source file */
|
|
75
75
|
filePath: string;
|
|
76
76
|
/** Name of the exported class, interface, or type alias to analyze */
|
|
@@ -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,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOtD,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,
|
|
1
|
+
{"version":3,"file":"class-schema.d.ts","sourceRoot":"","sources":["../../src/generators/class-schema.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAOtD,OAAO,EAIL,KAAK,eAAe,EACrB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAC/E,OAAO,EAEL,KAAK,+BAA+B,EACpC,KAAK,cAAc,EACpB,MAAM,gCAAgC,CAAC;AAGxC;;GAEG;AACH,MAAM,WAAW,YAAY;IAC3B,yCAAyC;IACzC,UAAU,EAAE,cAAc,CAAC;IAC3B,yCAAyC;IACzC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,eAAe,EACzB,MAAM,CAAC,EAAE,WAAW,EACpB,OAAO,CAAC,EAAE,+BAA+B,GACxC,YAAY,CAMd;AAED;;GAEG;AACH,MAAM,WAAW,wBAAyB,SAAQ,+BAA+B;IAC/E,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,4BAA4B;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACtC,yCAAyC;IACzC,UAAU,EAAE,cAAc,CAAC;IAC3B,yCAAyC;IACzC,QAAQ,EAAE,QAAQ,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,wBAAwB,CACtC,OAAO,EAAE,wBAAwB,GAChC,uBAAuB,CAsBzB;AAED;;GAEG;AACH,MAAM,WAAW,sBAAuB,SAAQ,+BAA+B;IAC7E,yCAAyC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,sBAAsB,GAAG,uBAAuB,CA8CxF"}
|