Skip to content

fix(pkgzip): exclude .venv & build/tooling caches from the App Block source bundle - #8

Merged
ZacxDev merged 1 commit into
mainfrom
zach/pkgzip-default-excludes
Jun 22, 2026
Merged

fix(pkgzip): exclude .venv & build/tooling caches from the App Block source bundle#8
ZacxDev merged 1 commit into
mainfrom
zach/pkgzip-default-excludes

Conversation

@ZacxDev

@ZacxDev ZacxDev commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Problem

app submit packages the source tree for the platform to rebuild, but the packager only skipped .git / node_modules / dist. Anything else in the project dir shipped — including a stray Python .venv in the gen-matrix block dir.

That one .venv added 859 files / ~11 MiB, bloating the gen-matrix submit bundle to 888 files / 4.5 MiB. The server never uses it (it rebuilds from src + configs), and the extra files slow the Forgejo review-repo push.

Fix

Extend the default excludedDirs set to the obvious VCS / dependency-install / build-output / tooling-cache dirs that should never ship:

  • VCS: .git, .hg, .svn
  • deps: node_modules, .venv, venv, .pnpm-store
  • build output: dist, build, out, .next
  • caches: .vite, .cache, coverage, .pytest_cache, .mypy_cache, .ruff_cache, .turbo

The app submit --help excludes list renders from pkgzip.JoinExcluded(), so it updates automatically.

Result (gen-matrix)

files compressed
before 888 4.5 MiB
after 29 126 KiB

Only real source remains: block.manifest.json, package.json, pnpm-lock.yaml, configs, 14 src/ files, docs.

Tests

  • New TestBuildExcludesVenvAndCaches asserts a tree with .venv/venv/build/out/.next/.vite/coverage/.pytest_cache packages down to just real source.
  • TestExcludedNames extended to cover every new entry (and assert src/public/assets/lib are NOT excluded).
  • The count-pinned TestExcludedNamesAndJoin assertion relaxed from == 3 to a core-membership check so it won't break on future additions.

go test ./... passes.

🤖 Generated with Claude Code

…ource bundle

The packager only skipped .git/node_modules/dist. A stray Python `.venv` in
an App Block dir (regenerable, never used by the server build recipe) leaked
into the bundle — for gen-matrix that was 859 extra files / ~11 MiB, ballooning
the submit bundle to 888 files / 4.5 MiB and slowing the Forgejo review-repo
push. Extend the default-exclude set to the obvious VCS / dependency-install /
build-output / tooling-cache dirs (.venv, venv, .pnpm-store, build, out, .next,
.vite, .cache, coverage, .pytest_cache, .mypy_cache, .ruff_cache, .turbo, .hg,
.svn) so they never ship.

Result on gen-matrix: 888 -> 29 files, 4.5 MiB -> 126 KiB compressed; only real
source (manifest + src + configs + lockfile + docs) remains.

The `app submit` help excludes list is rendered from pkgzip.JoinExcluded(), so
it updates automatically. Tests added for the new excludes; the count-pinned
ExcludedNames assertion relaxed to a core-membership check.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@ZacxDev
ZacxDev merged commit 5e5a806 into main Jun 22, 2026
1 of 2 checks passed
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