Fix Cursor IDE navigation to source files instead of .d.ts files
Description
This PR implements TypeScript project references to fix Cursor IDE navigation issues where "Go to Definition" was navigating to .d.ts declaration files instead of TypeScript source files when navigating between packages in the monorepo.
The solution establishes proper cross-module relationships by:
- Adding
referencesarrays to all packagetsconfig.jsonfiles pointing to their workspace dependencies - Creating a root
tsconfig.jsonwith references to all packages in the monorepo - Updating the VS Code workspace configuration with TypeScript-specific IDE settings
This replaces the previous approach of generating declaration maps via tsup callbacks, which was insufficient for cross-module navigation. TypeScript project references are the recommended solution according to the official TypeScript documentation for enabling "transparent goto definition" across project boundaries in monorepos.
Key Implementation Note: The initial implementation included composite: true in all tsconfig files (as recommended by TypeScript docs), but this had to be removed due to build compatibility issues with the tsup build system where files in subdirectories weren't being recognized properly.
Test plan
⚠️ Critical Testing Gap: The core functionality (Cursor IDE cross-module navigation) has not been tested yet and requires manual verification.
Completed Testing:
- ✅
pnpm build:libspasses with all packages building successfully - ✅
pnpm lint:fixresolves formatting issues in tsconfig files - ✅ All TypeScript project references are syntactically correct
Required Manual Testing:
- [ ] Test cross-module navigation in Cursor IDE: Open a file that imports from another workspace package (e.g.,
packages/client/react-base/src/providers/CrossmintProvider.tsxline 2) and use "Go to Definition" on the import to verify navigation goes to source files instead of.d.tsfiles - [ ] Verify navigation works across multiple package dependency chains
- [ ] Test with different types of imports (named exports, default exports, type imports)
Package updates
No package.json changes were made - this is purely a TypeScript configuration change.
Human Review Checklist
High Priority:
- Test the actual IDE navigation behavior - this is the core requirement that cannot be automated
- Verify dependency mapping accuracy - check that all
referencesarrays correctly reflect the actual workspace dependencies in package.json files - Assess impact of missing
composite: true- determine if the solution is effective without composite mode
Medium Priority:
4. Check that no packages are missing from the root tsconfig.json references
5. Verify build system stability with the new configuration
6. Test that existing development workflows (hot reload, etc.) still work properly
Notes:
- This approach follows TypeScript's official project references documentation
- The absence of
composite: trueis a compromise due to build system constraints and may affect effectiveness - Manual IDE testing is essential since this cannot be automated
Link to Devin run: https://app.devin.ai/sessions/c019a46789184dcfa032cd93b5e23f75
Requested by: @maxisch
Original prompt from [email protected]
when using cursor, file navigation is broken. It goes to the .d.ts files instead of the source file. Can you fix this?
You only need to look in the following repo: Crossmint/crossmint-sdk
🤖 Devin AI Engineer
I'll be helping with this pull request! Here's what you should know:
✅ I will automatically:
- Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
- Look at CI failures and help fix them
Note: I can only respond to comments from users who have write access to this repository.
⚙️ Control Options:
- [ ] Disable automatic comment and CI monitoring
⚠️ No Changeset found
Latest commit: 00a5435ac948c7c8101c3c3229edd546b5b14da4
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
The latest updates on your projects. Learn more about Vercel for Git ↗︎
1 Skipped Deployment
| Name | Status | Preview | Comments | Updated (UTC) |
|---|---|---|---|---|
| smart-wallet-auth-demo | ⬜️ Ignored (Inspect) | Aug 3, 2025 3:18am |