Changelog preset is not correctly picked up
See original GitHub issueExpected Behavior
Calling lerna version --conventional-commits --changelog-preset <preset>
should use the given preset.
In my case conventional-changelog-emojis
EDIT: I found the issue, but I am not sure this is an issue with lerna or conventional-changelog-core
. Since both syntax (see “Possible Solution”) seem to be supported when using the conventional-changelog-cli
.
Please just close this, if you want. Sorry for bothering!
Current Behavior
The preset is picked up correctly:
lerna info getChangelogConfig Auto-prefixing conventional-commits preset 'emojis'
But the printed changelog does not use the chosen (or any preset) and prints like this:
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
## 0.1.0 (2019-01-28)
- ✨ Feat 1 ([<sha>](<url>))
- 🛠 Config ([<sha>](<url>))
Using conventional changelog directly works, tough. Running conventional-changelog -p emojis -i CHANGELOG.md -s -r 0
will generate the correct changelog (in the root directory).
Possible Solution
~Digged into get-changelog-config.js
but debugging is kinda hard, because of conventional-changelog
only passing a function. But the transform function of the custom preset is never called.~
Seems like lerna “can not” resolve the “bloody Q.all”.
Basically it is this syntax (e.g. ember preset): https://github.com/conventional-changelog/conventional-changelog/blob/943542f3b2342bb5933d84847fb19b727c607df0/packages/conventional-changelog-ember/index.js#L10-L15
Versus this syntax (angular preset): https://github.com/conventional-changelog/conventional-changelog/blob/943542f3b2342bb5933d84847fb19b727c607df0/packages/conventional-changelog-angular/index.js#L8-L11
The angular preset syntax works with lerna! 🙂
Steps to Reproduce (for bugs)
- Setup monorepo with lerna
- Change a file and add commit \w message “✨ Feat 1”
- Change a file and add commit \w message “🛠 Config”
lerna version --conventional-commits --changelog-preset emojis
lerna.json
{
"version": "0.1.0",
"npmClient": "yarn",
"useWorkspaces": true,
"command": {
"version": {
"conventionalCommits": true,
"changelogPreset": "emojis",
"exact": true,
"message": "🔖 %s"
}
}
}
<!-- Please paste your `lerna.json` here -->
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.10.7 |
npm --version |
6.4.1 |
yarn --version |
1.12.3 |
node --version |
10.13.0 |
OS | Version |
---|---|
NAME | VERSION |
macOS Sierra | 10.14.2 |
Issue Analytics
- State:
- Created 5 years ago
- Reactions:6
- Comments:5 (2 by maintainers)
@hutson Sorry, I didn’t want to offend anyone. When I first digged into the codebase I was confused that it still uses
q
, because the project is so widely used 🙂Thanks!
PS: I honestly was startled when I looked at
conventional-changelog
source and that it still usesq
😔