Skip to content

Build the browser UI in release CLI builds so studio ui ships working - #4257

Merged
youknowriad merged 2 commits into
trunkfrom
claude/practical-heyrovsky-e36c43
Jul 21, 2026
Merged

Build the browser UI in release CLI builds so studio ui ships working#4257
youknowriad merged 2 commits into
trunkfrom
claude/practical-heyrovsky-e36c43

Conversation

@youknowriad

@youknowriad youknowriad commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Related issues

  • Related to the studio ui command shipping broken in published CLIs (no issue filed).

How AI was used in this PR

Claude Code investigated the release pipeline, confirmed the gap by inspecting the published wp-studio@1.15.0 registry tarball, wrote the fix, and verified the builds end-to-end (build outputs, npm pack contents, and studio ui serving the UI).

Proposed Changes

The published wp-studio npm package ships the studio ui command but not the browser UI it serves: wp-studio@1.15.0 on npm contains no ui/ assets, so running studio ui from an npm install responds with "Cannot GET /". The root cause is that nothing in the release pipeline ever builds apps/ui — the CLI build only copies dist-local if it happens to already exist, and silently skips it otherwise.

  • Release CLI builds (npm, prod, and the standalone bundle) now build the browser UI themselves before bundling, and fail loudly if the UI output is missing — a broken studio ui can no longer ship silently.
  • Dev builds are unchanged: the UI remains optional there, so API-only and Vite-dev-server workflows keep working without building the UI.
  • Adds a root npm run cli:build:ui convenience script that chains the UI build and the CLI build for anyone who wants the full studio ui experience from a dev build.

Testing Instructions

  • rm -rf apps/ui/dist-local && npm run cli:build:npm — the build should build the UI itself, and apps/cli/dist/cli/ui/index.local.html should exist afterwards.
  • npm pack -w wp-studio --dry-run | grep dist/cli/ui — the tarball file list should include the UI assets.
  • npm run cli:build:ui && node apps/cli/dist/cli/main.mjs ui — the browser should show the Studio UI at / (not "Cannot GET /").
  • Dev flow still permissive: rm -rf apps/ui/dist-local apps/cli/dist && npm run cli:build should succeed without building the UI.

Pre-merge Checklist

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

🤖 Generated with Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@wpmobilebot

wpmobilebot commented Jul 20, 2026

Copy link
Copy Markdown
Collaborator

📊 Performance Test Results

Comparing 0b4cff7 vs trunk

app-size

Metric trunk 0b4cff7 Diff Change
App Size (Mac) 1355.67 MB 1361.62 MB +5.95 MB 🔴 0.4%

site-editor

Metric trunk 0b4cff7 Diff Change
load 1075 ms 1093 ms +18 ms ⚪ 0.0%

site-startup

Metric trunk 0b4cff7 Diff Change
siteCreation 7010 ms 6991 ms 19 ms ⚪ 0.0%
siteStartup 2354 ms 2350 ms 4 ms ⚪ 0.0%

Results are median values from multiple test runs.

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

… on Windows

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@sejas sejas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I tested it and I confirm I was able to see apps/cli/dist/cli/ui/index.local.html after running rm -rf apps/ui/dist-local && npm run cli:build:npm. It also started the UI correctly in the browser.

I noticed that a warning appears when running npm run cli:build. I think the warning already existed, but now is more visible. I don't see any issue or delay when loading the UI.

Image Image Image
@youknowriad
youknowriad merged commit 6b4af1b into trunk Jul 21, 2026
13 checks passed
@youknowriad
youknowriad deleted the claude/practical-heyrovsky-e36c43 branch July 21, 2026 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants