-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "types"
to "exports"
#1704
Add "types"
to "exports"
#1704
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. The example on this page: https://www.typescriptlang.org/docs/handbook/esm-node.html#packagejson-exports-imports-and-self-referencing
has a comment saying "types" must come first:
// Entry-point for TypeScript resolution - must occur first!
"types": "./types/index.d.ts",
(It did work for me last when I was experimenting, but I think we better follow the example.)
This PR is to work with a future version of TypeScript. I have been doing a lot of reading to try and understand whether it is safe for us to ship now. And still not sure! Maybe I should ask...
Some interesting information about emit vs resolving with answer from an expert:
|
Asked if stable enough for release: microsoft/TypeScript#46452 (comment) |
And got a "100% yes". |
Oh, but then there was a followup. I need to reread some of the earlier comments again! |
@shadowspawn How could adding a |
In general, by making the behaviour worse for a use case where something reads |
@abetomo I am going to test now one more time with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
I think it is fine to release it next time. |
Ok. I won't merge until after release we have lined up. |
Pull Request
Problem
Fixes #1703
Solution
Add
"types"
to"exports"
ChangeLog