runbay 0.1.9 → 0.1.10

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/README.md CHANGED
@@ -52,6 +52,8 @@ npm install -g runbay
52
52
  runbay
53
53
  ```
54
54
 
55
+ > Depuis npm v12, les scripts d'installation des dépendances sont bloqués par défaut — dont le téléchargement du binaire Electron. Pas d'inquiétude : au premier lancement, RunBay détecte le binaire manquant et exécute lui-même l'installeur officiel d'Electron (téléchargement unique, affiché dans le terminal).
56
+
55
57
  Ou pour essayer une seule fois, sans rien installer :
56
58
 
57
59
  ```bash
package/bin/runbay.js CHANGED
@@ -2,8 +2,21 @@
2
2
  'use strict'
3
3
  // Lanceur RunBay (npm install -g runbay, npx runbay) : démarre l'app Electron
4
4
  // embarquée dans ce paquet, puis rend la main au terminal.
5
- const { spawn } = require('node:child_process')
6
- const { join } = require('node:path')
5
+ const { spawn, spawnSync } = require('node:child_process')
6
+ const { existsSync } = require('node:fs')
7
+ const { join, dirname } = require('node:path')
8
+
9
+ // npm v12 ne lance plus les scripts des dépendances par défaut : le postinstall
10
+ // d'electron (qui télécharge son binaire) a pu être sauté silencieusement.
11
+ // Plutôt que d'échouer platement, on rattrape ce script d'installation officiel
12
+ // d'electron nous-mêmes — c'est le même téléchargement, au bon moment.
13
+ const electronDir = dirname(require.resolve('electron'))
14
+ const electronBin = process.platform === 'win32' ? 'electron.exe' : 'electron'
15
+ if (!existsSync(join(electronDir, 'dist', electronBin))) {
16
+ console.log('RunBay : binaire Electron manquant, exécution de son installeur (téléchargement unique)…')
17
+ const r = spawnSync(process.execPath, [join(electronDir, 'install.js')], { stdio: 'inherit' })
18
+ if (r.status !== 0) process.exit(r.status ?? 1)
19
+ }
7
20
 
8
21
  // require('electron') renvoie le chemin du binaire Electron installé avec le paquet.
9
22
  const child = spawn(require('electron'), [join(__dirname, '..')], {
package/out/main/index.js CHANGED
@@ -725,8 +725,9 @@ async function applySelfUpdate() {
725
725
  const log = node_path.join(electron.app.getPath("userData"), "update.log");
726
726
  const appDir = electron.app.getAppPath();
727
727
  const electronExe = node_path.join(appDir, "node_modules", "electron", "dist", "electron.exe");
728
- const relaunch = node_fs.existsSync(electronExe) ? `start "" "${electronExe}" "${appDir}"` : `start "" "${shim}"`;
728
+ const relaunch = `if exist "${electronExe}" (start "" "${electronExe}" "${appDir}") else (start "" "${shim}")`;
729
729
  const install = `call npm install -g ${PKG}@${target}${registryFlag}`;
730
+ const ensureElectron = `if not exist "${electronExe}" node "${node_path.join(appDir, "node_modules", "electron", "install.js")}" >> "${log}" 2>&1`;
730
731
  const body = [
731
732
  "@echo off",
732
733
  "ping -n 9 127.0.0.1 >nul",
@@ -740,6 +741,7 @@ async function applySelfUpdate() {
740
741
  " ping -n 31 127.0.0.1 >nul",
741
742
  `${install} --prefer-online >> "${log}" 2>&1`,
742
743
  ")",
744
+ ensureElectron,
743
745
  relaunch,
744
746
  `del "${vbs}"`,
745
747
  'del "%~f0"',
@@ -922,6 +924,7 @@ let tray = null;
922
924
  let quitting = false;
923
925
  let closeHintShown = false;
924
926
  const BACKGROUND_SCAN_MS = 30 * 60 * 1e3;
927
+ const APP_ID = "com.skrodu10.runbay";
925
928
  function isOnScreen(b) {
926
929
  return electron.screen.getAllDisplays().some((d) => {
927
930
  const wa = d.workArea;
@@ -959,6 +962,13 @@ function createWindow() {
959
962
  }
960
963
  });
961
964
  if (saved?.maximized) mainWindow.maximize();
965
+ if (process.platform === "win32") {
966
+ mainWindow.setAppDetails({
967
+ appId: APP_ID,
968
+ appIconPath: appIconPath("icon.ico"),
969
+ appIconIndex: 0
970
+ });
971
+ }
962
972
  mainWindow.once("ready-to-show", () => {
963
973
  if (!mainWindow) return;
964
974
  if (settings.foregroundOnStart === false) {
@@ -1064,7 +1074,7 @@ if (isSecondInstance) {
1064
1074
  }
1065
1075
  electron.app.whenReady().then(() => {
1066
1076
  if (isSecondInstance) return;
1067
- utils.electronApp.setAppUserModelId("com.skrodu.runbay");
1077
+ utils.electronApp.setAppUserModelId(APP_ID);
1068
1078
  loadSettings();
1069
1079
  electron.Menu.setApplicationMenu(null);
1070
1080
  electron.app.on("browser-window-created", (_, window) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "runbay",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Not an installer. A launcher. Detect, launch, update and uninstall apps installed from the command line (npm, pnpm, yarn, bun, scoop) — in one modern window.",
5
5
  "main": "./out/main/index.js",
6
6
  "bin": {