Summary
Nothing in CI actually runs scripts/build-vercel.sh, the literal command Vercel executes to build every production deployment. CI builds apps/api-local and typechecks api/, but never exercises the real deploy path end to end.
Motivation
This gap is not theoretical: it already caused a production incident. packages/api-core was added and wired into every api/v1/* handler, but never added to build-vercel.sh's esbuild bundling step, so every Vercel serverless function importing it threw ERR_MODULE_NOT_FOUND in production (fixed in #398). Nothing in CI would have caught this before it shipped, because nothing in CI runs the script that actually builds for Vercel.
Proposed Solution
Add a CI job (or a step in the existing lint-typecheck job) that runs bash scripts/build-vercel.sh on every PR and fails if it errors, so a missing workspace-bundle step or similar build breakage is caught before merge instead of in production. At minimum, the job should assert that every workspace package imported by api/v1/* handlers has a corresponding dist/index.js produced by the script.
Scope
| Field |
Value |
| Area |
CI |
| Protocol affected |
None |
| Network |
N/A |
| Breaking change? |
No |
Alternatives Considered
Relying on manual review to catch missing bundle steps: already demonstrated to fail once; the reviewer (and the author) both missed it because nothing surfaced the gap until Vercel's runtime logs did.
Acceptance Criteria
Additional Context
See #398 for the incident and fix.
Summary
Nothing in CI actually runs
scripts/build-vercel.sh, the literal command Vercel executes to build every production deployment. CI buildsapps/api-localand typechecksapi/, but never exercises the real deploy path end to end.Motivation
This gap is not theoretical: it already caused a production incident.
packages/api-corewas added and wired into everyapi/v1/*handler, but never added tobuild-vercel.sh's esbuild bundling step, so every Vercel serverless function importing it threwERR_MODULE_NOT_FOUNDin production (fixed in #398). Nothing in CI would have caught this before it shipped, because nothing in CI runs the script that actually builds for Vercel.Proposed Solution
Add a CI job (or a step in the existing
lint-typecheckjob) that runsbash scripts/build-vercel.shon every PR and fails if it errors, so a missing workspace-bundle step or similar build breakage is caught before merge instead of in production. At minimum, the job should assert that every workspace package imported byapi/v1/*handlers has a correspondingdist/index.jsproduced by the script.Scope
Alternatives Considered
Relying on manual review to catch missing bundle steps: already demonstrated to fail once; the reviewer (and the author) both missed it because nothing surfaced the gap until Vercel's runtime logs did.
Acceptance Criteria
scripts/build-vercel.sh(or an equivalent check) on every PR touchingapi/,packages/api-core,packages/shared, orpackages/stellar-sdk-helpersapi/v1/*handler doesn't have a bundleddist/index.jsafter the script runsAdditional Context
See #398 for the incident and fix.