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",