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: invalid position of "types" in "exports" #1202

Merged
merged 1 commit into from
Dec 2, 2024
Merged

Conversation

delatrie
Copy link
Collaborator

@delatrie delatrie commented Dec 2, 2024

Context

When resolving types, TypeScript always uses the "types" entry of "exports" (provided it exists) regardless of its position and whether or not a previous entry had matched.

This is considered a bug and shouldn't be relied upon. See the details here: microsoft/TypeScript#50762.

This PR puts every "types" entry to the first place. This makes the resolution by TypeScript the same as the one performed by Node.

@delatrie delatrie added the type:bug Something isn't working label Dec 2, 2024
@github-actions github-actions bot added theme:api Javascript API related issue theme:mocha Mocha related issue theme:jest Jest related issue theme:cucumberjs CucumberJS related issue theme:jasmine Jasmine related issue theme:playwright theme:codeceptjs theme:vitest labels Dec 2, 2024
@baev baev merged commit d7e2994 into main Dec 2, 2024
13 checks passed
@baev baev deleted the package-exports-order-fix branch December 2, 2024 11:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme:api Javascript API related issue theme:codeceptjs theme:cucumberjs CucumberJS related issue theme:jasmine Jasmine related issue theme:jest Jest related issue theme:mocha Mocha related issue theme:playwright theme:vitest type:bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants