diff --git a/electron-builder.yml b/electron-builder.yml index 4651611..61168a8 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -10,6 +10,15 @@ files: - '!{.env,.env.*,.npmrc,pnpm-lock.yaml}' - '!{tsconfig.json,tsconfig.node.json,tsconfig.web.json}' - '!{_tmp,_local}/**' +# Note on dependency packaging: +# `debug` and `ms` are declared as direct dependencies in package.json +# even though they're transitives of electron-updater. This works around +# electron-builder #9654 — its pnpm-aware dep walker, triggered by the +# `packageManager` field in package.json, drops `ms` from the asar even +# when node_modules is hoisted flat. Without the explicit declaration, +# packaged builds crash on launch with `Cannot find module 'ms'` the +# moment electron-updater loads. Remove the explicit deps when #9654 is +# resolved upstream. asarUnpack: - resources/** mac: diff --git a/package.json b/package.json index 6323031..1c89bfd 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,10 @@ "clsx": "^2.1.1", "cmdk": "^1.1.1", "date-fns": "^4.1.0", + "debug": "^4.4.3", "electron-updater": "^6.8.3", "lucide-react": "^1.14.0", + "ms": "^2.1.3", "radix-ui": "^1.4.3", "react-day-picker": "^10.0.0", "react-router-dom": "^7.1.5", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bbf3fc9..e2d6827 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -29,12 +29,18 @@ importers: date-fns: specifier: ^4.1.0 version: 4.1.0 + debug: + specifier: ^4.4.3 + version: 4.4.3 electron-updater: specifier: ^6.8.3 version: 6.8.3 lucide-react: specifier: ^1.14.0 version: 1.14.0(react@19.2.6) + ms: + specifier: ^2.1.3 + version: 2.1.3 radix-ui: specifier: ^1.4.3 version: 1.4.3(@types/react-dom@19.2.3(@types/react@19.2.14))(@types/react@19.2.14)(react-dom@19.2.6(react@19.2.6))(react@19.2.6) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 14482fa..cdef518 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -2,3 +2,10 @@ allowBuilds: electron: true electron-winstaller: false esbuild: true + +# pnpm 10+ reads these from pnpm-workspace.yaml (not .npmrc). Required +# so electron-builder's asar walker finds transitive deps of bundled +# packages — without this, electron-updater's `debug` dep ships without +# `ms`, crashing the main process at module load on packaged builds. +nodeLinker: hoisted +shamefullyHoist: true