From 185c09af68dc71f005074fc1f179711127d86333 Mon Sep 17 00:00:00 2001 From: Anthony Date: Sat, 1 Aug 2026 05:57:56 +0000 Subject: [PATCH] fix(release): drop extension test files from the packaged build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) --- apps/desktop/scripts/build-release.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apps/desktop/scripts/build-release.sh b/apps/desktop/scripts/build-release.sh index 98a50f1..9a79f6d 100755 --- a/apps/desktop/scripts/build-release.sh +++ b/apps/desktop/scripts/build-release.sh @@ -95,6 +95,12 @@ stage() { # dest dir # -L dereferences the branding symlinks (icons/logo.svg -> repo-root logo.svg) # so the package contains real files, not dangling links. cp -RL "$DESKTOP/extensions/ai-sidebar" "$s/extensions/ai-sidebar" + # The copy is wholesale, so the vitest files sitting next to the extension + # sources ride along. Chrome never loads them — they are not in manifest.json + # and nothing it does load imports them — but they are dead weight in every + # download, and moshpit-drift.test.js imports @moshcoder/moshpit-resolve, a + # devDependency that cannot resolve from an unbundled extension. + find "$s/extensions/ai-sidebar" -name '*.test.js' -delete cp "$REPO_ROOT/LICENSE" "$s/LICENSE" # Branding from the repo-root single source of truth. The desktop/app icon uses # the emblem on the dark tile (hero.svg) — favicon.svg is the transparent emblem