@formspec/analysis 0.1.0-alpha.20 → 0.1.0-alpha.21
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/analysis.d.ts +69 -450
- package/dist/compiler-signatures.d.ts +48 -0
- package/dist/compiler-signatures.d.ts.map +1 -1
- package/dist/constants.d.ts +2 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/file-snapshots.d.ts +3 -0
- package/dist/file-snapshots.d.ts.map +1 -1
- package/dist/index.cjs +169 -2800
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +168 -2761
- package/dist/index.js.map +1 -1
- package/dist/internal.cjs +3995 -0
- package/dist/internal.cjs.map +1 -0
- package/dist/internal.d.ts +21 -0
- package/dist/internal.d.ts.map +1 -0
- package/dist/internal.js +3902 -0
- package/dist/internal.js.map +1 -0
- package/dist/perf-tracing.d.ts +16 -0
- package/dist/perf-tracing.d.ts.map +1 -0
- package/dist/protocol.cjs +951 -0
- package/dist/protocol.cjs.map +1 -0
- package/dist/protocol.d.ts +4 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +904 -0
- package/dist/protocol.js.map +1 -0
- package/dist/semantic-protocol.d.ts +49 -1
- package/dist/semantic-protocol.d.ts.map +1 -1
- package/dist/tag-registry.d.ts +2 -0
- package/dist/tag-registry.d.ts.map +1 -1
- package/dist/workspace-runtime.d.ts +6 -0
- package/dist/workspace-runtime.d.ts.map +1 -1
- package/package.json +12 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FormSpecPerformanceRecorder } from "./perf-tracing.js";
|
|
1
2
|
import { type ExtensionTagSource, type FormSpecPlacement, type TagDefinition, type TagSignature } from "./tag-registry.js";
|
|
2
3
|
/**
|
|
3
4
|
* Target kinds that can be represented in a synthetic compiler call.
|
|
@@ -52,6 +53,7 @@ export interface SyntheticCompilerDiagnostic {
|
|
|
52
53
|
*/
|
|
53
54
|
export interface CheckSyntheticTagApplicationOptions extends LowerSyntheticTagApplicationOptions {
|
|
54
55
|
readonly supportingDeclarations?: readonly string[];
|
|
56
|
+
readonly performance?: FormSpecPerformanceRecorder;
|
|
55
57
|
}
|
|
56
58
|
/**
|
|
57
59
|
* Result of checking a lowered synthetic tag application with the TypeScript
|
|
@@ -61,6 +63,36 @@ export interface SyntheticTagCheckResult {
|
|
|
61
63
|
readonly sourceText: string;
|
|
62
64
|
readonly diagnostics: readonly SyntheticCompilerDiagnostic[];
|
|
63
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* Options for the minimal synthetic applicability checker that operates on an
|
|
68
|
+
* already-resolved target type instead of reproducing path/member resolution in
|
|
69
|
+
* the synthetic program.
|
|
70
|
+
*/
|
|
71
|
+
export interface CheckNarrowSyntheticTagApplicabilityOptions {
|
|
72
|
+
readonly tagName: string;
|
|
73
|
+
readonly placement: FormSpecPlacement;
|
|
74
|
+
readonly resolvedTargetType: string;
|
|
75
|
+
readonly targetKind?: SyntheticTagTargetKind | null;
|
|
76
|
+
readonly argumentExpression?: string | null;
|
|
77
|
+
readonly extensions?: readonly ExtensionTagSource[];
|
|
78
|
+
readonly performance?: FormSpecPerformanceRecorder;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Options for running the minimal synthetic applicability checker against
|
|
82
|
+
* multiple already-resolved target types in a single in-memory program.
|
|
83
|
+
*/
|
|
84
|
+
export interface CheckNarrowSyntheticTagApplicabilitiesOptions {
|
|
85
|
+
readonly applications: readonly CheckNarrowSyntheticTagApplicabilityOptions[];
|
|
86
|
+
readonly performance?: FormSpecPerformanceRecorder;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Options for running the TypeScript checker against multiple lowered
|
|
90
|
+
* synthetic tag calls in a single in-memory program.
|
|
91
|
+
*/
|
|
92
|
+
export interface CheckSyntheticTagApplicationsOptions {
|
|
93
|
+
readonly applications: readonly CheckSyntheticTagApplicationOptions[];
|
|
94
|
+
readonly performance?: FormSpecPerformanceRecorder;
|
|
95
|
+
}
|
|
64
96
|
/**
|
|
65
97
|
* Filters a tag definition's overloads down to the ones that apply to the
|
|
66
98
|
* requested placement and synthetic target form.
|
|
@@ -89,6 +121,16 @@ export declare function buildSyntheticHelperPrelude(extensions?: readonly Extens
|
|
|
89
121
|
* the helper call and selects the matching overload metadata.
|
|
90
122
|
*/
|
|
91
123
|
export declare function lowerTagApplicationToSyntheticCall(options: LowerSyntheticTagApplicationOptions): LoweredSyntheticTagApplication;
|
|
124
|
+
/**
|
|
125
|
+
* Runs the TypeScript checker once against multiple lowered synthetic tag
|
|
126
|
+
* applications and returns per-application diagnostics.
|
|
127
|
+
*/
|
|
128
|
+
export declare function checkSyntheticTagApplications(options: CheckSyntheticTagApplicationsOptions): readonly SyntheticTagCheckResult[];
|
|
129
|
+
/**
|
|
130
|
+
* Runs the minimal synthetic applicability checker once against multiple
|
|
131
|
+
* already-resolved target types and returns per-application diagnostics.
|
|
132
|
+
*/
|
|
133
|
+
export declare function checkNarrowSyntheticTagApplicabilities(options: CheckNarrowSyntheticTagApplicabilitiesOptions): readonly SyntheticTagCheckResult[];
|
|
92
134
|
/**
|
|
93
135
|
* Runs the TypeScript checker against a lowered synthetic tag application.
|
|
94
136
|
*
|
|
@@ -97,4 +139,10 @@ export declare function lowerTagApplicationToSyntheticCall(options: LowerSynthet
|
|
|
97
139
|
* requiring comment tags themselves to be valid TypeScript syntax.
|
|
98
140
|
*/
|
|
99
141
|
export declare function checkSyntheticTagApplication(options: CheckSyntheticTagApplicationOptions): SyntheticTagCheckResult;
|
|
142
|
+
/**
|
|
143
|
+
* Runs a minimal synthetic applicability check against an already-resolved
|
|
144
|
+
* target type. This avoids reproducing path/member resolution in the synthetic
|
|
145
|
+
* program and isolates only the type-compatibility question.
|
|
146
|
+
*/
|
|
147
|
+
export declare function checkNarrowSyntheticTagApplicability(options: CheckNarrowSyntheticTagApplicabilityOptions): SyntheticTagCheckResult;
|
|
100
148
|
//# sourceMappingURL=compiler-signatures.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compiler-signatures.d.ts","sourceRoot":"","sources":["../src/compiler-signatures.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"compiler-signatures.d.ts","sourceRoot":"","sources":["../src/compiler-signatures.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmB,KAAK,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EAEtB,KAAK,aAAa,EAClB,KAAK,YAAY,EAElB,MAAM,mBAAmB,CAAC;AAE3B;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEnE;;;GAGG;AACH,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,CAAC,IAAI,EAAE,sBAAsB,CAAC;IACtC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,mCAAmC;IAClD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,iBAAiB,CAAC;IACtC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,2BAA2B,GAAG,IAAI,CAAC;IACrD,QAAQ,CAAC,kBAAkB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5C,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;CACrD;AAED;;;GAGG;AACH,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,CAAC,UAAU,EAAE,aAAa,CAAC;IACnC,QAAQ,CAAC,kBAAkB,EAAE,SAAS,YAAY,EAAE,CAAC;IACrD,QAAQ,CAAC,cAAc,EAA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;AACH,wBAAgB,wBAAwB,CACtC,UAAU,EAAE,aAAa,EACzB,SAAS,EAAE,iBAAiB,EAC5B,UAAU,EAAE,sBAAsB,GAAG,IAAI,GACxC,SAAS,YAAY,EAAE,CAKzB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,CAW9F;AAED;;;;;;;GAOG;AACH,wBAAgB,kCAAkC,CAChD,OAAO,EAAE,mCAAmC,GAC3C,8BAA8B,CAsChC;AA6cD;;;GAGG;AACH,wBAAgB,6BAA6B,CAC3C,OAAO,EAAE,oCAAoC,GAC5C,SAAS,uBAAuB,EAAE,CAwBpC;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,6CAA6C,GACrD,SAAS,uBAAuB,EAAE,CAuBpC;AAED;;;;;;GAMG;AACH,wBAAgB,4BAA4B,CAC1C,OAAO,EAAE,mCAAmC,GAC3C,uBAAuB,CASzB;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,2CAA2C,GACnD,uBAAuB,CAWzB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,uCAAuC,KAAK,CAAC"}
|
package/dist/file-snapshots.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as ts from "typescript";
|
|
2
2
|
import { type FormSpecAnalysisFileSnapshot } from "./semantic-protocol.js";
|
|
3
|
+
import { type FormSpecPerformanceRecorder } from "./perf-tracing.js";
|
|
3
4
|
import type { ExtensionTagSource } from "./tag-registry.js";
|
|
4
5
|
/**
|
|
5
6
|
* Options used when building a serializable, editor-oriented snapshot for a
|
|
@@ -8,6 +9,8 @@ import type { ExtensionTagSource } from "./tag-registry.js";
|
|
|
8
9
|
export interface BuildFormSpecAnalysisFileSnapshotOptions {
|
|
9
10
|
readonly checker: ts.TypeChecker;
|
|
10
11
|
readonly extensions?: readonly ExtensionTagSource[];
|
|
12
|
+
readonly now?: () => Date;
|
|
13
|
+
readonly performance?: FormSpecPerformanceRecorder;
|
|
11
14
|
}
|
|
12
15
|
/**
|
|
13
16
|
* Builds a transport-safe snapshot of every FormSpec-bearing doc comment in a
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"file-snapshots.d.ts","sourceRoot":"","sources":["../src/file-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"file-snapshots.d.ts","sourceRoot":"","sources":["../src/file-snapshots.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAYjC,OAAO,EAKL,KAAK,4BAA4B,EAClC,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAGL,KAAK,2BAA2B,EACjC,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,kBAAkB,EAAqB,MAAM,mBAAmB,CAAC;AAE/E;;;GAGG;AACH,MAAM,WAAW,wCAAwC;IACvD,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC,WAAW,CAAC;IACjC,QAAQ,CAAC,UAAU,CAAC,EAAE,SAAS,kBAAkB,EAAE,CAAC;IACpD,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,2BAA2B,CAAC;CACpD;AAmaD;;;;GAIG;AACH,wBAAgB,iCAAiC,CAC/C,UAAU,EAAE,EAAE,CAAC,UAAU,EACzB,OAAO,EAAE,wCAAwC,GAChD,4BAA4B,CA0E9B"}
|