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

The docs should provide better guidance for publishing pure ESM packages #2772

Closed
jedwards1211 opened this issue Apr 3, 2023 · 1 comment

Comments

@jedwards1211
Copy link

jedwards1211 commented Apr 3, 2023

Page URL: https://www.typescriptlang.org/docs/handbook/declaration-files/publishing.html, https://www.typescriptlang.org/docs/handbook/esm-node.html

Issue: There should be clear guidance how to configure pure ESM packages that work in consuming projects with "moduleResolution": "nodenext". I ran into a confusing issue with the antlr4 package. It wasn't immediately obvious to me what fix to suggest. As pure ESM becomes more widespread in the ecosystem there will be a lot of dev confusion like this with misconfigured packages.

Recommended Fix: I think the docs should recommend using "moduleResolution": "nodenext" in the build config for pure ESM packages so that they catch any issues consumers using that resolution would encounter. Or at least in the build config used to check the type defs for node. Are there any problems with this I'm not aware of?

In addition the publishing page should have an example of using export maps with types.

@jedwards1211 jedwards1211 changed the title The docs don't provide enough guidance for publishing pure ESM packages The docs should provide better guidance for publishing pure ESM packages Apr 3, 2023
@typescript-bot
Copy link
Collaborator

Hello! As per #2804, we are automatically closing all open issues. Please see #2804 for a description of what issues and PRs can be accepted going forward.

@typescript-bot typescript-bot closed this as not planned Won't fix, can't repro, duplicate, stale Apr 25, 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

No branches or pull requests

2 participants