Files
openswarm/electron/packaging.test.js
T
ciregenzandClaude Opus 5 c0bf5156e6 [eric] release: the 181MB dictation model is a runtime download, not something to ship in app.asar
Gitignored is not the same as excluded from electron-builder; the two lists had diverged, costing 175MB on every auto-update.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018foyDoK19jjbYdudfzQVkZ
2026-08-24 12:53:12 -07:00

22 lines
1.1 KiB
JavaScript

// The dictation model is a 181 MB RUNTIME download that lives in userData
// (voice/whisperModels.js resolves it from userDataDir, nothing reads it from the bundle).
// It is gitignored, which is NOT the same as excluded from electron-builder: those two lists
// diverged, so a machine that had ever used dictation baked the model into app.asar. Measured
// 2026-08-24: asar 184 MB vs 2.5 MB, DMG 475 MB vs 300 MB, i.e. 175 MB on every auto-update.
// v1.7.9 escaped only because it was cut in a detached worktree, which has no gitignored files.
const test = require('node:test');
const assert = require('node:assert');
const pkg = require('./package.json');
test('the whisper model is excluded from the package', () => {
const files = pkg.build.files;
assert.ok(files.includes('!whisper') && files.includes('!whisper/**'),
'electron/whisper holds a 181MB runtime-downloaded model; packing it costs every user 175MB per update');
});
test('every heavy build artifact stays out', () => {
for (const dir of ['python-env', 'build-staging', 'whisper']) {
assert.ok(pkg.build.files.includes(`!${dir}/**`), `${dir} must not be packed`);
}
});