Skip to content

Commit bd3c0d9

Browse files
committed
fix(build): build @loopover/contract in ui:build so a clean checkout can deploy
Cloudflare Workers Builds has failed on every recent commit, which is the deploy path for loopover-ui — no GitHub Actions workflow runs `wrangler deploy` (ui-deploy.yml only validates). Production has consequently been serving stale code: #9574's `fleetAccuracy.basis` and #9594's anchor-payload auth exemption both landed on main and neither is live. The build command is `npm run build:cloudflare` -> `npm ci && npm run ui:build`. `ui:build` runs `turbo run build --filter=@loopover/engine`, then `ui:openapi`, whose `scripts/write-ui-openapi.ts` reaches `src/openapi/schemas.ts` and imports `@loopover/contract/dist/public-api.js`. Nothing in that chain builds `@loopover/contract` — `@loopover/engine` does not depend on it — so on a clean checkout the import resolves to a directory that was never emitted: Error [ERR_MODULE_NOT_FOUND]: Cannot find module '/opt/buildhome/repo/node_modules/@loopover/contract/dist/public-api.js' imported from /opt/buildhome/repo/src/openapi/schemas.ts It passes in `test:ci` only by accident of ordering: `npm run typecheck` runs first, and the `//#typecheck` turbo task already carries an explicit `@loopover/contract#build` edge — added for exactly this failure mode, and documented in turbo.json as "the root package.json dependency does NOT create a build edge for a root task". Cloudflare runs `ui:build` on its own, with no typecheck ahead of it, so the incidental ordering never applies. Adding the same edge to `ui:build`'s own turbo invocation, which is the level that actually owns the dependency. Verified against a genuinely clean tree (package dists and .tsbuildinfo files removed, TURBO_FORCE=1 to defeat the shared worktree cache — the first two attempts at reproducing this were masked by a stale tsbuildinfo and then by a turbo cache replay): without this change `ui:build` exits 1 on the error above; with it, exit 0 and both dist artifacts are emitted.
1 parent 94fecf1 commit bd3c0d9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"lint:composite-actions": "node --experimental-strip-types scripts/lint-composite-actions.ts",
6060
"ui:dev": "npm run ui:preview",
6161
"ui:kit:build": "npm run build --workspace @loopover/ui-kit",
62-
"ui:build": "npm run ui:kit:build && turbo run build --filter=@loopover/engine && npm run ui:openapi && npm --workspace @loopover/ui run build && npm --workspace @loopover/ui-miner run build",
62+
"ui:build": "npm run ui:kit:build && turbo run build --filter=@loopover/engine --filter=@loopover/contract && npm run ui:openapi && npm --workspace @loopover/ui run build && npm --workspace @loopover/ui-miner run build",
6363
"ui:preview": "npm run ui:build && wrangler dev --config apps/loopover-ui/dist/server/wrangler.json --ip 127.0.0.1 --port 4173 --local",
6464
"ui:lint": "npm run ui:kit:build && npm --workspace @loopover/ui-kit run format:check && npm --workspace @loopover/ui run format:check && npm --workspace @loopover/ui run lint && npm --workspace @loopover/ui-miner run format:check && npm --workspace @loopover/ui-miner run lint",
6565
"ui:typecheck": "npm run ui:kit:build && npm --workspace @loopover/ui run typecheck && npm --workspace @loopover/ui-miner run typecheck",

0 commit comments

Comments
 (0)