From 9932d15213928aee404f7f83804a87ccb66f6aab Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Wed, 3 Jun 2026 23:53:37 +0200 Subject: [PATCH 1/2] chore: migrate vite-plugin-electron to v1 --- package.json | 16 +------ pnpm-lock.yaml | 107 +++++++++++++++++++++++++++++++++----------- pnpm-workspace.yaml | 8 ++++ vite.config.ts | 4 +- 4 files changed, 94 insertions(+), 41 deletions(-) diff --git a/package.json b/package.json index c10d4161a..25ddb4240 100644 --- a/package.json +++ b/package.json @@ -126,8 +126,7 @@ "typescript": "6.0.3", "vite": "8.0.14", "vite-plugin-checker": "0.14.1", - "vite-plugin-electron": "0.29.1", - "vite-plugin-electron-renderer": "1.0.0", + "vite-plugin-electron": "1.0.0", "vite-plus": "0.1.23", "vitest": "4.1.7", "zustand": "5.0.14" @@ -135,16 +134,5 @@ "engines": { "node": ">=24" }, - "packageManager": "pnpm@11.5.0", - "pnpm": { - "onlyBuiltDependencies": [ - "@parcel/watcher", - "@swc/core", - "@tailwindcss/oxide", - "electron", - "electron-winstaller", - "esbuild", - "unrs-resolver" - ] - } + "packageManager": "pnpm@11.5.0" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f63662f34..d12bfdc48 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,6 +6,7 @@ settings: overrides: react-is: 19.2.6 + yauzl: 3.3.1 cross-spawn: 7.0.6 got: 11.8.6 electron: 42.3.0 @@ -187,9 +188,6 @@ importers: specifier: 0.14.1 version: 0.14.1(oxlint@1.67.0(oxlint-tsgolint@0.23.0)(vite-plus@0.1.23(@types/node@24.12.4)(@vitest/coverage-v8@4.1.7)(@vitest/ui@4.1.7)(happy-dom@20.9.0)(jiti@2.7.0)(typescript@6.0.3)(vite@8.0.14(@types/node@24.12.4)(jiti@2.7.0)(yaml@2.9.0))(yaml@2.9.0)))(typescript@6.0.3)(vite@8.0.14(@types/node@24.12.4)(jiti@2.7.0)(yaml@2.9.0)) vite-plugin-electron: - specifier: 0.29.1 - version: 0.29.1(vite-plugin-electron-renderer@1.0.0) - vite-plugin-electron-renderer: specifier: 1.0.0 version: 1.0.0 vite-plus: @@ -1834,6 +1832,11 @@ packages: resolution: {integrity: sha512-a1wflyaL0tHtJSmLSOVybYhy22vRih4eduhhrkcjgrWGnRfrZtovJ2FRjxuTtkkj47O/baf0R86QU5OuYpz8fA==} engines: {node: ^20.17.0 || >=22.9.0} + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@7.1.4: resolution: {integrity: sha512-MnA+YT8fwfJPgBx3m60MNqakm30XOkyIoH1y6huTQvC0PwZG7ki8NacLBcrPbNoo8vEZy7Jpuk7+jMO+CUovTQ==} engines: {node: '>= 14'} @@ -2151,6 +2154,12 @@ packages: engines: {node: '>=22'} hasBin: true + confbox@0.1.8: + resolution: {integrity: sha512-RMtmw0iFkeR4YV+fUOSucriAQNb9g8zFR52MWCtl+cCZOFRNL6zeB395vPzFhEjjn4fMxXudmELnl/KF/WrK6w==} + + confbox@0.2.4: + resolution: {integrity: sha512-ysOGlgTFbN2/Y6Cg3Iye8YKulHw+R2fNXHrgSmXISQdMnomY6eNDprVdW9R5xBguEqI954+S6709UyiO7B+6OQ==} + configstore@3.1.5: resolution: {integrity: sha512-nlOhI4+fdzoK5xmJ+NY+1gZK56bwEaWZr8fYuXohZ9Vkc1o3a4T/R3M+yE/w7x/ZVJ1zF8c+oaOvF0dztdUgmA==} engines: {node: '>=4'} @@ -2458,6 +2467,9 @@ packages: exponential-backoff@3.1.3: resolution: {integrity: sha512-ZgEeZXj30q+I0EN+CbSSpIyPaJ5HVQD18Z1m+u1FXbAeT94mr1zw50q4q6jiiC447Nl/YTcIYSAftiGqetwXCA==} + exsolve@1.0.8: + resolution: {integrity: sha512-LmDxfWXwcTArk8fUEnOfSZpHOJ6zOMUJKOtFLFqJLoKJetuQG874Uc7/Kki7zFLzYybmZhp1M7+98pfMqeX8yA==} + extract-zip@2.0.1: resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} engines: {node: '>= 10.17.0'} @@ -2489,9 +2501,6 @@ packages: fastq@1.20.1: resolution: {integrity: sha512-GGToxJ/w1x32s/D2EKND7kTil4n8OVk/9mycTc4VDza13lOvpUZTGX3mFSCtV9ksdGBVzvsyAVLM6mHFThxXxw==} - fd-slicer@1.1.0: - resolution: {integrity: sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==} - fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -3071,6 +3080,10 @@ packages: resolution: {integrity: sha512-7I5knELsJKTUjXG+A6BkKAiGkW1i25fNa/xlUl9hFtk15WbE9jndA89xu5FzQKrY5llajE1hfZZFMILXkDHk/Q==} engines: {node: '>=22.13.0'} + local-pkg@1.2.1: + resolution: {integrity: sha512-++gUqRDEvcnN6Zhqrr+y/CkVEHhlrR96vZn3nZZPYzMcBUyBtTKzB9NadClFIsIVSsu+3i9tfk/erqy9kAmt7Q==} + engines: {node: '>=14'} + lodash.escaperegexp@4.1.2: resolution: {integrity: sha512-TM9YBvyC84ZxE3rgfefxUWiQKLilstD6k7PTGt6wfbtXF8ixIJLOL3VYyV/z+ZiPLsVxAsKAFVwWlWeb2Y8Yyw==} @@ -3235,6 +3248,9 @@ packages: resolution: {integrity: sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==} hasBin: true + mlly@1.8.2: + resolution: {integrity: sha512-d+ObxMQFmbt10sretNDytwt85VrbkhhUA/JBGm1MPaWJ65Cl4wOgLaB1NYvJSZ0Ef03MMEU/0xpPMXUIQ29UfA==} + mrmime@2.0.1: resolution: {integrity: sha512-Y3wQdFg2Va6etvQ5I82yUhGdsKrcYox6p7FfL1LbK2J4V01F9TGlepTIhnK24t7koZibmg82KGglhA1XK5IsLQ==} engines: {node: '>=10'} @@ -3458,6 +3474,12 @@ packages: resolution: {integrity: sha512-xhcb4yHu9sM/G7foGzoLtXYcC0zHEaOXXjRKhGup0fw78Nf2Tkiapv4EQyMzrbcmQPsllAI7DbFY2UT7PlI9Pg==} hasBin: true + pkg-types@1.3.1: + resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} + + pkg-types@2.3.1: + resolution: {integrity: sha512-y+ichcgc2LrADuhLNAx8DFjVfgz91pRxfZdI3UDhxHvcVEZsenLO+7XaU5vOp0u/7V/wZ+plyuQxtrDlZJ+yeg==} + plist@3.1.0: resolution: {integrity: sha512-uysumyrvkUX0rX/dEVqt8gC3sTBzd4zoWfLeS29nb53imdaXVvLINYXTI2GNqzaMuvacNx4uJQ8+b3zXR0pkgQ==} engines: {node: '>=10.4.0'} @@ -3505,6 +3527,9 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -3949,6 +3974,9 @@ packages: engines: {node: '>=14.17'} hasBin: true + ufo@1.6.4: + resolution: {integrity: sha512-JFNbkD1Svwe0KvGi8GOeLcP4kAWQ609twvCdcHxq1oSL8svv39ZuSvajcD8B+5D0eL4+s1Is2D/O6KN3qcTeRA==} + unc-path-regex@0.1.2: resolution: {integrity: sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==} engines: {node: '>=0.10.0'} @@ -4041,11 +4069,8 @@ packages: vue-tsc: optional: true - vite-plugin-electron-renderer@1.0.0: - resolution: {integrity: sha512-/9CBdUqnCgwWXn61v5PErWnR5q3Bfne2oI52uHzgJnKnlaoNgEKvxOzS0/XssDXWMK3ElStM2+J/Ko4Q63XhMA==} - - vite-plugin-electron@0.29.1: - resolution: {integrity: sha512-AejNed5BgHFnuw8h5puTa61C6vdP4ydbsbo/uVjH1fTdHAlCDz1+o6pDQ/scQj1udDrGvH01+vTbzQh/vMnR9w==} + vite-plugin-electron@1.0.0: + resolution: {integrity: sha512-05oTapZl917xRq2GtLFuxdXKDGFaa5qn+XJhmTWXQo1NdFq8GZs32uU6BjWzx4KHhdXgUQWs1zC1yQF5Rw/bYA==} peerDependencies: vite-plugin-electron-renderer: '*' peerDependenciesMeta: @@ -4262,8 +4287,9 @@ packages: resolution: {integrity: sha512-4UEqdc2RYGHZc7Doyqkrqiln3p9X2DZVxaGbwhn2pi7MrRagKaOcIKe8L3OxYcbhXLgLFUS3zAYuQjKBQgmuNg==} engines: {node: ^20.19.0 || ^22.12.0 || >=23} - yauzl@2.10.0: - resolution: {integrity: sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==} + yauzl@3.3.1: + resolution: {integrity: sha512-RNPCUkiE/ZgO4w8i9U5yDQVHaFDdnzaFANElRvpJteCspvmv2VqrRb9lvS6odVD+jqI/zDsxAHJVsafpcheVQQ==} + engines: {node: '>=12'} yocto-queue@0.1.0: resolution: {integrity: sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==} @@ -5899,6 +5925,8 @@ snapshots: abbrev@4.0.0: {} + acorn@8.16.0: {} + agent-base@7.1.4: {} ajv-keywords@3.5.2(ajv@6.15.0): @@ -6243,6 +6271,10 @@ snapshots: tree-kill: 1.2.2 yargs: 18.0.0 + confbox@0.1.8: {} + + confbox@0.2.4: {} + configstore@3.1.5: dependencies: dot-prop: 4.2.1 @@ -6581,11 +6613,13 @@ snapshots: exponential-backoff@3.1.3: {} + exsolve@1.0.8: {} + extract-zip@2.0.1: dependencies: debug: 4.4.3 get-stream: 5.2.0 - yauzl: 2.10.0 + yauzl: 3.3.1 optionalDependencies: '@types/yauzl': 2.10.3 transitivePeerDependencies: @@ -6620,10 +6654,6 @@ snapshots: dependencies: reusify: 1.1.0 - fd-slicer@1.1.0: - dependencies: - pend: 1.2.0 - fdir@6.5.0(picomatch@4.0.4): optionalDependencies: picomatch: 4.0.4 @@ -7172,6 +7202,12 @@ snapshots: rfdc: 1.4.1 wrap-ansi: 10.0.0 + local-pkg@1.2.1: + dependencies: + mlly: 1.8.2 + pkg-types: 2.3.1 + quansync: 0.2.11 + lodash.escaperegexp@4.1.2: {} lodash.isempty@4.4.0: {} @@ -7306,6 +7342,13 @@ snapshots: dependencies: minimist: 1.2.8 + mlly@1.8.2: + dependencies: + acorn: 8.16.0 + pathe: 2.0.3 + pkg-types: 1.3.1 + ufo: 1.6.4 + mrmime@2.0.1: {} ms@2.1.3: {} @@ -7531,6 +7574,18 @@ snapshots: dependencies: pngjs: 7.0.0 + pkg-types@1.3.1: + dependencies: + confbox: 0.1.8 + mlly: 1.8.2 + pathe: 2.0.3 + + pkg-types@2.3.1: + dependencies: + confbox: 0.2.4 + exsolve: 1.0.8 + pathe: 2.0.3 + plist@3.1.0: dependencies: '@xmldom/xmldom': 0.8.13 @@ -7585,6 +7640,8 @@ snapshots: punycode@2.3.1: {} + quansync@0.2.11: {} + queue-microtask@1.2.3: {} quick-lru@5.1.1: {} @@ -8005,6 +8062,8 @@ snapshots: typescript@6.0.3: {} + ufo@1.6.4: {} + unc-path-regex@0.1.2: {} undici-types@7.16.0: {} @@ -8078,11 +8137,9 @@ snapshots: oxlint: 1.67.0(oxlint-tsgolint@0.23.0)(vite-plus@0.1.23(@types/node@24.12.4)(@vitest/coverage-v8@4.1.7)(@vitest/ui@4.1.7)(happy-dom@20.9.0)(jiti@2.7.0)(typescript@6.0.3)(vite@8.0.14(@types/node@24.12.4)(jiti@2.7.0)(yaml@2.9.0))(yaml@2.9.0)) typescript: 6.0.3 - vite-plugin-electron-renderer@1.0.0: {} - - vite-plugin-electron@0.29.1(vite-plugin-electron-renderer@1.0.0): - optionalDependencies: - vite-plugin-electron-renderer: 1.0.0 + vite-plugin-electron@1.0.0: + dependencies: + local-pkg: 1.2.1 vite-plus@0.1.23(@types/node@24.12.4)(@vitest/coverage-v8@4.1.7)(@vitest/ui@4.1.7)(happy-dom@20.9.0)(jiti@2.7.0)(typescript@6.0.3)(vite@8.0.14(@types/node@24.12.4)(jiti@2.7.0)(yaml@2.9.0))(yaml@2.9.0): dependencies: @@ -8271,10 +8328,10 @@ snapshots: y18n: 5.0.8 yargs-parser: 22.0.0 - yauzl@2.10.0: + yauzl@3.3.1: dependencies: buffer-crc32: 0.2.13 - fd-slicer: 1.1.0 + pend: 1.2.0 yocto-queue@0.1.0: {} diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index a80074d3f..fc1693f84 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,10 +1,18 @@ allowBuilds: '@parcel/watcher': true '@primer/primitives': false + '@swc/core': true + '@tailwindcss/oxide': true electron: true electron-winstaller: true + esbuild: true + unrs-resolver: true overrides: react-is: '19.2.6' + # Temporary workaround for electron/electron#51619. + # Electron installs can miss `path.txt` on Node 24.16+ until the upstream + # yauzl fix is picked up. Remove this once Electron ships a proper fix. + yauzl: '3.3.1' # Force patched versions of transitive dev-tooling deps pulled in by # react-devtools (old electron/got/cross-spawn) so they don't trip security # scanners. None of these ship in the packaged app. diff --git a/vite.config.ts b/vite.config.ts index effa0b4f3..6593cf170 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -128,7 +128,7 @@ export default defineConfig({ envDir: fileURLToPath(new URL('.', import.meta.url)), build: { outDir: fileURLToPath(new URL('build', import.meta.url)), - rollupOptions: { + rolldownOptions: { output: { entryFileNames: 'main.js' }, external: [ 'electron', @@ -146,7 +146,7 @@ export default defineConfig({ vite: { build: { outDir: fileURLToPath(new URL('build', import.meta.url)), - rollupOptions: { output: { entryFileNames: 'preload.js' } }, + rolldownOptions: { output: { entryFileNames: 'preload.js' } }, }, resolve: { conditions: ['node'] }, }, From c049170594e708fdab8c13444009d388c152c406 Mon Sep 17 00:00:00 2001 From: Afonso Jorge Ramos Date: Thu, 4 Jun 2026 00:02:18 +0200 Subject: [PATCH 2/2] fix: start electron from repo root in dev --- vite.config.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/vite.config.ts b/vite.config.ts index 6593cf170..7efb4d63e 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -122,6 +122,14 @@ export default defineConfig({ electron({ main: { entry: fileURLToPath(new URL('src/main/index.ts', import.meta.url)), + onstart: async ({ startup }) => { + // vite-plugin-electron v1 starts Electron with `cwd: server.config.root`. + // Our Vite root is `src/renderer`, so we must override `cwd` back to the + // repository root or Electron will try to boot from `src/renderer`. + await startup(undefined, { + cwd: fileURLToPath(new URL('.', import.meta.url)), + }); + }, vite: { // The outer Vite config sets root:'src/renderer', so we must // explicitly tell the main-process sub-build where to find .env files.