Fix package exports for TypeScript#48
Conversation
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 9 9
Lines 964 964
Branches 137 137
=========================================
Hits 964 964
Flags with carried forward coverage won't be shown. Click here to find out more. Continue to review full report at Codecov.
|
It was introduced as the way to tell TS where to pick up the types for
What do you mean? |
Sorry to tease, but it would be perhaps a 6+ paragraph comment to adequately explain all the nuances and I'm a bit burned out from high-effort comments at the moment. |
|
It's fine. Take your time, if you would comment on this in a future. |
|
Everything looks good so far, but I can't release this immediately because I am busy on my work. Sorry. I'll merge it and include with the next release as soon as I can. |
|
Sorry for the delay :) |
This PR fixes the package
exportsfield for compatibility with prereleasetypescriptv4.6. Weirdly,tscin the CLI didn't have problems resolving the type definition for imports but the VS Code TypeScript extension did.Project code before, with
typescriptv4.6.0-dev.20211227:After the changes in this PR:
The specific change needed for the fix in the package
exportsfield was the addition ofexports["."].node.types. The others are added because it might solve other problems. I don't fully understand what the point of thetypesVersionsfield is, so you might want to consider it.See this TypeScript guide.
For the record, this PR works with the patterns already established but I would setup the files and package exports differently.