Skip to content
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

fix(pkg): add types to the exports #125

Merged
merged 1 commit into from
Jun 3, 2022
Merged

fix(pkg): add types to the exports #125

merged 1 commit into from
Jun 3, 2022

Conversation

rinsuki
Copy link
Contributor

@rinsuki rinsuki commented May 26, 2022

in node16/nodenext module mode of TyepScript 4.7+, If package has exports entry on package.json, needs "types" field in exports.* for find typings.

ref. https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/

in node16/nodenext module mode of TyepScript 4.7+, If package has
`exports` entry on package.json, needs "types" field in `exports.*`
for find typings.

ref. https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/
@pi0
Copy link
Member

pi0 commented Jun 1, 2022

Thanks for the PR. I agree to start adding types to subpath exports but wondering is top level types totally ignored in new mode? /cc @danielroe

@pi0 pi0 changed the title chore: support node16/next module mode of TS 4.7+ feat(pkg): add types to the exports Jun 1, 2022
@rinsuki
Copy link
Contributor Author

rinsuki commented Jun 3, 2022

yes, in node16/nodenext mode, if types are missing in exports fields, TypeScript says missing declaration file and throws compile error, like this:

image

@pi0
Copy link
Member

pi0 commented Jun 3, 2022

Thanks for confirming 👍🏼

@pi0 pi0 changed the title feat(pkg): add types to the exports fix(pkg): add types to the exports Jun 3, 2022
@pi0 pi0 merged commit bf8a329 into unjs:main Jun 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants