Fix standalone CLI bundle build failing with data-liberation E404#4101
Merged
Conversation
The second install:bundle run per CI job hit an npm --install-links bug: reinstalling over a tree whose data-liberation file: dep content changed makes npm re-resolve it from the registry, failing with E404. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Collaborator
📊 Performance Test ResultsComparing f19b8e8 vs trunk app-size
site-editor
site-startup
Results are median values from multiple test runs. Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff) |
wojtekn
approved these changes
Jul 7, 2026
wojtekn
left a comment
Contributor
There was a problem hiding this comment.
Looks reasonable, thank for the fix.
Contributor
gcsecsey
pushed a commit
that referenced
this pull request
Jul 7, 2026
) Delete `apps/cli/node_modules` before the bundle's packaging step in `scripts/create-standalone-bundle.ts`, so it always starts from a clean tree — the same thing `forge.config.ts` already does for the desktop packaging path. Covers the Mac/Linux/Windows dev and release pipelines, which all go through this script. Cost is one extra fresh `npm install` (~40 s in CI with a warm cache); no user-facing behavior change.
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.

Related issues
data-liberationfile:dependency inapps/cli)How AI was used in this PR
AI was used to investigate the CI failure (reproducing the npm behavior locally against a copy of the workspace tree) and to draft the fix and this PR description. The change was reviewed and verified manually.
Proposed Changes
Trunk dev builds fail on all platforms at the "Building standalone CLI bundle" step with:
Root problem: each dev-build CI job runs the CLI's
install:bundletwice — first inside the desktop make (the forge hook starts it from a cleanapps/cli/node_modules), then again insidecli:bundle. Between the two runs, the CLI build rebuildspackages/data-liberation-agent/dist, so the content of thedata-liberationfile:dependency changes. Reinstalling with--install-linksover that tree hits an npm bug: instead of re-packing the local folder, npm re-resolvesdata-liberation@0.1.0from the public registry, where it doesn't exist → E404.Solution: delete
apps/cli/node_modulesbefore the bundle's packaging step inscripts/create-standalone-bundle.ts, so it always starts from a clean tree — the same thingforge.config.tsalready does for the desktop packaging path. Covers the Mac/Linux/Windows dev and release pipelines, which all go through this script. Cost is one extra freshnpm install(~40 s in CI with a warm cache); no user-facing behavior change.Testing Instructions
npm run cli:bundle -- darwin arm64twice in a row (the second run reproduces CI's dirty-tree state). Without this fix the second run fails with the E404 above; with it, both runs producestandalone-bundles/studio-cli-darwin-arm64.tgz. Note: this mutatesapps/cli/node_modules; runnpm ciafterwards to restore your workspace.Pre-merge Checklist
🤖 Generated with Claude Code