Skip to content

Fix standalone CLI bundle build failing with data-liberation E404#4101

Merged
sejas merged 1 commit into
trunkfrom
fix-standalone-bundle-data-liberation-install
Jul 7, 2026
Merged

Fix standalone CLI bundle build failing with data-liberation E404#4101
sejas merged 1 commit into
trunkfrom
fix-standalone-bundle-data-liberation-install

Conversation

@sejas

@sejas sejas commented Jul 7, 2026

Copy link
Copy Markdown
Member

Related issues

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:

npm error 404 Not Found - GET https://registry.npmjs.org/data-liberation - Not found

Root problem: each dev-build CI job runs the CLI's install:bundle twice — first inside the desktop make (the forge hook starts it from a clean apps/cli/node_modules), then again inside cli:bundle. Between the two runs, the CLI build rebuilds packages/data-liberation-agent/dist, so the content of the data-liberation file: dependency changes. Reinstalling with --install-links over that tree hits an npm bug: instead of re-packing the local folder, npm re-resolves data-liberation@0.1.0 from the public registry, where it doesn't exist → E404.

Solution: 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.

Testing Instructions

  • Run npm run cli:bundle -- darwin arm64 twice 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 produce standalone-bundles/studio-cli-darwin-arm64.tgz. Note: this mutates apps/cli/node_modules; run npm ci afterwards to restore your workspace.
  • CI on this PR: trigger the dev build ("🚦 Build for Mac?" / Linux) and confirm the "Building standalone CLI bundle" step passes.

Pre-merge Checklist

  • Have you checked for TypeScript, React or other console errors?

🤖 Generated with Claude Code

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>
@sejas sejas self-assigned this Jul 7, 2026
@sejas sejas requested a review from nightnei July 7, 2026 09:23
@wpmobilebot

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing f19b8e8 vs trunk

app-size

Metric trunk f19b8e8 Diff Change
App Size (Mac) 1411.93 MB 1411.93 MB +0.00 MB ⚪ 0.0%

site-editor

Metric trunk f19b8e8 Diff Change
load 756 ms 1081 ms +325 ms 🔴 43.0%

site-startup

Metric trunk f19b8e8 Diff Change
siteCreation 6480 ms 6512 ms +32 ms ⚪ 0.0%
siteStartup 2389 ms 2386 ms 3 ms ⚪ 0.0%

Results are median values from multiple test runs.

Legend: 🟢 Improvement (faster) | 🔴 Regression (slower) | ⚪ No change (<50ms diff)

@wojtekn wojtekn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable, thank for the fix.

@sejas sejas merged commit 7d47bec into trunk Jul 7, 2026
12 checks passed
@sejas sejas deleted the fix-standalone-bundle-data-liberation-install branch July 7, 2026 09:49
@nightnei

nightnei commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

I tried a few times, with reinstalling node modules etc but npm run cli:bundle -- darwin arm64 always works well in trunk. Anyway, the explanation makes sense 👍 Interesting case.
Screenshot 2026-07-07 at 10 49 37

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.
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.

4 participants