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

Add types to export map #57

Merged
merged 4 commits into from
Jun 26, 2022
Merged

Add types to export map #57

merged 4 commits into from
Jun 26, 2022

Conversation

calebeby
Copy link
Contributor

https://devblogs.microsoft.com/typescript/announcing-typescript-4-7/#package-json-exports-imports-and-self-referencing

TS 4.7 adds a new resolution mode which matches node's built in ESM resolution. TS adds a types export condition which allows it to resolve types for, e.g. kleur/colors.

The existing types field outside of exports is left as a fallback for older TS versions or for people not using the new resolution mode.

@lukeed
Copy link
Owner

lukeed commented Jun 26, 2022

Hey thanks, as per your linked documentation, the "types" condition must be first for every entry.

@calebeby
Copy link
Contributor Author

Oops, fixed! It seems like a weird requirement though, and it was working as-is before I reordered it 🤔

@lukeed
Copy link
Owner

lukeed commented Jun 26, 2022

It most definitely is. The whole thing is wonky.

@codecov-commenter
Copy link

Codecov Report

Merging #57 (2b31bd5) into master (598f24c) will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master      #57   +/-   ##
=======================================
  Coverage   98.77%   98.77%           
=======================================
  Files           2        2           
  Lines         163      163           
  Branches       28       28           
=======================================
  Hits          161      161           
  Misses          1        1           
  Partials        1        1           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 598f24c...2b31bd5. Read the comment docs.

@lukeed
Copy link
Owner

lukeed commented Jun 26, 2022

Kept the "types" key so that non-Node16 usage continues to work. Thanks~

@lukeed lukeed merged commit 06f28e0 into lukeed:master Jun 26, 2022
@calebeby calebeby deleted the patch-1 branch June 27, 2022 14:50
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.

3 participants