fix(build): package manifest.json and drop dev files from zips #7

Merged
adrianbonpin merged 1 commits from fix/build-package-manifest into prod 2026-09-27 18:24:28 +00:00
Owner

Problem

collectFiles() skipped manifest.json unconditionally, but the final archive is produced by calling collectFiles() on the built target dir:

writeStoredZip(collectFiles(dir), dir, zipName);   // manifest.json filtered back out

The per-target manifest was written into dist/<target>/ correctly, then excluded on the way into the zip. Result: both dist/ismis-helper-*.zip shipped with no manifest.json at all and could not be installed by any means. The Firefox zip also carried contributor files (AGENTS.md, README.md, package.json, package-lock.json).

Note this affected only the .zip artifacts — CI's AMO signing reads dist/firefox/ directly, so the signed XPIs on AMO are fine.

Fix

Split the exclusion list and only apply the dev-file part when reading the repo root:

  • EXCLUDED_DIRS — .git, node_modules, dist, docs, scripts, test, web-ext-artifacts
  • DEV_ONLY_FILES — manifest.json, AGENTS.md, README.md, package.json, package-lock.json (applied with excludeDev: true when reading ROOT, skipped when reading a built target)

background.chrome.js and the generated manifest.json now survive into the Chrome zip too.

Verification

npm test   -> 35 pass / 0 fail

firefox zip: 26 files, 1,843,871 B, no manifest.json
          -> 23 files, 1,683,935 B, manifest.json present (id ismis-helper@adrianbonpin)

chrome  zip: manifest.json present, background.service_worker = background.chrome.js
             background.chrome.js bundled

Dev files confirmed absent from both zips.

## Problem `collectFiles()` skipped `manifest.json` unconditionally, but the final archive is produced by calling `collectFiles()` on the **built target dir**: ```js writeStoredZip(collectFiles(dir), dir, zipName); // manifest.json filtered back out ``` The per-target manifest was written into `dist/<target>/` correctly, then excluded on the way into the zip. Result: **both `dist/ismis-helper-*.zip` shipped with no `manifest.json` at all** and could not be installed by any means. The Firefox zip also carried contributor files (`AGENTS.md`, `README.md`, `package.json`, `package-lock.json`). Note this affected only the `.zip` artifacts — CI's AMO signing reads `dist/firefox/` directly, so the signed XPIs on AMO are fine. ## Fix Split the exclusion list and only apply the dev-file part when reading the repo root: - `EXCLUDED_DIRS` — `.git`, `node_modules`, `dist`, `docs`, `scripts`, `test`, `web-ext-artifacts` - `DEV_ONLY_FILES` — `manifest.json`, `AGENTS.md`, `README.md`, `package.json`, `package-lock.json` (applied with `excludeDev: true` when reading ROOT, skipped when reading a built target) `background.chrome.js` and the generated `manifest.json` now survive into the Chrome zip too. ## Verification ``` npm test -> 35 pass / 0 fail firefox zip: 26 files, 1,843,871 B, no manifest.json -> 23 files, 1,683,935 B, manifest.json present (id ismis-helper@adrianbonpin) chrome zip: manifest.json present, background.service_worker = background.chrome.js background.chrome.js bundled ``` Dev files confirmed absent from both zips.
adrianbonpin added 1 commit 2026-09-27 18:24:24 +00:00
collectFiles() skipped manifest.json unconditionally, and the final zip is
produced by calling collectFiles() on the built target dir — so both
dist/*.zip shipped with no manifest.json at all and could not be installed.
The per-target manifest was written into the dir correctly, then filtered
back out on the way into the archive.

Split the exclusion list: EXCLUDED_DIRS plus DEV_ONLY_FILES (manifest.json,
AGENTS.md, README.md, package.json, package-lock.json), and only apply the
latter when reading the repo root. Reading a built target keeps its
generated manifest.

Firefox zip: 26 files/1.84 MB (no manifest) -> 23 files/1.68 MB.
Chrome zip gains its manifest.json and background.chrome.js as before.
adrianbonpin merged commit 2a94d7072f into prod 2026-09-27 18:24:28 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: adrianbonpin/ismis-helper#7