@lvce-editor/process-explorer-worker 3.19.0 → 3.21.0
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/index.js +20 -2
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2517,6 +2517,23 @@ const prepareError = async error => {
|
|
|
2517
2517
|
}
|
|
2518
2518
|
};
|
|
2519
2519
|
|
|
2520
|
+
const conceptualChildNames = ['embeds-process', 'file-system-process', 'file-watcher-process', 'process-explorer', 'terminal-process'];
|
|
2521
|
+
const reparentSharedProcessChildren = processes => {
|
|
2522
|
+
const sharedProcess = processes.find(process => process.name === 'shared-process');
|
|
2523
|
+
if (!sharedProcess) {
|
|
2524
|
+
return processes;
|
|
2525
|
+
}
|
|
2526
|
+
return processes.map(process => {
|
|
2527
|
+
if (process.ppid === sharedProcess.pid || !conceptualChildNames.includes(process.name)) {
|
|
2528
|
+
return process;
|
|
2529
|
+
}
|
|
2530
|
+
return {
|
|
2531
|
+
...process,
|
|
2532
|
+
ppid: sharedProcess.pid
|
|
2533
|
+
};
|
|
2534
|
+
});
|
|
2535
|
+
};
|
|
2536
|
+
|
|
2520
2537
|
const getFocusedIndex = (oldFocusedIndex, visibleProcesses) => {
|
|
2521
2538
|
if (visibleProcesses.length === 0) {
|
|
2522
2539
|
return -1;
|
|
@@ -2543,7 +2560,8 @@ const refresh = async state => {
|
|
|
2543
2560
|
const processes = await listProcesses(rootPid, state.platform);
|
|
2544
2561
|
const frontendMemoryProcesses = state.includeFrontendMemoryUsage ? await getFrontendMemoryUsage(rootPid) : [];
|
|
2545
2562
|
const allProcesses = [...processes, ...frontendMemoryProcesses];
|
|
2546
|
-
const
|
|
2563
|
+
const displayedProcesses = state.platform === Electron ? reparentSharedProcessChildren(allProcesses) : allProcesses;
|
|
2564
|
+
const visibleProcesses = getVisibleProcesses(displayedProcesses, state.collapsedPids, rootPid);
|
|
2547
2565
|
return {
|
|
2548
2566
|
...state,
|
|
2549
2567
|
errorCodeFrame: '',
|
|
@@ -2551,7 +2569,7 @@ const refresh = async state => {
|
|
|
2551
2569
|
errorStack: '',
|
|
2552
2570
|
focusedIndex: getFocusedIndex(state.focusedIndex, visibleProcesses),
|
|
2553
2571
|
initial: false,
|
|
2554
|
-
processes:
|
|
2572
|
+
processes: displayedProcesses,
|
|
2555
2573
|
rootPid,
|
|
2556
2574
|
visibleProcesses
|
|
2557
2575
|
};
|