fix(package): keep cached dev Electron bundles out of app.asar (#15359)

`files` is an all-negation list, so electron-builder's default `**/*` packs
anything without an explicit `!` entry. out/electron-dev holds `pnpm dev`'s
per-branch Electron.app copies (~270MB each), so packaging on a machine that
has run dev bundled them all. CI never creates the directory, so releases were
never affected.
This commit is contained in:
Neil
2026-08-18 13:27:25 -07:00
committed by GitHub
parent 4b0e01f613
commit a3edabcd7b
2 changed files with 22 additions and 0 deletions
@@ -75,6 +75,25 @@ describe('electron-builder config', () => {
expect(packs('out/main/examples/index.js')).toBe(true)
})
// Why: out/electron-dev holds `pnpm dev`'s cached Electron.app copies (~270MB per branch).
// CI never creates it, so only a local package would have hit this -- silently, as bulk.
it('keeps cached dev Electron bundles out of app.asar', () => {
const matcher = new FileMatcher('/app', '/dest', (value) => value, electronBuilderConfig.files)
matcher.prependPattern('**/*')
const isPacked = matcher.createFilter()
const packs = (repoPath) => isPacked(join('/app', repoPath), { isDirectory: () => false })
for (const devBundlePath of [
'out/electron-dev/1a2b3c4d5e6f/Orca: dev.app/Contents/MacOS/Electron',
'out/electron-dev/1a2b3c4d5e6f/orca-dev-electron-app.json'
]) {
expect(packs(devBundlePath)).toBe(false)
}
// The real build outputs sit beside it under out/ and must still ship.
expect(packs('out/main/index.js')).toBe(true)
expect(packs('out/renderer/index.html')).toBe(true)
})
it('keeps runtime resources available through extraResources', () => {
const bundledPluginResources = expect.objectContaining({
from: 'resources/plugins/launch',