-
Notifications
You must be signed in to change notification settings - Fork 764
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
Configure 2 TypeScript compile targets for ESM and CJS #1704
Conversation
c5b3090
to
dec91ed
Compare
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.
Nice work! Mostly nits and discussions.
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.
nits
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.
Great work!
Summary
Prepare to convert stripe-node to a dual package. This sets up the TypeScript build step to transpile into two separate ESM and CJS outputs, but we only expose the
cjs
entry point for now.In this PR:
cjs
andesm
(lib
is removed)src/stripe.cjs.*..ts
, will add ESM entry point in a follow-up PRstripe.common.ts
tostripe.core.ts
because the naming is too similar to CommonJSStripe
anddefault
properties to Stripe object instripe.core.ts
for backwards compatibility.js
file endingstripe.core.ts
and add rule to update that version during releases.cjs/
outputTesting
In addition to CI tests, verified that package works as expected in manual test projects