@component-compass/plugin-core 0.1.19 → 0.1.20
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/diagnostic.d.ts +8 -0
- package/dist/diagnostic.js +3 -1
- package/dist/diagnostic.js.map +1 -1
- package/dist/logical-id.js +4 -4
- package/dist/occurrence-id.d.ts +3 -5
- package/dist/occurrence-id.js +3 -5
- package/dist/occurrence-id.js.map +1 -1
- package/dist/output-types.d.ts +15 -18
- package/dist/scan-types.d.ts +8 -9
- package/package.json +1 -1
package/dist/diagnostic.d.ts
CHANGED
|
@@ -34,6 +34,14 @@ export type Diagnostic = {
|
|
|
34
34
|
line: number;
|
|
35
35
|
column: number;
|
|
36
36
|
specifier: string;
|
|
37
|
+
} | {
|
|
38
|
+
code: "lazy-import-unsupported";
|
|
39
|
+
severity: "warning";
|
|
40
|
+
filePath: string;
|
|
41
|
+
line: number;
|
|
42
|
+
column: number;
|
|
43
|
+
specifier: string;
|
|
44
|
+
detail: string;
|
|
37
45
|
} | {
|
|
38
46
|
code: "unresolved-component-tag";
|
|
39
47
|
severity: "warning";
|
package/dist/diagnostic.js
CHANGED
|
@@ -21,7 +21,7 @@ function assertUnreachable(x) {
|
|
|
21
21
|
* exportName), not the consumer package that triggered resolution. Including
|
|
22
22
|
* `packageName` (which is the consumer's package) would un-dedup based on
|
|
23
23
|
* consumer attribution and re-introduce the noise pattern this collector
|
|
24
|
-
* exists to suppress
|
|
24
|
+
* exists to suppress.
|
|
25
25
|
*/
|
|
26
26
|
function dedupKey(d) {
|
|
27
27
|
switch (d.code) {
|
|
@@ -33,6 +33,8 @@ function dedupKey(d) {
|
|
|
33
33
|
return `${d.code}::${d.filePath}::${d.tagName}`;
|
|
34
34
|
case "unresolved-import":
|
|
35
35
|
return `${d.code}::${d.filePath}::${d.line}::${d.column}::${d.specifier}`;
|
|
36
|
+
case "lazy-import-unsupported":
|
|
37
|
+
return `${d.code}::${d.filePath}::${d.line}::${d.column}::${d.specifier}`;
|
|
36
38
|
case "unresolved-component-tag":
|
|
37
39
|
return `${d.code}::${d.filePath}::${d.line ?? ""}::${d.column ?? ""}::${d.tagName}`;
|
|
38
40
|
case "auto-import-stale-entry":
|
package/dist/diagnostic.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"diagnostic.js","sourceRoot":"","sources":["../src/diagnostic.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgHH,SAAS,iBAAiB,CAAC,CAAQ;IACjC,MAAM,IAAI,KAAK,CAAC,8BAA+B,CAAsB,CAAC,IAAI,EAAE,CAAC,CAAC;AAChF,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,SAAS,QAAQ,CAAC,CAAa;IAC7B,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,uBAAuB;YAC1B,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,EAAE,CAAC;QACvF,KAAK,oBAAoB;YACvB,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,IAAI,EAAE,KAAK,CAAC,CAAC,MAAM,IAAI,EAAE,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QACtF,KAAK,2BAA2B;YAC9B,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC;QAClD,KAAK,mBAAmB;YACtB,OAAO,GAAG,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,QAAQ,KAAK,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC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,CAAC;IAChC,CAAC;AACH,CAAC;AAID,MAAM,UAAU,yBAAyB;IACvC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAiB,EAAE,CAAC;IACjC,OAAO;QACL,IAAI,CAAC,CAAC;YACJ,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;YACxB,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO;YAC1B,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QAClB,CAAC;QACD,KAAK;YACH,MAAM,GAAG,GAAG,OAAO,CAAC,KAAK,EAAE,CAAC;YAC5B,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;YACnB,IAAI,CAAC,KAAK,EAAE,CAAC;YACb,OAAO,GAAG,CAAC;QACb,CAAC;KACF,CAAC;AACJ,CAAC"}
|
package/dist/logical-id.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* THE logical-id seam
|
|
2
|
+
* THE logical-id seam. A logical component groups the physical
|
|
3
3
|
* identities that realize it; the key is a pure function of one identity:
|
|
4
4
|
* - external custom-element -> logical::<tagName>
|
|
5
5
|
* - external react/vue with `wraps` -> its TARGET's tag key (same as above)
|
|
6
6
|
* - everything else -> null (singleton: logicalId = physical id)
|
|
7
|
-
* Tag keys are deliberately modulePath-free
|
|
8
|
-
* from the identity alone so every repo lands on the same id
|
|
9
|
-
* Keyed on tag name alone, not package+tag
|
|
7
|
+
* Tag keys are deliberately modulePath-free and derivable
|
|
8
|
+
* from the identity alone so every repo lands on the same id.
|
|
9
|
+
* Keyed on tag name alone, not package+tag: tag names
|
|
10
10
|
* are the platform's global-uniqueness contract, and package-keying split a
|
|
11
11
|
* resolved custom element from its package-unresolved twin onto two logical
|
|
12
12
|
* ids for the same element.
|
package/dist/occurrence-id.d.ts
CHANGED
|
@@ -8,12 +8,10 @@
|
|
|
8
8
|
* id === computeOccurrenceId(o.componentId, o.filePath, o.line, o.column, o.ownerComponentId)
|
|
9
9
|
*
|
|
10
10
|
* `ownerComponentId` participates in the hash so that one JSX call site
|
|
11
|
-
* fanning out to multiple owner resolutions (helper-call fanout
|
|
12
|
-
*
|
|
13
|
-
* produces distinct ids per resolution. When `ownerComponentId` is
|
|
11
|
+
* fanning out to multiple owner resolutions (helper-call fanout) produces
|
|
12
|
+
* distinct ids per resolution. When `ownerComponentId` is
|
|
14
13
|
* undefined (parser-direct occurrence with no owner, or root JSX), the
|
|
15
|
-
* hash is computed without an owner segment
|
|
16
|
-
* pre-fanout occurrences.
|
|
14
|
+
* hash is computed without an owner segment.
|
|
17
15
|
*
|
|
18
16
|
* 64 bits of entropy via 16-char SHA-256 truncation. Birthday-bound
|
|
19
17
|
* collision at ~4 billion occurrences; full hash is overkill for current
|
package/dist/occurrence-id.js
CHANGED
|
@@ -9,12 +9,10 @@ import { createHash } from "node:crypto";
|
|
|
9
9
|
* id === computeOccurrenceId(o.componentId, o.filePath, o.line, o.column, o.ownerComponentId)
|
|
10
10
|
*
|
|
11
11
|
* `ownerComponentId` participates in the hash so that one JSX call site
|
|
12
|
-
* fanning out to multiple owner resolutions (helper-call fanout
|
|
13
|
-
*
|
|
14
|
-
* produces distinct ids per resolution. When `ownerComponentId` is
|
|
12
|
+
* fanning out to multiple owner resolutions (helper-call fanout) produces
|
|
13
|
+
* distinct ids per resolution. When `ownerComponentId` is
|
|
15
14
|
* undefined (parser-direct occurrence with no owner, or root JSX), the
|
|
16
|
-
* hash is computed without an owner segment
|
|
17
|
-
* pre-fanout occurrences.
|
|
15
|
+
* hash is computed without an owner segment.
|
|
18
16
|
*
|
|
19
17
|
* 64 bits of entropy via 16-char SHA-256 truncation. Birthday-bound
|
|
20
18
|
* collision at ~4 billion occurrences; full hash is overkill for current
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"occurrence-id.js","sourceRoot":"","sources":["../src/occurrence-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC
|
|
1
|
+
{"version":3,"file":"occurrence-id.js","sourceRoot":"","sources":["../src/occurrence-id.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAAmB,EACnB,QAAgB,EAChB,IAAY,EACZ,MAAc,EACd,gBAAyB;IAEzB,MAAM,IAAI,GAAG,GAAG,WAAW,IAAI,QAAQ,IAAI,IAAI,IAAI,MAAM,EAAE,CAAC;IAC5D,MAAM,GAAG,GAAG,gBAAgB,KAAK,SAAS,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAClF,OAAO,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;AACrE,CAAC"}
|
package/dist/output-types.d.ts
CHANGED
|
@@ -79,9 +79,6 @@ export type InvocableDecl = {
|
|
|
79
79
|
};
|
|
80
80
|
/**
|
|
81
81
|
* Per-component manifest payload as it appears in `component-compass.json`.
|
|
82
|
-
* Field set is the closed-form Phase 3 schema (trimmed): description, lifecycle,
|
|
83
|
-
* and the three per-feature record maps. Methods, CSS surfaces, inheritance,
|
|
84
|
-
* and `since` are deferred to later sub-plans / phases.
|
|
85
82
|
*/
|
|
86
83
|
export type AuthoredManifestData = {
|
|
87
84
|
description?: string;
|
|
@@ -145,8 +142,8 @@ export type DeclaredProp = {
|
|
|
145
142
|
* prop has any default (a default makes it optional); otherwise absent. */
|
|
146
143
|
required?: boolean;
|
|
147
144
|
/** Literal default value, when the default is a literal. Same union as
|
|
148
|
-
* `PropValueEntry.value
|
|
149
|
-
*
|
|
145
|
+
* `PropValueEntry.value`, so it stringifies identically to observed written
|
|
146
|
+
* values. Absent for no default or a non-literal default. */
|
|
150
147
|
default?: string | number | boolean | null;
|
|
151
148
|
};
|
|
152
149
|
/**
|
|
@@ -176,9 +173,8 @@ export type EventDistribution = {
|
|
|
176
173
|
boundCount: number;
|
|
177
174
|
};
|
|
178
175
|
/**
|
|
179
|
-
* Entry/wrapper package through which this repo reached the component
|
|
180
|
-
*
|
|
181
|
-
* identity. `version` is the entry package's installed version, null when
|
|
176
|
+
* Entry/wrapper package through which this repo reached the component.
|
|
177
|
+
* Scan-observational provenance — how the repo imported it — not identity. `version` is the entry package's installed version, null when
|
|
182
178
|
* its package.json is unreadable or unversioned.
|
|
183
179
|
*/
|
|
184
180
|
export type EntryPackageRef = {
|
|
@@ -186,7 +182,7 @@ export type EntryPackageRef = {
|
|
|
186
182
|
version: string | null;
|
|
187
183
|
};
|
|
188
184
|
/**
|
|
189
|
-
* Why this component is in the inventory
|
|
185
|
+
* Why this component is in the inventory.
|
|
190
186
|
* Total classification; precedence: direct > root > none.
|
|
191
187
|
* - direct: ≥1 parsed occurrence (JSX / template / HTML tag).
|
|
192
188
|
* - root: local, zero occurrences, framework entry-point file's default export.
|
|
@@ -198,7 +194,7 @@ export type OutputComponent = {
|
|
|
198
194
|
id: string;
|
|
199
195
|
identity: OutputIdentity;
|
|
200
196
|
/**
|
|
201
|
-
* Logical-component id this physical identity realizes
|
|
197
|
+
* Logical-component id this physical identity realizes.
|
|
202
198
|
* Singletons carry their own `id`; wrap chains share the tag-keyed hash.
|
|
203
199
|
* See plugin-core/src/logical-id.ts — the ONE derivation seam.
|
|
204
200
|
*/
|
|
@@ -221,7 +217,7 @@ export type OutputComponent = {
|
|
|
221
217
|
/** Source-derived declared prop API. Local components only; absent when the
|
|
222
218
|
* declaration site is unreadable. Orthogonal to `manifest`. */
|
|
223
219
|
declared?: DeclaredPropApi;
|
|
224
|
-
/** Entry/wrapper packages this repo reached the component through
|
|
220
|
+
/** Entry/wrapper packages this repo reached the component through.
|
|
225
221
|
* Deduped by {package, version}, sorted. Present only when non-empty. */
|
|
226
222
|
entryPackages?: EntryPackageRef[];
|
|
227
223
|
/** Package version from package.json or CEM. Null for external packages not versioned at scan time. */
|
|
@@ -245,11 +241,11 @@ export type OutputOccurrence = {
|
|
|
245
241
|
props: Record<string, PropValueState>;
|
|
246
242
|
/** Event names bound at this call site (Vue/html/lit). React handlers stay in `props`. */
|
|
247
243
|
events?: string[];
|
|
248
|
-
/**
|
|
244
|
+
/** Stable id keyed on (componentId, filePath, line, column). */
|
|
249
245
|
occurrenceId: string;
|
|
250
|
-
/**
|
|
246
|
+
/** occurrenceId of nearest tracked ancestor. Absent if root in this scope. */
|
|
251
247
|
parentOccurrenceId?: string;
|
|
252
|
-
/**
|
|
248
|
+
/** Distance from highest tracked-rootless ancestor in same lexical scope. */
|
|
253
249
|
depth?: number;
|
|
254
250
|
/**
|
|
255
251
|
* Stable id of the component-definition that lexically contains this call
|
|
@@ -285,11 +281,12 @@ export type ScanMeta = {
|
|
|
285
281
|
};
|
|
286
282
|
};
|
|
287
283
|
/**
|
|
288
|
-
* First-class realization edge
|
|
289
|
-
*
|
|
290
|
-
*
|
|
284
|
+
* First-class realization edge. The edge target is a logical key,
|
|
285
|
+
* bound to a physical componentId only when that target was observed in this
|
|
286
|
+
* repo's scan.
|
|
291
287
|
* Only "wraps" is emitted today; the union stays open for future sources
|
|
292
|
-
* ("re-exports" provenance is already carried by
|
|
288
|
+
* ("re-exports" provenance is already carried by leaf folding and
|
|
289
|
+
* entryPackages).
|
|
293
290
|
*/
|
|
294
291
|
export type RelationshipEdge = {
|
|
295
292
|
sourceId: string;
|
package/dist/scan-types.d.ts
CHANGED
|
@@ -139,7 +139,6 @@ export type ScanConfig = {};
|
|
|
139
139
|
* literal set from a ternary), or boolean-shorthand `true`, or literal `null`.
|
|
140
140
|
* - reference: a non-literal captured by name/path but not resolved.
|
|
141
141
|
* - dynamic: opaque (call, spread, object/array, mixed template, etc.).
|
|
142
|
-
* The `resolved` tier is added by the engine in Plan 2.
|
|
143
142
|
*/
|
|
144
143
|
export type PropUsage = {
|
|
145
144
|
name: string;
|
|
@@ -165,19 +164,19 @@ export type Occurrence = {
|
|
|
165
164
|
props: PropUsage[];
|
|
166
165
|
events: string[];
|
|
167
166
|
/**
|
|
168
|
-
*
|
|
167
|
+
* Parser-side parent reference. Index into the same
|
|
169
168
|
* ParseResult.occurrences array. `undefined` = no tracked parent in this
|
|
170
169
|
* lexical scope. The CLI's projection layer (`parseResultsToOccurrences`)
|
|
171
170
|
* resolves this index into a `parentOccurrenceId` string; downstream
|
|
172
171
|
* queries needing the parent's componentId look it up via the flat
|
|
173
|
-
* occurrence stream. Cross-file composition is out of scope
|
|
174
|
-
*
|
|
172
|
+
* occurrence stream. Cross-file composition is out of scope, so the index
|
|
173
|
+
* is local to one ParseResult.
|
|
175
174
|
*/
|
|
176
175
|
parentRef?: number;
|
|
177
176
|
/**
|
|
178
|
-
*
|
|
179
|
-
*
|
|
180
|
-
*
|
|
177
|
+
* Distance from the highest tracked-rootless ancestor in the same lexical
|
|
178
|
+
* scope. 0 for roots; matches `parentStack.length` at the time the
|
|
179
|
+
* occurrence was emitted.
|
|
181
180
|
*/
|
|
182
181
|
depth?: number;
|
|
183
182
|
/**
|
|
@@ -198,7 +197,7 @@ export type Occurrence = {
|
|
|
198
197
|
* Per-language framing:
|
|
199
198
|
* - parser-vue: owner = enclosing SFC's vue-component Identity.
|
|
200
199
|
* - parser-react: owner = nearest enclosing function/class Component binding.
|
|
201
|
-
* - parser-lit (planned
|
|
200
|
+
* - parser-lit (planned): owner = enclosing @customElement class Identity.
|
|
202
201
|
* - parser-html: no owner; HTML files are not Component definitions.
|
|
203
202
|
*
|
|
204
203
|
* Path-based identity resolution must use `normalizeOwnerPath` (from
|
|
@@ -280,6 +279,6 @@ export type ScanOutput = {
|
|
|
280
279
|
components: OutputComponent[];
|
|
281
280
|
occurrences: OutputOccurrence[];
|
|
282
281
|
diagnostics: Diagnostic[];
|
|
283
|
-
/** Realization edges
|
|
282
|
+
/** Realization edges. Populated post-resolve by applyWrapRelationships (scan.ts). */
|
|
284
283
|
relationships: RelationshipEdge[];
|
|
285
284
|
};
|