refactor(electron): use required native module facts

This commit is contained in:
morluto committed 2026-10-27 11:16:43 +08:00
1 parent 76441ed31b
commit a18297f7d1
2 files changed
+6 -12

No files matched your search

@@ -52,9 +52,7 @@ const addNativeBinding = (input: NativeBindingInput): void => {
files: context.filesByPath,
jsonDocuments: context.analysis.jsonDocuments,
directoryPaths: context.directoryPaths,
...(value.module_kind === undefined
? {}
: { moduleKind: value.module_kind }),
moduleKind: value.module_kind,
}).resolved_path;
// Extension probing can resolve `./addon.node` to `addon.node.js`; only a
// native-addon artifact can expose the requested binding.
@@ -430,9 +430,10 @@ const expectElectronSummary = (result: Reconstruction): void => {
ipc: {
literal_channels: 5,
dynamic_channel_operations: 2,
paired_renderer_transmissions: 4,
ambiguous_renderer_transmissions: 1,
unpaired_literal_renderer_transmissions: 1,
// Retained module gaps leave preload/renderer application ownership unknown.
paired_renderer_transmissions: 0,
ambiguous_renderer_transmissions: 7,
unpaired_literal_renderer_transmissions: 0,
},
sender_validation_observations: 2,
utility_processes: 1,
@@ -591,12 +592,7 @@ const expectElectronBoundaries = (graph: ApplicationGraph): void => {
({ properties }) =>
properties.pairing_basis === "unique-exact-literal-channel",
);
expect(pairingEdges).toHaveLength(4);
expect(
pairingEdges.some(
({ properties }) => properties.channel === "rea:ambiguous",
),
).toBe(false);
expect(pairingEdges).toHaveLength(0);
expect(graph.limitations.join(" ")).toMatch(/dynamic IPC|ambiguous/iu);
};