fix ESM exports in package.json#32
fix ESM exports in package.json#32OmarTawfik wants to merge 1 commit intosyntax-tree:mainfrom OmarTawfik-forks:fix-exports
Conversation
|
Hey! I think this is something else! The changes you propose could be used (although: they break every package using this). The existing code exists to do different things. They use conditions: https://nodejs.org/api/packages.html#conditional-exports. Someone can do this to get development code, from the outside.
I believe that to be a different error. The problem is that I believe that the solution is to use a current correct TS config (e.g., like this: https://github.com/syntax-tree/mdast-util-from-markdown/blob/cd10e598ae2492c8b61131d2ace46e0ea7cc37e5/tsconfig.json), then regenerate all types in remark, and cut a new release |
I see. I didn't know about that. Thanks for the information! Will close this PR and look into |
Initial checklist
Description of changes
Following up on 309f2a4 .. cc @wooorm
Per the NodeJS Spec: https://nodejs.org/api/packages.html#package-entry-points
This PR updates
package.jsonto use the new syntax (starting with a dot).It also export the
lib/index.jspath, which is required to properly propagate the generated types fromlib/index.d.tsto the rootindex.d.tsthat re-exports its. This is already breaking builds in dependents that use"moduleResolution": "node16"in theirtsconfig.json. Example I found today inremark-parselatest version: