From 762c4fe6e60372203e67bea500a86ab061f6001c Mon Sep 17 00:00:00 2001 From: Simon Rho Date: Thu, 17 Oct 2024 02:05:08 -0400 Subject: [PATCH] Update macos app bundle id --- jccm/forge.config.js | 16 ++++++++++++---- jccm/package-lock.json | 27 +++++++++++++++++++++++++++ jccm/package.json | 10 +--------- jccm/src/main.js | 2 +- 4 files changed, 41 insertions(+), 14 deletions(-) diff --git a/jccm/forge.config.js b/jccm/forge.config.js index 3085c53..778649c 100644 --- a/jccm/forge.config.js +++ b/jccm/forge.config.js @@ -10,6 +10,7 @@ let archOption; module.exports = { packagerConfig: { + appBundleId: 'net.juniper.juniper-cloud-connection-manager', asar: true, icon: './assets/icons/AppIcon', // Path without the extension osxSign: { @@ -49,11 +50,14 @@ module.exports = { format: 'ULFO', // Optional: Customize DMG format overwrite: true, }, - }, + }, { name: '@electron-forge/maker-squirrel', config: { - iconUrl: `file://${path.resolve(__dirname, 'assets/icons/AppIcon.ico')}`, // Local file URL for Windows + iconUrl: `file://${path.resolve( + __dirname, + 'assets/icons/AppIcon.ico' + )}`, // Local file URL for Windows setupIcon: path.join(__dirname, 'assets/icons/AppIcon.ico'), // Path to the .ico file for Windows overwrite: true, out: path.join(__dirname, 'out/make/windows-x64'), @@ -95,8 +99,12 @@ module.exports = { archOption = arch ? arch : process.arch; }, preMake: async (config) => { - const makerPkg = config.makers.find((maker) => maker.name === '@electron-forge/maker-pkg'); - const makerDmg = config.makers.find((maker) => maker.name === '@electron-forge/maker-dmg'); + const makerPkg = config.makers.find( + (maker) => maker.name === '@electron-forge/maker-pkg' + ); + const makerDmg = config.makers.find( + (maker) => maker.name === '@electron-forge/maker-dmg' + ); const name = `jccm-darwin-${archOption}`; diff --git a/jccm/package-lock.json b/jccm/package-lock.json index d05f785..acc023c 100644 --- a/jccm/package-lock.json +++ b/jccm/package-lock.json @@ -51,6 +51,7 @@ "socket.io-client": "^4.7.5", "ssh2": "^1.15.0", "tough-cookie": "^4.1.4", + "update-electron-app": "^3.0.0", "uuid": "^9.0.1", "validator": "^13.12.0", "xlsx": "^0.18.5", @@ -9611,6 +9612,15 @@ "node": ">=6" } }, + "node_modules/github-url-to-object": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/github-url-to-object/-/github-url-to-object-4.0.6.tgz", + "integrity": "sha512-NaqbYHMUAlPcmWFdrAB7bcxrNIiiJWJe8s/2+iOc9vlcHlwHqSGrPk+Yi3nu6ebTwgsZEa7igz+NH2vEq3gYwQ==", + "license": "MIT", + "dependencies": { + "is-url": "^1.1.0" + } + }, "node_modules/glob": { "version": "7.2.3", "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", @@ -10572,6 +10582,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "license": "MIT" + }, "node_modules/is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", @@ -15549,6 +15565,17 @@ "browserslist": ">= 4.21.0" } }, + "node_modules/update-electron-app": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/update-electron-app/-/update-electron-app-3.0.0.tgz", + "integrity": "sha512-Ccs46fgUEcMpSRPMNw82DFMux2MGi5tkKkEpV723JmtPNI3qAtxvTeiYkKczN2/LehA3U7JGrGr4MhraxGdRTw==", + "license": "MIT", + "dependencies": { + "github-url-to-object": "^4.0.4", + "is-url": "^1.2.4", + "ms": "^2.1.1" + } + }, "node_modules/uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", diff --git a/jccm/package.json b/jccm/package.json index 3452bd1..096a5b3 100644 --- a/jccm/package.json +++ b/jccm/package.json @@ -3,15 +3,6 @@ "productName": "Juniper Cloud Connection Manager", "description": "Juniper Cloud Connection Manager", "version": "1.2.3", - "build": { - "publish": [ - { - "provider": "github", - "owner": "simonrho", - "repo": "juniper-jccm" - } - ] - }, "main": ".webpack/main", "scripts": { "start": "pkill -9 node; nodemon --watch ./src --ext js,json --ignore ./src/Frontend/ --exec 'electron-forge start'", @@ -92,6 +83,7 @@ "socket.io-client": "^4.7.5", "ssh2": "^1.15.0", "tough-cookie": "^4.1.4", + "update-electron-app": "^3.0.0", "uuid": "^9.0.1", "validator": "^13.12.0", "xlsx": "^0.18.5", diff --git a/jccm/src/main.js b/jccm/src/main.js index 4675dd8..cc1ced2 100644 --- a/jccm/src/main.js +++ b/jccm/src/main.js @@ -51,7 +51,6 @@ const createWindow = () => { console.log('Window Created'); }; - // This method will be called when Electron has finished // initialization and is ready to create browser windows. // Some APIs can only be used after this event occurs. @@ -59,6 +58,7 @@ app.whenReady().then(() => { setupApiHandlers(); // Set up IPC handlers createWindow(); + // On OS X it's common to re-create a window in the app when the // dock icon is clicked and there are no other windows open. app.on('activate', () => {