Commit bd3c0d9
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
0 commit comments