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

feat: Add exports.types to package.json #131

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

andreavaccari
Copy link

@andreavaccari andreavaccari commented Jul 7, 2022

This allows TypeScript to correctly resolve type imports when using Node's module resolution with:

  • "moduleResolution": "NodeNext", or
  • "moduleResolution": "Node16"

Refs:

@marijnh
Copy link
Member

marijnh commented Jul 7, 2022

What problem does this address?

@andreavaccari
Copy link
Author

Hi @marijnh, I just added a description to the PR. Apologies for not doing so when submitting.

@marijnh
Copy link
Member

marijnh commented Jul 7, 2022

Nice. Will this work both for CommonJS and ES module resolution?

@andreavaccari
Copy link
Author

The rest of the specifications were correct, and this change won't affect CJS and ESM resolution, so all resolution paths will work correctly. I like to run npx -y publint (see also the web tool) to make sure there aren't any errors in the exports specs, however this won't catch missing specifications like in this case. Getting these right is quite difficult! (ref).

@andreavaccari
Copy link
Author

Hi @marijnh, anything I can do to help get this PR plus this and this merged? Thank you!

@marijnh
Copy link
Member

marijnh commented Jul 21, 2022

I'm not seeing any problems when I import the ProseMirror modules from a TypeScript project that has moduleResolution set to node16, so I am still confused about what this adds.

@marijnh
Copy link
Member

marijnh commented Aug 19, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants