fix(ui): self-heal the Cloudflare Pages build's incomplete workspace install#6624
Merged
Merged
Conversation
…install The Cloudflare Pages project's root directory is set to apps/loopover-ui, so its automatic `npm clean-install` step only installs that workspace's own declared dependencies (957 packages) rather than the full monorepo tree (~1316) -- it never reaches sibling workspace packages' dependencies. This silently worked until packages/loopover-engine gained two new direct dependencies (@anthropic-ai/claude-agent-sdk, web-tree-sitter) for its miner chat-grounding work, which the Cloudflare build then fails to resolve (TS2307), breaking preview builds for every PR touching apps/loopover-ui/**. build:cloudflare already `cd`s to the monorepo root to run ui:build; extend the same pattern one step earlier and run a full `npm ci` from the root first, so the build is self-sufficient regardless of what Cloudflare's own auto-detected install step covered.
Contributor
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
Bundle ReportChanges will increase total bundle size by 4 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: loopover-uiAssets Changed:
|
This was referenced Jul 16, 2026
andriypolanski
pushed a commit
to andriypolanski/gittensory
that referenced
this pull request
Jul 16, 2026
Closes JSONbored#6642. A CI job cannot actually reproduce Cloudflare Pages' scoped-install behavior to regression-test JSONbored#6624 end to end -- confirmed empirically that a plain `npm ci` run from apps/loopover-ui in a normal git checkout correctly finds and installs the full workspace tree (Cloudflare's build sandbox does something else that isn't reproducible via plain npm/git commands in GitHub Actions). The reliable, cheap guard is the invariant that actually prevents the regression: build:cloudflare must keep running a full monorepo-root `npm ci` before `ui:build`. Adds a unit test asserting that exact script shape, mirroring the existing ci-ui-build-openapi.test.ts convention of testing critical build-recipe content directly. Verified it fails when the self-heal step is removed (reverted locally, confirmed red, restored).
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.
Summary
apps/loopover-ui, so its automaticnpm clean-installstep only installs that workspace's own declared dependencies (957 packages), never reaching sibling workspace packages (the full monorepo installs ~1316).packages/loopover-enginegained two new direct dependencies (@anthropic-ai/claude-agent-sdk,web-tree-sitter) for its miner chat-grounding work — the Cloudflare build now fails withTS2307: Cannot find moduleon those, breaking the preview build for every PR that touchesapps/loopover-ui/**.build:cloudflarealreadycds to the monorepo root (npm --prefix ../.. run ui:build) to run the real build; this extends the same pattern one step earlier —npm --prefix ../.. ci && npm --prefix ../.. run ui:build— so the build is self-sufficient regardless of what Cloudflare's own auto-detected install step covered, with no Cloudflare dashboard changes needed.Scope
apps/loopover-ui/package.jsononly (one script line)src/**changesValidation
npm run build:cloudflarefrom insideapps/loopover-ui(the exact CWD Cloudflare invokes it from) — full rootnpm ci+ui:build(engine + ui + ui-miner) all succeed.npx tsc --noEmit— cleannpm run actionlint— clean (no workflow changes, just confirming nothing else drifted)Safety