Fix desktop release collector resolution under pnpm #284

Closed
opened 2026-06-04 23:22:05 +00:00 by steve · 0 comments
Owner

pnpm release:desktop:local -- --version 2026.31.5 --skip-checks --skip-smoke --skip-upload now gets through the desktop bundle, but Electron Builder dies in the custom pnpm collector patch because the patch file requires app-builder-lib internals by package name and pnpm does not expose that transitive dependency from the package root.

Problem

The release helper reaches packages/desktop-electron/scripts/electron-builder-collector-fallback.cjs, then fails with Cannot find module 'app-builder-lib/out/node-module-collector/packageManager.js' under the pnpm workspace layout.

Goal

Make the Electron Builder fallback collector resolve app-builder-lib in a pnpm-safe way so the local desktop release dry run completes without touching Forgejo.

Scope

  • Update packages/desktop-electron/scripts/electron-builder-collector-fallback.cjs to resolve app-builder-lib through Electron Builder's own package path instead of assuming it is hoisted.
  • Keep the change limited to the desktop release/build tooling.

Non-goals

  • No Forgejo upload or tag changes.
  • No changes to the desktop app runtime or renderer behavior.

Acceptance Criteria

  • pnpm release:desktop:local -- --version 2026.31.5 --skip-checks --skip-smoke --skip-upload completes locally on macOS.
  • The desktop bundle still uses the traversal collector fallback when Electron Builder runs under pnpm.
  • The fix does not require any remote release changes.

Implementation Notes

  • Prefer the smallest resolution change that makes app-builder-lib load reliably under pnpm.
  • Reuse the existing custom collector patch instead of removing the pnpm fallback.

Suggested Files or Specs To Inspect

  • packages/desktop-electron/scripts/electron-builder-collector-fallback.cjs
  • packages/desktop-electron/scripts/run-electron-builder.mjs
  • packages/desktop-electron/electron-builder.config.cjs
  • spec/src/20-packages/desktop-electron/index.md

Validation Commands

  • pnpm release:desktop:local -- --version 2026.31.5 --skip-checks --skip-smoke --skip-upload

Follow-up Tasks

Implementation Summary

electron-builder-collector-fallback.cjs resolves app-builder-lib through createRequire(electron-builder/package.json) so pnpm can load the traversal collector patch. release:desktop:local --allow-dirty now reaches mac packaging with manual node_modules traversal; a later unrelated plugin-history dist ENOENT blocked the full dry run.

`pnpm release:desktop:local -- --version 2026.31.5 --skip-checks --skip-smoke --skip-upload` now gets through the desktop bundle, but Electron Builder dies in the custom pnpm collector patch because the patch file requires `app-builder-lib` internals by package name and pnpm does not expose that transitive dependency from the package root. ## Problem The release helper reaches `packages/desktop-electron/scripts/electron-builder-collector-fallback.cjs`, then fails with `Cannot find module 'app-builder-lib/out/node-module-collector/packageManager.js'` under the pnpm workspace layout. ## Goal Make the Electron Builder fallback collector resolve `app-builder-lib` in a pnpm-safe way so the local desktop release dry run completes without touching Forgejo. ## Scope - Update `packages/desktop-electron/scripts/electron-builder-collector-fallback.cjs` to resolve `app-builder-lib` through Electron Builder's own package path instead of assuming it is hoisted. - Keep the change limited to the desktop release/build tooling. ## Non-goals - No Forgejo upload or tag changes. - No changes to the desktop app runtime or renderer behavior. ## Acceptance Criteria - `pnpm release:desktop:local -- --version 2026.31.5 --skip-checks --skip-smoke --skip-upload` completes locally on macOS. - The desktop bundle still uses the traversal collector fallback when Electron Builder runs under pnpm. - The fix does not require any remote release changes. ## Implementation Notes - Prefer the smallest resolution change that makes `app-builder-lib` load reliably under pnpm. - Reuse the existing custom collector patch instead of removing the pnpm fallback. ## Suggested Files or Specs To Inspect - `packages/desktop-electron/scripts/electron-builder-collector-fallback.cjs` - `packages/desktop-electron/scripts/run-electron-builder.mjs` - `packages/desktop-electron/electron-builder.config.cjs` - `spec/src/20-packages/desktop-electron/index.md` ## Validation Commands - `pnpm release:desktop:local -- --version 2026.31.5 --skip-checks --skip-smoke --skip-upload` ## Related Issues ## Follow-up Tasks ## Implementation Summary electron-builder-collector-fallback.cjs resolves app-builder-lib through createRequire(electron-builder/package.json) so pnpm can load the traversal collector patch. release:desktop:local --allow-dirty now reaches mac packaging with manual node_modules traversal; a later unrelated plugin-history dist ENOENT blocked the full dry run. <!-- backlog:task_id=TASK-DESKTOP-LOCAL-RELEASE-001 source_spec=spec/src/20-packages/desktop-electron/index.md -->
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#284
No description provided.