fix: include source files in published package for IDE navigation#316
Open
amilz wants to merge 1 commit intosolana-program:mainfrom
Open
fix: include source files in published package for IDE navigation#316amilz wants to merge 1 commit intosolana-program:mainfrom
amilz wants to merge 1 commit intosolana-program:mainfrom
Conversation
Declaration maps reference `../../src/` but source files were excluded from the npm package. Adding `"./src/"` to the files field enables IDE "Go to Definition" to navigate to actual TypeScript source instead of .d.ts type declarations. Zero impact on app bundle size — bundlers resolve imports via `exports`/`main`/`module` to compiled JS in dist/.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Problem
"Go to Definition" (Cmd+Click / F12) on any import from this package takes you to
.d.tstype declarations instead of actual source code.Why
declarationMap: trueis set in tsconfig ✅.d.ts.mapfiles reference source paths like../../src/index.ts✅filesonly includes./dist/srcand./dist/typesDeclaration maps point to
../../src/but that path doesn't exist innode_modules. IDE can't follow the map, falls back to.d.ts.Fix
Add
"./src/"to thefilesarray inclients/js/package.json. No build, tsconfig, or code changes.Size impact
dist/viaexports/main/moduleContext
Same fix applied to
@solana/kit(anza-xyz/kit#1468) and@solana/kit-plugins.