Skip to content
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

Doesn't list commits inside a changelog due to version mismatches #207

Open
Janiczek opened this issue Nov 26, 2024 · 4 comments
Open

Doesn't list commits inside a changelog due to version mismatches #207

Janiczek opened this issue Nov 26, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@Janiczek
Copy link

Describe the bug

  • The dependency [email protected] creates a CPS-style transform function (never returns, calls cb(null, commit))
  • The dependency [email protected] tries to use it in a non-CPS style (commit = transform(commit, context), resulting in commit being null)
  • The result is that an empty array of commits is given to the CHANGELOG.md generator, and that returns
## [0.0.221](https://github.com/AUTHOR/REPO/compare/v0.0.220...v0.0.221) (2024-11-26)

without any commits listed.

Current behavior
No commits are listed in the generated CHANGELOG.md

Expected behavior
Commits are listed in the generated CHANGELOG.md

Environment

  • commit-and-tag-version version(s): 12.5.0
  • Node/npm version: Node v20.18.1, NPM v10.8.2
  • OS: Ubuntu 22.04.5 LTS (Github Actions runner)

Possible Solution

Hopefully updating conventional-changelog to something new-ish (currently used version is 4.0.0 while the newest version seems to be 6.0.0 according to npmjs.com) would help? I haven't tried this.

Looking at the current master version of conventional-changelog:

  • core still uses CPS in mergeConfig
  • writer has been substantially rewritten and the closest code seems to be here, though it looks like it has the same bug. Maybe I'm missing some promisification happening elsewhere.

Additional context
I'm using commit-and-tag-version from within [email protected]. It lists

    "commit-and-tag-version": "^12",

as a dependency automatically for all TS projects.

@Janiczek Janiczek added the bug Something isn't working label Nov 26, 2024
@Janiczek
Copy link
Author

Just realized that perhaps I don't have the full story here because the transform fn from mergeOptions doesn't even get run. So maybe it's a red herring

@Janiczek
Copy link
Author

The way for me to make commit-and-tag-version work properly was to patch-package this code out:

Screenshot 2024-11-26 at 15 50 15

as I haven't found a way to set transform: null or something similar in the writerOpts that would work in the same way.

@TimothyJones
Copy link
Member

Is that a patch for conventional-changelog-core ? It's not super clear to me, but it doesn't look like code from this repository.

I'm keen to get the core updated - but it needs a migration to ESM, so it's not a small amount of work.

@Janiczek
Copy link
Author

Janiczek commented Dec 2, 2024

The highlighted code is from conventional-changelog-writer 6.0.1, to be specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants