Add types resolutions to package.json exports field to support NodeNext/Node16 module resolution. #196
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.
Hey there! First of all wanted to thank you for building this very useful and underappreciated library :-) It's clear how much care was put into ensuring it works across all flavors of JS in the JS/TS ecosystem!
TS 4.7 added "NodeNext" and "Node16" as possible settings for "compilerOptions/moduleResolution" in
tsconfig.json
.If either of these settings are used, TS is no longer enable to resolve the types for
get-current-line
:As a temporary workaround, I explicitly added
get-current-line
's types to my tsconfig's mapped "paths":Unfortunately, this kind of problem can be quite tricky to resolve for developers who are relatively new to the quirks of Node/TypeScript's module resolution behavior.
I added a reference to the package's types in the
package.json
"exports" map, and, based on some very superficial testing, the types appear to be resolvable in all Node environments by default. I'm not sure what impact this might have in non-Node environments, but none seems like a safe assumption (or at least nothing should break 🤣).Thanks again for the great work, and wishing you all the best!