-
Notifications
You must be signed in to change notification settings - Fork 162
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
Fix mismatched types between entrypoint and pure modules #565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
morale stamp
@fruchtose-stripe I am seeing the following in our jest tests after updating to v3.0.9
|
Same problem as esetnik here: X [ERROR] Could not resolve "../dist/stripe.mjs"
Created Issue... |
This reverts commit 0230bbd.
Hi all. Thank you for the reports. This pull request has been reverted in issue v3.0.10. Please use that version instead. |
* Change types generation strategy to avoid duplicate declarations * Remove rollup-plugin-dts
* Fix mismatched types between entrypoint and pure modules (#565) * Change types generation strategy to avoid duplicate declarations * Remove rollup-plugin-dts * Fix import paths
Summary & motivation
This change addresses #563. Types from
pure
and the main entrypoint are not interchangeable sincerollup-plugin-dts
generates two separate sets of types. This fixes the issue and keeps the.d.mts
files by copying the.d.ts
files from thetypes
directory into./dist
in two copies: one with the.d.ts
extension, and with the.d.mts
extension as well.I've also made two directories for module entrypoints so that the main and
pure
entrypoints live in sister folderslib
andpure
. This helps with testing and standardization.Testing & documentation
I tested these changes with a number of sample repos, as well as with the
react-stripe-js
repo. I also checked witharethetypeswrong
andpublint
.