@react-native/debugger-shell 0.83.0-nightly-20250911-dab8a4562 → 0.83.0-nightly-20250913-4fb42c84d

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.
@@ -1,8 +1,10 @@
1
1
  "use strict";
2
2
 
3
- const { BrowserWindow, app, shell, ipcMain } = require("electron");
3
+ const { BrowserWindow, Menu, app, shell, ipcMain } = require("electron");
4
+ const Store = require("electron-store");
4
5
  const path = require("path");
5
6
  const util = require("util");
7
+ const appSettings = new Store();
6
8
  const windowMetadata = new WeakMap();
7
9
  function handleLaunchArgs(argv) {
8
10
  const {
@@ -34,8 +36,10 @@ function handleLaunchArgs(argv) {
34
36
  }
35
37
  } else {
36
38
  frontendWindow = new BrowserWindow({
37
- width: 1200,
38
- height: 600,
39
+ ...(getSavedWindowPosition(windowKey) ?? {
40
+ width: 1200,
41
+ height: 600,
42
+ }),
39
43
  webPreferences: {
40
44
  partition: "persist:react-native-devtools",
41
45
  preload: require.resolve("./preload.js"),
@@ -43,6 +47,7 @@ function handleLaunchArgs(argv) {
43
47
  icon: path.join(__dirname, "resources", "icon.png"),
44
48
  });
45
49
  frontendWindow.setMenuBarVisibility(false);
50
+ setupWindowResizeListeners(frontendWindow, windowKey);
46
51
  }
47
52
  frontendWindow.webContents.setWindowOpenHandler(({ url }) => {
48
53
  shell.openExternal(url);
@@ -61,8 +66,75 @@ function handleLaunchArgs(argv) {
61
66
  }
62
67
  frontendWindow.focus();
63
68
  }
69
+ function configureAppMenu() {
70
+ const template = [
71
+ ...(process.platform === "darwin"
72
+ ? [
73
+ {
74
+ role: "appMenu",
75
+ },
76
+ ]
77
+ : []),
78
+ {
79
+ role: "fileMenu",
80
+ },
81
+ {
82
+ role: "editMenu",
83
+ },
84
+ {
85
+ role: "viewMenu",
86
+ },
87
+ {
88
+ role: "windowMenu",
89
+ },
90
+ {
91
+ role: "help",
92
+ submenu: [
93
+ {
94
+ label: "React Native Website",
95
+ click: () => shell.openExternal("https://reactnative.dev"),
96
+ },
97
+ {
98
+ label: "Release Notes",
99
+ click: () =>
100
+ shell.openExternal(
101
+ "https://github.com/facebook/react-native/releases",
102
+ ),
103
+ },
104
+ ],
105
+ },
106
+ ];
107
+ const menu = Menu.buildFromTemplate(template);
108
+ Menu.setApplicationMenu(menu);
109
+ }
110
+ function getSavedWindowPosition(windowKey) {
111
+ return appSettings.get("windowArrangements", {})[windowKey];
112
+ }
113
+ function saveWindowPosition(windowKey, position) {
114
+ const windowArrangements = appSettings.get("windowArrangements", {});
115
+ windowArrangements[windowKey] = position;
116
+ appSettings.set("windowArrangements", windowArrangements);
117
+ }
118
+ function setupWindowResizeListeners(browserWindow, windowKey) {
119
+ const savePosition = () => {
120
+ if (!browserWindow.isDestroyed()) {
121
+ const [x, y] = browserWindow.getPosition();
122
+ const [width, height] = browserWindow.getSize();
123
+ saveWindowPosition(windowKey, {
124
+ x,
125
+ y,
126
+ width,
127
+ height,
128
+ });
129
+ }
130
+ };
131
+ browserWindow.on("moved", savePosition);
132
+ browserWindow.on("resized", savePosition);
133
+ browserWindow.on("closed", savePosition);
134
+ }
64
135
  app.whenReady().then(() => {
65
136
  handleLaunchArgs(process.argv.slice(app.isPackaged ? 1 : 2));
137
+ configureAppMenu();
66
138
  app.on(
67
139
  "second-instance",
68
140
  (event, electronArgv, workingDirectory, additionalData) => {
@@ -7,7 +7,7 @@ function _interopRequireDefault(e) {
7
7
  const pkg = require("../../package.json");
8
8
  const util = require("util");
9
9
  const { app } = require("electron");
10
- app.setName(pkg.name);
10
+ app.setName(pkg.productName ?? pkg.name);
11
11
  app.setVersion(pkg.version + "-" + _BuildInfo.default.revision);
12
12
  const {
13
13
  values: { version = false },
@@ -21,7 +21,7 @@ const {
21
21
  strict: false,
22
22
  });
23
23
  if (version) {
24
- console.log(`${app.getName()} v${app.getVersion()}`);
24
+ console.log(`${pkg.name} v${app.getVersion()}`);
25
25
  app.exit(0);
26
26
  }
27
27
  const gotTheLock = app.requestSingleInstanceLock({
package/package.json CHANGED
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@react-native/debugger-shell",
3
- "version": "0.83.0-nightly-20250911-dab8a4562",
3
+ "productName": "React Native DevTools",
4
+ "version": "0.83.0-nightly-20250913-4fb42c84d",
4
5
  "description": "Experimental debugger shell for React Native for use with @react-native/debugger-frontend",
5
6
  "keywords": [
6
7
  "react-native",
@@ -34,6 +35,7 @@
34
35
  },
35
36
  "devDependencies": {
36
37
  "electron": "37.2.6",
38
+ "electron-store": "^8.2.0",
37
39
  "semver": "^7.1.3"
38
40
  },
39
41
  "files": [