fix(todesktop): trim appFiles to stop re-uploading raw source - #1443
Open
claude[bot] wants to merge 1 commit into
Open
fix(todesktop): trim appFiles to stop re-uploading raw source#1443claude[bot] wants to merge 1 commit into
claude[bot] wants to merge 1 commit into
Conversation
The last two ToDesktop releases (v1.0.40-rc.1, v1.0.40) failed at the "Build with ToDesktop" step because the uploaded app source archive exceeded the CLI's uploadSizeLimit (30 MB at the time; ~46.2 MB actual). #1437 already raised the limit to 60 MB as an immediate unblock, but the upload was oversized to begin with because todesktop.json's appFiles (`["**", ...]`) uploads almost the entire repo, unlike electron-builder.yml's `files` list (which already excludes src/, docs/, tsconfig, eslint/prettier config, etc. for the same app). Notably src/ alone is ~23 MB and includes src/renderer/public, whose ~10 MB of install-showcase-scene .webm assets (added in #1426) get uploaded twice: once as source under src/, and again as the built copy under out/renderer/ that electron-vite produces. None of src/, e2e/, docs/, or the various dev-only config files are read by ToDesktop's remote build (confirmed against scripts/afterPack.mjs, scripts/todesktop-beforeBuild.cjs, and postinstall.mjs) — only the pre-built out/ plus package.json, lib/, resources/, assets/, and locales/ are needed. Mirrors electron-builder.yml's proven-safe exclusions onto todesktop.json's appFiles. Verified with `todesktop build --dry-run --files` (via @todesktop/cli@1.28.0): the appFiles-selected archive drops from 27 MB to 4.32 MB before factoring in the real out/ build (which was stubbed for the dry run), consistent with bringing the true ~46.2 MB upload back under the original 30 MB limit with room to spare — on top of the 60 MB headroom #1437 already added. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VfNkVLBPdy9Vj3oiRqorC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by James Kwon · Slack thread
Summary
The last two ToDesktop releases (
v1.0.40-rc.1,v1.0.40) failed at the "Build with ToDesktop" step. James's read was right: it's the app-size check, not something else — confirmed viacheck-runsannotations (Process completed with exit code 1on that step) and by reproducing the CLI's exact size-check logic and message locally.Root cause:
todesktop.json'sappFilesis["**", ...]with only 3 narrow exclusions, so it re-uploads almost the entire repo — including the ~23 MBsrc/tree — instead of just what the packaged app needs.src/renderer/public/install-showcase-scene/alone (~10 MB of.webmassets added in #1426, "live output showcase during the install wait") gets uploaded twice: once as source undersrc/, and again as the copyelectron-vitewrites toout/renderer/at build time. That, pluse2e/,docs/, and various dev-only config files that ToDesktop's remote build never reads, pushed the uploaded archive to ~46.2 MB against a 30 MBuploadSizeLimit.#1437 already merged raising
uploadSizeLimit30 → 60 MB as an immediate unblock (confirmed: merged 2026-08-21T18:30Z, after both failing runs —v1.0.40-rc.1ran 08-20T05:17Z,v1.0.40ran 08-21T04:30Z — so neither failing run had it, and no tag has been re-cut since). That PR's own description flagged trimmingappFilesas the "follow-up optimization" over just raising the cap, per its "Alternative" note.Changes
todesktop.json: add exclusions toappFilesmirroringelectron-builder.yml's already-proven-safefileslist —src/**,e2e/**,docs/**,reference/**,.vscode/**, and the dev-only config files (playwright.config.ts,eslint.config.ts,electron.vite.config.*,vitest.*,tsconfig*.json, lint/format/env files,*.wsb). None of these are referenced byscripts/afterPack.mjs,scripts/todesktop-beforeBuild.cjs, orscripts/postinstall.mjs— ToDesktop's remote build only needs the pre-builtout/,package.json,lib/,resources/,assets/, andlocales/.This is the root-cause trim rather than relying solely on the raised cap — it also restores headroom for the next asset-heavy feature instead of spending it all on removable dev files.
Verification
check-runsannotations on the failing commit (Process completed with exit code 1on "Build with ToDesktop") and by extracting the ToDesktop CLI's own size-check source (@todesktop/clidist/cli.js): it zipsappFilesand errors withYour app is larger than {uploadSizeLimit}MBwhen the total exceeds it — this matches chore: raise todesktop uploadSizeLimit to 60 MB #1437's description and James's number exactly (30 MB limit, ~46.2 MB actual).bootstrap-python/(fetched fresh per-platform by ToDesktop's ownbeforeBuildhook, seescripts/todesktop-beforeBuild.cjs) is not part of the size-limited upload — it's excluded fromappFilesand fetched separately on ToDesktop's build servers, so it's not a contributor here.todesktop build --config=todesktop.json --dry-run --fileslocally (@todesktop/cli@1.28.0, with stubout/main/index.jsandbootstrap-python/*placeholders to satisfy path validation, since a fullpnpm installcouldn't complete in this sandbox — see caveat below):src/,e2e/,docs/,tsconfig*,eslint.config.ts, etc. no longer appear.out/bundle (a few MB of JS + the 12 MBpublic/copy, which I could not produce here — see caveat), so the real uploaded size will land higher than 4.32 MB, but the ~23 MB removed fromsrc/alone is more than enough to bring the true ~46.2 MB upload back under the original 30 MB cap, well within the new 60 MB one.npx prettier --check todesktop.jsonpasses (matches this repo'sformat:check), and the file is valid JSON per the@todesktop/clischema (no validation errors in the dry run).Caveat: I could not run a full
pnpm install/pnpm run buildin this sandbox —pnpm install --frozen-lockfilefails fetching an unrelated transitive dependency (@electron/rebuild's@electron/node-gypgit tarball) that this sandbox's egress policy blocks, unrelated to this change. I was not able to get a real end-to-endtodesktop build --dry-runnumber including the actual compiledout/directory, or re-run CI on this branch. The before/after appFiles-only comparison above (27 MB → 4.32 MB) is real and reproducible, but the final total includingout/is an estimate, not a measured number.