fix(release): use pnpm hoisted node-linker for etherpad bundle (Windows)#54
Merged
Merged
Conversation
After #51 excluded etherpad/bin/, Windows still failed because the .nsis.7z packaging hit dangling junctions inside resources/etherpad/src/node_modules/ itself. Example from the v0.4.3 build: .\resources\etherpad\src\node_modules\http-errors\ : The system cannot find the path specified. pnpm's default layout is symlinks/junctions from node_modules/<dep> into node_modules/.pnpm/<dep>@<ver>/node_modules/<dep>. Our post-install store prune (PNPM_PRUNE_PREFIXES) deletes some of those targets, leaving the junction dangling. On Linux 7za follows through; on Windows the junction-target check fails and 7za exits 1. Pass `--config.node-linker=hoisted` so pnpm produces a flat, npm-style layout with real files instead of junctions. No symlinks, nothing to dangle. This is what every Electron app on Windows ships anyway. Tradeoff: ~135MB larger bundle (no .pnpm dedup). The prunePnpmStore step still runs but no-ops because .pnpm/ won't exist in hoisted mode — its try/catch already handles that gracefully. Trimming the hoisted-mode transitive bloat (mongodb etc.) is a follow-up via electron-builder extraResources filter; for now disk wins lose to "Windows build actually exists." Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
ⓘ You've reached your Qodo monthly free-tier limit. Reviews pause until next month — upgrade your plan to continue now, or link your paid account if you already have one. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v0.4.3 still failed on Windows after #51 excluded `etherpad/bin/`. The new failure is one layer deeper — inside `resources/etherpad/src/node_modules/` itself:
```
.\resources\etherpad\src\node_modules\http-errors
: The system cannot find the path specified.
```
Root cause: pnpm's default layout creates junctions from `node_modules/` → `node_modules/.pnpm/@/node_modules/`. Our post-install `prunePnpmStore` deletes targets in `.pnpm/` that the dirty-driver runtime path never loads, but some still leave dangling junctions in the top-level `node_modules/` view. Linux/macOS 7za follows through (no harm done); Windows 7za scan-fails and exits 1 on the missing target.
Fix
Pass `--config.node-linker=hoisted` to the `pnpm install` step inside `fetch-etherpad.mjs`. That produces a flat, npm-style layout with real files instead of junctions — no symlinks, nothing to dangle. This is what every Electron app on Windows already ships.
Tradeoff
Bundle grows by ~135MB (no `.pnpm` dedup). The existing `prunePnpmStore` step still runs but no-ops gracefully because `.pnpm/` doesn't exist in hoisted mode (try/catch already handles that path).
Trimming the hoisted-mode transitive bloat (mongodb, mysql2, pg, ...) is a follow-up via electron-builder's `extraResources` filter, but it's not required to ship — "Windows build actually exists" wins over "Windows bundle is small."
Test plan
Snap publish (still blocked on you)
Independent of this PR. The earlier v0.4.x snap uploads are stuck in Snap Store review queue; until you "Reject and remove from review queue" them on https://dashboard.snapcraft.io/, the v0.4.4 snap publish will hit the same conflict.
🤖 Generated with Claude Code