Fix Cursor IDE navigation to source files instead of .d.ts files #1329
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR implements TypeScript project references to fix Cursor IDE navigation issues where "Go to Definition" was navigating to
.d.tsdeclaration files instead of TypeScript source files when navigating between packages in the monorepo.The solution establishes proper cross-module relationships by:
referencesarrays to all packagetsconfig.jsonfiles pointing to their workspace dependenciestsconfig.jsonwith references to all packages in the monorepoThis 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: truein 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
Completed Testing:
pnpm build:libspasses with all packages building successfullypnpm lint:fixresolves formatting issues in tsconfig filesRequired Manual Testing:
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.tsfilesPackage updates
No package.json changes were made - this is purely a TypeScript configuration change.
Human Review Checklist
High Priority:
referencesarrays correctly reflect the actual workspace dependencies in package.json filescomposite: true- determine if the solution is effective without composite modeMedium Priority:
4. Check that no packages are missing from the root
tsconfig.jsonreferences5. Verify build system stability with the new configuration
6. Test that existing development workflows (hot reload, etc.) still work properly
Notes:
composite: trueis a compromise due to build system constraints and may affect effectivenessLink to Devin run: https://app.devin.ai/sessions/c019a46789184dcfa032cd93b5e23f75
Requested by: @maxisch