Skip to content

Keep the project folder out of app.asar and correct the 5.1.0 notes - #58

Merged
iLevyTate merged 2 commits into
mainfrom
claude/gallant-babbage-mlfl4c
Nov 1, 2026
Merged

iLevyTate merged 2 commits into
mainfrom
claude/gallant-babbage-mlfl4c

Conversation

@iLevyTate

Copy link
Copy Markdown
Owner

Summary

  • Packaging regression in 5.1.0. electron-builder normalizes the top-level files strings into a { filter: [...] } file set with its own matcher. The string lists added under win, mac and linux in Close the startup follow-ups' known limitations: driver-version reset, embedding worker, x64 payload, Linux raster #53/Ship only each build's own better-sqlite3 prebuild; fix the e2e first-run wizard race in every spec #54 became a second matcher made only of exclusions, and electron-builder starts such a matcher with **/*. Every 5.1.0 build packed the whole project folder into app.asar: the webpack cache (207 MB), docs images (79 MB), src/main, src/renderer, test, scripts and CLAUDE.md, about 300 MB unpacked. I measured this by reading the asar headers of the published 5.0.0 and 5.1.0 macOS arm64 zips. Every 5.1.0 download is 57 to 82 MB larger than 5.0.0 as a result.
  • Fix: the per-platform rules move into the top-level list. ${platform} expands to the build machine's process.platform, and each release leg builds on its own OS. So !(${platform}-${arch}|${platform}musl-${arch}) keeps exactly the better-sqlite3 prebuilds the platform rules kept, and the @node-llama-cpp/win-!(${arch}|${arch}-*) rule is unchanged.
  • Guards: test/electron-builder-config.test.js now runs electron-builder's own steps (doMergeConfigs, getMainFileMatchers, getNodeModuleFileMatcher) for each release leg. It fails on the 5.1.0 config and passes on the 5.0.0 config. The old test handed the raw JSON to the node_modules matcher and never saw the second matcher. verify-packaged-artifacts.js, which every release leg runs before upload, now reads the app.asar header and fails if it holds anything besides dist, node_modules, package.json and src/shared.
  • CHANGELOG: the 5.1.0 summary no longer claims smaller downloads. The size growth is recorded as a 5.1.0 known issue, with the fix under Unreleased. Electron 41 → 45, better-sqlite3 12 → 13 and the macOS 13 minimum move to 5.0.0: the v5.0.0 tag already locked Electron 45.1.0 and better-sqlite3 13.0.3, but its release notes left them out.

Scope

  • Area(s): packaging (electron-builder config), release verification, CHANGELOG, RELEASING.md
  • Risk Level: medium. This changes what every build packages. The tests show it matches 5.0.0's app files plus the 5.1.0 dependency trimming, but only a packaged build proves it.
  • Breaking Changes: none

Type of Change

  • Bug fix
  • Enhancement
  • New feature
  • Refactor
  • Documentation update
  • Breaking change

Test Plan

Automated

  • npm run format:check (Prettier on every changed file)
  • npm run lint (ESLint on the changed scripts and tests)
  • npm test: electron-builder-config, verifyPackagedArtifacts, verifyElectronFusesConfig (97 tests), plus verify:electron-fuses-config and compliance:commercial:verify (the inventory is regenerated and stable on re-run)
  • Additional tests added/updated when behavior changed

Test results against older configs: the six release-leg app-file tests and the platform-block test fail on the v5.1.0 config. The app-file tests pass on the v5.0.0 config. I checked the new readAsarHeader against archives built by @electron/asar: an archive with an extra docs folder fails and a clean one passes.

Manual QA

  • Manual checklist completed (see docs/TESTING.md)
  • Not applicable (explain below)

Manual QA notes:

  • No local packaged build was run. The release workflows run verify-packaged-artifacts.js, which now fails on a bloated app.asar, so the next release run on each platform will check this fix against real artifacts.

Checklist

  • I scoped this PR to one logical change
  • I self-reviewed code and naming for clarity
  • I updated docs/config references where needed
  • I called out follow-up work or known limitations: the published v5.1.0 release notes on GitHub still carry the old summary and the misattributed entries. Those need a manual edit, since no tool here edits releases. Shipping the smaller builds needs a new release (5.1.1).

Generated by Claude Code

electron-builder normalizes the top-level `files` strings into a
`{ filter: [...] }` file set with its own matcher. The string lists added
under win/mac/linux in 5.1.0 instead became a second matcher made only of
exclusions, which electron-builder starts with `**/*`. Every 5.1.0 build
therefore packed the whole project folder into app.asar: the webpack cache
(207 MB), docs images (79 MB), src/main, src/renderer, test and scripts,
about 300 MB unpacked, so each download grew 57 to 82 MB over 5.0.0.

The per-platform rules move into the top-level list. ${platform} expands to
the build machine's process.platform (each release leg builds on its own
OS), so `!(${platform}-${arch}|${platform}musl-${arch})` keeps exactly the
prebuilds the platform rules kept.

The builder-config test now runs electron-builder's own steps (config
normalization, getMainFileMatchers, getNodeModuleFileMatcher) for each
release leg and fails on the 5.1.0 config; the old test handed the raw JSON
to the node_modules matcher and never saw the second matcher.
verify-packaged-artifacts reads the app.asar header and fails if it holds
anything besides dist, node_modules, package.json and src/shared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5Uo5hC58DRSh1qB489Sos
- Drop "smaller downloads on every platform" from the 5.1.0 summary: every
  5.1.0 download is 57 to 82 MB larger than 5.0.0. Record that as a known
  issue and the fix under Unreleased.
- Move Electron 41 -> 45, better-sqlite3 12 -> 13 and the macOS 13 minimum
  to 5.0.0: the v5.0.0 tag already locked Electron 45.1.0 and
  better-sqlite3 13.0.3, but its release notes left them out.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Q5Uo5hC58DRSh1qB489Sos
@iLevyTate
iLevyTate merged commit fb8acf2 into main Nov 1, 2026
11 checks passed
@iLevyTate iLevyTate mentioned this pull request Nov 1, 2026
8 of 16 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants