fix(core): replace deprecated conventional-changelog dependencies#4332
fix(core): replace deprecated conventional-changelog dependencies#4332AI-JamesHenry wants to merge 26 commits into
Conversation
Replace deprecated `conventional-changelog-core@5.0.1` and `conventional-recommended-bump@7.0.1` with their maintained successors that use `@conventional-changelog/git-client` instead of the deprecated `git-semver-tags` and `git-raw-commits` packages. - conventional-changelog-core@5.0.1 → conventional-changelog@7.2.0 - conventional-recommended-bump@7.0.1 → conventional-recommended-bump@11.2.0 - conventional-changelog-angular@7.0.0 → conventional-changelog-angular@8.3.0 Closes lerna#4331
- Use dynamic import() for ESM-only packages to work in CJS runtime - Configure Jest with moduleNameMapper and transformIgnorePatterns for ESM-only conventional-changelog ecosystem packages - Update test fixture writer-opts.js for immutable commit objects in conventional-changelog-writer - Update test snapshots for new changelog output format - Fix TypeScript type issues with semver.inc overloads
The new conventional-changelog-writer produces slightly different markdown output (fewer blank lines between sections). Update all inline snapshots in integration tests to match.
Fork PR CI checkouts don't create origin/HEAD, causing snapshot mismatches. Remove the optional ref from all inline snapshots.
Call readPackage() for all changelog types to discover repository URL from package.json. The new ConventionalChangelog API does not auto-discover repository context like the old conventional-changelog-core, which caused root changelogs to render plain SHAs instead of linked commit references.
- Restore the detailed semver major version zero comment that was accidentally dropped during the rewrite - Fix 3 remaining inline test snapshots that still had plain SHA instead of linked ([SHA](COMMIT_URL)) format
The previous snapshot update re-introduced origin/HEAD from local environment. Remove again — fork PR CI checkouts don't create this ref.
The new conventional-changelog does not generate commit links for local filesystem git remotes. Update e2e inline snapshots to use plain SHA format instead of linked format.
- Replace local filesystem path prefixes in compare URLs with relative paths (new conventional-changelog strips local paths) - Remove excessive blank lines between changelog sections
Adjust blank line counts between changelog sections to match the actual output from the new conventional-changelog-writer.
The new ConventionalChangelog class uses parseHostedGitUrl which rejects local filesystem paths, causing commit links to be dropped. The old conventional-changelog-core passed these URLs through directly as repoUrl. Add a repoUrl fallback that reads the git remote origin URL and sets it directly in the writer context, bypassing parseHostedGitUrl. This preserves commit links for all git remote types including local paths used in E2E tests. Also reverts the invalid E2E snapshot changes that removed commit links.
Replace the repoUrl-based fallback with a proper owner/project parsing approach that replicates the old @hutson/parse-repository-url behavior. For local filesystem bare repos (valid git remotes), parse the path into owner and project components and set them via .repository() BEFORE .readPackage() so hosted URL parsing can override them when available. This ensures commit links are generated for ALL valid git remote types — hosted providers, self-hosted servers, and local bare repos.
The new conventional-changelog-writer produces fewer blank lines between changelog sections. Update the 3 remaining inline snapshots with excessive blank lines (whitespace-only change).
Revert snapshot changes in non-changelog integration tests that were just Jest re-formatting inline snapshot indentation, not actual content changes. Only keep the real whitespace diffs from the new conventional-changelog-writer in the 4 conventional changelog tests.
… integration tests
…lease integration test
- Add E2E test proving old-style presets (parserOpts/writerOpts/whatBump) still work correctly through the normalization layer - Remove pointless unit test for local filesystem remotes - Fix excessive blank lines in 3 integration test snapshots that were re-introduced when reverting Jest re-indentation noise
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Nx Cloud is proposing a fix for your failed CI:
We ran nx format:write to fix the formatting issues in recommend-version.ts that were introduced when the file was rewritten to use the new Bumper API. These changes ensure the format:check CI task passes without altering any logic.
diff --git a/libs/core/src/lib/conventional-commits/recommend-version.ts b/libs/core/src/lib/conventional-commits/recommend-version.ts
index 36a3d7e7..ea835d01 100644
--- a/libs/core/src/lib/conventional-commits/recommend-version.ts
+++ b/libs/core/src/lib/conventional-commits/recommend-version.ts
@@ -30,10 +30,9 @@ export async function recommendVersion(
// For legacy presets, recommendedBumpOpts.parserOpts are bump-specific overrides
// (e.g. different noteKeywords or headerPattern) that historically only applied to
// version bump calculation, not changelog rendering. Apply them here only.
- const bumpConfig =
- config.recommendedBumpOpts?.parserOpts
- ? { ...config, parser: { ...config.parser, ...config.recommendedBumpOpts.parserOpts } }
- : config;
+ const bumpConfig = config.recommendedBumpOpts?.parserOpts
+ ? { ...config, parser: { ...config.parser, ...config.recommendedBumpOpts.parserOpts } }
+ : config;
bumper.config(bumpConfig);
bumper.commits({ path: pkg.location });
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.
Apply changes locally with:
npx nx-cloud apply-locally n3vH-mTI4
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
There was a problem hiding this comment.
Important
At least one additional CI pipeline execution has run since the conclusion below was written and it may no longer be applicable.
Nx Cloud is proposing a fix for your failed CI:
We ran nx format:write to fix the formatting issues in recommend-version.ts that were introduced when the file was rewritten to use the new Bumper API. These changes ensure the format:check CI task passes without altering any logic.
Tip
✅ We verified this fix by re-running nx-cloud record -- npx nx format:check.
diff --git a/libs/core/src/lib/conventional-commits/recommend-version.ts b/libs/core/src/lib/conventional-commits/recommend-version.ts
index 36a3d7e7..ea835d01 100644
--- a/libs/core/src/lib/conventional-commits/recommend-version.ts
+++ b/libs/core/src/lib/conventional-commits/recommend-version.ts
@@ -30,10 +30,9 @@ export async function recommendVersion(
// For legacy presets, recommendedBumpOpts.parserOpts are bump-specific overrides
// (e.g. different noteKeywords or headerPattern) that historically only applied to
// version bump calculation, not changelog rendering. Apply them here only.
- const bumpConfig =
- config.recommendedBumpOpts?.parserOpts
- ? { ...config, parser: { ...config.parser, ...config.recommendedBumpOpts.parserOpts } }
- : config;
+ const bumpConfig = config.recommendedBumpOpts?.parserOpts
+ ? { ...config, parser: { ...config.parser, ...config.recommendedBumpOpts.parserOpts } }
+ : config;
bumper.config(bumpConfig);
bumper.commits({ path: pkg.location });
🔔 Heads up, your workspace has pending recommendations ↗ to auto-apply fixes for similar failures.
Because this branch comes from a fork, it is not possible for us to apply fixes directly, but you can apply the changes locally using the available options below.
Apply changes locally with:
npx nx-cloud apply-locally n3vH-mTI4
Apply fix locally with your editor ↗ View interactive diff ↗
🎓 Learn more about Self-Healing CI on nx.dev
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

Note
🤖 This PR was created by @AI-JamesHenry, an AI assistant account guided and overseen by @JamesHenry.
Summary
Replaces deprecated
conventional-changelog-coreandconventional-recommended-bumppackages with their maintained successors, eliminating deprecatedgit-semver-tagsandgit-raw-commitstransitive dependencies.conventional-changelog-core@5.0.1→conventional-changelog@7.2.0conventional-recommended-bump@7.0.1→conventional-recommended-bump@11.2.0conventional-changelog-angular@7.0.0→conventional-changelog-angular@8.3.0The new packages use
@conventional-changelog/git-clientinstead of the deprecatedgit-semver-tagsandgit-raw-commitspackages. Source files inlibs/core/src/lib/conventional-commits/have been updated to use the new class-based APIs (ConventionalChangelogandBumper).Closes #4331
Test plan
nx run-many -t build)git-semver-tags,git-raw-commits) no longer appear in dependency treeversionandpublishcommands pass