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

Support TypeScript nodenext module resolution #155

Closed
wants to merge 1 commit into from

Conversation

abrenneke
Copy link

When using nodenext module resolution and there's an exports in the package.json, it requires a types field or else fails to resolve modules.

This adds types to exports/./* to resolve types for import etc from 'fp-ts-std/etc', and changes the . import to an object so that types are correctly resolved for import { etc } from 'fp-ts-std'. Not sure why it didn't have an ESM import for . already, so added that too.

Related TS issue

When using `nodenext` module resolution and there's an `exports` in the package.json, it requires a `types` field or else fails to resolve modules.

This adds `types` to `exports/./*` to resolve types for `import etc from 'fp-ts-std/etc'`, and changes the `.` import to an object so that types are correctly resolved for `import { etc } from 'fp-ts-std'`. Not sure why it didn't have an ESM import for `.` already, so added that too.

[Related TS issue](microsoft/TypeScript#49388)
@abrenneke
Copy link
Author

I see this was tried in gcanti/fp-ts#1726 but then reverted so, 🤷 take it or leave it no big deal

@samhh
Copy link
Owner

samhh commented Apr 21, 2023

Implemented in d393ae0 via #117. Sorry for not getting around to this sooner!

@samhh samhh closed this Apr 21, 2023
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