-
Notifications
You must be signed in to change notification settings - Fork 946
feat: add CJS export for cz-commitlint #3963
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 CJS export for cz-commitlint #3963
Conversation
relates to: #3850 (comment) resolves #3949
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. |
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.
Line 40 in 67baff9
| files: ['*.ts'], |
This line should change to files: ['*.cts', '*.ts'],
| @@ -0,0 +1,7 @@ | |||
| const esmPrompterPromise = import('./index.js'); | |||
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.
I was thinking to use typeof import('./index.js') but I found there was a TypeScript error (I believe it's a bug), but considering this, I'm thinking to use <packageDir>/index.cjs which is plain js instead.
Basically it should be await import('./lib/index.js')
@frantic1048 How do you think?
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.
Yes, that's weird and I'm trying to use cjs to workaround this.
I was thinking to use typeof import('./index.js') but I found there was a TypeScript error
|
CI is broken |
|
The error from the tests appears to be related to vitest-dev/vitest#3987 🤔 |
|
We can bypass that issue easily. |
|
🚀 |
|
Checking the outupt: https://ci.codesandbox.io/status/conventional-changelog/commitlint/pr/3963/builds/482116, it appears the build is not containing |
|
@escapedcat, oh, the merge may have been too hasty. I'm testing the built package and have found an issue with the build configuration. 😮 |
|
Ah sorry :D |
|
I meant to have |
resolves #3949
Description
Motivation and Context
Currently
comittizendoes not support ESM adapter, this PR add additional CJS export for@commitlint/cz-commitlint, which allowscomittizento work with it.#3850 (comment)
Usage examples
This PR does not change usage.
How Has This Been Tested?
package.json{ "config": { "commitizen": { "path": "@commitlint/cz-commitlint" } }, }Install new
@commitlint/cz-commitlintand runcommitizen:Types of changes
Checklist: