fix(core): replace deprecated conventional-changelog dependencies by AI-JamesHenry · Pull Request #4332 · lerna/lerna · GitHub
Skip to content

fix(core): replace deprecated conventional-changelog dependencies#4332

Open
AI-JamesHenry wants to merge 26 commits into
lerna:mainfrom
AI-JamesHenry-Org:fix/deprecated-deps-v2
Open

fix(core): replace deprecated conventional-changelog dependencies#4332
AI-JamesHenry wants to merge 26 commits into
lerna:mainfrom
AI-JamesHenry-Org:fix/deprecated-deps-v2

Conversation

@AI-JamesHenry

Copy link
Copy Markdown
Collaborator

Note

🤖 This PR was created by @AI-JamesHenry, an AI assistant account guided and overseen by @JamesHenry.

Summary

Replaces deprecated conventional-changelog-core and conventional-recommended-bump packages with their maintained successors, eliminating deprecated git-semver-tags and git-raw-commits transitive dependencies.

  • conventional-changelog-core@5.0.1conventional-changelog@7.2.0
  • conventional-recommended-bump@7.0.1conventional-recommended-bump@11.2.0
  • conventional-changelog-angular@7.0.0conventional-changelog-angular@8.3.0

The new packages use @conventional-changelog/git-client instead of the deprecated git-semver-tags and git-raw-commits packages. Source files in libs/core/src/lib/conventional-commits/ have been updated to use the new class-based APIs (ConventionalChangelog and Bumper).

Closes #4331

Test plan

  • Build passes (nx run-many -t build)
  • Lint passes with zero new errors
  • Format check passes
  • Deprecated packages (git-semver-tags, git-raw-commits) no longer appear in dependency tree
  • CI passes
  • E2E tests for version and publish commands pass

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
@nx-cloud

nx-cloud Bot commented Mar 16, 2026

Copy link
Copy Markdown

- 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.
nx-cloud[bot]

This comment was marked as outdated.

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.
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

- 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.
nx-cloud[bot]

This comment was marked as outdated.

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.
nx-cloud[bot]

This comment was marked as outdated.

- 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.
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@AI-JamesHenry AI-JamesHenry marked this pull request as ready for review March 16, 2026 16:30
@AI-JamesHenry AI-JamesHenry marked this pull request as draft March 16, 2026 16:33
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).
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

@AI-JamesHenry AI-JamesHenry marked this pull request as ready for review March 17, 2026 08:25
@AI-JamesHenry AI-JamesHenry marked this pull request as draft March 17, 2026 08:26
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.
nx-cloud[bot]

This comment was marked as outdated.

nx-cloud[bot]

This comment was marked as outdated.

- 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
nx-cloud[bot]

This comment was marked as outdated.

@AI-JamesHenry AI-JamesHenry marked this pull request as ready for review March 18, 2026 10:50
AI-JamesHenry and others added 3 commits March 18, 2026 17:04
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>

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@nx-cloud nx-cloud Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lerna@v9.0.7 : packages deprecated warnings

1 participant