diff --git a/build.js b/build.js index 29948c710..17089b8a4 100644 --- a/build.js +++ b/build.js @@ -24,13 +24,13 @@ const main = async () => { appId: "xyz.valory.olas-operate-app", artifactName: "${productName}-${version}-${platform}-${arch}.${ext}", productName: "Pearl", - files: ["electron/**/*", "package.json", "app-update.yml"], + files: ["./electron/**/*", "./package.json", "./app-update.yml"], directories: { - output: "dist", + output: "./dist", }, extraResources: [ { - from: "electron/bins", + from: "./electron/bins", to: "bins", filter: ["**/*"], }, @@ -45,12 +45,12 @@ const main = async () => { }, ], publish: publishOptions, - category: "public.app-category.utilities", - icon: "electron/assets/icons/splash-robot-head-dock.png", + category: "./public.app-category.utilities", + icon: "./electron/assets/icons/splash-robot-head-dock.png", hardenedRuntime: true, gatekeeperAssess: false, - entitlements: "electron/entitlements.mac.plist", - entitlementsInherit: "electron/entitlements.mac.plist", + entitlements: "./electron/entitlements.mac.plist", + entitlementsInherit: "./electron/entitlements.mac.plist", notarize: { teamId: process.env.APPLETEAMID, }, diff --git a/build.tester.js b/build.tester.js index 5304672b0..430c7721b 100644 --- a/build.tester.js +++ b/build.tester.js @@ -18,17 +18,17 @@ const main = async () => { appId: 'xyz.valory.olas-operate-app', artifactName: '${productName}-${version}-${platform}-${arch}.${ext}', productName: 'Pearl', - files: ['electron/**/*', 'package.json', 'dev-app-update.yml'], + files: ['./electron/**/*', './package.json', './dev-app-update.yml'], directories: { - output: 'dist', + output: './dist', }, extraResources: [ { - from: 'electron/bins', + from: './electron/bins', to: 'bins', filter: ['**/*'], }, - ], + ], // NOTE - Edit this for your own platform, or leave it commented for default settings // mac: { // publish: null, diff --git a/electron/main.js b/electron/main.js index 66f7c8c34..a4e4f64f1 100644 --- a/electron/main.js +++ b/electron/main.js @@ -179,7 +179,9 @@ const createSplashWindow = () => { splashWindow.loadURL('file://' + import.meta.dirname + '/loading/index.html'); if (isDev) { - splashWindow.webContents.openDevTools(); + splashWindow.webContents.openDevTools({ + mode: 'detach', + }); } }; @@ -263,7 +265,7 @@ const createMainWindow = async () => { await setupStoreIpc(ipcMain, mainWindow, storeInitialValues); if (isDev) { - mainWindow.webContents.openDevTools(); + mainWindow.webContents.openDevTools({ mode: 'detach' }); } }; @@ -354,7 +356,7 @@ async function launchDaemonDev() { async function launchNextApp() { const nextApp = next({ dev: false, - dir: path.join(import.meta.dirname), + dir: '.', port: appConfig.ports.prod.next, env: { ...process.env, @@ -364,6 +366,7 @@ async function launchNextApp() { : appConfig.ports.dev.operate, }, }); + await nextApp.prepare(); const server = http.createServer(nextApp.getRequestHandler); @@ -477,6 +480,7 @@ ipcMain.on('check', async function (event, _argument) { // APP-SPECIFIC EVENTS app.on('ready', async () => { + logger.electron('App ready'); createTray(); if (isMac) { app.dock?.setIcon( diff --git a/electron/utils/processes.js b/electron/utils/processes.js index 6f65f5ec5..0c1f8cff4 100644 --- a/electron/utils/processes.js +++ b/electron/utils/processes.js @@ -2,6 +2,7 @@ import { exec } from 'child_process'; import psTree from 'ps-tree'; import { isWindows } from '../constants/os.js'; +import { logger } from './logger.js'; const unixKillCommand = 'kill -9'; const windowsKillCommand = 'taskkill /F /PID'; @@ -13,6 +14,7 @@ const windowsKillCommand = 'taskkill /F /PID'; * @returns {Promise} A promise that resolves when the process and its children are killed, or rejects with an error. */ export function killProcesses(pid) { + logger.electron('Killing processes...', pid); return new Promise((resolve, reject) => { psTree(pid, (err, children) => { if (err) {