@component-compass/reference-graph 0.1.25 → 0.1.26
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/engine/binding.d.ts +96 -0
- package/dist/engine/binding.js +405 -0
- package/dist/engine/binding.js.map +1 -0
- package/dist/engine/component-shape.js +2 -2
- package/dist/engine/component-shape.js.map +1 -1
- package/dist/engine/helper-callers.d.ts +0 -7
- package/dist/engine/helper-callers.js +2 -23
- package/dist/engine/helper-callers.js.map +1 -1
- package/dist/engine/index.js +113 -254
- package/dist/engine/index.js.map +1 -1
- package/dist/engine/member-identity.d.ts +1 -21
- package/dist/engine/member-identity.js +1 -22
- 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 +6 -6
- package/dist/engine/re-export-chain.js.map +1 -1
- package/dist/engine/registry.d.ts +9 -14
- package/dist/engine/registry.js +9 -42
- package/dist/engine/registry.js.map +1 -1
- package/dist/engine/resolve-reference.d.ts +2 -21
- package/dist/engine/resolve-reference.js +4 -178
- package/dist/engine/resolve-reference.js.map +1 -1
- package/dist/engine/resolve-type.d.ts +7 -7
- package/dist/engine/resolve-type.js +23 -29
- package/dist/engine/resolve-type.js.map +1 -1
- package/dist/engine/wrapper-folding.d.ts +8 -19
- package/dist/engine/wrapper-folding.js +34 -226
- package/dist/engine/wrapper-folding.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -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,CAAC;AAC3C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"helper-callers.js","sourceRoot":"","sources":["../../src/engine/helper-callers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAC3C,OAA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AU,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.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { asTagName, computeOccurrenceId, serialiseComponentId, projectPropUsages, parseCompoundExport } from "@component-compass/plugin-core";
|
|
2
2
|
import { MODULE_SCOPE } from "../index.js";
|
|
3
3
|
import { createArgumentMap } from "./argument-map.js";
|
|
4
|
-
import { resolveReference } from "./resolve-reference.js";
|
|
5
4
|
import { walkWithFolding, argumentProvenance, foldedArgument } from "./wrapper-folding.js";
|
|
6
5
|
import { packageNameFromSpecifier, externalSubpath } from "./specifier.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
6
|
+
import { buildHelperCallers } from "./helper-callers.js";
|
|
7
|
+
import { bindingIdentity, bindingValue, findLocalDeclaration, pinUnparsed, resolveBinding } from "./binding.js";
|
|
8
|
+
import { assertNever } from "./assert-never.js";
|
|
9
9
|
import { resolveOwnerChain } from "./owner-resolution.js";
|
|
10
10
|
import { createCycleGuard } from "./cycle-detection.js";
|
|
11
|
-
import {
|
|
12
|
-
import { buildComponentRegistry, excludeFoldedHolders, excludeHostElementNames, entryKey
|
|
11
|
+
import { compoundExportName, memberOfObjectPath } from "./member-identity.js";
|
|
12
|
+
import { buildComponentRegistry, excludeFoldedHolders, excludeHostElementNames, entryKey } from "./registry.js";
|
|
13
13
|
import { hasOnlyHostElementNames, isHostElementName, HOOK_NAME } from "./host-element.js";
|
|
14
14
|
import { firstDynamicImport } from "./component-shape.js";
|
|
15
15
|
import { creditedTerminals, isCallable, renderOutcome } from "./denotation.js";
|
|
@@ -31,7 +31,7 @@ export function resolve(graph, opts) {
|
|
|
31
31
|
// reads the result.
|
|
32
32
|
const tagEvaluations = new Map();
|
|
33
33
|
for (const [filePath, fileGraph] of graph.files) {
|
|
34
|
-
tagEvaluations.set(filePath, fileGraph.jsxUsages.map((usage) => evaluateJsxUsage(graph,
|
|
34
|
+
tagEvaluations.set(filePath, fileGraph.jsxUsages.map((usage) => evaluateJsxUsage(graph, fileGraph, usage, argMap)));
|
|
35
35
|
}
|
|
36
36
|
// The registry is the one judge of component-ness: every declaration a
|
|
37
37
|
// tag landed on as a function is a member. Owner classification asks it
|
|
@@ -439,46 +439,6 @@ function relabelExternalLeaf(rawComponentId, filePath, specifier, resolveExterna
|
|
|
439
439
|
source: externalSource(hit.leafPackage, `${hit.leafPackage}/${hit.modulePath}`),
|
|
440
440
|
};
|
|
441
441
|
}
|
|
442
|
-
/**
|
|
443
|
-
* Build the local fallback ComponentId for a workspace-sibling import.
|
|
444
|
-
* When a bare-package import (`@org/foo`) resolves to a file in the parsed
|
|
445
|
-
* graph, the package is a workspace sibling — JSX edges should land on the
|
|
446
|
-
* sibling's actual file rather than a phantom external stub.
|
|
447
|
-
*
|
|
448
|
-
* Returns null when the target isn't in the graph (external package) or
|
|
449
|
-
* when the canonical export name can't be derived; callers fall back to the
|
|
450
|
-
* default external fallback.
|
|
451
|
-
*/
|
|
452
|
-
function workspaceSiblingFallback(graph, resolvedTarget, matchedImport,
|
|
453
|
-
/** Namespace-member-resolved export name; see `effectiveExportName`. */
|
|
454
|
-
effectiveImported, consumerDialect) {
|
|
455
|
-
if (!resolvedTarget)
|
|
456
|
-
return undefined;
|
|
457
|
-
// Follow re-exports — workspace siblings can also use barrels.
|
|
458
|
-
const chained = followReExportChain(graph, resolvedTarget, effectiveImported);
|
|
459
|
-
const canonicalFile = chained?.file ?? resolvedTarget;
|
|
460
|
-
let exportName = chained?.localExport ?? effectiveImported;
|
|
461
|
-
if (!chained) {
|
|
462
|
-
const target = graph.files.get(resolvedTarget);
|
|
463
|
-
if (!target)
|
|
464
|
-
return undefined;
|
|
465
|
-
if (effectiveImported === "default") {
|
|
466
|
-
const def = target.exports.find((e) => e.kind === "default");
|
|
467
|
-
if (def && "local" in def)
|
|
468
|
-
exportName = def.local;
|
|
469
|
-
}
|
|
470
|
-
else {
|
|
471
|
-
const named = target.exports.find((e) => e.kind === "named" && "exportedAs" in e && e.exportedAs === effectiveImported && "local" in e);
|
|
472
|
-
if (named && "local" in named)
|
|
473
|
-
exportName = named.local;
|
|
474
|
-
}
|
|
475
|
-
}
|
|
476
|
-
return {
|
|
477
|
-
kind: componentKindFor(consumerDialect),
|
|
478
|
-
export: exportName,
|
|
479
|
-
source: { type: "local", filePath: canonicalFile },
|
|
480
|
-
};
|
|
481
|
-
}
|
|
482
442
|
/**
|
|
483
443
|
* THE occurrence constructor: one occurrence per owner, `viaChain` being the
|
|
484
444
|
* owner's prefix followed by `chain`. Every emission path calls it; never
|
|
@@ -541,211 +501,108 @@ function namesObjectMember(holder, path) {
|
|
|
541
501
|
}
|
|
542
502
|
/**
|
|
543
503
|
* Evaluate one JSX usage's tag and name each credited terminal's fallback
|
|
544
|
-
* identity, chain head and `definition
|
|
545
|
-
* `host-element` and is not evaluated; a
|
|
546
|
-
* binding, so the rule does not apply to it.
|
|
547
|
-
*
|
|
548
|
-
*
|
|
549
|
-
*
|
|
550
|
-
*
|
|
551
|
-
*
|
|
552
|
-
*
|
|
553
|
-
*
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
*
|
|
557
|
-
*
|
|
504
|
+
* identity, chain head and `definition`, from the binding the tag's reference
|
|
505
|
+
* names. A bare lowercase React tag is `host-element` and is not evaluated; a
|
|
506
|
+
* Vue usage's reference names a binding, so the rule does not apply to it.
|
|
507
|
+
* Every walk here is in tag position.
|
|
508
|
+
*
|
|
509
|
+
* - A declaration walks its value, falling back to the binding's identity. A
|
|
510
|
+
* terminal with no identity of its own is credited under a compound
|
|
511
|
+
* fallback only when the declaration names an object member there
|
|
512
|
+
* (`namesObjectMember`).
|
|
513
|
+
* - A package export, however its import reached it, and an unparsed file
|
|
514
|
+
* reached through a package specifier whose own target is outside the graph
|
|
515
|
+
* are not walked: each credits a `foreign` sentinel that falls back to the
|
|
516
|
+
* external package, or to the workspace member's definition
|
|
517
|
+
* (`pinUnparsed`). A namespace member and any other unparsed file walk
|
|
518
|
+
* their value.
|
|
519
|
+
* - An undeclared, unimported name is `unbound`, and an import whose own
|
|
520
|
+
* target does not resolve is `import-failed`. The same answers reached
|
|
521
|
+
* through a parsed file, and `no-export`, walk their value.
|
|
558
522
|
*/
|
|
559
|
-
function evaluateJsxUsage(graph,
|
|
523
|
+
function evaluateJsxUsage(graph, fileGraph, usage, argMap) {
|
|
560
524
|
if (fileGraph.dialect === "react" && isHostElementRoot(usage.ref))
|
|
561
525
|
return { kind: "host-element" };
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
const
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
const decl = findLocalDeclaration(fileGraph, usage.ref);
|
|
569
|
-
if (!decl)
|
|
570
|
-
return { kind: "unbound" };
|
|
571
|
-
// A member access on a same-file binding (`<LocalNS.Leaf/>`) walks the
|
|
572
|
-
// MEMBER, not the whole object — `resolveReference` applies the usage's
|
|
573
|
-
// member chain exactly as the import path already gets it (the same
|
|
574
|
-
// static-MemberOf arm). A bare reference is unchanged:
|
|
575
|
-
// `decl.value` is what `resolveReference` returns for an empty chain.
|
|
576
|
-
const value = usage.ref.memberChain.length > 0 ? resolveReference(graph, fileGraph, usage.ref) : decl.value;
|
|
577
|
-
const evaluation = walkWithFolding(graph, fileGraph, value, argMap, createCycleGuard(), undefined, "tag");
|
|
578
|
-
const fallback = {
|
|
579
|
-
kind: componentKindFor(fileGraph.dialect),
|
|
580
|
-
export: compoundExportName(usage.ref.symbol, usage.ref.memberChain),
|
|
581
|
-
source: { type: "local", filePath },
|
|
582
|
-
};
|
|
583
|
-
const definition = { line: decl.loc.line, column: decl.loc.column };
|
|
584
|
-
const outerVia = { kind: "local-component" };
|
|
585
|
-
const rendered = usage.ref.memberChain.length === 0 ? { declaration: decl } : {};
|
|
586
|
-
const named = namesObjectMember(decl.value, usage.ref.memberChain);
|
|
587
|
-
const credits = creditedTerminals(evaluation).filter((t) => t.identity !== null || named).map((terminal) => ({
|
|
588
|
-
terminal,
|
|
589
|
-
fallback,
|
|
590
|
-
outerVia,
|
|
591
|
-
...(terminal.identity === null ? { definition, ...rendered } : {}),
|
|
592
|
-
}));
|
|
593
|
-
return { kind: "evaluated", evaluation, value, credits };
|
|
594
|
-
}
|
|
595
|
-
const packageName = packageNameFromSpecifier(matchedImport.specifier);
|
|
596
|
-
// Resolve namespace-import members to their export name once, up front —
|
|
597
|
-
// every export-name / re-export lookup below keys on this, not the raw
|
|
598
|
-
// `imported`. `via.import` keeps the raw `imported` (provenance).
|
|
599
|
-
const effectiveImported = effectiveExportName(matchedImport.imported, usage.ref.memberChain);
|
|
600
|
-
// Lookups below key on `effectiveImported` (the ROOT); the
|
|
601
|
-
// identity stamped on a fallback is the root plus the residual chain.
|
|
602
|
-
// A member the walker resolves to its own declaration never reaches a
|
|
603
|
-
// fallback, so this only names members with no declaration of their own.
|
|
604
|
-
const residual = residualMemberChain(matchedImport.imported, usage.ref.memberChain);
|
|
605
|
-
const holderDecl = (file, exportName) => {
|
|
606
|
-
const holderFile = graph.files.get(file);
|
|
607
|
-
return holderFile === undefined ? undefined : findDeclaration(holderFile, exportName);
|
|
608
|
-
};
|
|
609
|
-
const holderDefinition = (file, exportName) => {
|
|
610
|
-
if (residual.length === 0)
|
|
611
|
-
return undefined;
|
|
612
|
-
const loc = holderDecl(file, exportName)?.loc;
|
|
613
|
-
return loc === undefined ? undefined : { line: loc.line, column: loc.column };
|
|
526
|
+
const binding = resolveBinding(graph, fileGraph, usage.ref);
|
|
527
|
+
const imp = fileGraph.importsByLocal.get(usage.ref.symbol);
|
|
528
|
+
const walkTag = (value) => walkWithFolding(graph, fileGraph, value, argMap, createCycleGuard(), undefined, "tag");
|
|
529
|
+
const walked = () => {
|
|
530
|
+
const value = bindingValue(binding);
|
|
531
|
+
return { kind: "evaluated", evaluation: walkTag(value), value, credits: [] };
|
|
614
532
|
};
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
}
|
|
533
|
+
switch (binding.kind) {
|
|
534
|
+
// Transitional: these two arms read `walkIdentity`, which only a name or
|
|
535
|
+
// import that fails inside a parsed file carries, to tell that failure
|
|
536
|
+
// from the usage's own. They change when those failures stop naming the
|
|
537
|
+
// parsed file in walks.
|
|
538
|
+
case "unbound":
|
|
539
|
+
return binding.walkIdentity === undefined ? { kind: "unbound" } : walked();
|
|
540
|
+
case "import-failed":
|
|
541
|
+
return binding.walkIdentity === undefined ? { kind: "import-failed", specifier: binding.specifier } : walked();
|
|
542
|
+
case "no-export":
|
|
543
|
+
return walked();
|
|
544
|
+
case "declaration": {
|
|
545
|
+
const value = bindingValue(binding);
|
|
546
|
+
const evaluation = walkTag(value);
|
|
547
|
+
const declared = makeLocalComponentId(binding.file, compoundExportName(binding.decl.symbol, binding.path), fileGraph.dialect);
|
|
548
|
+
const fallback = buildComponentId(bindingIdentity(binding), declared, fileGraph.dialect);
|
|
549
|
+
// A walk identity names where the re-export chain stopped short of the
|
|
550
|
+
// declaration; nothing is declared there under the fallback's name.
|
|
551
|
+
const holder = binding.walkIdentity === undefined ? binding.decl : undefined;
|
|
552
|
+
const definition = holder !== undefined && (binding.inScope || binding.path.length > 0)
|
|
553
|
+
? { line: holder.loc.line, column: holder.loc.column }
|
|
554
|
+
: undefined;
|
|
555
|
+
const rendered = holder !== undefined && binding.path.length === 0 ? { declaration: holder } : {};
|
|
556
|
+
const namesMember = namesObjectMember(holder?.value, binding.path);
|
|
557
|
+
const outerVia = binding.inScope || imp === undefined
|
|
558
|
+
? { kind: "local-component" }
|
|
559
|
+
: { kind: "direct-import", specifier: imp.specifier, import: imp.imported };
|
|
560
|
+
const credits = creditedTerminals(evaluation)
|
|
561
|
+
.filter((terminal) => terminal.identity !== null || namesMember)
|
|
562
|
+
.map((terminal) => ({
|
|
563
|
+
terminal,
|
|
564
|
+
fallback,
|
|
565
|
+
outerVia,
|
|
566
|
+
...(terminal.identity === null ? { ...(definition !== undefined ? { definition } : {}), ...rendered } : {}),
|
|
567
|
+
}));
|
|
568
|
+
return { kind: "evaluated", evaluation, value, credits };
|
|
569
|
+
}
|
|
570
|
+
case "package-export":
|
|
571
|
+
case "unparsed": {
|
|
572
|
+
// Transitional: for an unparsed file this repeats the classification's
|
|
573
|
+
// package-specifier test, to credit it only through a package specifier
|
|
574
|
+
// whose own target is outside the graph.
|
|
575
|
+
if (binding.mainGap !== undefined ||
|
|
576
|
+
imp === undefined ||
|
|
577
|
+
(binding.kind === "unparsed" && packageNameFromSpecifier(imp.specifier) === null)) {
|
|
578
|
+
return walked();
|
|
662
579
|
}
|
|
580
|
+
const pinned = binding.kind === "unparsed" ? pinUnparsed(graph, binding) : binding;
|
|
581
|
+
const sentinel = { denotation: { kind: "foreign" }, viaTrail: [], identity: null };
|
|
582
|
+
const fallback = {
|
|
583
|
+
kind: componentKindFor(fileGraph.dialect),
|
|
584
|
+
export: compoundExportName(pinned.exportName, pinned.path),
|
|
585
|
+
source: pinned.kind === "unparsed"
|
|
586
|
+
? { type: "local", filePath: pinned.file }
|
|
587
|
+
: externalSource(packageNameFromSpecifier(pinned.specifier) ?? pinned.specifier, pinned.specifier),
|
|
588
|
+
};
|
|
589
|
+
return {
|
|
590
|
+
kind: "evaluated",
|
|
591
|
+
evaluation: [sentinel],
|
|
592
|
+
value: null,
|
|
593
|
+
credits: [
|
|
594
|
+
{
|
|
595
|
+
terminal: sentinel,
|
|
596
|
+
fallback,
|
|
597
|
+
fallbackSpecifier: pinned.kind === "package-export" ? pinned.specifier : imp.specifier,
|
|
598
|
+
outerVia: { kind: "direct-import", specifier: imp.specifier, import: imp.imported },
|
|
599
|
+
},
|
|
600
|
+
],
|
|
601
|
+
};
|
|
663
602
|
}
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
export: compoundExportName(exportName, residual),
|
|
667
|
-
source: { type: "local", filePath: canonicalFile },
|
|
668
|
-
};
|
|
669
|
-
const definition = holderDefinition(canonicalFile, exportName);
|
|
670
|
-
const named = namesHolderMember(canonicalFile, exportName);
|
|
671
|
-
const credits = jsxTerminals.filter((t) => t.identity !== null || named).map((terminal) => ({
|
|
672
|
-
terminal,
|
|
673
|
-
fallback,
|
|
674
|
-
outerVia,
|
|
675
|
-
...(terminal.identity === null && definition !== undefined ? { definition } : {}),
|
|
676
|
-
}));
|
|
677
|
-
return { kind: "evaluated", evaluation, value: refType, credits };
|
|
678
|
-
}
|
|
679
|
-
const externalFallback = {
|
|
680
|
-
kind: componentKindFor(fileGraph.dialect),
|
|
681
|
-
export: compoundExportName(effectiveImported, residual),
|
|
682
|
-
source: externalSource(packageName, matchedImport.specifier),
|
|
683
|
-
};
|
|
684
|
-
// Check whether the import resolves to a local file that IS in the graph.
|
|
685
|
-
// If it does, resolve properly to avoid false positives (e.g. importing a
|
|
686
|
-
// utility function that happens to be named with a capital letter from a
|
|
687
|
-
// workspace sibling). For imports whose target is outside the graph
|
|
688
|
-
// (external packages in node_modules), trust the JSX call site directly.
|
|
689
|
-
const resolvedAbsTarget = graph.moduleResolver(filePath, matchedImport.specifier);
|
|
690
|
-
// Normalize absolute path → repo-relative graph key when possible.
|
|
691
|
-
const resolvedNormTarget = resolvedAbsTarget !== null && graph.resolveToGraphKey
|
|
692
|
-
? (graph.resolveToGraphKey(resolvedAbsTarget) ?? resolvedAbsTarget)
|
|
693
|
-
: resolvedAbsTarget;
|
|
694
|
-
const targetInGraph = resolvedNormTarget !== null && graph.files.has(resolvedNormTarget);
|
|
695
|
-
if (targetInGraph) {
|
|
696
|
-
// Target file is in graph — workspace sibling. Resolve to check
|
|
697
|
-
// JSX type, fan out per terminal. The fallback identity is local so
|
|
698
|
-
// null-identity terminals still attribute to the sibling file rather
|
|
699
|
-
// than a phantom external stub. Terminal identities from deriveIdentity
|
|
700
|
-
// are already local when applicable (workspaceSiblingIdentity fires).
|
|
701
|
-
const refType = resolveReference(graph, fileGraph, usage.ref);
|
|
702
|
-
const evaluation = walkWithFolding(graph, fileGraph, refType, argMap, createCycleGuard(), undefined, "tag");
|
|
703
|
-
const jsxTerminals = creditedTerminals(evaluation);
|
|
704
|
-
if (jsxTerminals.length === 0)
|
|
705
|
-
return { kind: "evaluated", evaluation, value: refType, credits: [] };
|
|
706
|
-
const siblingFallback = workspaceSiblingFallback(graph, resolvedNormTarget, matchedImport, effectiveImported, fileGraph.dialect);
|
|
707
|
-
const localFallback = siblingFallback !== undefined && siblingFallback.kind !== "custom-element"
|
|
708
|
-
? { ...siblingFallback, export: compoundExportName(siblingFallback.export, residual) }
|
|
709
|
-
: siblingFallback;
|
|
710
|
-
const localHolder = siblingFallback !== undefined && siblingFallback.kind !== "custom-element" && siblingFallback.source.type === "local"
|
|
711
|
-
? { filePath: siblingFallback.source.filePath, exportName: siblingFallback.export }
|
|
712
|
-
: undefined;
|
|
713
|
-
const definition = localHolder === undefined ? undefined : holderDefinition(localHolder.filePath, localHolder.exportName);
|
|
714
|
-
const named = localHolder === undefined || namesHolderMember(localHolder.filePath, localHolder.exportName);
|
|
715
|
-
const fallback = localFallback ?? externalFallback;
|
|
716
|
-
const credits = jsxTerminals.filter((t) => t.identity !== null || named).map((terminal) => ({
|
|
717
|
-
terminal,
|
|
718
|
-
fallback,
|
|
719
|
-
fallbackSpecifier: matchedImport.specifier,
|
|
720
|
-
outerVia,
|
|
721
|
-
...(terminal.identity === null && definition !== undefined ? { definition } : {}),
|
|
722
|
-
}));
|
|
723
|
-
return { kind: "evaluated", evaluation, value: refType, credits };
|
|
603
|
+
default:
|
|
604
|
+
return assertNever(binding);
|
|
724
605
|
}
|
|
725
|
-
// Target not in graph. Workspace membership: a
|
|
726
|
-
// resolved target owned by a workspace member is first-party — credit
|
|
727
|
-
// LOCAL, pinned to the definition file (bounded re-export resolution)
|
|
728
|
-
// so identity is scope-invariant between whole-repo and single-app
|
|
729
|
-
// scans. Otherwise: external, trusting the JSX call site (external
|
|
730
|
-
// package or unresolvable specifier — identity null →
|
|
731
|
-
// matchedImport-based componentId). See `unparsedMemberDefinition`.
|
|
732
|
-
const member = resolvedAbsTarget !== null
|
|
733
|
-
? unparsedMemberDefinition(graph, resolvedAbsTarget, effectiveImported)
|
|
734
|
-
: null;
|
|
735
|
-
const sentinel = { denotation: { kind: "foreign" }, viaTrail: [], identity: null };
|
|
736
|
-
const fallback = member !== null
|
|
737
|
-
? {
|
|
738
|
-
kind: componentKindFor(fileGraph.dialect),
|
|
739
|
-
export: compoundExportName(member.exportName, residual),
|
|
740
|
-
source: { type: "local", filePath: member.absFile },
|
|
741
|
-
}
|
|
742
|
-
: externalFallback;
|
|
743
|
-
return {
|
|
744
|
-
kind: "evaluated",
|
|
745
|
-
evaluation: [sentinel],
|
|
746
|
-
value: null,
|
|
747
|
-
credits: [{ terminal: sentinel, fallback, fallbackSpecifier: matchedImport.specifier, outerVia }],
|
|
748
|
-
};
|
|
749
606
|
}
|
|
750
607
|
/** The declaration a credit carries: its identity's tag-position stamp, else
|
|
751
608
|
* the render site's own binding for a credit with no identity. */
|
|
@@ -755,10 +612,11 @@ function carriedDeclaration(credit) {
|
|
|
755
612
|
return credit.declaration;
|
|
756
613
|
return identity.kind === "local" ? identity.declaration : undefined;
|
|
757
614
|
}
|
|
758
|
-
/**
|
|
759
|
-
* terminal's own identity, else the
|
|
760
|
-
* the render loop names it
|
|
761
|
-
* render site
|
|
615
|
+
/** The declaration every local `react-component` identity a tag's walk
|
|
616
|
+
* landed on as a function carries (the terminal's own identity, else the
|
|
617
|
+
* render site's fallback, named as the render loop names it): the identity's
|
|
618
|
+
* stamp or the render site's binding. A credit that carries none marks
|
|
619
|
+
* nothing. */
|
|
762
620
|
function taggedDeclarations(graph, tagEvaluations) {
|
|
763
621
|
const tagged = [];
|
|
764
622
|
for (const [filePath, evaluations] of tagEvaluations) {
|
|
@@ -773,7 +631,8 @@ function taggedDeclarations(graph, tagEvaluations) {
|
|
|
773
631
|
const id = buildComponentId(identity, credit.fallback, dialect);
|
|
774
632
|
if (id.kind === "react-component" && id.source.type === "local") {
|
|
775
633
|
const declaration = carriedDeclaration(credit);
|
|
776
|
-
|
|
634
|
+
if (declaration !== undefined)
|
|
635
|
+
tagged.push(declaration);
|
|
777
636
|
}
|
|
778
637
|
}
|
|
779
638
|
}
|
|
@@ -954,8 +813,8 @@ function registryHolds(registry, graph, id, declaration) {
|
|
|
954
813
|
}
|
|
955
814
|
/** A local, non-compound `react-component` identity declared in a parsed
|
|
956
815
|
* React-dialect file is what a `callable` credit names only when tagged
|
|
957
|
-
* membership marked
|
|
958
|
-
*
|
|
816
|
+
* membership marked the declaration the credit carries (`isTagged`). Any
|
|
817
|
+
* other identity is not the registry's to judge. */
|
|
959
818
|
function registryTagged(registry, graph, id, declaration) {
|
|
960
819
|
if (id.kind !== "react-component" || id.source.type !== "local")
|
|
961
820
|
return true;
|
|
@@ -963,7 +822,7 @@ function registryTagged(registry, graph, id, declaration) {
|
|
|
963
822
|
return true;
|
|
964
823
|
if (parseCompoundExport(id.export).isCompound)
|
|
965
824
|
return true;
|
|
966
|
-
return registry.isTagged(
|
|
825
|
+
return registry.isTagged(declaration);
|
|
967
826
|
}
|
|
968
827
|
/**
|
|
969
828
|
* THE argument-site push seam: one `passed-as-argument` occurrence per
|
|
@@ -1001,7 +860,7 @@ function pushCallArgumentOccurrences(occurrences, filePath, call, owners, graph,
|
|
|
1001
860
|
const seedIdentifier = (site, index, arg, hops) => {
|
|
1002
861
|
if (isHostElementName(arg.ref.symbol))
|
|
1003
862
|
return;
|
|
1004
|
-
const outerVia = { kind: "passed-as-argument", index, ...argumentProvenance(site, arg, fileGraph) };
|
|
863
|
+
const outerVia = { kind: "passed-as-argument", index, ...argumentProvenance(graph, site, arg, fileGraph) };
|
|
1005
864
|
const argDecl = findLocalDeclaration(fileGraph, arg.ref);
|
|
1006
865
|
// Never applied: every terminal used below carries a non-null identity,
|
|
1007
866
|
// and `buildComponentId` returns the fallback only for a null one. The
|
|
@@ -1014,7 +873,7 @@ function pushCallArgumentOccurrences(occurrences, filePath, call, owners, graph,
|
|
|
1014
873
|
filePath,
|
|
1015
874
|
resolveExternalLeaf: opts?.resolveExternalLeaf,
|
|
1016
875
|
});
|
|
1017
|
-
if (!registryHolds(registry, graph, rawComponentId))
|
|
876
|
+
if (!registryHolds(registry, graph, rawComponentId, ft.identity.kind === "local" ? ft.identity.declaration : undefined))
|
|
1018
877
|
continue;
|
|
1019
878
|
resolvedOwners ??= owners();
|
|
1020
879
|
emitOccurrence(occurrences, { filePath, line: arg.ref.loc.line, column: arg.ref.loc.column, props: {}, events: [] }, rawComponentId, resolvedOwners, [outerVia, ...hops, ...ft.viaTrail], argDecl !== null ? { line: argDecl.loc.line, column: argDecl.loc.column } : undefined);
|