CHANGELOGS not generated correctly when using "--conventional-graduate"
See original GitHub issueExpected Behavior
When versioning and publishing a prerelease version we do not want to generate the CHANGELOGS. This is done successfully with the “–no-changelog” for DTA environments.
But when we do “–conventional-graduate” for the production release to remove the “preid”, we want to generate a CHANGELOG for the production version. This is what we expect in the CHANGELOG for production.
## [0.0.7](git-tags) (2019-09-02)
### Bug Fixes
- commit 1
- commit 2
Current Behavior
This is what we are currently seeing in the CHANGELOG for production.
## [0.0.7](git-tags) (2019-09-02)
**Note:** Version bump only for package @package
Possible Solution
It probably has something to do with the git-tags for the prerelease versions that are already “released” with their changes. That is why the production publish does not see the changes anymore.
Steps to Reproduce (for bugs)
For prerelease:
lerna version --conventional-prerelease --no-changelog
lerna publish
Then for production:
lerna version --conventional-graduate
lerna publish
lerna.json
{
"packages": ["packages/*"],
"version": "independent",
"command": {
"publish": {
"conventionalCommits": true,
"ignoreChanges": ["**/*.md"],
"yes": true
},
"version": {
"conventionalCommits": true,
"ignoreChanges": ["**/*.md"]
}
},
}
Context
Your Environment
Executable | Version |
---|---|
lerna --version |
3.16.4 |
npm --version |
10 |
node --version |
6 |
Issue Analytics
- State:
- Created 4 years ago
- Reactions:9
- Comments:6
Top Results From Across the Web
@lerna/version - npm
When using conventional-commits , do not generate any CHANGELOG.md files. NOTE: When using this option, you cannot pass --create-release . --no- ...
Read more >Monorepo using Lerna, Conventional commits, and Github ...
We will create a monorepo that will contain two projects (packages). After making changes to any of the projects we will commit them...
Read more >JS monorepos in prod 3: commit enforcement and changelog ...
We need to enforce good practices and not let invalid commits be created and pushed. commitlint validates messages based on Conventional Commits ...
Read more >lerna conventional versioning with github actions
1-beta.0 while main is 1.0.1). There's also difference in the CHANGELOG.md content when graduating a beta version. This behavior ...
Read more >@lerna/publish | Yarn - Package Manager
Now: lerna publish when there are no updates is a no-op, exiting successfully with a helpful log message; lerna updated when there are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hey @thuringia, I tried with the commit messages
fix
andfeat
. Both of them will not generate CHANGELOGs when performinglerna version --conventional-graduate
on production.We have found a fix for this. Not sure if this is a preferred way, but it is currently working for us:
Prereleases:
lerna version --conventional-prerelease --preid dev --no-changelog
git tag -d $(git describe --abbrev=0)
(This will remove the git tags from the commit so that lerna does not think it is released already)git push
lerna publish from-package
Production:
lerna version --conventional-graduate
lerna publish from-git
I found that for 4.0.0,
--no-git-tag-version
skips all git interactions. No tag, no commit, no push. (--no-push
appears superfluous and--push
doesn’t change anything about the behavior.)Using it prevents use of
lerna publish from-git
with the message:One has to add steps to make a commit and then
lerna publish from-package
or it fails with the message:(This is in the above build script, but now it’s in plain text.)