@component-compass/reference-graph 0.0.0-pr-169-9586f80-20260526131456 → 0.1.1
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/builder.d.ts +32 -1
- package/dist/builder.js +62 -3
- package/dist/builder.js.map +1 -1
- package/dist/engine/helper-callers.d.ts +17 -7
- package/dist/engine/helper-callers.js +104 -53
- package/dist/engine/helper-callers.js.map +1 -1
- package/dist/engine/index.d.ts +69 -3
- package/dist/engine/index.js +248 -33
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/owner-resolution.d.ts +2 -2
- package/dist/engine/owner-resolution.js +1 -2
- package/dist/engine/owner-resolution.js.map +1 -1
- package/dist/engine/re-export-chain.d.ts +16 -11
- package/dist/engine/re-export-chain.js +59 -30
- package/dist/engine/re-export-chain.js.map +1 -1
- package/dist/engine/resolve-reference.js +46 -18
- package/dist/engine/resolve-reference.js.map +1 -1
- package/dist/engine/wrapper-folding.js +4 -2
- package/dist/engine/wrapper-folding.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js.map +1 -1
- package/dist/types/file-graph.d.ts +44 -1
- package/package.json +2 -2
package/dist/builder.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { OccurrenceVia, PropUsage, ResolveImport } from "@component-compass/plugin-core";
|
|
2
2
|
import type { BindingDecl, ExportRecord, Graph, ImportRecord, Reference, ScopeId } from "./index.js";
|
|
3
|
+
import type { Dialect } from "./types/file-graph.js";
|
|
3
4
|
export interface FileBuilder {
|
|
4
5
|
/** Repo-relative POSIX path of the file this builder is emitting into. */
|
|
5
6
|
readonly filePath: string;
|
|
@@ -23,9 +24,24 @@ export interface FileBuilder {
|
|
|
23
24
|
};
|
|
24
25
|
props: PropUsage[];
|
|
25
26
|
}): void;
|
|
27
|
+
/** Record a tag-based element reference (Vue auto-imports, future Lit/HTML
|
|
28
|
+
* elements). Pushes a parallel ownership entry with `kind: "tag"`. */
|
|
29
|
+
addTagUsage(usage: {
|
|
30
|
+
tagName: string;
|
|
31
|
+
loc: {
|
|
32
|
+
line: number;
|
|
33
|
+
column: number;
|
|
34
|
+
};
|
|
35
|
+
props: PropUsage[];
|
|
36
|
+
}): void;
|
|
26
37
|
/** Wire the owner of the last-emitted JsxUsage. Optionally override the
|
|
27
38
|
* `via` the engine emits for this occurrence (see FileGraph.ownership). */
|
|
28
39
|
setOwner(ownerSymbolRef: Reference | null, viaOverride?: OccurrenceVia): void;
|
|
40
|
+
/** Wire the owner of the most-recently-emitted TagUsage. Walks backward
|
|
41
|
+
* through `ownership` to find the latest `kind: "tag"` entry, so it
|
|
42
|
+
* remains correct when a TagUsage push is followed by a JsxUsage push
|
|
43
|
+
* (or vice versa). No-op when no tag-kind ownership entry exists. */
|
|
44
|
+
setTagOwner(ownerSymbolRef: Reference | null, viaOverride?: OccurrenceVia): void;
|
|
29
45
|
/** Same as setOwner but addresses a specific ownership entry by index.
|
|
30
46
|
* Used by parser-react's prop-forward finalize pass (#151) to re-attribute
|
|
31
47
|
* the original construction-site ownership entry without disturbing later
|
|
@@ -60,9 +76,24 @@ export interface FileBuilder {
|
|
|
60
76
|
scope?: ScopeId;
|
|
61
77
|
};
|
|
62
78
|
}): void;
|
|
79
|
+
/** Mark the most-recently-emitted usage as the lexical parent for any
|
|
80
|
+
* subsequent usages emitted before the matching `popUsageScope`. Parsers
|
|
81
|
+
* walking an element tree push when entering a child-bearing element and
|
|
82
|
+
* pop on exit; the builder stamps `parentUsageIdx` + `depth` on ownership
|
|
83
|
+
* entries while the stack is non-empty.
|
|
84
|
+
*
|
|
85
|
+
* Parent matching is intra-kind: a jsx usage's parent must also be jsx,
|
|
86
|
+
* a tag usage's parent must also be tag. When a mixed-kind boundary is
|
|
87
|
+
* crossed, depth still reflects the open scope but `parentUsageIdx`
|
|
88
|
+
* is omitted.
|
|
89
|
+
*
|
|
90
|
+
* No-op when there are no emitted usages yet. */
|
|
91
|
+
pushUsageScope(): void;
|
|
92
|
+
/** Pop the most-recent parent-stack frame. No-op when the stack is empty. */
|
|
93
|
+
popUsageScope(): void;
|
|
63
94
|
}
|
|
64
95
|
export interface GraphBuilder {
|
|
65
|
-
beginFile(filePath: string): FileBuilder;
|
|
96
|
+
beginFile(filePath: string, dialect?: Dialect): FileBuilder;
|
|
66
97
|
build(): Graph;
|
|
67
98
|
}
|
|
68
99
|
export type CreateGraphBuilderOptions = {
|
package/dist/builder.js
CHANGED
|
@@ -7,18 +7,24 @@ import { MODULE_SCOPE } from "./index.js";
|
|
|
7
7
|
export function createGraphBuilder(opts) {
|
|
8
8
|
const files = new Map();
|
|
9
9
|
return {
|
|
10
|
-
beginFile(filePath) {
|
|
10
|
+
beginFile(filePath, dialect = "react") {
|
|
11
11
|
const scopes = new Map([[MODULE_SCOPE, { parent: null }]]);
|
|
12
12
|
const declarations = new Map();
|
|
13
13
|
const imports = [];
|
|
14
14
|
const importsByLocal = new Map();
|
|
15
15
|
const exports = [];
|
|
16
16
|
const jsxUsages = [];
|
|
17
|
+
const tagUsages = [];
|
|
17
18
|
const ownership = [];
|
|
18
19
|
const bodyCalls = [];
|
|
19
20
|
const scopeStack = [MODULE_SCOPE];
|
|
20
21
|
let nextScopeId = 1;
|
|
21
|
-
|
|
22
|
+
// Lexical parent stack for composition tracking. Each frame records the
|
|
23
|
+
// usage-array index + kind of the most-recently-emitted usage when
|
|
24
|
+
// `pushUsageScope` was called. See FileGraph.ownership.parentUsageIdx /
|
|
25
|
+
// depth.
|
|
26
|
+
const parentStack = [];
|
|
27
|
+
const fg = { filePath, dialect, scopes, declarations, imports, importsByLocal, exports, jsxUsages, tagUsages, ownership, bodyCalls };
|
|
22
28
|
files.set(filePath, fg);
|
|
23
29
|
return {
|
|
24
30
|
filePath,
|
|
@@ -58,7 +64,29 @@ export function createGraphBuilder(opts) {
|
|
|
58
64
|
loc: usage.loc,
|
|
59
65
|
props: usage.props,
|
|
60
66
|
});
|
|
61
|
-
|
|
67
|
+
const top = parentStack[parentStack.length - 1];
|
|
68
|
+
const entry = {
|
|
69
|
+
usageIdx: jsxUsages.length - 1,
|
|
70
|
+
kind: "jsx",
|
|
71
|
+
ownerSymbolRef: null,
|
|
72
|
+
depth: parentStack.length,
|
|
73
|
+
};
|
|
74
|
+
if (top && top.kind === "jsx")
|
|
75
|
+
entry.parentUsageIdx = top.idx;
|
|
76
|
+
ownership.push(entry);
|
|
77
|
+
},
|
|
78
|
+
addTagUsage(usage) {
|
|
79
|
+
tagUsages.push({ tagName: usage.tagName, loc: usage.loc, props: usage.props });
|
|
80
|
+
const top = parentStack[parentStack.length - 1];
|
|
81
|
+
const entry = {
|
|
82
|
+
usageIdx: tagUsages.length - 1,
|
|
83
|
+
kind: "tag",
|
|
84
|
+
ownerSymbolRef: null,
|
|
85
|
+
depth: parentStack.length,
|
|
86
|
+
};
|
|
87
|
+
if (top && top.kind === "tag")
|
|
88
|
+
entry.parentUsageIdx = top.idx;
|
|
89
|
+
ownership.push(entry);
|
|
62
90
|
},
|
|
63
91
|
setOwner(ownerSymbolRef, viaOverride) {
|
|
64
92
|
if (ownership.length === 0)
|
|
@@ -71,6 +99,20 @@ export function createGraphBuilder(opts) {
|
|
|
71
99
|
}
|
|
72
100
|
}
|
|
73
101
|
},
|
|
102
|
+
setTagOwner(ownerSymbolRef, viaOverride) {
|
|
103
|
+
// Walk backward to find the latest "tag" entry — setTagOwner must
|
|
104
|
+
// remain correct when a TagUsage push is followed by a JsxUsage
|
|
105
|
+
// push (or vice versa). No-op when no tag entry exists.
|
|
106
|
+
for (let i = ownership.length - 1; i >= 0; i--) {
|
|
107
|
+
const entry = ownership[i];
|
|
108
|
+
if (entry?.kind === "tag") {
|
|
109
|
+
entry.ownerSymbolRef = ownerSymbolRef;
|
|
110
|
+
if (viaOverride !== undefined)
|
|
111
|
+
entry.viaOverride = viaOverride;
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
},
|
|
74
116
|
setOwnerAt(usageIdx, ownerSymbolRef, viaOverride) {
|
|
75
117
|
const entry = ownership[usageIdx];
|
|
76
118
|
if (!entry)
|
|
@@ -93,6 +135,23 @@ export function createGraphBuilder(opts) {
|
|
|
93
135
|
const scope = record.callee.scope ?? scopeStack[scopeStack.length - 1] ?? MODULE_SCOPE;
|
|
94
136
|
bodyCalls.push({ ownerSymbol: record.ownerSymbol, callee: { ...record.callee, scope } });
|
|
95
137
|
},
|
|
138
|
+
pushUsageScope() {
|
|
139
|
+
// Push the most-recently-emitted usage as the parent frame. No-op
|
|
140
|
+
// when there are no ownership entries yet — pushing before any
|
|
141
|
+
// usage has been emitted is meaningless.
|
|
142
|
+
if (ownership.length === 0)
|
|
143
|
+
return;
|
|
144
|
+
const last = ownership[ownership.length - 1];
|
|
145
|
+
if (!last)
|
|
146
|
+
return;
|
|
147
|
+
parentStack.push({ idx: last.usageIdx, kind: last.kind });
|
|
148
|
+
},
|
|
149
|
+
popUsageScope() {
|
|
150
|
+
// Pop is a no-op on empty stack — defensive against parser bugs
|
|
151
|
+
// emitting an unmatched pop. Throwing here would force every
|
|
152
|
+
// emitter to track stack depth.
|
|
153
|
+
parentStack.pop();
|
|
154
|
+
},
|
|
96
155
|
};
|
|
97
156
|
},
|
|
98
157
|
build() {
|
package/dist/builder.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kDAAkD;AAClD,wDAAwD;AACxD,qEAAqE;AAErE,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAYjD,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"builder.js","sourceRoot":"","sources":["../src/builder.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,kDAAkD;AAClD,wDAAwD;AACxD,qEAAqE;AAErE,OAAO,EAAE,UAAU,EAAE,QAAQ,EA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,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;gBAClB,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;gBAC/B,MAAM,iBAAiB,GAAG,CAAC,OAAe,EAAiB,EAAE;oBAC3D,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;wBAAE,OAAO,IAAI,CAAC;oBACtC,MAAM,GAAG,GAAG,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;oBAC5D,oEAAoE;oBACpE,kEAAkE;oBAClE,mEAAmE;oBACnE,mEAAmE;oBACnE,kEAAkE;oBAClE,6BAA6B;oBAC7B,IAAI,GAAG,CAAC,UAAU,CAAC,IAAI,CAAC;wBAAE,OAAO,IAAI,CAAC;oBACtC,OAAO,GAAG,CAAC;gBACb,CAAC,CAAC;gBACF,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,iBAAiB,EAAE,CAAC;YAC3E,CAAC;YACD,OAAO,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,CAAC,cAAc,EAAE,CAAC;QACxD,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -35,11 +35,15 @@ export type SymbolKey = {
|
|
|
35
35
|
export type HelperCallerIndex = {
|
|
36
36
|
get(key: SymbolKey): Set<SymbolKey> | undefined;
|
|
37
37
|
};
|
|
38
|
+
export type ClassifiedHelperIndex = HelperCallerIndex & {
|
|
39
|
+
classification(file: string, symbol: string): Classification;
|
|
40
|
+
};
|
|
38
41
|
/**
|
|
39
|
-
*
|
|
42
|
+
* Three-phase build of the helper → component-callers reverse index plus
|
|
43
|
+
* per-decl classification cache.
|
|
40
44
|
*
|
|
41
|
-
*
|
|
42
|
-
* collecting caller-side references from three sources:
|
|
45
|
+
* Phase 1 (collect) walks every module-scope `Function`-valued BindingDecl
|
|
46
|
+
* across the graph, collecting caller-side references from three sources:
|
|
43
47
|
*
|
|
44
48
|
* 1. `TypeOf` refs inside the decl's return-type expressions
|
|
45
49
|
* (`decl.value.returns`) — captures `() => helper()` shapes where the
|
|
@@ -56,11 +60,17 @@ export type HelperCallerIndex = {
|
|
|
56
60
|
* Without this pass, helper-classified functions consumed via JSX
|
|
57
61
|
* (the dominant React call shape) never appear as called by anyone.
|
|
58
62
|
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
63
|
+
* Phase 2 (classify) runs structural classification on every module-scope
|
|
64
|
+
* Function decl, with a reclassification gate: a decl classified as
|
|
65
|
+
* `"component"` but consumed only as a value (never JSX) is reclassified
|
|
66
|
+
* as `"helper"`.
|
|
67
|
+
*
|
|
68
|
+
* Phase 3 (index) walks the pending value-refs and JSX-calls collected in
|
|
69
|
+
* phase 1, recording caller edges for targets classified as `"helper"`. Each
|
|
70
|
+
* collected ref resolves to its declaring file/symbol; external and
|
|
71
|
+
* unresolvable refs are skipped.
|
|
62
72
|
*
|
|
63
73
|
* Cost: O(declarations × refs-per-declaration + jsx-usages). Cross-file
|
|
64
74
|
* resolution uses the existing module resolver — no new IO.
|
|
65
75
|
*/
|
|
66
|
-
export declare function buildHelperCallers(graph: Graph):
|
|
76
|
+
export declare function buildHelperCallers(graph: Graph): ClassifiedHelperIndex;
|
|
@@ -72,10 +72,11 @@ export function hasJsx(t, graph, originFile, guard) {
|
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
-
*
|
|
75
|
+
* Three-phase build of the helper → component-callers reverse index plus
|
|
76
|
+
* per-decl classification cache.
|
|
76
77
|
*
|
|
77
|
-
*
|
|
78
|
-
* collecting caller-side references from three sources:
|
|
78
|
+
* Phase 1 (collect) walks every module-scope `Function`-valued BindingDecl
|
|
79
|
+
* across the graph, collecting caller-side references from three sources:
|
|
79
80
|
*
|
|
80
81
|
* 1. `TypeOf` refs inside the decl's return-type expressions
|
|
81
82
|
* (`decl.value.returns`) — captures `() => helper()` shapes where the
|
|
@@ -92,30 +93,30 @@ export function hasJsx(t, graph, originFile, guard) {
|
|
|
92
93
|
* Without this pass, helper-classified functions consumed via JSX
|
|
93
94
|
* (the dominant React call shape) never appear as called by anyone.
|
|
94
95
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
96
|
+
* Phase 2 (classify) runs structural classification on every module-scope
|
|
97
|
+
* Function decl, with a reclassification gate: a decl classified as
|
|
98
|
+
* `"component"` but consumed only as a value (never JSX) is reclassified
|
|
99
|
+
* as `"helper"`.
|
|
100
|
+
*
|
|
101
|
+
* Phase 3 (index) walks the pending value-refs and JSX-calls collected in
|
|
102
|
+
* phase 1, recording caller edges for targets classified as `"helper"`. Each
|
|
103
|
+
* collected ref resolves to its declaring file/symbol; external and
|
|
104
|
+
* unresolvable refs are skipped.
|
|
98
105
|
*
|
|
99
106
|
* Cost: O(declarations × refs-per-declaration + jsx-usages). Cross-file
|
|
100
107
|
* resolution uses the existing module resolver — no new IO.
|
|
101
108
|
*/
|
|
102
109
|
export function buildHelperCallers(graph) {
|
|
110
|
+
// ── Phase 1: collect ────────────────────────────────────────────────────
|
|
111
|
+
// Per-target accumulators (file::symbol → ...). callerKeysByHelper dedupes
|
|
112
|
+
// caller edges in O(1); valueConsumers mirrors the index but indexed by
|
|
113
|
+
// target (used in phase 2 for the reclassification rule).
|
|
103
114
|
const index = new Map();
|
|
104
|
-
// Parallel string-key sets so dedupe runs in O(1) instead of an O(n) linear
|
|
105
|
-
// scan of `Set<SymbolKey>` (whose entries are object-identity-keyed and so
|
|
106
|
-
// can't dedupe themselves on field equality).
|
|
107
115
|
const callerKeysByHelper = new Map();
|
|
116
|
+
const valueConsumers = new Map();
|
|
117
|
+
// Per-decl classification cache populated in phase 2.
|
|
108
118
|
const classificationCache = new Map();
|
|
109
119
|
const refResolutionCache = new Map();
|
|
110
|
-
function classifyCached(decl, file) {
|
|
111
|
-
const key = `${file}::${decl.symbol}`;
|
|
112
|
-
const hit = classificationCache.get(key);
|
|
113
|
-
if (hit !== undefined)
|
|
114
|
-
return hit;
|
|
115
|
-
const result = classifyDeclaration(decl, graph, file);
|
|
116
|
-
classificationCache.set(key, result);
|
|
117
|
-
return result;
|
|
118
|
-
}
|
|
119
120
|
function resolveRefCached(ref, callerFile, callerGraph) {
|
|
120
121
|
const key = `${callerFile}::${ref.symbol}`;
|
|
121
122
|
if (refResolutionCache.has(key)) {
|
|
@@ -125,24 +126,7 @@ export function buildHelperCallers(graph) {
|
|
|
125
126
|
refResolutionCache.set(key, result);
|
|
126
127
|
return result;
|
|
127
128
|
}
|
|
128
|
-
|
|
129
|
-
const keyStr = `${target.file}::${target.decl.symbol}`;
|
|
130
|
-
const callerKeyStr = `${callerKey.file}::${callerKey.symbol}`;
|
|
131
|
-
let seen = callerKeysByHelper.get(keyStr);
|
|
132
|
-
if (!seen) {
|
|
133
|
-
seen = new Set();
|
|
134
|
-
callerKeysByHelper.set(keyStr, seen);
|
|
135
|
-
}
|
|
136
|
-
if (seen.has(callerKeyStr))
|
|
137
|
-
return;
|
|
138
|
-
seen.add(callerKeyStr);
|
|
139
|
-
let callers = index.get(keyStr);
|
|
140
|
-
if (!callers) {
|
|
141
|
-
callers = new Set();
|
|
142
|
-
index.set(keyStr, callers);
|
|
143
|
-
}
|
|
144
|
-
callers.add(callerKey);
|
|
145
|
-
}
|
|
129
|
+
const pendingValueRefs = [];
|
|
146
130
|
for (const [file, fileGraph] of graph.files) {
|
|
147
131
|
for (const decl of fileGraph.declarations.values()) {
|
|
148
132
|
if (decl.scope !== MODULE_SCOPE)
|
|
@@ -161,42 +145,108 @@ export function buildHelperCallers(graph) {
|
|
|
161
145
|
const target = resolveRefCached(ref, file, fileGraph);
|
|
162
146
|
if (!target)
|
|
163
147
|
continue;
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
148
|
+
pendingValueRefs.push({ target, caller: callerKey });
|
|
149
|
+
const targetKey = `${target.file}::${target.decl.symbol}`;
|
|
150
|
+
let consumerSet = valueConsumers.get(targetKey);
|
|
151
|
+
if (!consumerSet) {
|
|
152
|
+
consumerSet = new Set();
|
|
153
|
+
valueConsumers.set(targetKey, consumerSet);
|
|
154
|
+
}
|
|
155
|
+
consumerSet.add(`${callerKey.file}::${callerKey.symbol}`);
|
|
168
156
|
}
|
|
169
157
|
}
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
// through with `viaPrefix: [hop]` un-terminated.
|
|
158
|
+
}
|
|
159
|
+
const pendingJsxCalls = [];
|
|
160
|
+
const jsxConsumerCount = new Map();
|
|
161
|
+
for (const [file, fileGraph] of graph.files) {
|
|
175
162
|
for (let i = 0; i < fileGraph.jsxUsages.length; i++) {
|
|
176
163
|
const usage = fileGraph.jsxUsages[i];
|
|
177
164
|
if (!usage)
|
|
178
165
|
continue;
|
|
179
|
-
const ownership = fileGraph.ownership[i];
|
|
180
|
-
if (!ownership?.ownerSymbolRef)
|
|
181
|
-
continue;
|
|
182
166
|
const target = resolveRefCached(usage.ref, file, fileGraph);
|
|
183
167
|
if (!target)
|
|
184
168
|
continue;
|
|
185
|
-
const
|
|
186
|
-
|
|
169
|
+
const targetKey = `${target.file}::${target.decl.symbol}`;
|
|
170
|
+
jsxConsumerCount.set(targetKey, (jsxConsumerCount.get(targetKey) ?? 0) + 1);
|
|
171
|
+
const ownership = fileGraph.ownership[i];
|
|
172
|
+
if (!ownership?.ownerSymbolRef)
|
|
187
173
|
continue;
|
|
188
174
|
const callerTarget = resolveRefCached(ownership.ownerSymbolRef, file, fileGraph);
|
|
189
175
|
if (!callerTarget)
|
|
190
176
|
continue;
|
|
191
177
|
if (callerTarget.decl.scope !== MODULE_SCOPE)
|
|
192
178
|
continue;
|
|
193
|
-
|
|
179
|
+
pendingJsxCalls.push({
|
|
180
|
+
target,
|
|
181
|
+
caller: { file: callerTarget.file, symbol: callerTarget.decl.symbol },
|
|
182
|
+
});
|
|
194
183
|
}
|
|
195
184
|
}
|
|
185
|
+
// ── Phase 2: classify ───────────────────────────────────────────────────
|
|
186
|
+
// Structural classification, then reclassification gate. (The gate kicks
|
|
187
|
+
// in at task 3; today it's a no-op because we already cache the result.)
|
|
188
|
+
function classifyKey(file, decl) {
|
|
189
|
+
const key = `${file}::${decl.symbol}`;
|
|
190
|
+
const hit = classificationCache.get(key);
|
|
191
|
+
if (hit !== undefined)
|
|
192
|
+
return hit;
|
|
193
|
+
let result = classifyDeclaration(decl, graph, file);
|
|
194
|
+
if (result === "component"
|
|
195
|
+
&& (jsxConsumerCount.get(key) ?? 0) === 0
|
|
196
|
+
&& (valueConsumers.get(key)?.size ?? 0) > 0) {
|
|
197
|
+
result = "helper";
|
|
198
|
+
}
|
|
199
|
+
classificationCache.set(key, result);
|
|
200
|
+
return result;
|
|
201
|
+
}
|
|
202
|
+
// Walk every module-scope Function-valued decl so its classification lands
|
|
203
|
+
// in the cache before resolveOwnerChain runs. Non-Function decls classify
|
|
204
|
+
// lazily via the same path.
|
|
205
|
+
for (const [file, fileGraph] of graph.files) {
|
|
206
|
+
for (const decl of fileGraph.declarations.values()) {
|
|
207
|
+
if (decl.scope !== MODULE_SCOPE)
|
|
208
|
+
continue;
|
|
209
|
+
if (decl.value.kind !== "Function")
|
|
210
|
+
continue;
|
|
211
|
+
classifyKey(file, decl);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
// ── Phase 3: index ──────────────────────────────────────────────────────
|
|
215
|
+
function recordCallerEdge(target, callerKey) {
|
|
216
|
+
const keyStr = `${target.file}::${target.decl.symbol}`;
|
|
217
|
+
const callerKeyStr = `${callerKey.file}::${callerKey.symbol}`;
|
|
218
|
+
let seen = callerKeysByHelper.get(keyStr);
|
|
219
|
+
if (!seen) {
|
|
220
|
+
seen = new Set();
|
|
221
|
+
callerKeysByHelper.set(keyStr, seen);
|
|
222
|
+
}
|
|
223
|
+
if (seen.has(callerKeyStr))
|
|
224
|
+
return;
|
|
225
|
+
seen.add(callerKeyStr);
|
|
226
|
+
let callers = index.get(keyStr);
|
|
227
|
+
if (!callers) {
|
|
228
|
+
callers = new Set();
|
|
229
|
+
index.set(keyStr, callers);
|
|
230
|
+
}
|
|
231
|
+
callers.add(callerKey);
|
|
232
|
+
}
|
|
233
|
+
for (const { target, caller } of pendingValueRefs) {
|
|
234
|
+
if (classifyKey(target.file, target.decl) !== "helper")
|
|
235
|
+
continue;
|
|
236
|
+
recordCallerEdge(target, caller);
|
|
237
|
+
}
|
|
238
|
+
for (const { target, caller } of pendingJsxCalls) {
|
|
239
|
+
if (classifyKey(target.file, target.decl) !== "helper")
|
|
240
|
+
continue;
|
|
241
|
+
recordCallerEdge(target, caller);
|
|
242
|
+
}
|
|
196
243
|
return {
|
|
197
244
|
get(key) {
|
|
198
245
|
return index.get(`${key.file}::${key.symbol}`);
|
|
199
246
|
},
|
|
247
|
+
classification(file, symbol) {
|
|
248
|
+
return classificationCache.get(`${file}::${symbol}`) ?? "unknown";
|
|
249
|
+
},
|
|
200
250
|
};
|
|
201
251
|
}
|
|
202
252
|
/** Walk an InferredType, collecting every `TypeOf` ref found at any depth. */
|
|
@@ -280,8 +330,9 @@ function resolveRefToDecl(ref, callerFile, callerGraph, graph) {
|
|
|
280
330
|
}
|
|
281
331
|
}
|
|
282
332
|
// Fallback: locally-defined named/default exports at the resolved target.
|
|
283
|
-
//
|
|
284
|
-
//
|
|
333
|
+
// Reached when followReExportChain returned null but the target file's
|
|
334
|
+
// local exports may still match the imported symbol. Star entries are
|
|
335
|
+
// handled inside followReExportChain (#158); they don't need handling here.
|
|
285
336
|
for (const exp of targetGraph.exports) {
|
|
286
337
|
if (exp.kind === "named" && "local" in exp && exp.exportedAs === imp.imported) {
|
|
287
338
|
const decl = targetGraph.declarations.get(`${MODULE_SCOPE}::${exp.local}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper-callers.js","sourceRoot":"","sources":["../../src/engine/helper-callers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CA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ACjB,MAAM,IAAI,GAAG,YAAY,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,YAAY,KAAK,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;YACtF,IAAI,IAAI;gBAAE,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC;QAChD,CAAC;IACH,CAAC;IAED,0EAA0E;IAC1E,uEAAuE;IACvE,sEAAsE;IACtE,4EAA4E;IAC5E,KAAK,MAAM,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,CAAC;QACtC,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,IAAI,OAAO,IAAI,GAAG,IAAI,GAAG,CAAC,UAAU,KAAK,GAAG,CAAC,QAAQ,EAAE,CAAC;YAC9E,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,YAAY,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3E,IAAI,IAAI;gBAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QAC9C,CAAC;QACD,IAAI,GAAG,CAAC,IAAI,KAAK,SAAS,IAAI,OAAO,IAAI,GAAG,IAAI,GAAG,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;YAC3E,MAAM,IAAI,GAAG,WAAW,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,YAAY,KAAK,GAAG,CAAC,KAAK,EAAE,CAAC,CAAC;YAC3E,IAAI,IAAI;gBAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC;QAC9C,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/engine/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Graph } from "../index.js";
|
|
2
|
-
import type { OccurrenceVia, ComponentId, PropValueState } from "@component-compass/plugin-core";
|
|
2
|
+
import type { OccurrenceVia, ComponentId, PropValueState, DiagnosticCollector } from "@component-compass/plugin-core";
|
|
3
3
|
/** Full occurrence shape produced by the engine.
|
|
4
4
|
*
|
|
5
5
|
* `rawComponentId` carries the structured `ComponentId` (same type as in
|
|
@@ -25,8 +25,18 @@ export type EngineOccurrence = {
|
|
|
25
25
|
/** Provisional stable id (keyed on serialised componentId + location).
|
|
26
26
|
* Scan.ts re-derives using the final hashed componentId string. */
|
|
27
27
|
occurrenceId: string;
|
|
28
|
-
/** Composition depth —
|
|
28
|
+
/** Composition depth — count of tracked ancestors at emit time. Sourced from
|
|
29
|
+
* the per-file ownership entry's `depth`. Zero for root-level usages and
|
|
30
|
+
* for occurrences in files whose parser doesn't call
|
|
31
|
+
* `pushUsageScope`/`popUsageScope`. Helper-call fanout shares the same
|
|
32
|
+
* depth across every fanned-out occurrence (they share one lexical site). */
|
|
29
33
|
depth: number;
|
|
34
|
+
/** Index into the resolved `occurrences[]` array of the immediate-tracked
|
|
35
|
+
* lexical parent. Absent for root-level usages and when the parent's
|
|
36
|
+
* emission produced no occurrence. Computed by a second pass after the
|
|
37
|
+
* main emission loop. Parent tracking is intra-kind: a jsx usage's parent
|
|
38
|
+
* must also be jsx; a tag usage's parent must also be tag. */
|
|
39
|
+
parentRef?: number;
|
|
30
40
|
/** Declaration position for local-scope identities. */
|
|
31
41
|
definition?: {
|
|
32
42
|
line: number;
|
|
@@ -36,8 +46,64 @@ export type EngineOccurrence = {
|
|
|
36
46
|
rawOwnerComponentId?: ComponentId;
|
|
37
47
|
/** Stable id of enclosing component definition. Absent when deferred. */
|
|
38
48
|
ownerComponentId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* Cross-link to the underlying custom element this react-component wraps.
|
|
51
|
+
* Present only when `wrapCallback` was supplied to `resolve` and returned a
|
|
52
|
+
* hit for this occurrence's (packageName, exportName) pair.
|
|
53
|
+
* Does NOT participate in componentId hashing.
|
|
54
|
+
*/
|
|
55
|
+
wraps?: {
|
|
56
|
+
kind: "custom-element";
|
|
57
|
+
tagName: string;
|
|
58
|
+
packageName: string;
|
|
59
|
+
};
|
|
39
60
|
};
|
|
40
61
|
export type ResolvedGraph = {
|
|
41
62
|
occurrences: EngineOccurrence[];
|
|
42
63
|
};
|
|
43
|
-
|
|
64
|
+
/**
|
|
65
|
+
* Project-wide tag → identity lookup. Supplied by the host so the engine can
|
|
66
|
+
* resolve tag-based usages (e.g. `<pie-button>` in Vue/HTML/Lit dialects) to
|
|
67
|
+
* either a CEM-known external custom element or a workspace-local web
|
|
68
|
+
* component. Both methods return `undefined` on miss; the engine never imports
|
|
69
|
+
* CEM types — it only consumes the return shapes here.
|
|
70
|
+
*/
|
|
71
|
+
export type TagResolverIndex = {
|
|
72
|
+
/** Tag → externally-declared custom element (CEM hit). */
|
|
73
|
+
externalByTag(tag: string): {
|
|
74
|
+
packageName: string;
|
|
75
|
+
modulePath?: string;
|
|
76
|
+
} | undefined;
|
|
77
|
+
/** Tag → locally-defined custom element (workspace WC). */
|
|
78
|
+
localByTag(tag: string): {
|
|
79
|
+
filePath: string;
|
|
80
|
+
exportName: string;
|
|
81
|
+
} | undefined;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Options for the `resolve` engine pass.
|
|
85
|
+
*/
|
|
86
|
+
export type ResolveOpts = {
|
|
87
|
+
/**
|
|
88
|
+
* Optional cross-link callback. Called at each external react-component
|
|
89
|
+
* emission with (packageName, exportName). When a hit is returned the engine
|
|
90
|
+
* attaches `wraps` to the emitted `EngineOccurrence`. No-op when omitted or
|
|
91
|
+
* returns null. Engine never imports CEM types — only consumes the return shape.
|
|
92
|
+
*/
|
|
93
|
+
wrapCallback?: (packageName: string, exportName: string) => {
|
|
94
|
+
tagName: string;
|
|
95
|
+
packageName: string;
|
|
96
|
+
} | null;
|
|
97
|
+
/**
|
|
98
|
+
* Optional project-wide tag resolver. Required for dialects that emit
|
|
99
|
+
* `TagUsage` entries (vue / html / lit); parser-react-only consumers can
|
|
100
|
+
* omit it.
|
|
101
|
+
*/
|
|
102
|
+
tagIndex?: TagResolverIndex;
|
|
103
|
+
/**
|
|
104
|
+
* Sink for engine-emitted diagnostics (currently: low-confidence-tag).
|
|
105
|
+
* Optional — when omitted, diagnostics are silently dropped.
|
|
106
|
+
*/
|
|
107
|
+
collector?: DiagnosticCollector;
|
|
108
|
+
};
|
|
109
|
+
export declare function resolve(graph: Graph, opts?: ResolveOpts): ResolvedGraph;
|