From 6bd29efd231f401003f8381aefb8607749fda4fe Mon Sep 17 00:00:00 2001 From: debont80 Date: Wed, 1 Jul 2026 08:39:38 -0400 Subject: [PATCH] =?UTF-8?q?build:=20Phase=202=20=E2=80=94=20stop=20emittin?= =?UTF-8?q?g=20unused=20.blockmap=20+=20clean=20dist=20per=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - L83: nsis.differentialPackage: false — the custom updater does full downloads and never consumes the differential blockmap, so don't generate it (NsisTarget gates blockmap generation on differentialPackage !== false). - L84: add clean:dist script (fs.rmSync) run at the front of build:win so dist/ no longer accumulates old-version installers (~3 GB observed). dist/out were already gitignored, so this is local-disk hygiene. Config only; TS gate unaffected. 137 -> 135 open audit items. Co-Authored-By: Claude Opus 4.8 --- CODE-AUDIT.md | 13 +++++++++---- electron-builder.yml | 3 +++ package.json | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/CODE-AUDIT.md b/CODE-AUDIT.md index af84d74..c33f269 100644 --- a/CODE-AUDIT.md +++ b/CODE-AUDIT.md @@ -637,11 +637,16 @@ token system + shared primitives (UI/SIMP — high value, larger effort) · i18n sketch now carries the shipped `videoId`/`itemCount`/`watched`/`feedUrl` fields (plus the required `url`/`playlistTitle`/`playlistIndex`) and a note that the block reflects the shipped `shared/ipc.ts` shape.* -- [ ] **L83 — Dead build artifacts.** electron-builder emits `.blockmap` differential-update files +- [x] **L83 — Dead build artifacts.** electron-builder emits `.blockmap` differential-update files for each NSIS installer, but the custom [updater.ts](src/main/updater.ts) does a full download and - never consumes them. -- [ ] **L84 — `dist/` accumulates unboundedly.** ~620 MB per build with no cleanup; it currently - holds 0.1.0–0.5.0 Setup + portable artifacts (~3 GB). Add a clean step or prune. + never consumes them. *Fixed: `nsis.differentialPackage: false` in + [electron-builder.yml](electron-builder.yml) stops the blockmap being generated (NsisTarget gates it + on `differentialPackage !== false`), with a comment explaining the custom-updater rationale.* +- [x] **L84 — `dist/` accumulates unboundedly.** ~620 MB per build with no cleanup; it currently + holds 0.1.0–0.5.0 Setup + portable artifacts (~3 GB). Add a clean step or prune. *Fixed: a + `clean:dist` npm script (`fs.rmSync('dist', …)`) now runs at the front of `build:win`, so each + packaged build starts from an empty `dist/` and only the current version's artifacts remain. + (`dist`/`out` were already gitignored, so this is disk hygiene, not a repo change.)* - [x] **L85 — `.claude/launch.json` is committed and misplaced.** A VS Code launch config lives in `.claude/` (VS Code reads `.vscode/launch.json`), so no tool consumes it; it's also tracked (not gitignored). diff --git a/electron-builder.yml b/electron-builder.yml index 763f6a5..485ff83 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -68,4 +68,7 @@ nsis: perMachine: false allowToChangeInstallationDirectory: true deleteAppDataOnUninstall: false + # The custom updater (src/main/updater.ts) does a full download and never consumes + # the differential .blockmap, so don't emit it (audit L83 — dead build artifact). + differentialPackage: false # Flip perMachine to true for an all-users install to Program Files (requires admin). diff --git a/package.json b/package.json index f8341d6..897f953 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,8 @@ "ui:build": "vite build", "ui:preview": "vite preview", "build": "electron-vite build", - "build:win": "electron-vite build && electron-builder --win", + "clean:dist": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"", + "build:win": "npm run clean:dist && electron-vite build && electron-builder --win", "start": "electron-vite preview", "typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false", "typecheck:web": "tsc --noEmit -p tsconfig.web.json --composite false",