@react-native/debugger-shell
Advanced tools
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * | ||
| * @format | ||
| */ | ||
| export declare function configureAppMenu(): void; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true, | ||
| }); | ||
| exports.configureAppMenu = configureAppMenu; | ||
| const { BrowserWindow, Menu, app, nativeImage, shell } = require("electron"); | ||
| const { isMacOSAtLeast } = require("./utils"); | ||
| function configureAppMenu() { | ||
| const template = [ | ||
| ...(process.platform === "darwin" | ||
| ? [ | ||
| { | ||
| role: "appMenu", | ||
| }, | ||
| ] | ||
| : []), | ||
| { | ||
| label: "File", | ||
| submenu: [ | ||
| { | ||
| label: "Reload App", | ||
| accelerator: | ||
| process.platform === "darwin" ? "Command+R" : "Control+R", | ||
| click: () => invokeCommand("inspector-main.reload"), | ||
| }, | ||
| { | ||
| label: "Reload DevTools", | ||
| accelerator: process.platform === "darwin" ? "Option+R" : "Alt+R", | ||
| click: () => BrowserWindow.getFocusedWindow()?.webContents.reload(), | ||
| }, | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| label: "Quick Open…", | ||
| ...menuSymbol("doc.text.magnifyingglass"), | ||
| accelerator: | ||
| process.platform === "darwin" ? "Command+P" : "Control+P", | ||
| click: () => invokeCommand("quick-open.show"), | ||
| }, | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| role: "close", | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| label: "Edit", | ||
| submenu: [ | ||
| { | ||
| role: "undo", | ||
| }, | ||
| { | ||
| role: "redo", | ||
| }, | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| role: "cut", | ||
| }, | ||
| { | ||
| role: "copy", | ||
| }, | ||
| { | ||
| role: "paste", | ||
| }, | ||
| { | ||
| role: "selectAll", | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| label: "View", | ||
| submenu: [ | ||
| { | ||
| label: "Command Palette…", | ||
| ...menuSymbol("filemenu.and.selection"), | ||
| accelerator: | ||
| process.platform === "darwin" | ||
| ? "Command+Shift+P" | ||
| : "Control+Shift+P", | ||
| click: () => invokeCommand("quick-open.show-command-menu"), | ||
| }, | ||
| ...(!app.isPackaged | ||
| ? [ | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| role: "toggleDevTools", | ||
| }, | ||
| ] | ||
| : []), | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| role: "resetZoom", | ||
| }, | ||
| { | ||
| role: "zoomIn", | ||
| }, | ||
| { | ||
| role: "zoomOut", | ||
| }, | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| role: "togglefullscreen", | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| role: "windowMenu", | ||
| }, | ||
| { | ||
| role: "help", | ||
| submenu: [ | ||
| { | ||
| label: "Keyboard Shortcuts", | ||
| ...menuSymbol("keyboard"), | ||
| click: () => invokeCommand("settings.shortcuts"), | ||
| }, | ||
| { | ||
| type: "separator", | ||
| }, | ||
| { | ||
| label: "React Native Website", | ||
| click: () => shell.openExternal("https://reactnative.dev"), | ||
| }, | ||
| { | ||
| label: "Release Notes", | ||
| click: () => | ||
| shell.openExternal( | ||
| "https://github.com/facebook/react-native/releases", | ||
| ), | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
| const menu = Menu.buildFromTemplate(template); | ||
| Menu.setApplicationMenu(menu); | ||
| } | ||
| function menuSymbol(symbolName) { | ||
| if (!isMacOSAtLeast(26)) { | ||
| return {}; | ||
| } | ||
| return { | ||
| icon: nativeImage.createMenuSymbol(symbolName), | ||
| }; | ||
| } | ||
| function invokeCommand(commandId) { | ||
| const win = BrowserWindow.getFocusedWindow(); | ||
| win?.webContents.executeJavaScript( | ||
| `(async () => { | ||
| const UI = await import('./ui/legacy/legacy.js'); | ||
| return UI.ActionRegistry.ActionRegistry.instance() | ||
| .getAction(${JSON.stringify(commandId)})?.execute(); | ||
| })()`, | ||
| true, | ||
| ); | ||
| } |
Sorry, the diff of this file is not supported yet
| /** | ||
| * Copyright (c) Meta Platforms, Inc. and affiliates. | ||
| * | ||
| * This source code is licensed under the MIT license found in the | ||
| * LICENSE file in the root directory of this source tree. | ||
| * | ||
| * | ||
| * @format | ||
| */ | ||
| /** Equivalent of Swift's `if #available(macOS 26, *)`. */ | ||
| export declare function isMacOSAtLeast(major: number): boolean; |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { | ||
| value: true, | ||
| }); | ||
| exports.isMacOSAtLeast = isMacOSAtLeast; | ||
| function isMacOSAtLeast(major) { | ||
| return ( | ||
| process.platform === "darwin" && | ||
| Number.parseInt(process.getSystemVersion().split(".")[0], 10) >= major | ||
| ); | ||
| } |
Sorry, the diff of this file is not supported yet
| "use strict"; | ||
| var _AppMenu = require("./AppMenu.js"); | ||
| var _SettingsStore = _interopRequireDefault(require("./SettingsStore.js")); | ||
@@ -9,3 +10,3 @@ function _interopRequireDefault(e) { | ||
| const util = require("util"); | ||
| const { BrowserWindow, Menu, app, shell, ipcMain } = require("electron"); | ||
| const { BrowserWindow, app, shell, ipcMain } = require("electron"); | ||
| const appSettings = new _SettingsStore.default(); | ||
@@ -76,43 +77,2 @@ const windowMetadata = new WeakMap(); | ||
| } | ||
| function configureAppMenu() { | ||
| const template = [ | ||
| ...(process.platform === "darwin" | ||
| ? [ | ||
| { | ||
| role: "appMenu", | ||
| }, | ||
| ] | ||
| : []), | ||
| { | ||
| role: "fileMenu", | ||
| }, | ||
| { | ||
| role: "editMenu", | ||
| }, | ||
| { | ||
| role: "viewMenu", | ||
| }, | ||
| { | ||
| role: "windowMenu", | ||
| }, | ||
| { | ||
| role: "help", | ||
| submenu: [ | ||
| { | ||
| label: "React Native Website", | ||
| click: () => shell.openExternal("https://reactnative.dev"), | ||
| }, | ||
| { | ||
| label: "Release Notes", | ||
| click: () => | ||
| shell.openExternal( | ||
| "https://github.com/facebook/react-native/releases", | ||
| ), | ||
| }, | ||
| ], | ||
| }, | ||
| ]; | ||
| const menu = Menu.buildFromTemplate(template); | ||
| Menu.setApplicationMenu(menu); | ||
| } | ||
| function getSavedWindowPosition(windowKey) { | ||
@@ -145,3 +105,3 @@ return appSettings.get("windowArrangements", {})[windowKey]; | ||
| handleLaunchArgs(process.argv.slice(app.isPackaged ? 1 : 2)); | ||
| configureAppMenu(); | ||
| (0, _AppMenu.configureAppMenu)(); | ||
| app.on( | ||
@@ -148,0 +108,0 @@ "second-instance", |
+2
-2
| { | ||
| "name": "@react-native/debugger-shell", | ||
| "productName": "React Native DevTools", | ||
| "version": "0.87.0-nightly-20260706-e04ff69ab", | ||
| "version": "0.87.0-nightly-20260707-b67b7ba62", | ||
| "description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend", | ||
@@ -39,3 +39,3 @@ "keywords": [ | ||
| "devDependencies": { | ||
| "electron": "39.8.10", | ||
| "electron": "43.0.0", | ||
| "semver": "^7.1.3" | ||
@@ -42,0 +42,0 @@ }, |
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
AI-detected potential code anomaly
Supply chain riskAI has identified unusual behaviors that may pose a security risk.
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
893842
0.51%39
18.18%899
21.32%6
-14.29%