-
Notifications
You must be signed in to change notification settings - Fork 912
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!: migrate to pure ESM #3850
Conversation
2dd7414
to
74b4111
Compare
I haven't upgraded all dependencies to pure ESM like |
Thanks @JounQin ! |
1055feb
to
f7b0772
Compare
@escapedcat I'm not for sure to understand this failing test case. Would you like to help? |
Interesting unexpected change here.
Founded and fixed at |
The last failing test case I've just found is that See also jestjs/jest#14856 |
I'll try to migrate to vitest tomorrow. |
How did it go? |
Oh, I'm sorry, I was a bit business busy these days and totally forgot this PR. I'll find some time to work on this soon later. |
@escapedcat I've rebased from master branch, CI is required to be approved. |
CI is required to be approved again. 🤣 |
😅 |
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.
Hello @JounQin,
thank you for your work in this migration!
I noticed a few things that might be changed in order to avoid additional workflow approval 😂
@escapedcat @marcalexiei Would you like to help to fix these test cases? |
Hey @JounQin, |
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.
@JounQin I tackled with the tests and I found a possible cause of the issue.
Does it make sense to you?
I have also added some additional thoughts.
👍 I'll take a look when I'm free enough. |
Should these be updated as well then? "engines": {
"node": ">=v18"
}, |
I think it's good to only support LTS versions. |
Ubuntu 24.04 is LTS and has Node 18. Please revert Node version back to 18. |
Soo... We keep 18 but tests will be done in 20? |
Why do you say that? CI was green. |
Sorry for the confusion. Reverted it. Somehow I got confused by the locally failing tests. |
Ping me if this can be published. Will wait with all other/unrelated PRs till then. No rush. |
BREAKING CHANGE: migrate to pure ESM * feat: migrate to pure ESM * chore: update snapshot * fix: load `parserPreset` with another `await` * test: migrate to vitest * test: remove no replacement `--runInBand` test-ci script * chore: fix code reviews * refactor(load): rewrite resolve logic * fix(config-nx-scopes): fix syntax error * feat(resolve-extends): add resolveFrom and loadParserPreset * feat(load): use resolveFrom and loadParserPreset from resolve-extends * test: include only @commitlint/* packages src in coverage * test: explicit import vitest utilities * test: remove @jest/globals from dependencies * fix(resolve-extends): `resolveFrom` output should be platform aware * test: restore NO_COLOR to test script * chore: fix linting issues * fix: should use fileURLToPath instead of pathname for Windows compatibility * Apply suggestions from code review * fix: should reuse `cli` instead call `yargs()` * feat(cli): set terminalWidth as wrap to avoid work break on help * Update .eslintrc.cjs * feat: migrate @commitlint/config-conventional to pure ESM --------- Co-authored-by: Marco Pasqualetti <[email protected]>
Thanks everyone! Please give it a try |
Any idea? |
@escapedcat I'll take a look if reproduction provided. |
We are still seeing the behaviour described by #3949 on 19.0.0 and 19.0.3. 😞 |
@CJKay |
@CJKay, because commitizen does not support ESM (commitizen/cz-cli#916), issues are expected to arise when A temporary workaround, as described in #3949 (comment), involves wrapping The long-term fix is to add ESM support in |
@frantic1048 Considering the workaround, I have an idea to make |
Given the facts that:
It follows that the latest I'm not opposing the ESM-only or any particular module format; however, could we address the usability issue for |
@frantic1048 Yes, that's what I sad to make it a dual package, do you want to raise a PR? |
@JounQin, yes, allow me some time to delve into the codebase. |
@frantic1048 It's just easy to add a |
@JounQin @escapedcat Right-o, sorry, these errors threw me for a bit of a loop - I'm not particularly familiar with the JavaScript ecosystem. |
* feat: add CJS export for cz-commitlint relates to: #3850 (comment) resolves #3949 * chore: add .cts to eslintrc * fix: workaround cts issues of vitest and typescript
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [@commitlint/cli](https://commitlint.js.org/) ([source](https://togithub.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli)) | [`^18.6.1` -> `^19.2.1`](https://renovatebot.com/diffs/npm/@commitlint%2fcli/18.6.1/19.2.1) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@commitlint%2fcli/19.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@commitlint%2fcli/19.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@commitlint%2fcli/18.6.1/19.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@commitlint%2fcli/18.6.1/19.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@commitlint/config-conventional](https://commitlint.js.org/) ([source](https://togithub.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional)) | [`^18.6.3` -> `^19.1.0`](https://renovatebot.com/diffs/npm/@commitlint%2fconfig-conventional/18.6.3/19.1.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@commitlint%2fconfig-conventional/19.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@commitlint%2fconfig-conventional/19.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@commitlint%2fconfig-conventional/18.6.3/19.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@commitlint%2fconfig-conventional/18.6.3/19.1.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [@commitlint/cz-commitlint](https://commitlint.js.org/) ([source](https://togithub.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cz-commitlint)) | [`^18.6.1` -> `^19.2.0`](https://renovatebot.com/diffs/npm/@commitlint%2fcz-commitlint/18.6.1/19.2.0) | [![age](https://developer.mend.io/api/mc/badges/age/npm/@commitlint%2fcz-commitlint/19.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/npm/@commitlint%2fcz-commitlint/19.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/npm/@commitlint%2fcz-commitlint/18.6.1/19.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/npm/@commitlint%2fcz-commitlint/18.6.1/19.2.0?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (@​commitlint/cli)</summary> ### [`v19.2.1`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1921-2024-03-19) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.2.0...v19.2.1) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) ### [`v19.2.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1920-2024-03-15) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) ##### Features - **cli:** introduce new --last flag, to stop recommending HEAD~1 ([#​3916](https://togithub.com/conventional-changelog/commitlint/issues/3916)) ([99f4f3f](https://togithub.com/conventional-changelog/commitlint/commit/99f4f3f4839190a2758083df7ba20b988e7b68a6)) ### [`v19.1.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1910-2024-03-12) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) #### [19.0.3](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.2...v19.0.3) (2024-02-28) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) #### [19.0.2](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.1...v19.0.2) (2024-02-28) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) #### [19.0.1](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.0...v19.0.1) (2024-02-27) ##### Bug Fixes - drop `resolve-from`, `resolve-global` and `import-fresh`, resolve global packages correctly ([#​3939](https://togithub.com/conventional-changelog/commitlint/issues/3939)) ([8793c63](https://togithub.com/conventional-changelog/commitlint/commit/8793c639c083c33714da0a29429b338776813d0c)), closes [#​3938](https://togithub.com/conventional-changelog/commitlint/issues/3938) ### [`v19.0.3`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1903-2024-02-28) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.2...v19.0.3) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) ### [`v19.0.2`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1902-2024-02-28) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.1...v19.0.2) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) ### [`v19.0.1`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1901-2024-02-27) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.0...v19.0.1) ##### Bug Fixes - drop `resolve-from`, `resolve-global` and `import-fresh`, resolve global packages correctly ([#​3939](https://togithub.com/conventional-changelog/commitlint/issues/3939)) ([8793c63](https://togithub.com/conventional-changelog/commitlint/commit/8793c639c083c33714da0a29429b338776813d0c)), closes [#​3938](https://togithub.com/conventional-changelog/commitlint/issues/3938) ### [`v19.0.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#1900-2024-02-27) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.1...v19.0.0) - feat!: migrate to pure ESM ([#​3850](https://togithub.com/conventional-changelog/commitlint/issues/3850)) ([3423735](https://togithub.com/conventional-changelog/commitlint/commit/342373559bdf7c783c4ef37ff05dc38a5f681159)), closes [#​3850](https://togithub.com/conventional-changelog/commitlint/issues/3850) ##### Reverts - Revert "chore!: minimum node version v20" ([2816783](https://togithub.com/conventional-changelog/commitlint/commit/2816783d00e7eb967de3ac9347c2fc43dc8b94fa)) ##### BREAKING CHANGES - migrate to pure ESM - feat: migrate to pure ESM - chore: update snapshot - fix: load `parserPreset` with another `await` - test: migrate to vitest - test: remove no replacement `--runInBand` test-ci script - chore: fix code reviews - refactor(load): rewrite resolve logic - fix(config-nx-scopes): fix syntax error - feat(resolve-extends): add resolveFrom and loadParserPreset - feat(load): use resolveFrom and loadParserPreset from resolve-extends - test: include only @​commitlint/\* packages src in coverage - test: explicit import vitest utilities - test: remove [@​jest/globals](https://togithub.com/jest/globals) from dependencies - fix(resolve-extends): `resolveFrom` output should be platform aware - test: restore NO_COLOR to test script - chore: fix linting issues - fix: should use fileURLToPath instead of pathname for Windows compatibility - Apply suggestions from code review - fix: should reuse `cli` instead call `yargs()` - feat(cli): set terminalWidth as wrap to avoid work break on help - Update .eslintrc.cjs - feat: migrate [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) to pure ESM #### [18.6.1](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.0...v18.6.1) (2024-02-13) **Note:** Version bump only for package [@​commitlint/cli](https://togithub.com/commitlint/cli) </details> <details> <summary>conventional-changelog/commitlint (@​commitlint/config-conventional)</summary> ### [`v19.1.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/config-conventional/CHANGELOG.md#1910-2024-03-12) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) **Note:** Version bump only for package [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) #### [19.0.3](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.2...v19.0.3) (2024-02-28) **Note:** Version bump only for package [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) ### [`v19.0.3`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/config-conventional/CHANGELOG.md#1903-2024-02-28) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.0...v19.0.3) **Note:** Version bump only for package [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) ### [`v19.0.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/config-conventional/CHANGELOG.md#1900-2024-02-27) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.3...v19.0.0) - feat!: migrate to pure ESM ([#​3850](https://togithub.com/conventional-changelog/commitlint/issues/3850)) ([3423735](https://togithub.com/conventional-changelog/commitlint/commit/342373559bdf7c783c4ef37ff05dc38a5f681159)), closes [#​3850](https://togithub.com/conventional-changelog/commitlint/issues/3850) ##### Reverts - Revert "chore!: minimum node version v20" ([2816783](https://togithub.com/conventional-changelog/commitlint/commit/2816783d00e7eb967de3ac9347c2fc43dc8b94fa)) ##### BREAKING CHANGES - migrate to pure ESM - feat: migrate to pure ESM - chore: update snapshot - fix: load `parserPreset` with another `await` - test: migrate to vitest - test: remove no replacement `--runInBand` test-ci script - chore: fix code reviews - refactor(load): rewrite resolve logic - fix(config-nx-scopes): fix syntax error - feat(resolve-extends): add resolveFrom and loadParserPreset - feat(load): use resolveFrom and loadParserPreset from resolve-extends - test: include only @​commitlint/\* packages src in coverage - test: explicit import vitest utilities - test: remove [@​jest/globals](https://togithub.com/jest/globals) from dependencies - fix(resolve-extends): `resolveFrom` output should be platform aware - test: restore NO_COLOR to test script - chore: fix linting issues - fix: should use fileURLToPath instead of pathname for Windows compatibility - Apply suggestions from code review - fix: should reuse `cli` instead call `yargs()` - feat(cli): set terminalWidth as wrap to avoid work break on help - Update .eslintrc.cjs - feat: migrate [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) to pure ESM #### [18.6.2](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.1...v18.6.2) (2024-02-14) ##### Bug Fixes - **config-conventional:** use default export ([#​3911](https://togithub.com/conventional-changelog/commitlint/issues/3911)) ([bc48408](https://togithub.com/conventional-changelog/commitlint/commit/bc4840832f9484186d3281d13ab5e0b4f9f63113)) #### [18.6.1](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.0...v18.6.1) (2024-02-13) **Note:** Version bump only for package [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) </details> <details> <summary>conventional-changelog/commitlint (@​commitlint/cz-commitlint)</summary> ### [`v19.2.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cz-commitlint/CHANGELOG.md#1920-2024-03-15) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.1.0...v19.2.0) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) ### [`v19.1.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cz-commitlint/CHANGELOG.md#1910-2024-03-12) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.3...v19.1.0) ##### Bug Fixes - add missing cjs entry in package ([#​3967](https://togithub.com/conventional-changelog/commitlint/issues/3967)) ([9cea6fd](https://togithub.com/conventional-changelog/commitlint/commit/9cea6fdb7b1bf7cfc9a86e882e2742379b4b6aec)) ##### Features - add CJS export for cz-commitlint ([#​3963](https://togithub.com/conventional-changelog/commitlint/issues/3963)) ([6ae3c6a](https://togithub.com/conventional-changelog/commitlint/commit/6ae3c6a827de8622d827146ffb0984a9e62fe505)), closes [/github.com/conventional-changelog/commitlint/pull/3850#issuecomment-1984932236](https://togithub.com//github.com/conventional-changelog/commitlint/pull/3850/issues/issuecomment-1984932236) [#​3949](https://togithub.com/conventional-changelog/commitlint/issues/3949) #### [19.0.3](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.2...v19.0.3) (2024-02-28) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) #### [19.0.2](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.1...v19.0.2) (2024-02-28) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) #### [19.0.1](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.0...v19.0.1) (2024-02-27) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) ### [`v19.0.3`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cz-commitlint/CHANGELOG.md#1903-2024-02-28) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.2...v19.0.3) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) ### [`v19.0.2`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cz-commitlint/CHANGELOG.md#1902-2024-02-28) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.1...v19.0.2) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) ### [`v19.0.1`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cz-commitlint/CHANGELOG.md#1901-2024-02-27) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v19.0.0...v19.0.1) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) ### [`v19.0.0`](https://togithub.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cz-commitlint/CHANGELOG.md#1900-2024-02-27) [Compare Source](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.1...v19.0.0) - feat!: migrate to pure ESM ([#​3850](https://togithub.com/conventional-changelog/commitlint/issues/3850)) ([3423735](https://togithub.com/conventional-changelog/commitlint/commit/342373559bdf7c783c4ef37ff05dc38a5f681159)), closes [#​3850](https://togithub.com/conventional-changelog/commitlint/issues/3850) ##### Reverts - Revert "chore!: minimum node version v20" ([2816783](https://togithub.com/conventional-changelog/commitlint/commit/2816783d00e7eb967de3ac9347c2fc43dc8b94fa)) ##### BREAKING CHANGES - migrate to pure ESM - feat: migrate to pure ESM - chore: update snapshot - fix: load `parserPreset` with another `await` - test: migrate to vitest - test: remove no replacement `--runInBand` test-ci script - chore: fix code reviews - refactor(load): rewrite resolve logic - fix(config-nx-scopes): fix syntax error - feat(resolve-extends): add resolveFrom and loadParserPreset - feat(load): use resolveFrom and loadParserPreset from resolve-extends - test: include only @​commitlint/\* packages src in coverage - test: explicit import vitest utilities - test: remove [@​jest/globals](https://togithub.com/jest/globals) from dependencies - fix(resolve-extends): `resolveFrom` output should be platform aware - test: restore NO_COLOR to test script - chore: fix linting issues - fix: should use fileURLToPath instead of pathname for Windows compatibility - Apply suggestions from code review - fix: should reuse `cli` instead call `yargs()` - feat(cli): set terminalWidth as wrap to avoid work break on help - Update .eslintrc.cjs - feat: migrate [@​commitlint/config-conventional](https://togithub.com/commitlint/config-conventional) to pure ESM #### [18.6.1](https://togithub.com/conventional-changelog/commitlint/compare/v18.6.0...v18.6.1) (2024-02-13) **Note:** Version bump only for package [@​commitlint/cz-commitlint](https://togithub.com/commitlint/cz-commitlint) </details> --- ### Configuration 📅 **Schedule**: Branch creation - "before 4am on Monday" in timezone Europe/Amsterdam, Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/remcolakens/next-boilerplate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4yMjAuMiIsInVwZGF0ZWRJblZlciI6IjM3LjI0NS4wIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Description
As title
Motivation and Context
close #3642
close #3705
close #3842
Usage examples
N/A
How Has This Been Tested?
Yes
Types of changes
Checklist:
TODO list after merged:
exports
field inpackage.json
(via @marcalexiei)