reactoradar 1.6.0 → 1.6.1
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/main.js +26 -11
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -417,17 +417,32 @@ function setupIPC() {
|
|
|
417
417
|
ipcMain.on('open-react-devtools', () => {
|
|
418
418
|
// Start the relay server if not already running
|
|
419
419
|
if (!reactDTServer) startReactDevToolsServer();
|
|
420
|
-
//
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
420
|
+
// Launch standalone react-devtools via npx in a background process
|
|
421
|
+
try {
|
|
422
|
+
const { spawn } = require('child_process');
|
|
423
|
+
const env = { ...process.env };
|
|
424
|
+
// Remove ELECTRON_RUN_AS_NODE to prevent npx from running in Electron's Node
|
|
425
|
+
delete env.ELECTRON_RUN_AS_NODE;
|
|
426
|
+
const child = spawn('npx', ['react-devtools'], {
|
|
427
|
+
stdio: 'ignore',
|
|
428
|
+
detached: true,
|
|
429
|
+
env,
|
|
430
|
+
});
|
|
431
|
+
child.unref();
|
|
432
|
+
console.log('[ReactDevTools] Launched standalone react-devtools');
|
|
433
|
+
_send('react-dt-status', 'launched');
|
|
434
|
+
} catch (e) {
|
|
435
|
+
console.error('[ReactDevTools] Failed to launch:', e.message);
|
|
436
|
+
// Fallback: show instructions in a dialog
|
|
437
|
+
const { dialog } = require('electron');
|
|
438
|
+
dialog.showMessageBox(mainWindow, {
|
|
439
|
+
type: 'info',
|
|
440
|
+
title: 'React DevTools',
|
|
441
|
+
message: 'Could not launch React DevTools automatically.',
|
|
442
|
+
detail: 'Run this command in your terminal:\n\nnpx react-devtools\n\nIt will connect to your app on port 8097.',
|
|
443
|
+
buttons: ['OK'],
|
|
444
|
+
});
|
|
445
|
+
}
|
|
431
446
|
});
|
|
432
447
|
|
|
433
448
|
// clear-all is handled by renderer via clear-all-ui IPC from menu
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactoradar",
|
|
3
3
|
"productName": "ReactoRadar",
|
|
4
|
-
"version": "1.6.
|
|
4
|
+
"version": "1.6.1",
|
|
5
5
|
"description": "macOS debugger for React Native — Console, Sources, Network, Performance, Memory, Redux, AsyncStorage, React tree. Supports RN 0.74+ with Hermes and New Architecture.",
|
|
6
6
|
"main": "main.js",
|
|
7
7
|
"bin": {
|