fix(ui): make ui:build work on Windows#52291
Conversation
Greptile SummaryThis PR fixes two related issues that caused Changes:
The implementation is clean and well-scoped. The logic in Confidence Score: 5/5
Reviews (1): Last reviewed commit: "fix(ui): make ui build work on Windows" | Re-trigger Greptile |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 05a293af24
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| action === "build" ? { ...process.env, NODE_ENV: "production" } : process.env; | ||
| const installArgs = action === "build" ? ["install", "--prod"] : ["install"]; | ||
| runSync(runner.cmd, installArgs, installEnv); | ||
| runSync(runner.cmd, ["install"]); |
There was a problem hiding this comment.
Limit the fallback install to the UI package
At this line, the missing-deps fallback switched from pnpm install --prod to a bare pnpm install while createSpawnOptions() still runs it from ui/. I checked pnpm install --help, and inside a workspace that command installs dependencies for all workspace projects, not just the current package. Because depsInstalled("build") only requires vite and dompurify, pnpm ui:build now turns a clean checkout into a full workspace dev install, pulling unrelated dev/test tooling just to build the UI. That is a regression in scope and can make ui:build unexpectedly slow or fail on hosts that intentionally do not have the full repo toolchain available.
Useful? React with 👍 / 👎.
Summary
pnpm ui:buildcan fail on Windows when the resolvedpnpm.cmdpath contains spaces, becausescripts/ui.jslaunches shell-backed commands without quoting the executable path.pnpm install --prod, which skipsviteand leaves the UI build unable to start.spawn/spawnSync, and make the build auto-install path install the full UI dependency set instead of production-only deps.Change Type
Scope
Linked Issue/PR
User-visible / Behavior Changes
On Windows,
pnpm ui:buildnow works when the package manager lives under a path with spaces (for exampleC:\Program Files\...). On clean checkouts, the command also installs the build-time UI dependencies it needs before invoking Vite.Security Impact
Repro + Verification
Environment
pnpm ui:buildExpected
pnpm ui:buildshould launch the resolved package-manager command correctly on Windows.Actual before fix
'D:\Program' is not recognized ...--prod, sovite buildfailed becausevitewas absent.Evidence
Commands run:
pnpm exec vitest run --config vitest.config.ts test/scripts/ui.test.tspnpm ui:buildObserved after fix:
test/scripts/ui.test.ts:1 passed,6 passedtestspnpm ui:build: completed successfully and emitteddist/control-ui/*Human Verification
What I personally verified:
pnpm ui:buildsucceeds locally on a fresh worktree after the script changes.Review Conversations
Compatibility / Migration
Failure Recovery
ui:buildfailures returningRisks and Mitigations
buildmay do more work than the previous production-only install.vite/other dev-time tooling to succeed.