feat: add CJS export for cz-commitlint#3963
feat: add CJS export for cz-commitlint#3963escapedcat merged 3 commits intoconventional-changelog:masterfrom frantic1048:feat/add-cjs-export-for-cz-commitlint
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. |
| @@ -0,0 +1,7 @@ | |||
| const esmPrompterPromise = import('./index.js'); | |||
There was a problem hiding this comment.
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.
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: