@react-native/dev-middleware
Advanced tools
@@ -11,6 +11,4 @@ "use strict"; | ||
| } = require("@react-native/debugger-shell"); | ||
| const ChromeLauncher = require("chrome-launcher"); | ||
| const { Launcher: EdgeLauncher } = require("chromium-edge-launcher"); | ||
| const { spawn } = require("node:child_process"); | ||
| const open = require("open"); | ||
| const { apps, openApp } = open; | ||
| const DefaultToolLauncher = { | ||
@@ -21,31 +19,18 @@ launchDebuggerAppWindow: async (url) => { | ||
| } | ||
| let chromePath; | ||
| try { | ||
| chromePath = ChromeLauncher.getChromePath(); | ||
| const subprocess = await openApp(apps.chrome, { | ||
| arguments: [`--app=${url}`], | ||
| newInstance: true, | ||
| }); | ||
| await new Promise((resolve, reject) => { | ||
| subprocess.once("error", reject); | ||
| subprocess.once("exit", (code) => { | ||
| code === 0 | ||
| ? resolve() | ||
| : reject(new Error(`openApp exited with code ${code}`)); | ||
| }); | ||
| }); | ||
| } catch (e) { | ||
| chromePath = EdgeLauncher.getFirstInstallation(); | ||
| } | ||
| if (chromePath == null) { | ||
| await open(url); | ||
| return; | ||
| } | ||
| const chromeFlags = [`--app=${url}`, "--window-size=1200,600"]; | ||
| return new Promise((resolve, reject) => { | ||
| const childProcess = spawn(chromePath, chromeFlags, { | ||
| detached: true, | ||
| stdio: "ignore", | ||
| }); | ||
| childProcess.on("data", () => { | ||
| resolve(); | ||
| }); | ||
| childProcess.on("close", (code) => { | ||
| if (code !== 0) { | ||
| reject( | ||
| new Error( | ||
| `Failed to launch debugger app window: ${chromePath} exited with code ${code}`, | ||
| ), | ||
| ); | ||
| } | ||
| }); | ||
| }); | ||
| }, | ||
@@ -52,0 +37,0 @@ async launchDebuggerShell(url, windowKey) { |
+5
-7
| { | ||
| "name": "@react-native/dev-middleware", | ||
| "version": "0.88.0-nightly-20260722-eb4d3892a", | ||
| "version": "0.88.0-nightly-20260723-e46189e1e", | ||
| "description": "Dev server middleware for React Native", | ||
@@ -29,6 +29,4 @@ "keywords": [ | ||
| "@isaacs/ttlcache": "^1.4.1", | ||
| "@react-native/debugger-frontend": "0.88.0-nightly-20260722-eb4d3892a", | ||
| "@react-native/debugger-shell": "0.88.0-nightly-20260722-eb4d3892a", | ||
| "chrome-launcher": "^0.15.2", | ||
| "chromium-edge-launcher": "^0.3.0", | ||
| "@react-native/debugger-frontend": "0.88.0-nightly-20260723-e46189e1e", | ||
| "@react-native/debugger-shell": "0.88.0-nightly-20260723-e46189e1e", | ||
| "connect": "^3.6.5", | ||
@@ -38,3 +36,3 @@ "debug": "^4.4.0", | ||
| "nullthrows": "^1.1.1", | ||
| "open": "^7.0.3", | ||
| "open": "^8.4.2", | ||
| "serve-static": "^1.16.2", | ||
@@ -44,3 +42,3 @@ "ws": "^7.5.10" | ||
| "devDependencies": { | ||
| "@react-native/debugger-shell": "0.88.0-nightly-20260722-eb4d3892a", | ||
| "@react-native/debugger-shell": "0.88.0-nightly-20260723-e46189e1e", | ||
| "selfsigned": "^5.5.0", | ||
@@ -47,0 +45,0 @@ "undici": "^6.23.0", |
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
10
-16.67%1
-50%162794
-0.34%3289
-0.45%+ Added
+ Added
+ Added
+ Added
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
- Removed
Updated
Updated
Updated