Skip to content

build: enforce and document @yieldvault/api-schemas build order - #1494

Merged
Junirezz merged 2 commits into
Junirezz:mainfrom
CathyZaks:fix/issue-1371-build-api-schemas-before-tsc
Oct 3, 2026
Merged

Junirezz merged 2 commits into
Junirezz:mainfrom
CathyZaks:fix/issue-1371-build-api-schemas-before-tsc

Conversation

@CathyZaks

Copy link
Copy Markdown
Contributor

Summary

Enforce and document the monorepo build order ensuring @yieldvault/api-schemas is built before running backend TypeScript compilation (tsc), development, or type-checking.

Problem

backend/src/middleware/validate.ts imports @yieldvault/api-schemas, which emits type declarations to packages/api-schemas/dist/index.d.ts. In local development environments after a fresh clone, packages/api-schemas has not been built yet, causing tsc --noEmit and backend builds to fail with Cannot find module '@yieldvault/api-schemas'. Furthermore, the backend package.json had duplicate and conflicting build script definitions, and documentation lacked instructions on building shared packages before backend startup.

Solution

  1. Deduplicate build scripts in backend/package.json and configure prebuild, predev, and typecheck scripts to invoke build:schemas (npm --prefix ../packages/api-schemas run build) before running TypeScript or starting dev.
  2. Add build:schemas, root build, typecheck, and update dev:backend and dev:frontend in the root package.json to ensure schemas are built before running workspace dev servers.
  3. Document the required build order in CONTRIBUTING.md, docs/LOCAL_DEV_BOOTSTRAP.md, docs/CONTRIBUTOR_ONBOARDING_CHECKLIST.md, and backend/docs/REQUEST_VALIDATION.md.

Changes

  • package.json: Added build:schemas, root build, typecheck, and ensured dev:backend/dev:frontend trigger build:schemas first.
  • backend/package.json: Removed duplicated build script entries, added build:schemas, wired predev and prebuild to compile schemas before building/running, and added a typecheck script.
  • CONTRIBUTING.md: Documented the requirement to run npm run build:schemas after installing dependencies and clarified the build order dependency.
  • docs/LOCAL_DEV_BOOTSTRAP.md: Added the shared schema build step to the bootstrap installation flow with an explanatory note on the build order requirement.
  • docs/CONTRIBUTOR_ONBOARDING_CHECKLIST.md: Added npm run build:schemas to Section 2 and referenced the automatic build enforcement in Section 5.
  • backend/docs/REQUEST_VALIDATION.md: Added an explicit note explaining the @yieldvault/api-schemas build dependency for backend type validation.

Testing

  • Ran npm run build:schemas from backend and confirmed successful compilation of @yieldvault/api-schemas.
  • Ran npx vitest run scripts/validate-workspace-test-scripts.test.ts and confirmed all 6 tests pass.

Closes #1371

@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@CathyZaks Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Enforce building @yieldvault/api-schemas prior to backend build, dev, and typechecking, and document the monorepo build order in contributor and setup guides.
@CathyZaks
CathyZaks force-pushed the fix/issue-1371-build-api-schemas-before-tsc branch from b2d765d to 1daa7ee Compare October 2, 2026 16:31
@Junirezz
Junirezz merged commit 7547eb7 into Junirezz:main Oct 3, 2026
6 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

@yieldvault/api-schemas package must be built before tsc or local type-checking breaks

2 participants