feat(resolve-extends): resolve pure-ESM presets (conventional-changelog v7/v9/v10)#4859
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
4bee721 to
40ac266
Compare
Confidence Score: 5/5Safe to merge; the new ESM resolver is a strict fallback that only activates after both CJS paths fail, leaving normal resolution behaviour unchanged. The ESM fallback in resolveFrom is guarded by a try/catch and only fires when CommonJS resolution has already given up, so there is no regression risk for packages that CJS can already resolve. Root-entry resolution of pure-ESM packages is correct and covered by new unit tests. The one open gap — the subpath branch ignores the exports map for subpath entries — does not affect the declared targets. @commitlint/resolve-extends/src/index.ts lines 86-93 (subpath resolution) if support for exports-mapped subpaths is ever needed. Important Files Changed
Reviews (3): Last reviewed commit: "fix: update dependency conventional-chan..." | Re-trigger Greptile |
40ac266 to
91b2556
Compare
Parser presets published as pure ESM expose an exports map with only the import condition (no require/default/main). The CommonJS preset resolver could not read these and threw "No exports main defined". Add an ESM-aware node_modules fallback that runs only after CommonJS resolution fails, plus the same fallback in the test bootstrap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
v9 ships its own typings: createPreset() is typed as {} and the named parser export was
dropped (still present at runtime). Read the parser options via createPreset().parser and
drop the now-unused @ts-expect-error directives.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
91b2556 to
edb6005
Compare
This PR contains the following updates: | Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) | |---|---|---|---| | [@commitlint/cli](https://commitlint.js.org/) ([source](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/cli)) | [`21.1.0` → `21.2.0`](https://renovatebot.com/diffs/npm/@commitlint%2fcli/21.1.0/21.2.0) |  |  | | [@commitlint/config-conventional](https://commitlint.js.org/) ([source](https://github.com/conventional-changelog/commitlint/tree/HEAD/@commitlint/config-conventional)) | [`21.1.0` → `21.2.0`](https://renovatebot.com/diffs/npm/@commitlint%2fconfig-conventional/21.1.0/21.2.0) |  |  | --- ### Release Notes <details> <summary>conventional-changelog/commitlint (@​commitlint/cli)</summary> ### [`v21.2.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/cli/CHANGELOG.md#2120-2026-06-30) [Compare Source](conventional-changelog/commitlint@v21.1.0...v21.2.0) ##### Features - **resolve-extends:** resolve pure-ESM presets (conventional-changelog v7/v9/v10) ([#​4859](conventional-changelog/commitlint#4859)) ([fdb566f](conventional-changelog/commitlint@fdb566f)) </details> <details> <summary>conventional-changelog/commitlint (@​commitlint/config-conventional)</summary> ### [`v21.2.0`](https://github.com/conventional-changelog/commitlint/blob/HEAD/@​commitlint/config-conventional/CHANGELOG.md#2120-2026-06-30) [Compare Source](conventional-changelog/commitlint@v21.1.0...v21.2.0) ##### Features - **resolve-extends:** resolve pure-ESM presets (conventional-changelog v7/v9/v10) ([#​4859](conventional-changelog/commitlint#4859)) ([fdb566f](conventional-changelog/commitlint@fdb566f)) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), 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 [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi44MS4zIiwidXBkYXRlZEluVmVyIjoiNDIuODEuMyIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==--> Reviewed-on: https://git.3caravelle.net/3Caravelle/renovate/pulls/43 Co-authored-by: Renovate Bot <renovate-bot@3caravelle.com> Co-committed-by: Renovate Bot <renovate-bot@3caravelle.com>
Adopts the conventional-changelog family majors released 2026-06-26. Supersedes the three Renovate PRs (#4858, #4857, #4856).
Structured as four commits — the shared ESM resolver as a
feat, then onefixper dependency bump:feat(resolve-extends): resolve pure-ESM parser presetsfix: update dependency conventional-commits-parser to v7(fix: update dependency conventional-commits-parser to v7 - autoclosed #4858)fix: update dependency conventional-changelog-conventionalcommits to v10(fix: update dependency conventional-changelog-conventionalcommits to v10 - autoclosed #4857)fix: update dependency conventional-changelog-angular to v9(fix: update dependency conventional-changelog-angular to v9 - autoclosed #4856)Why the feat
conventional-changelog-angular@9andconventional-changelog-conventionalcommits@10are now pure ESM whoseexportsmap declares only theimportcondition (norequire/default/main). commitlint's CommonJS resolvers (require.resolve,resolve-from,resolve-pkg) fail withNo "exports" main definedwhen resolving a string parser preset.@commitlint/resolve-extendsnow falls back to an ESM-awarenode_moduleswalk only after CommonJS resolution fails — so resolution of normal packages is unchanged — with the equivalent fallback in the test bootstrap. Covered by new unit tests on syntheticexports-only manifests.angular@9 typings
v9 ships its own types:
createPreset()is typed{}and the namedparserexport was dropped (still present at runtime). The affected source/tests now read the options viacreatePreset().parserand drop the now-unused@ts-expect-errordirectives. The runtime in@commitlint/parsewas already callingcreatePreset().parser, so only the cast/types changed.User impact
Suitable for a minor release. commitlint only consumes these packages'
parserOpts, never their writer/template side, and Node 22 was already required. The new capability is resolving pure-ESM parser presets; the one behavior change is the parser footer fix (conventional-changelog#1485) whereBREAKING CHANGEnotes no longer absorb trailing footer trailers.Verification
pnpm build(tsc -b --force, clean) ✅oxlint✅ ·oxfmt --check✅@commitlint/config-conventional(valid / invalid /BREAKING CHANGE) ✅🤖 Generated with Claude Code