diff --git a/package.json b/package.json index 9efd135dc..081199ff8 100644 --- a/package.json +++ b/package.json @@ -131,8 +131,7 @@ "typescript": "6.0.3", "vite": "8.0.16", "vite-plugin-checker": "0.14.1", - "vite-plugin-electron": "0.29.1", - "vite-plugin-electron-renderer": "0.14.7", + "vite-plugin-electron": "1.0.4", "vitest": "4.1.8", "zustand": "5.0.14" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b6359c15d..4191e68ca 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,9 @@ settings: overrides: react-is: 19.2.6 - cross-spawn: ^7.0.6 - got: ^11.8.5 + yauzl: 3.3.1 + cross-spawn: 7.0.6 + got: 11.8.6 electron: 42.3.3 importers: @@ -235,11 +236,8 @@ importers: specifier: 0.14.1 version: 0.14.1(@biomejs/biome@2.4.16)(typescript@6.0.3)(vite@8.0.16(@types/node@24.13.1)(jiti@2.7.0)(yaml@2.9.0)) vite-plugin-electron: - specifier: 0.29.1 - version: 0.29.1(vite-plugin-electron-renderer@0.14.7) - vite-plugin-electron-renderer: - specifier: 0.14.7 - version: 0.14.7 + specifier: 1.0.4 + version: 1.0.4(vite-plugin-electron-renderer@0.14.7) vitest: specifier: 4.1.8 version: 4.1.8(@types/node@24.13.1)(@vitest/coverage-v8@4.1.8)(@vitest/ui@4.1.8)(happy-dom@20.10.1)(vite@8.0.16(@types/node@24.13.1)(jiti@2.7.0)(yaml@2.9.0)) @@ -1900,6 +1898,11 @@ packages: resolution: {integrity: sha512-AO2ac6pjRB3SJmGJo+v5/aK6Omggp6fsLrs6wN9bd35ulu4cCwaAU9+7ZhXjeqHVkaHThLuzH0nZr0YpCDhygg==} engines: {node: ^18.17.0 || >=20.5.0} + acorn@8.16.0: + resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} + engines: {node: '>=0.4.0'} + hasBin: true + agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -2268,6 +2271,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'} @@ -2640,6 +2649,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'} @@ -2667,9 +2679,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'} @@ -3363,6 +3372,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==} @@ -3568,6 +3581,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'} @@ -3799,6 +3815,12 @@ packages: resolution: {integrity: sha512-C3FsVNH1udSEX48gGX1xfvwTWfsYWj5U+8/uK15BGzIGrKoUpghX8hWZwa/OFnakBiiVNmBvemTJR5mcy7iPcg==} engines: {node: '>=4'} + 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==} + pkijs@3.4.0: resolution: {integrity: sha512-emEcLuomt2j03vxD54giVB4SxTjnsqkU692xZOZXHDVoYyypEm+b3jpiTcc+Cf+myooc+/Ly0z01jqeNHVgJGw==} engines: {node: '>=16.0.0'} @@ -4049,6 +4071,9 @@ packages: resolution: {integrity: sha512-KTqnxsgGiQ6ZAzZCVlJH5eOjSnvlyEgx1m8bkRJfOhmGRqfo5KLvmAlACQkrjEtOQ4B7wF9TdSLIs9O90MX9xA==} engines: {node: '>=16.0.0'} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} + queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -4618,6 +4643,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'} @@ -4752,8 +4780,8 @@ packages: vite-plugin-electron-renderer@0.14.7: resolution: {integrity: sha512-hHBMKuZ24MB2SIxG7U7ix+DDEnvxou7Bgy/TdhYxNz3S5N3Yh7Hjvj9blfMeGEJ0oaZJn7y5z0V/RyDmJ5OuCA==} - vite-plugin-electron@0.29.1: - resolution: {integrity: sha512-AejNed5BgHFnuw8h5puTa61C6vdP4ydbsbo/uVjH1fTdHAlCDz1+o6pDQ/scQj1udDrGvH01+vTbzQh/vMnR9w==} + vite-plugin-electron@1.0.4: + resolution: {integrity: sha512-YBpc7l0gQMAhmt/aETr1Xa4IXEmPUFEoY+2FZK05wusfdsqtvAVcSGStfOPc/JpQBdtLPwFNERoxUB/brn8VLw==} peerDependencies: vite-plugin-electron-renderer: '*' peerDependenciesMeta: @@ -4981,8 +5009,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==} @@ -7297,6 +7326,8 @@ snapshots: abbrev@3.0.1: {} + acorn@8.16.0: {} + agent-base@6.0.2: dependencies: debug: 4.4.3 @@ -7714,6 +7745,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 @@ -8153,11 +8188,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: @@ -8189,10 +8226,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 @@ -8870,6 +8903,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.isequal@4.5.0: {} @@ -9059,6 +9098,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: {} @@ -9273,6 +9319,18 @@ snapshots: pify@3.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 + pkijs@3.4.0: dependencies: '@noble/hashes': 1.4.0 @@ -9518,6 +9576,8 @@ snapshots: pvutils@1.1.5: {} + quansync@0.2.11: {} + queue-microtask@1.2.3: {} quick-lru@5.1.1: {} @@ -10066,6 +10126,8 @@ snapshots: typescript@6.0.3: {} + ufo@1.6.4: {} + unc-path-regex@0.1.2: {} undici-types@7.18.2: {} @@ -10171,9 +10233,12 @@ snapshots: '@biomejs/biome': 2.4.16 typescript: 6.0.3 - vite-plugin-electron-renderer@0.14.7: {} + vite-plugin-electron-renderer@0.14.7: + optional: true - vite-plugin-electron@0.29.1(vite-plugin-electron-renderer@0.14.7): + vite-plugin-electron@1.0.4(vite-plugin-electron-renderer@0.14.7): + dependencies: + local-pkg: 1.2.1 optionalDependencies: vite-plugin-electron-renderer: 0.14.7 @@ -10336,10 +10401,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 a0c335892..6f2cc621b 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,17 +1,22 @@ allowBuilds: + '@biomejs/biome': true '@parcel/watcher': true '@swc/core': true + '@tailwindcss/oxide': true electron: true electron-winstaller: true - '@biomejs/biome': true - '@tailwindcss/oxide': 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. - cross-spawn: '^7.0.6' - got: '^11.8.5' - electron: '$electron' \ No newline at end of file + cross-spawn: '7.0.6' + got: '11.8.6' + electron: '$electron' +savePrefix: '' diff --git a/vite.config.ts b/vite.config.ts index 55911038e..8d3544ff0 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -137,13 +137,21 @@ export default defineConfig(({ command }) => { 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. envDir: fileURLToPath(new URL('.', import.meta.url)), build: { outDir: fileURLToPath(new URL('build', import.meta.url)), - rollupOptions: { + rolldownOptions: { output: { entryFileNames: 'main.js' }, external: [ 'electron', @@ -164,7 +172,7 @@ export default defineConfig(({ command }) => { vite: { build: { outDir: fileURLToPath(new URL('build', import.meta.url)), - rollupOptions: { output: { entryFileNames: 'preload.js' } }, + rolldownOptions: { output: { entryFileNames: 'preload.js' } }, }, resolve: { conditions: ['node'] }, },