mirror of
https://github.com/morluto/rea.git
synced 2026-10-27 18:05:45 +00:00
fix(electron): resolve package and dirname entrypoints by context
This commit is contained in:
1 parent
a6f02a05a4
commit
1ac9a09ce1
158 files changed
+1654
-493
No files matched your search
@@ -17,6 +17,7 @@ import {
|
||||
astObservationEvidence,
|
||||
staticInferenceEvidence,
|
||||
} from "./JavaScriptArtifactGraphEvidence.js";
|
||||
import { resolveArtifactPathByContext } from "./JavaScriptArtifactPathResolution.js";
|
||||
|
||||
type StaticReference = JavaScriptStaticAnalysis["references"][number];
|
||||
type StaticEndpoint = JavaScriptStaticAnalysis["endpoints"][number];
|
||||
@@ -226,17 +227,17 @@ const addDiscoveredRole = (
|
||||
context: JavaScriptArtifactGraphContext,
|
||||
input: FindingInput<StaticRolePath>,
|
||||
): void => {
|
||||
const resolvedPath = resolveArtifactPath(
|
||||
input.value.path,
|
||||
input.file.path,
|
||||
context.filesByPath,
|
||||
);
|
||||
const resolution = resolveArtifactPathByContext({
|
||||
declaredPath: input.value.path,
|
||||
sourcePath: input.file.path,
|
||||
context: input.value.resolution_context,
|
||||
files: context.filesByPath,
|
||||
});
|
||||
const role = createElectronRoleNode(context, {
|
||||
kind:
|
||||
input.value.role === "preload" ? "electron-preload" : "electron-renderer",
|
||||
anchor: input.file,
|
||||
declaredPath: input.value.path,
|
||||
resolvedPath,
|
||||
resolution,
|
||||
mechanism: input.value.mechanism,
|
||||
range: input.value.location,
|
||||
coverage: input.coverage,
|
||||
@@ -256,7 +257,7 @@ const addDiscoveredRole = (
|
||||
linkElectronRoleToAsset(context, {
|
||||
role,
|
||||
anchor: input.file,
|
||||
path: resolvedPath,
|
||||
resolution,
|
||||
range: input.value.location,
|
||||
coverage: input.coverage,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user