Commit 5a4e62f
committed
fix(build): build @loopover/contract in both deploy paths so a clean checkout can deploy
Cloudflare Workers Builds is the deploy path for BOTH workers — no GitHub
Actions workflow runs `wrangler deploy` (ui-deploy.yml only validates) — and
both have failed on every recent commit. 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.
One root cause, two scripts: nothing builds `@loopover/contract` before
something needs its `dist/`. `@loopover/engine` does not depend on it, so
building engine alone leaves it unemitted.
loopover-ui — `npm run 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`:
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'/opt/buildhome/repo/node_modules/@loopover/contract/dist/public-api.js'
loopover-api — `npm run deploy:api` builds only `@loopover/engine`, then
`wrangler deploy` bundles `src/index.ts`, which reaches `@loopover/contract`
from src/mcp/*, src/openapi/schemas.ts and src/orb/broker-client.ts:
✘ [ERROR] Build failed with 8 errors:
✘ [ERROR] Could not resolve "@loopover/contract"
Both pass 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". Neither deploy command runs a typecheck ahead of
itself, so the incidental ordering never applies.
Adding the same edge to each deploy path's own turbo invocation, which is the
level that actually owns the dependency. `deploy:api` also moves from a bare
`npm --workspace ... run build` to turbo so both paths express it identically.
Verified against a genuinely clean tree (package dists and .tsbuildinfo files
removed, TURBO_FORCE=1 to defeat the shared worktree cache — the first two
reproduction attempts were masked by a stale tsbuildinfo and then by a turbo
cache replay). ui:build: exit 1 -> exit 0. wrangler deploy --dry-run: 8
unresolved "@loopover/contract" imports -> 0, exit 0.1 parent 94fecf1 commit 5a4e62f
1 file changed
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments