Skip to content

fix(api): map workspace package paths to source in api tsconfig (#956) - #1016

Open
Ranjeet2063 wants to merge 2 commits into
drydocs:mainfrom
Ranjeet2063:fix/vercel-deploy-api-tsconfig-paths
Open

Ranjeet2063 wants to merge 2 commits into
drydocs:mainfrom
Ranjeet2063:fix/vercel-deploy-api-tsconfig-paths

Conversation

@Ranjeet2063

Copy link
Copy Markdown

Closes #956

Summary of Changes

Decouples Vercel's serverless function type-checking () from emitted declaration files by adding explicit path mappings in directly to the live workspace package sources.

Background & Root Cause

Production Vercel deployments were failing in the serverless function type-check phase with errors such as:

api/v1/vaults/index.ts(2,10): error TS2305: Module '"@meridian/api-core"' has no exported member 'handleGetVaults'.
api/v1/vaults/index.ts(3,10): error TS2305: Module '"@meridian/shared"' has no exported member 'APP_NETWORK'.
api/_lib/middleware.ts(3,10): error TS2305: Module '"@meridian/shared"' has no exported member 'DEFAULT_ALLOWED_ORIGIN'.

While CI passes cleanly, Vercel restores packages/*/dist from previous deployment caches. If @vercel/node runs its independent tsc over api/** against stale .d.ts declarations, newly introduced exports fail to resolve.

Implementation Details

  • Configured paths in api/tsconfig.json:
    • @meridian/shared -> ["../packages/shared/src/index.ts"]: Points directly to shared schemas and constants.
    • @meridian/api-core -> ["../packages/api-core/src/index.ts"]: Points to core API handlers.
    • @meridian/stellar-sdk-helpers -> ["../packages/stellar-sdk-helpers/src/index.ts"]: Points to keeper, rate source, and sdk helper sources.
  • Runtime bundling remains unaffected as esbuild resolves dist/index.js via each package's main.

Local Verification

  1. Isolated No-Dist Test:
    • Manually removed packages/shared/dist, packages/api-core/dist, and packages/stellar-sdk-helpers/dist.
    • Executed pnpm typecheck:api -> Passed with 0 errors, confirming that typechecking no longer depends on emitted declarations.
  2. Full Workspace Build & Verification:
    • pnpm build: 10/10 tasks successful (wasm contracts, sdk, web, apps).
    • pnpm typecheck: 12/12 packages passed cleanly.
    • pnpm typecheck:api: Passed cleanly.
    • pnpm lint: All packages passed without lint warnings.
    • pnpm test: 40 test files passed (335/335 unit tests passing).

…ocs#956)

Decouple @vercel/node function type-check from emitted declarations by
pointing tsconfig paths directly to live workspace source modules.
This prevents TS2305 missing export errors when Vercel restores stale
package dist cache across consecutive deployments.

Closes drydocs#956
Copilot AI balanced review requested due to automatic review settings October 9, 2026 15:00
@vercel

vercel Bot commented Oct 9, 2026

Copy link
Copy Markdown

@Ranjeet2063 is attempting to deploy a commit to the Collins' projects Team on Vercel.

A member of the Team first needs to authorize it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

This branch has not been deployed

No deployments
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.

[Bug] Production Vercel deploy fails on stale workspace declarations in function type-check

2 participants