reactoradar 1.2.3 → 1.2.5
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/app.js +24 -11
- package/main.js +13 -3
- package/package.json +1 -1
- package/preload.js +1 -1
package/app.js
CHANGED
|
@@ -225,17 +225,30 @@ if (window.electronAPI) {
|
|
|
225
225
|
|
|
226
226
|
window.electronAPI.on('clear-all-ui', clearAll);
|
|
227
227
|
|
|
228
|
+
window.electronAPI.on('app-version', (version) => {
|
|
229
|
+
state._appVersion = version;
|
|
230
|
+
const el = $('aboutVersion');
|
|
231
|
+
if (el) el.textContent = 'v' + version;
|
|
232
|
+
});
|
|
233
|
+
|
|
228
234
|
window.electronAPI.on('update-available', ({ current, latest }) => {
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
235
|
+
// Show in settings only, not as a banner
|
|
236
|
+
state._updateAvailable = { current, latest };
|
|
237
|
+
const el = $('aboutVersion');
|
|
238
|
+
if (el) el.innerHTML = `v${current} <span style="color:var(--green);font-size:10px;margin-left:6px">v${latest} available</span>`;
|
|
239
|
+
// Add update button in settings if not already there
|
|
240
|
+
if (!$('updateBtn')) {
|
|
241
|
+
const aboutEl = document.querySelector('.settings-about');
|
|
242
|
+
if (aboutEl) {
|
|
243
|
+
const btn = document.createElement('div');
|
|
244
|
+
btn.style.cssText = 'margin-top:10px';
|
|
245
|
+
btn.innerHTML = '<button id="updateBtn" class="tb-btn primary" style="font-size:11px">Download v' + latest + '</button>';
|
|
246
|
+
aboutEl.appendChild(btn);
|
|
247
|
+
$('updateBtn')?.addEventListener('click', () => {
|
|
248
|
+
window.electronAPI?.openExternal('https://github.com/sharanagouda/react-native-debugger/releases');
|
|
249
|
+
});
|
|
250
|
+
}
|
|
251
|
+
}
|
|
239
252
|
});
|
|
240
253
|
|
|
241
254
|
window.electronAPI.on('trigger-open-cdp', () => {
|
|
@@ -1880,7 +1893,7 @@ function initSettingsPanel() {
|
|
|
1880
1893
|
<div class="settings-section-title">About</div>
|
|
1881
1894
|
<div class="settings-about">
|
|
1882
1895
|
<div class="about-name" id="aboutAppName">${getStoredAppName()}</div>
|
|
1883
|
-
<div class="about-version">
|
|
1896
|
+
<div class="about-version" id="aboutVersion">v${state._appVersion || '...'}</div>
|
|
1884
1897
|
<div class="about-desc">A standalone macOS debugger for React Native apps.<br/>Supports Hermes, New Architecture, and React Native 0.74+.</div>
|
|
1885
1898
|
<div class="about-links" style="display:flex;gap:16px;justify-content:center">
|
|
1886
1899
|
<span class="about-link" id="linkGithub">GitHub</span>
|
package/main.js
CHANGED
|
@@ -29,10 +29,14 @@ app.whenReady().then(async () => {
|
|
|
29
29
|
// Theme will be set by renderer via IPC once it reads localStorage
|
|
30
30
|
nativeTheme.themeSource = 'dark';
|
|
31
31
|
|
|
32
|
-
// Set dock icon on macOS
|
|
32
|
+
// Set dock icon on macOS — use icns for proper scaling
|
|
33
33
|
if (process.platform === 'darwin') {
|
|
34
34
|
try {
|
|
35
|
-
const
|
|
35
|
+
const icnsPath = path.join(__dirname, 'ReactoRadar.icns');
|
|
36
|
+
const pngPath = path.join(__dirname, 'ReactoRadar.png');
|
|
37
|
+
const fs = require('fs');
|
|
38
|
+
// Prefer .icns (handles dock scaling correctly), fallback to .png
|
|
39
|
+
const iconPath = fs.existsSync(icnsPath) ? icnsPath : pngPath;
|
|
36
40
|
const icon = nativeImage.createFromPath(iconPath);
|
|
37
41
|
if (!icon.isEmpty()) {
|
|
38
42
|
app.dock.setIcon(icon);
|
|
@@ -44,6 +48,12 @@ app.whenReady().then(async () => {
|
|
|
44
48
|
|
|
45
49
|
await createMainWindow();
|
|
46
50
|
|
|
51
|
+
// Send version to renderer
|
|
52
|
+
const appVersion = require('./package.json').version;
|
|
53
|
+
mainWindow?.webContents.on('did-finish-load', () => {
|
|
54
|
+
mainWindow?.webContents.send('app-version', appVersion);
|
|
55
|
+
});
|
|
56
|
+
|
|
47
57
|
// Check for updates (non-blocking)
|
|
48
58
|
checkForUpdates();
|
|
49
59
|
startBridgeServers();
|
|
@@ -86,7 +96,7 @@ async function createMainWindow() {
|
|
|
86
96
|
contextIsolation: true,
|
|
87
97
|
preload: path.join(__dirname, 'preload.js'),
|
|
88
98
|
},
|
|
89
|
-
icon: nativeImage.createFromPath(path.join(__dirname, 'ReactoRadar.
|
|
99
|
+
icon: nativeImage.createFromPath(path.join(__dirname, 'ReactoRadar.icns')),
|
|
90
100
|
});
|
|
91
101
|
|
|
92
102
|
mainWindow.loadFile(path.join(__dirname, 'index.html'));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "reactoradar",
|
|
3
3
|
"productName": "ReactoRadar",
|
|
4
|
-
"version": "1.2.
|
|
4
|
+
"version": "1.2.5",
|
|
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": {
|
package/preload.js
CHANGED
|
@@ -10,7 +10,7 @@ contextBridge.exposeInMainWorld('electronAPI', {
|
|
|
10
10
|
const allowed = [
|
|
11
11
|
'ports', 'cdp-targets', 'redux-event', 'storage-event', 'network-event',
|
|
12
12
|
'console-event', 'perf-event', 'redux-connected', 'storage-connected', 'network-connected',
|
|
13
|
-
'react-dt-status', 'trigger-open-cdp', 'clear-all-ui', 'theme-changed', 'update-available',
|
|
13
|
+
'react-dt-status', 'trigger-open-cdp', 'clear-all-ui', 'theme-changed', 'update-available', 'app-version',
|
|
14
14
|
];
|
|
15
15
|
if (allowed.includes(channel)) {
|
|
16
16
|
ipcRenderer.removeAllListeners(channel);
|