Repository navigation
Preserve bundled npm dependencies in desktop artifacts - #3590
Merged
Merged
Conversation
Copy npm's complete nested dependency tree before signing and gate packaging on artifact dependency/version resolution, ESM imports, and offline plugin dependency install/update through bundled Electron. Verify packaged resources remain unchanged. The explicit file-set approach was also proposed in unmerged PR #3587. Covers reports #3566, #3581, and #3584.
SawyerHood
marked this pull request as ready for review
September 12, 2026 15:41
SawyerHood
deleted the
bb/3566-fix-desktop-npm-bundling-thr_jr49kcavnh
branch
September 12, 2026 15:48
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.
Human comments
What was wrong
Desktop 0.43.0 ships npm 11.16.0 without its bundled dependencies. Electron-builder's pnpm collector treats npm as a leaf, and its dependency copier excludes nested
node_modules. Source builds and the separate bb-app tarball smoke pass, while packaged npm exits 7 with missingproc-logand cannot install or update plugin dependencies.What changed
Preserve npm's complete nested dependency tree through an explicit shared electron-builder file set, before signing. The same file-set approach was proposed in closed, unmerged #3587.
Gate native-host packaging in
afterPackon an artifact smoke test, and repeat it in packaged desktop smoke. The test runs the shipped npm through bundled Electron with an empty PATH and isolated HOME/cache/config. It audits required CJS/ESM dependency resolution and version ranges, imports ESM dependencies, and performs an offline disposable plugin dependency install and update from 1.0.0 to 2.0.0. Lockfile contents and actual ESM imports verify both operations; resource hashes reject bundle mutations. Document standalone npm smoke and add Turbo prerequisites for local packaging.No server/daemon wire or public SDK changes.
How you verified
pnpm exec turbo run package --filter=@bb/desktop: passed, including the pre-signing npm gate.pnpm exec turbo run typecheck test --filter=@bb/desktop: passed; 322 tests passed, 1 existing skip. The sandbox initially aborted the existing Electron preload test; the macOS-process-enabled rerun passed.git diff --check, and the public-content scan passed.Independent Linux verification on x86_64/glibc 2.44 at commit
1d1ec370a90d53d97dc76d5b3998368ecf8aba88:f17e6bf79d3a26b92b6ce26ad2825b81fb5541a1a3d361cc60188d2a3c31024d.Limitations: Linux AppImage FUSE lifecycle testing is blocked identically before and after (exit 127; host lacks
/dev/fuseandfusermount); extracted-artifact checks above pass. macOS packaged GUI readiness timed out on both before and after artifacts. Developer ID signing/notarization and full Extensions UI activation were not tested. The new runtime gate requires a native target host. All verification used disposable artifacts and fixtures; no installed production app or store was modified.Fixes #3566
Fixes #3581
Fixes #3584