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 field to exports to resolve node16 and nodenext typescript module resolution #158

Closed
balupton opened this issue Nov 19, 2023 · 4 comments

Comments

@balupton
Copy link
Member Author

balupton commented Nov 19, 2023

This is in my current batch of work, and I'll tackle it this week.

Sorry it took 18 months from the first report! Thanks to my GitHub Sponsors, I've now been able to afford this month to work on my javascript projects again. The more sponsors, the more I can support my projects, and the smaller the delay in fixes.

@balupton
Copy link
Member Author

balupton commented Nov 20, 2023

The reason Bevry never encountered this issue is twofold:

  1. We use "moduleResolution": "Node" instead of NodeNext/Node16

  2. We use "maxNodeModuleJsDepth": 5 however anything 2 or higher will do, even with NodeNext and Node16

I'm now testing the module.exports[...][types] suggestion.

@balupton
Copy link
Member Author

Okay, so module.exports[...][types] cannot be a directory (same as index.cjs types annotation), unlike package.json:types which should be a directory. It does resolve the issue.

To make this happen properly I think I'll make an edition for the types, that way it's entry can be easily fetched.

The code has also reemerged the issue of deno/bun/worker exports. Currently that is handled via entry points, however generating exports for them I believe was something we did. I will need to look into this tomorrow.

@balupton
Copy link
Member Author

The change has been verified on the typechecker package and its consumer ambi.

I'll now run the new boundation release on all the bevry packages, and it'll roll out over the coming days.

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

No branches or pull requests

1 participant