Skip to content

changelogPreset no longer working as expected #4021

@achille1789

Description

@achille1789

Current Behavior

After updating "conventional-changelog-conventionalcommits" package to latest version 8.0.0 (but probably this issue happens with other conventional-changelog pkgs), Lerna is not updating the changelog as before. With "conventional-changelog-conventionalcommits" version 7.0.2 everything works as expected.
There are at least 2 issues:

  1. v8.0.0 of all conventional-changelog pkgs are now supporting ESM instead of CommonJS. Using "require" to import the conventional-changelog pkg in the config file leads Lerna to exit with error. This can be bypassed changing how the pkg is imported in the config.js file
  2. the structure of the returned config object has been changed and some properties are now missing or renamed. This leads Lerna to not update the changelog file as usual

Expected Behavior

Lerna should update changelog file as before.

Steps to Reproduce

conventional-changelog-conventionalcommits as been update with some breaking changes that maybe Lerna is not able to handle.

My changelog-preset.config.js content:

module.exports = import( 'conventional-changelog-conventionalcommits')
    .then( pkg => pkg.default({
        issuePrefixes: ['TEST-'],
        issueUrlFormat: 'https://myBugTracker.com/{{prefix}}{{id}}'
    }));

This way to export the config, allows Lerna to bump the version and update the changelog using both versions of "conventional-changelog-conventionalcommits", otherwise with v8.0.0 using "require" Lerna exits with error.
Anyway, the changelog it is not updated as it should: links are missing and other differences, see below versions:

Changelog updated with v8.0.0

# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## <small>1.50.1 (2024-06-07)</small>

* fix: test lerna (TEST-123) ([139d881](https://github.com/xxxxx/commit/139d881))
* chore: bump dev.version ([111a521](https://github.com/xxxxx/commit/111a521))

Changelog updated with v7.0.2

# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

## [1.50.1](https://github.com/my-repo/xxxxx/compare/xxxxx@1.50.0...xxxxx@1.50.1) (2024-06-07)


### Bug Fixes

* test lerna (TEST-123) ([139d881](https://github.com/xxxxx/commit/139d881e309a6f3b172493beb3c480abcda5dc9d)), closes [TEST-123](https://myBugTracker.com/TEST-123)

As on the above examples, using v8.0.0:

  • the title has now <small> tag
  • the title has not link for GH
  • there is no "Bug Fixes" subtitle
  • the fix commit has not the "closes" part

This issue may not be prioritized if details are not provided to help us reproduce the issue.

Failure Logs / Configuration

lerna.json

{
  "$schema": "node_modules/lerna/schemas/lerna-schema.json",
  "version": "independent",
  "command": {
    "version": {
      "allowBranch": ["main"],
      "message": "chore(release): [ci skip] version bump",
      "conventionalCommits": true,
      "private": false
    }
  },
  "yes": true,
  "changelogPreset": "./changelog-preset.config.js",
  "ignoreChanges": [
    "**/unit/**",
    "**/*.version"
  ]
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Environment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions