@component-compass/reference-graph 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/builder.d.ts +3 -3
- package/dist/builder.js +4 -6
- package/dist/builder.js.map +1 -1
- package/dist/engine/assert-never.d.ts +1 -1
- package/dist/engine/assert-never.js +1 -1
- package/dist/engine/component-shape.d.ts +18 -7
- package/dist/engine/component-shape.js +48 -18
- package/dist/engine/component-shape.js.map +1 -1
- package/dist/engine/helper-callers.d.ts +7 -10
- package/dist/engine/helper-callers.js +18 -23
- package/dist/engine/helper-callers.js.map +1 -1
- package/dist/engine/host-element.d.ts +3 -3
- package/dist/engine/host-element.js +3 -3
- package/dist/engine/index.d.ts +4 -4
- package/dist/engine/index.js +94 -77
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/library-stubs.js +1 -1
- package/dist/engine/member-identity.d.ts +9 -10
- package/dist/engine/member-identity.js +9 -10
- package/dist/engine/member-identity.js.map +1 -1
- package/dist/engine/re-export-chain.d.ts +1 -1
- package/dist/engine/re-export-chain.js +4 -3
- package/dist/engine/re-export-chain.js.map +1 -1
- package/dist/engine/registry.d.ts +21 -23
- package/dist/engine/registry.js +20 -20
- package/dist/engine/registry.js.map +1 -1
- package/dist/engine/resolve-reference.js +1 -1
- package/dist/engine/resolve-reference.js.map +1 -1
- package/dist/engine/resolve-type.d.ts +12 -0
- package/dist/engine/resolve-type.js +44 -52
- package/dist/engine/resolve-type.js.map +1 -1
- package/dist/engine/wrapper-folding.d.ts +22 -3
- package/dist/engine/wrapper-folding.js +146 -132
- package/dist/engine/wrapper-folding.js.map +1 -1
- package/dist/types/file-graph.d.ts +9 -14
- package/dist/types/inferred-type.d.ts +2 -1
- package/package.json +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Graph } from "../types/file-graph.js";
|
|
2
2
|
/**
|
|
3
3
|
* Seam: derive the export name a JSX usage attributes to, resolving
|
|
4
|
-
* namespace-import members
|
|
4
|
+
* namespace-import members.
|
|
5
5
|
*
|
|
6
6
|
* `import * as Dialog from "@radix-ui/react-dialog"` records `imported: "*"`;
|
|
7
7
|
* the member that actually names the component lives on the usage's member
|
|
@@ -13,23 +13,23 @@ import type { Graph } from "../types/file-graph.js";
|
|
|
13
13
|
*
|
|
14
14
|
* Deeper chains (`<Dialog.Root.Foo/>`) still key on the first segment as the
|
|
15
15
|
* ROOT; the remaining segments are the residual (`residualMemberChain`,
|
|
16
|
-
* below) and are re-joined into the identity by `compoundExportName
|
|
16
|
+
* below) and are re-joined into the identity by `compoundExportName`.
|
|
17
17
|
* Non-namespace imports and bare namespace usages (`<Dialog/>`, no member)
|
|
18
18
|
* return `imported` unchanged.
|
|
19
19
|
*
|
|
20
20
|
* This is the single home for the namespace-member → export-name rule; call it
|
|
21
21
|
* at every site that derives an export name from `ImportRecord.imported`, never
|
|
22
|
-
* re-derive it inline (see docs/CONTEXT.md
|
|
22
|
+
* re-derive it inline (see docs/CONTEXT.md). Provenance (`via.import`)
|
|
23
23
|
* intentionally keeps the raw `"*"` — it records the actual import statement,
|
|
24
24
|
* which was a namespace import.
|
|
25
25
|
*
|
|
26
26
|
* Both identity-derivation sites route through here: the direct-import branch
|
|
27
|
-
* (engine/index.ts
|
|
28
|
-
* `deriveIdentity
|
|
27
|
+
* (engine/index.ts) and the composition path (wrapper-folding.ts's
|
|
28
|
+
* `deriveIdentity`).
|
|
29
29
|
*/
|
|
30
30
|
export declare function effectiveExportName(imported: string, memberChain: readonly string[]): string;
|
|
31
31
|
/**
|
|
32
|
-
* The member-chain segments a usage carries BEYOND the root export
|
|
32
|
+
* The member-chain segments a usage carries BEYOND the root export.
|
|
33
33
|
* `effectiveExportName` consumes the first segment as the export for a
|
|
34
34
|
* namespace import (`import * as Dialog; <Dialog.Root.Foo/>` → root `Root`,
|
|
35
35
|
* residual `["Foo"]`); every other import form keeps `imported` as the root,
|
|
@@ -41,16 +41,15 @@ export declare function effectiveExportName(imported: string, memberChain: reado
|
|
|
41
41
|
*/
|
|
42
42
|
export declare function residualMemberChain(imported: string, memberChain: readonly string[]): readonly string[];
|
|
43
43
|
/**
|
|
44
|
-
* THE one place a compound export name is written
|
|
44
|
+
* THE one place a compound export name is written: the root export
|
|
45
45
|
* followed by the residual member chain, dot-joined. An empty residual is the
|
|
46
46
|
* identity function, so every existing non-member path is unchanged.
|
|
47
47
|
* `parseCompoundExport` (plugin-core `id.ts`) is the matching reader.
|
|
48
48
|
*/
|
|
49
49
|
export declare function compoundExportName(root: string, residual: readonly string[]): string;
|
|
50
50
|
/**
|
|
51
|
-
* THE seam for classifying an import target that is NOT in `graph.files
|
|
52
|
-
*
|
|
53
|
-
* first-party: pin its identity to the definition file (bounded re-export
|
|
51
|
+
* THE seam for classifying an import target that is NOT in `graph.files`.
|
|
52
|
+
* A resolved absolute target owned by a workspace member is first-party: pin its identity to the definition file (bounded re-export
|
|
54
53
|
* resolution via `graph.resolveLocalDefinition`) so identity is
|
|
55
54
|
* scope-invariant between whole-repo and single-app scans, falling back to
|
|
56
55
|
* the resolved entry file. Returns null when the target is not a member (or
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Seam: derive the export name a JSX usage attributes to, resolving
|
|
3
|
-
* namespace-import members
|
|
3
|
+
* namespace-import members.
|
|
4
4
|
*
|
|
5
5
|
* `import * as Dialog from "@radix-ui/react-dialog"` records `imported: "*"`;
|
|
6
6
|
* the member that actually names the component lives on the usage's member
|
|
@@ -12,26 +12,26 @@
|
|
|
12
12
|
*
|
|
13
13
|
* Deeper chains (`<Dialog.Root.Foo/>`) still key on the first segment as the
|
|
14
14
|
* ROOT; the remaining segments are the residual (`residualMemberChain`,
|
|
15
|
-
* below) and are re-joined into the identity by `compoundExportName
|
|
15
|
+
* below) and are re-joined into the identity by `compoundExportName`.
|
|
16
16
|
* Non-namespace imports and bare namespace usages (`<Dialog/>`, no member)
|
|
17
17
|
* return `imported` unchanged.
|
|
18
18
|
*
|
|
19
19
|
* This is the single home for the namespace-member → export-name rule; call it
|
|
20
20
|
* at every site that derives an export name from `ImportRecord.imported`, never
|
|
21
|
-
* re-derive it inline (see docs/CONTEXT.md
|
|
21
|
+
* re-derive it inline (see docs/CONTEXT.md). Provenance (`via.import`)
|
|
22
22
|
* intentionally keeps the raw `"*"` — it records the actual import statement,
|
|
23
23
|
* which was a namespace import.
|
|
24
24
|
*
|
|
25
25
|
* Both identity-derivation sites route through here: the direct-import branch
|
|
26
|
-
* (engine/index.ts
|
|
27
|
-
* `deriveIdentity
|
|
26
|
+
* (engine/index.ts) and the composition path (wrapper-folding.ts's
|
|
27
|
+
* `deriveIdentity`).
|
|
28
28
|
*/
|
|
29
29
|
export function effectiveExportName(imported, memberChain) {
|
|
30
30
|
const first = memberChain[0];
|
|
31
31
|
return imported === "*" && first !== undefined ? first : imported;
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
|
-
* The member-chain segments a usage carries BEYOND the root export
|
|
34
|
+
* The member-chain segments a usage carries BEYOND the root export.
|
|
35
35
|
* `effectiveExportName` consumes the first segment as the export for a
|
|
36
36
|
* namespace import (`import * as Dialog; <Dialog.Root.Foo/>` → root `Root`,
|
|
37
37
|
* residual `["Foo"]`); every other import form keeps `imported` as the root,
|
|
@@ -45,7 +45,7 @@ export function residualMemberChain(imported, memberChain) {
|
|
|
45
45
|
return imported === "*" && memberChain.length > 0 ? memberChain.slice(1) : memberChain;
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
* THE one place a compound export name is written
|
|
48
|
+
* THE one place a compound export name is written: the root export
|
|
49
49
|
* followed by the residual member chain, dot-joined. An empty residual is the
|
|
50
50
|
* identity function, so every existing non-member path is unchanged.
|
|
51
51
|
* `parseCompoundExport` (plugin-core `id.ts`) is the matching reader.
|
|
@@ -54,9 +54,8 @@ export function compoundExportName(root, residual) {
|
|
|
54
54
|
return residual.length === 0 ? root : `${root}.${residual.join(".")}`;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* THE seam for classifying an import target that is NOT in `graph.files
|
|
58
|
-
*
|
|
59
|
-
* first-party: pin its identity to the definition file (bounded re-export
|
|
57
|
+
* THE seam for classifying an import target that is NOT in `graph.files`.
|
|
58
|
+
* A resolved absolute target owned by a workspace member is first-party: pin its identity to the definition file (bounded re-export
|
|
60
59
|
* resolution via `graph.resolveLocalDefinition`) so identity is
|
|
61
60
|
* scope-invariant between whole-repo and single-app scans, falling back to
|
|
62
61
|
* the resolved entry file. Returns null when the target is not a member (or
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"member-identity.js","sourceRoot":"","sources":["../../src/engine/member-identity.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,WAA8B;IAClF,MAAM,KAAK,GAAG,WAAW,CAAC,CAAC,CAAC,CAAC;IAC7B,OAAO,QAAQ,KAAK,GAAG,IAAI,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC;AACpE,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,mBAAmB,CAAC,QAAgB,EAAE,WAA8B;IAClF,OAAO,QAAQ,KAAK,GAAG,IAAI,WAAW,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC;AACzF,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,QAA2B;IAC1E,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,QAAQ,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC;AACxE,CAAC;AAED
|
|
1
|
+
{"version":3,"file":"member-identity.js","sourceRoot":"","sources":["../../src/eng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|
|
|
6
6
|
*
|
|
7
7
|
* Mirrors what `resolveExport` in `resolve-reference.ts` does for value-flow
|
|
8
8
|
* resolution — applied here at identity-stamping time so JSX edges through a
|
|
9
|
-
* re-export barrel attribute to the actual definition file
|
|
9
|
+
* re-export barrel attribute to the actual definition file.
|
|
10
10
|
* Without this, two consumers importing the same component through different
|
|
11
11
|
* paths (barrel vs. direct) fragment across phantom identities.
|
|
12
12
|
*
|
|
@@ -6,7 +6,7 @@ import { packageNameFromSpecifier } from "./specifier.js";
|
|
|
6
6
|
*
|
|
7
7
|
* Mirrors what `resolveExport` in `resolve-reference.ts` does for value-flow
|
|
8
8
|
* resolution — applied here at identity-stamping time so JSX edges through a
|
|
9
|
-
* re-export barrel attribute to the actual definition file
|
|
9
|
+
* re-export barrel attribute to the actual definition file.
|
|
10
10
|
* Without this, two consumers importing the same component through different
|
|
11
11
|
* paths (barrel vs. direct) fragment across phantom identities.
|
|
12
12
|
*
|
|
@@ -62,7 +62,8 @@ function walk(graph, file, imported, seen) {
|
|
|
62
62
|
// `import X from './x'; export { X }` (named-local)
|
|
63
63
|
// `import X from './x'; export { X as default }` (named-local, default name)
|
|
64
64
|
// Follow it to the import's source. Bare-package (external) re-exports stay
|
|
65
|
-
// at the barrel (following an external barrel to its leaf is
|
|
65
|
+
// at the barrel (following an external barrel to its leaf is the
|
|
66
|
+
// external-leaf resolver's job), as
|
|
66
67
|
// do namespace re-exports (`import * as NS`).
|
|
67
68
|
if ("local" in exp) {
|
|
68
69
|
const imp = target.importsByLocal.get(exp.local);
|
|
@@ -90,7 +91,7 @@ function walk(graph, file, imported, seen) {
|
|
|
90
91
|
}
|
|
91
92
|
return { file, localExport: imported };
|
|
92
93
|
}
|
|
93
|
-
// Step 2 — star fallback
|
|
94
|
+
// Step 2 — star fallback. When `imported` is not among the file's
|
|
94
95
|
// named exports, iterate {kind: "star"} entries in source order and try each
|
|
95
96
|
// source for the same imported name. First branch that resolves wins —
|
|
96
97
|
// matches JS module semantics where ambiguous wildcards are a runtime error
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"re-export-chain.js","sourceRoot":"","sources":["../../src/engine/re-export-chain.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,mBAAmB,CACjC,KAAY,EACZ,IAAY,EACZ,QAAgB;IAEhB,OAAO,IAAI,CAAC,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,GAAG,EAAE,CAAC,CAAC;AAChD,CAAC;AAED,SAAS,IAAI,CACX,KAAY,EACZ,IAAY,EACZ,QAAgB,EAChB,IAAiB;IAEjB,MAAM,OAAO,GAAG,GAAG,IAAI,KAAK,QAAQ,EAAE,CAAC;IACvC,0EAA0E;IAC1E,0EAA0E;IAC1E,2EAA2E;IAC3E,yCAAyC;IACzC,IAAI,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IACnC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IAClB,MAAM,MAAM,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACrC,IAAI,CAAC,MAAM;QAAE,OAAO,IAAI,CAAC;IAEzB,yCAAyC;IACzC,MAAM,GAAG,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,CAC7B,CAAC,CAAC,EAAE,EAAE,CACJ,CAAC,CAAC,CAAC,IAAI,KAAK,OAAO,IAAI,YAAY,IAAI,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,QAAQ,CAAC;QACtE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,IAAI,QAAQ,KAAK,SAAS,CAAC,CACnD,CAAC;IACF,IAAI,GAAG,EAAE,CAAC;QACR,gDAAgD;QAChD,IAAI,GAAG,CAAC,IAAI,KAAK,OAAO,IAAI,MAAM,IAAI,GAAG,EAAE,CA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,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,CAAC;IACzC,CAAC;IAED,kEAAkE;IAClE,6EAA6E;IAC7E,uEAAuE;IACvE,4EAA4E;IAC5E,wDAAwD;IACxD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACrC,IAAI,OAAO,CAAC,IAAI,KAAK,MAAM;YAAE,SAAS;QACtC,MAAM,OAAO,GAAG,KAAK,CAAC,cAAc,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC;QACzD,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,OAAO,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAC,KAAK,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;QACrF,IAAI,CAAC,OAAO;YAAE,SAAS;QACvB,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,IAAI,CAAC,CAAC;QACpD,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC5B,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -1,31 +1,29 @@
|
|
|
1
1
|
import type { Graph } from "../index.js";
|
|
2
2
|
/**
|
|
3
|
-
* THE registry of component declarations
|
|
3
|
+
* THE registry of component declarations. Identity is a lookup
|
|
4
4
|
* into this set, never a walk terminus. A declaration is a member iff it is
|
|
5
5
|
* admitted-shaped (`isAdmittedShape`, below — `evalKind === "component"`, OR
|
|
6
|
-
*
|
|
6
|
+
* the component-namespace widening below) AND consumed: exported,
|
|
7
7
|
* referenced by a JSX usage, or HELD — named by an identifier in value
|
|
8
8
|
* position anywhere in the file (`FileGraph.heldRefs`, recorded by the
|
|
9
9
|
* parser: a call argument, an object property value, an array element, an
|
|
10
10
|
* assignment right-hand side, a return value, a JSX attribute or child
|
|
11
|
-
* expression
|
|
11
|
+
* expression). Neither the usage nor the hold
|
|
12
12
|
* has to be at module scope: each carries its scope, and the registry does
|
|
13
13
|
* its own scope-aware walk, since `resolveRefToDecl` alone only looks up
|
|
14
14
|
* MODULE_SCOPE.
|
|
15
15
|
*
|
|
16
16
|
* Consumption is the gate that keeps `renderIcon()` helpers, render-less
|
|
17
17
|
* classes and other component-shaped-but-inert declarations out of the
|
|
18
|
-
* roster
|
|
18
|
+
* roster. Vue-dialect files contribute nothing: their
|
|
19
19
|
* SFC declaration is not typed by this algebra and the engine admits their
|
|
20
20
|
* identities unconditionally.
|
|
21
21
|
*
|
|
22
22
|
* A folded holding declaration (`export default memo(Foo)`, `const Enhanced =
|
|
23
23
|
* connect()(Foo)`) is component-shaped and exported, so `buildComponentRegistry`
|
|
24
|
-
* admits it; it is removed again by `excludeFoldedHolders` (
|
|
24
|
+
* admits it; it is removed again by `excludeFoldedHolders` (below),
|
|
25
25
|
* which `resolve()` applies from the one fold it already runs per call-valued
|
|
26
|
-
* member. The registry never folds
|
|
27
|
-
*
|
|
28
|
-
* `parseCompoundExport` (#518 D5) reads compound export names into root + path.
|
|
26
|
+
* member. The registry never folds: admission is shape-only.
|
|
29
27
|
*/
|
|
30
28
|
export type RegistryEntry = {
|
|
31
29
|
filePath: string;
|
|
@@ -40,7 +38,7 @@ export type RegistryEntry = {
|
|
|
40
38
|
};
|
|
41
39
|
export type ComponentRegistry = {
|
|
42
40
|
hasLocal(filePath: string, exportName: string): boolean;
|
|
43
|
-
/** Shape-only lookup for engine admission
|
|
41
|
+
/** Shape-only lookup for engine admission: is the declaration
|
|
44
42
|
* named by (filePath, symbol-or-exportedAs) component-shaped? Consumption
|
|
45
43
|
* is not required here — the JSX usage being resolved is the consumption.
|
|
46
44
|
* `hasLocal` (shape AND consumed) remains the roster's membership test. */
|
|
@@ -48,9 +46,9 @@ export type ComponentRegistry = {
|
|
|
48
46
|
localEntries(): readonly RegistryEntry[];
|
|
49
47
|
};
|
|
50
48
|
/**
|
|
51
|
-
* A member the engine folded away
|
|
49
|
+
* A member the engine folded away: every render of it is credited
|
|
52
50
|
* to another identity. `target` is that identity when it is a single local
|
|
53
|
-
* member of the SAME file (
|
|
51
|
+
* member of the SAME file (it inherits `isDefault`); `null` otherwise
|
|
54
52
|
* (external, other file, or a fan-out to several identities).
|
|
55
53
|
*/
|
|
56
54
|
export type FoldedHolder = {
|
|
@@ -63,38 +61,38 @@ export type FoldedHolder = {
|
|
|
63
61
|
export declare function entryKey(filePath: string, name: string): string;
|
|
64
62
|
export declare function buildComponentRegistry(graph: Graph): ComponentRegistry;
|
|
65
63
|
/**
|
|
66
|
-
* THE narrowing seam
|
|
64
|
+
* THE narrowing seam: the roster registry after folded holders are
|
|
67
65
|
* removed. `resolve()` computes `folded` from the ONE fold it already runs
|
|
68
|
-
* per call-valued member
|
|
66
|
+
* per call-valued member; this function never folds. A
|
|
69
67
|
* folded holder is absent from `localEntries()` and `hasLocal` says no for
|
|
70
68
|
* its symbol and its export name; `isComponentShaped` (occurrence admission)
|
|
71
69
|
* is untouched, since a fold never lands an occurrence on a folded holder.
|
|
72
|
-
*
|
|
70
|
+
* A folded DEFAULT holder hands `isDefault` to its same-file target.
|
|
73
71
|
* The narrowed `hasLocal` answers only for names of surviving entries, so a
|
|
74
72
|
* name the base registry knew only through its de-duplicated `byKey` (never
|
|
75
|
-
* in `localEntries()`) answers false here — the CLI
|
|
76
|
-
* `
|
|
73
|
+
* in `localEntries()`) answers false here — the CLI derives `hasLocal` from
|
|
74
|
+
* `localEntries()` anyway.
|
|
77
75
|
*/
|
|
78
76
|
export declare function excludeFoldedHolders(registry: ComponentRegistry, folded: ReadonlyMap<string, FoldedHolder>): ComponentRegistry;
|
|
79
77
|
/**
|
|
80
|
-
* THE roster naming gate
|
|
78
|
+
* THE roster naming gate: a member whose every renderable name is a
|
|
81
79
|
* JSX host-element name is not a component. React's own rule — a bare
|
|
82
80
|
* lowercase-initial name in tag position is an intrinsic element — means such
|
|
83
81
|
* a binding can never be rendered under that name, whatever shape its value
|
|
84
|
-
* has (`const dirname = path.dirname(url)` is an opaque wrapper by
|
|
85
|
-
*
|
|
82
|
+
* has (`const dirname = path.dirname(url)` is an opaque wrapper, consumed by
|
|
83
|
+
* `path.join(dirname, …)`, and would otherwise be a member).
|
|
86
84
|
*
|
|
87
85
|
* Applied at `resolve()`'s return, AFTER `excludeFoldedHolders`, and never
|
|
88
86
|
* inside `buildComponentRegistry`: the base registry's `hasLocal` also gates
|
|
89
|
-
* the argument-site holder loop
|
|
87
|
+
* the argument-site holder loop, so a lowercase holder
|
|
90
88
|
* (`const wrap = withHarness(Button)`) is still walked and still credits
|
|
91
89
|
* `Button` at its argument. Only the roster row goes away. Ordering matters
|
|
92
|
-
* — a target that inherited `isDefault` from a folded default holder
|
|
93
|
-
*
|
|
90
|
+
* — a target that inherited `isDefault` from a folded default holder
|
|
91
|
+
* is exempt, and that inheritance happens in the fold narrowing.
|
|
94
92
|
*
|
|
95
93
|
* The naming rule and its exemptions live in `hasOnlyHostElementNames`,
|
|
96
94
|
* shared with owner classification. `isComponentShaped` is untouched: JSX
|
|
97
|
-
* cannot render a bare lowercase name, and
|
|
95
|
+
* cannot render a bare lowercase name, and a diagnostic is the residual
|
|
98
96
|
* guard for any other path that lands an occurrence on one.
|
|
99
97
|
*/
|
|
100
98
|
export declare function excludeHostElementNames(registry: ComponentRegistry, graph: Graph): ComponentRegistry;
|
package/dist/engine/registry.js
CHANGED
|
@@ -10,8 +10,8 @@ export function entryKey(filePath, name) {
|
|
|
10
10
|
/**
|
|
11
11
|
* A narrowed view over an existing registry: `localEntries()` and `hasLocal`
|
|
12
12
|
* answer for `entries` only; `isComponentShaped` (occurrence admission) is
|
|
13
|
-
* always delegated untouched. Both roster narrowings —
|
|
14
|
-
*
|
|
13
|
+
* always delegated untouched. Both roster narrowings — folded holders and
|
|
14
|
+
* host-element names — construct their result here rather than
|
|
15
15
|
* each rebuilding the name index.
|
|
16
16
|
*/
|
|
17
17
|
function narrowTo(registry, entries) {
|
|
@@ -75,7 +75,7 @@ export function buildComponentRegistry(graph) {
|
|
|
75
75
|
byKey.set(entryKey(file, exportName), entry);
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
|
-
// Shape-only lookup
|
|
78
|
+
// Shape-only lookup, lazy + cached per (file, name). Used by
|
|
79
79
|
// the engine's `admit` rule: a JSX usage that resolves to a local
|
|
80
80
|
// declaration IS that declaration's consumption, so admission re-checks
|
|
81
81
|
// shape only — re-deriving the engine's own alias/union/dynamic-map/
|
|
@@ -89,7 +89,7 @@ export function buildComponentRegistry(graph) {
|
|
|
89
89
|
const fg = graph.files.get(filePath);
|
|
90
90
|
let result = false;
|
|
91
91
|
if (fg && fg.dialect !== "vue") {
|
|
92
|
-
// A compound export (`NS.Inline
|
|
92
|
+
// A compound export (`NS.Inline`) names a member of a holder
|
|
93
93
|
// declaration: look the HOLDER up by its root, then walk the residual
|
|
94
94
|
// path through its Object props. `parseCompoundExport` is the one
|
|
95
95
|
// reader of the dotted form; `compoundExportName` the one writer.
|
|
@@ -103,7 +103,7 @@ export function buildComponentRegistry(graph) {
|
|
|
103
103
|
// findable by symbol; module-scope-only lookup would reject it even
|
|
104
104
|
// though the engine's own resolution already landed on it.
|
|
105
105
|
//
|
|
106
|
-
// Known imprecision (
|
|
106
|
+
// Known imprecision (kept — the shape check is a lookup,
|
|
107
107
|
// not a resolution walk): when two SIBLING scopes both declare a
|
|
108
108
|
// same-named symbol with DIFFERENT shapes (two `Item`s in unrelated
|
|
109
109
|
// function bodies, one a component, one not), this takes the FIRST
|
|
@@ -133,17 +133,17 @@ export function buildComponentRegistry(graph) {
|
|
|
133
133
|
};
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
|
-
* THE narrowing seam
|
|
136
|
+
* THE narrowing seam: the roster registry after folded holders are
|
|
137
137
|
* removed. `resolve()` computes `folded` from the ONE fold it already runs
|
|
138
|
-
* per call-valued member
|
|
138
|
+
* per call-valued member; this function never folds. A
|
|
139
139
|
* folded holder is absent from `localEntries()` and `hasLocal` says no for
|
|
140
140
|
* its symbol and its export name; `isComponentShaped` (occurrence admission)
|
|
141
141
|
* is untouched, since a fold never lands an occurrence on a folded holder.
|
|
142
|
-
*
|
|
142
|
+
* A folded DEFAULT holder hands `isDefault` to its same-file target.
|
|
143
143
|
* The narrowed `hasLocal` answers only for names of surviving entries, so a
|
|
144
144
|
* name the base registry knew only through its de-duplicated `byKey` (never
|
|
145
|
-
* in `localEntries()`) answers false here — the CLI
|
|
146
|
-
* `
|
|
145
|
+
* in `localEntries()`) answers false here — the CLI derives `hasLocal` from
|
|
146
|
+
* `localEntries()` anyway.
|
|
147
147
|
*/
|
|
148
148
|
export function excludeFoldedHolders(registry, folded) {
|
|
149
149
|
if (folded.size === 0)
|
|
@@ -166,24 +166,24 @@ export function excludeFoldedHolders(registry, folded) {
|
|
|
166
166
|
return narrowTo(registry, entries);
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* THE roster naming gate
|
|
169
|
+
* THE roster naming gate: a member whose every renderable name is a
|
|
170
170
|
* JSX host-element name is not a component. React's own rule — a bare
|
|
171
171
|
* lowercase-initial name in tag position is an intrinsic element — means such
|
|
172
172
|
* a binding can never be rendered under that name, whatever shape its value
|
|
173
|
-
* has (`const dirname = path.dirname(url)` is an opaque wrapper by
|
|
174
|
-
*
|
|
173
|
+
* has (`const dirname = path.dirname(url)` is an opaque wrapper, consumed by
|
|
174
|
+
* `path.join(dirname, …)`, and would otherwise be a member).
|
|
175
175
|
*
|
|
176
176
|
* Applied at `resolve()`'s return, AFTER `excludeFoldedHolders`, and never
|
|
177
177
|
* inside `buildComponentRegistry`: the base registry's `hasLocal` also gates
|
|
178
|
-
* the argument-site holder loop
|
|
178
|
+
* the argument-site holder loop, so a lowercase holder
|
|
179
179
|
* (`const wrap = withHarness(Button)`) is still walked and still credits
|
|
180
180
|
* `Button` at its argument. Only the roster row goes away. Ordering matters
|
|
181
|
-
* — a target that inherited `isDefault` from a folded default holder
|
|
182
|
-
*
|
|
181
|
+
* — a target that inherited `isDefault` from a folded default holder
|
|
182
|
+
* is exempt, and that inheritance happens in the fold narrowing.
|
|
183
183
|
*
|
|
184
184
|
* The naming rule and its exemptions live in `hasOnlyHostElementNames`,
|
|
185
185
|
* shared with owner classification. `isComponentShaped` is untouched: JSX
|
|
186
|
-
* cannot render a bare lowercase name, and
|
|
186
|
+
* cannot render a bare lowercase name, and a diagnostic is the residual
|
|
187
187
|
* guard for any other path that lands an occurrence on one.
|
|
188
188
|
*/
|
|
189
189
|
export function excludeHostElementNames(registry, graph) {
|
|
@@ -194,7 +194,7 @@ export function excludeHostElementNames(registry, graph) {
|
|
|
194
194
|
return narrowTo(registry, entries);
|
|
195
195
|
}
|
|
196
196
|
/**
|
|
197
|
-
*
|
|
197
|
+
* A declaration is an admitted shape iff `evalKind === "component"`
|
|
198
198
|
* OR it is a "component namespace" — an `Object`-valued declaration with at
|
|
199
199
|
* least one prop that is itself component-shaped, e.g.
|
|
200
200
|
* `export const Sidebar = { Root, Branch, Leaf }` rendered as
|
|
@@ -210,7 +210,7 @@ function isAdmittedShape(value, graph, fg) {
|
|
|
210
210
|
return Object.values(value.props).some((prop) => evalKind(prop, graph, fg) === "component");
|
|
211
211
|
}
|
|
212
212
|
/**
|
|
213
|
-
*
|
|
213
|
+
* The member a compound export names. Walk `path` through nested
|
|
214
214
|
* `Object` props from the holder's value; the terminal value must be
|
|
215
215
|
* admitted-shaped (a component, or itself a component namespace). Any step
|
|
216
216
|
* that is not an `Object` prop, or a missing prop, is not a member.
|
|
@@ -229,7 +229,7 @@ function isAdmittedMember(holder, path, graph, fg) {
|
|
|
229
229
|
}
|
|
230
230
|
/** Scope-aware resolution of a reference to the declaration it names:
|
|
231
231
|
* walk the scope chain in the referencing file first (body locals) via the
|
|
232
|
-
* engine's own scope walk (
|
|
232
|
+
* engine's own scope walk (`findLocalDeclaration`, shared with
|
|
233
233
|
* `engine/index.ts` so the two never drift), then fall back to the
|
|
234
234
|
* module-scope / import resolution helper-callers uses. */
|
|
235
235
|
function resolveUsageTarget(ref, file, fg, graph) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/engine/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/engine/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAuD5D,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAC,QAAgB,EAAE,IAAY;IACrD,OAAO,GAAG,QAAQ,KAAK,IAAI,EAAE,CAAC;AAChC,CAAC;AAED;;;;;;GAMG;AACH,SAAS,QAAQ,CAAC,QAA2B,EAAE,OAAiC;IAC9E,MAAM,cAAc,GAAG,IAAI,GAAG,EAAU,CAAC;IACzC,KAAK,MAAM,CAAC,IAAI,OAAO,EAAE,CAAC;QACxB,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;QACnD,cAAc,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,UAA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AK,SAAS;YAAE,OAAO,KAAK,CAAC;QACrC,GAAG,GAAG,IAAI,CAAC;IACb,CAAC;IACD,OAAO,eAAe,CAAC,GAAG,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AACzC,CAAC;AAED;;;;4DAI4D;AAC5D,SAAS,kBAAkB,CAAC,GAAc,EAAE,IAAY,EAAE,EAAa,EAAE,KAAY;IACnF,MAAM,KAAK,GAAG,oBAAoB,CAAC,EAAE,EAAE,GAAG,CAAC,CAAC;IAC5C,IAAI,KAAK;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,EAAE,CAAC;IACjD,MAAM,QAAQ,GAAG,gBAAgB,CAAC,GAAG,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,CAAC;IACxD,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AACjF,CAAC"}
|
|
@@ -35,7 +35,7 @@ export function resolveReference(graph, fileGraph, ref, guard = createCycleGuard
|
|
|
35
35
|
const imp = lookupGraph.importsByLocal.get(ref.symbol);
|
|
36
36
|
if (!imp)
|
|
37
37
|
return { kind: "Unknown" };
|
|
38
|
-
// Library stub table
|
|
38
|
+
// Library stub table: a known framework export gets a structural
|
|
39
39
|
// type instead of walking node_modules it can never parse. Checked before
|
|
40
40
|
// module resolution because these packages are never in the graph.
|
|
41
41
|
const stub = libraryStubFor(imp, ref);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-reference.js","sourceRoot":"","sources":["../../src/engine/resolve-reference.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAmB,MAAM,sBAAsB,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,o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B,KAAY,EACZ,GAAc,EACd,QAAmB;IAEnB,IAAI,CAAC,GAAG,CAAC,UAAU;QAAE,OAAO,QAAQ,CAAC;IACrC,IAAI,GAAG,CAAC,UAAU,KAAK,QAAQ,CAAC,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAC1D,OAAO,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,QAAQ,CAAC;AACrD,CAAC"}
|
|
@@ -21,6 +21,18 @@ export type ResolvedTerminal = {
|
|
|
21
21
|
* Returns one or more results — multi-result for Union and fanout cases.
|
|
22
22
|
*/
|
|
23
23
|
export declare function resolveType(graph: Graph, fileGraph: FileGraph, type: InferredType, argMap: ArgumentMap, guard?: CycleGuard): ResolvedTerminal[];
|
|
24
|
+
/**
|
|
25
|
+
* A DynamicImport's target: the graph file its specifier resolves to, from
|
|
26
|
+
* the file that contains the import(), and the value of the projected
|
|
27
|
+
* export with any remaining projection applied as member walks. Null when
|
|
28
|
+
* the target is not in the graph or the export is not found.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveDynamicImportTarget(graph: Graph, fileGraph: FileGraph, di: Extract<InferredType, {
|
|
31
|
+
kind: "DynamicImport";
|
|
32
|
+
}>, guard: CycleGuard): {
|
|
33
|
+
targetFileGraph: FileGraph;
|
|
34
|
+
value: InferredType;
|
|
35
|
+
} | null;
|
|
24
36
|
export type FnEntry = {
|
|
25
37
|
fn: InferredType;
|
|
26
38
|
bindingRef: Reference | null;
|