-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Generate root changelog in fixed mode #1078
Conversation
When using lerna in fixed mode it would be desireable to have lerna generate a consolidated changelog.md file in the root directory that contains changes for all packages. This commit adds said feature, so that, when executing `lerna publish --conventional-commits` it will generate one changelog per package and also one consolidated changelog in the root of the repository. The changelog generation in independent mode stays the same (it generates one changelog per package). Fixes: lerna#1015
fc92b83
to
e7c880a
Compare
e7c880a
to
bc27b64
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ZauberNerd!
const args = [ | ||
CHANGELOG_CLI, | ||
"-p", "angular", | ||
"--context", path.resolve(__dirname, "..", "lib", "ConventionalChangelogContext.js"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hah, awesome!
@@ -590,6 +590,21 @@ export default class PublishCommand extends Command { | |||
changedFiles.push(packageJsonLocation); | |||
}); | |||
|
|||
if (this.options.conventionalCommits) { | |||
if (!this.repository.isIndependent()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I probably would have combined this into one compound conditional (this.options.conventionalCommits && !this.repository.isIndependent()
), but I am okay with this.
// TODO: make interesting git history for meaningful snapshots | ||
test.skip("--conventional-commits", async () => { | ||
const cwd = await initFixture("PublishCommand/independent"); | ||
// TODO: stabilize timestamp and commit sha of changelog output |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the additions here, I hope we can stop skipping these tests soon...
* master: Generate root changelog in fixed mode (lerna#1078) Republish prereleased packages during subsequent non-prerelease publish (lerna#1077) fix: fail when --hoist and --yarn are used together (lerna#1063) Improve "import" edgecases + (i18n fixes + git tweaks) (lerna#1059) Warn about two or more packages having the same npm package.json name (lerna#1081)
This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
The integration of conventional-changelog into lerna (via the
--conventional-commits
flag) currently generates oneCHANGELOG.md
file per package.This is fine as long as lerna is configured in "independent mode", but when using lerna in "fixed mode" it might be desirable to additionally generate a consolidated
CHANGELOG.md
in the root directory of the repository.This "root changelog" contains changes for all packages, while the per package changelogs only list changes affecting their package.
Motivation and Context
Based on the discussion in #1015
How Has This Been Tested?
Types of changes
Checklist: