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(types): allow typescript's new Node16 module resolution to find types #209

Merged
merged 1 commit into from
Jun 21, 2022

Conversation

bgotink
Copy link
Contributor

@bgotink bgotink commented Jun 5, 2022

TypeScript's new Node16 module resolution reads exports. It is currently looking for dist/index.d.ts or dist/index.d.mts as main types for uvu, and <export>/index.d.ts or <export>/index.d.mts for other exports depending on whether require or import is being used.

Setting the types export condition tells typescript where to find the correct types.

Closes #210, #211

Copy link
Owner

@lukeed lukeed left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you. Gotta love how TS created a bunch of pointless work for authors by purposefully disregarding a system that already worked for something new that also happens to flagrantly ignore the "exports" specs for conditions' ordering.

@lukeed lukeed merged commit b84b116 into lukeed:master Jun 21, 2022
@bgotink bgotink deleted the feature/typescript-node16 branch June 21, 2022 22:19
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.

Cannnot resolve typescript types with TypeScript ESM using moduleResolution NodeNext
2 participants