Skip to content

fix(release): drop extension test files from the packaged build - #62

Merged
ralyodio merged 1 commit into
mainfrom
fix/prune-extension-test-files
Aug 1, 2026
Merged

fix(release): drop extension test files from the packaged build#62
ralyodio merged 1 commit into
mainfrom
fix/prune-extension-test-files

Conversation

@ralyodio

@ralyodio ralyodio commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

What

stage() in apps/desktop/scripts/build-release.sh copies the extension wholesale:

cp -RL "$DESKTOP/extensions/ai-sidebar" "$s/extensions/ai-sidebar"

There's no pruning afterwards, so the vitest files that live next to the extension sources ship inside every download — moshpit.test.js today, and moshpit-drift.test.js as of #60.

Chrome never executes them: neither is listed in manifest.json, and nothing manifest.json does load imports them. But moshpit-drift.test.js contains

import * as pkg from '@moshcoder/moshpit-resolve';

which is a devDependency — by the test's own reasoning it can never resolve from an unbundled extension. So we're shipping unresolvable dead code in a release artifact.

Change

One find -delete after the copy. Staged extension: 284K → 268K.

Verified: syntax clean (bash -n), both test files removed, manifest.json and the other 31 entries untouched.

⚠️ Not complete without a second change

release.yml does the same wholesale copy on the Windows path, so Windows builds keep shipping the test files until it gets the matching prune. I couldn't include it here — my token lacks the workflow scope, so any push touching .github/workflows/ is rejected.

Apply this on top before tagging a release:

           Copy-Item -Recurse apps/desktop/extensions/ai-sidebar "$stage/extensions/ai-sidebar"
+          Get-ChildItem "$stage/extensions/ai-sidebar" -Filter *.test.js -Recurse | Remove-Item -Force
           Copy-Item LICENSE "$stage/LICENSE"

Release note

release.yml runs scripts/set-version.mjs on the runner from the tag name, so no version-bump commit is needed — tagging v3.8.9 is sufficient once this is merged. Tagging before merging would ship exactly the thing this fixes.

🤖 Generated with Claude Code

stage() copies extensions/ai-sidebar wholesale with `cp -RL`, so the two
vitest files next to the extension sources ship inside every download:
moshpit.test.js, and now moshpit-drift.test.js. Chrome never loads them —
neither is in manifest.json and nothing manifest.json does load imports
them — but moshpit-drift.test.js does `import * as pkg from
'@moshcoder/moshpit-resolve'`, a devDependency that cannot resolve from an
unbundled extension, so it is unresolvable dead code in a shipped artifact.

Prune them after the copy. Staged extension goes 284K -> 268K.

Note: release.yml does the same wholesale copy on the Windows path
(Copy-Item -Recurse), so it needs the matching prune to fully close this.
That change is not in this PR — see the PR description.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

vu1nz Security Review

0 finding(s) in PR #?

No security issues found.

@ralyodio
ralyodio marked this pull request as ready for review August 1, 2026 05:59
@ralyodio
ralyodio merged commit 7c636d4 into main Aug 1, 2026
5 checks passed
ralyodio added a commit that referenced this pull request Aug 1, 2026
#62 pruned them from build-release.sh, which covers linux/macos/deb/rpm/
AppImage. The Windows job stages separately with Copy-Item -Recurse and
kept shipping them: v3.8.9's tronbrowser-win-x64.zip contains
moshpit.test.js (12077B) and moshpit-drift.test.js (4106B).

Mirror the prune in the pwsh path so every platform matches.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
ralyodio added a commit that referenced this pull request Aug 1, 2026
#65)

* fix(release): drop extension test files from the Windows zip too

#62 pruned them from build-release.sh, which covers linux/macos/deb/rpm/
AppImage. The Windows job stages separately with Copy-Item -Recurse and
kept shipping them: v3.8.9's tronbrowser-win-x64.zip contains
moshpit.test.js (12077B) and moshpit-drift.test.js (4106B).

Mirror the prune in the pwsh path so every platform matches.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(store): stamp our update_url into the .crx, so installs can update

Chromium polls the update_url baked into the installed manifest — it never
consults the feed the store advertises on the listing page. Most publishers
omit it (it points at us, and they write their manifest long before they
list here), so a store install pinned itself to whatever version it was
installed at and never moved again, while the store served a correct
updates.xml that nothing ever asked for.

CoinPay Wallet is the live case: the store, its gupdate feed and the packed
.crx are all at 0.9.2, but the shipped manifest has no update_url, so every
existing install sits on the version it was first given.

The .crx is packed on demand and we already know the feed URL, so set it
there, before signing (the CRX3 signature covers the zip bytes). Overwriting
a publisher's own update_url is deliberate: the id comes from the store's
signing key, and only our feed can serve an update Chromium accepts for it.

Verified against the real published 0.9.2 bundle: all 13 files stay
byte-identical, only the empty directory entries drop (Chromium recreates
those from the paths), and the resulting .crx carries the feed URL.

Note this cannot rescue already-installed copies — they have no update_url
to poll, so they need one manual reinstall to get onto the channel.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@ralyodio
ralyodio deleted the fix/prune-extension-test-files branch August 4, 2026 04:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant