@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.
@@ -7,17 +7,79 @@
7
7
  *
8
8
  * @packageDocumentation
9
9
  */
10
- import { type ConstraintSemanticDiagnostic } from "@formspec/analysis/internal";
11
10
  import type { FormIR } from "@formspec/core/internals";
12
11
  import type { ExtensionRegistry } from "../extensions/index.js";
13
- export type ValidationDiagnostic = ConstraintSemanticDiagnostic;
12
+ /**
13
+ * Supported severity levels returned by static build validation.
14
+ *
15
+ * @public
16
+ */
17
+ export type ValidationDiagnosticSeverity = "error" | "warning";
18
+ /**
19
+ * Public source-location shape attached to validation diagnostics.
20
+ *
21
+ * This mirrors the provenance information surfaced by the shared analysis
22
+ * layer without exposing `@formspec/core/internals` through the public API.
23
+ *
24
+ * @public
25
+ */
26
+ export interface ValidationDiagnosticLocation {
27
+ /** Authoring surface that produced the diagnostic location. */
28
+ readonly surface: "tsdoc" | "chain-dsl" | "extension" | "inferred";
29
+ /** Absolute path to the source file. */
30
+ readonly file: string;
31
+ /** 1-based line number in the source file. */
32
+ readonly line: number;
33
+ /** 0-based column number in the source file. */
34
+ readonly column: number;
35
+ /** Optional span length in characters. */
36
+ readonly length?: number;
37
+ /** Optional tag or construct associated with the location. */
38
+ readonly tagName?: string;
39
+ }
40
+ /**
41
+ * A machine-readable validation diagnostic returned by static schema analysis.
42
+ *
43
+ * @public
44
+ */
45
+ export interface ValidationDiagnostic {
46
+ /** Stable machine-readable diagnostic code. */
47
+ readonly code: string;
48
+ /** Human-readable explanation of the validation problem. */
49
+ readonly message: string;
50
+ /** Severity of the reported validation problem. */
51
+ readonly severity: ValidationDiagnosticSeverity;
52
+ /** Primary source location associated with the diagnostic. */
53
+ readonly primaryLocation: ValidationDiagnosticLocation;
54
+ /** Related source locations that add context to the diagnostic. */
55
+ readonly relatedLocations: readonly ValidationDiagnosticLocation[];
56
+ }
57
+ /**
58
+ * Result of validating canonical FormIR before schema emission.
59
+ *
60
+ * @public
61
+ */
14
62
  export interface ValidationResult {
63
+ /** Diagnostics produced during validation. */
15
64
  readonly diagnostics: readonly ValidationDiagnostic[];
65
+ /** Whether any error-severity diagnostics were produced. */
16
66
  readonly valid: boolean;
17
67
  }
68
+ /**
69
+ * Options for validating canonical FormIR.
70
+ *
71
+ * @public
72
+ */
18
73
  export interface ValidateIROptions {
74
+ /** Vendor prefix used when resolving extension-backed keywords. */
19
75
  readonly vendorPrefix?: string;
76
+ /** Extension registry used to resolve custom constraints and types. */
20
77
  readonly extensionRegistry?: ExtensionRegistry;
21
78
  }
79
+ /**
80
+ * Validates canonical FormIR and returns all discovered diagnostics.
81
+ *
82
+ * @public
83
+ */
22
84
  export declare function validateIR(ir: FormIR, options?: ValidateIROptions): ValidationResult;
23
85
  //# sourceMappingURL=constraint-validator.d.ts.map
@@ -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,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,E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AS,oBAAoB,EAAE,CAAC;IACtD,4DAA4D;IAC5D,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;CACzB;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,mEAAmE;IACnE,QAAQ,CAAC,YAAY,CAAC,EAAE,MAAM,CAAC;IAC/B,uEAAuE;IACvE,QAAQ,CAAC,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CAChD;AA6ED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,gBAAgB,CAepF"}
@@ -4,6 +4,6 @@
4
4
  * @packageDocumentation
5
5
  */
6
6
  export { validateIR } from "./constraint-validator.js";
7
- export type { ValidationDiagnostic, ValidationResult, ValidateIROptions, } from "./constraint-validator.js";
7
+ export type { ValidationDiagnostic, ValidationDiagnosticLocation, ValidationDiagnosticSeverity, ValidationResult, ValidateIROptions, } from "./constraint-validator.js";
8
8
  export type { ExtensionRegistry } from "../extensions/index.js";
9
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AACvD,YAAY,EACV,oBAAoB,EACpB,4BAA4B,EAC5B,4BAA4B,EAC5B,gBAAgB,EAChB,iBAAiB,GAClB,MAAM,2BAA2B,CAAC;AAGnC,YAAY,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@formspec/build",
3
- "version": "0.1.0-alpha.38",
3
+ "version": "0.1.0-alpha.39",
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",