Skip to content

root changelog for fixed-mode --conventional-commits #1015

Closed

Description

@rsouthgate

Our monorepo is typically distributed as a whole, though each package can live separately. We operate lerna in fixed mode and the recent changes in 2.1.0 that fix #922 are great. One thing that would help us though is the ability to combine the changelog messaging into a root changelog in addition to the package changelogs currently generated in that mode.

Activity

  1. ZauberNerd commented on Oct 14, 2017

    @ZauberNerd
    Contributor

    I dug into this and there are a couple of complications:

    Right now I can see two ways to make this work:

    1. Let lerna update the version field in the root package.json file if it is configured to run in fixed-mode.
    2. Overwrite the version through a context that can be passed to the conventional-changelog-cli as --context

    If choosing option 2 there are two ways to make this work:

    The actual changes in lerna are quite simple:

    • in src/commands/PublishCommand.js move the ConventionalCommitUtilities.updateFixedChangelog() invocation out of the the forEach loop.
    • In src/ConventionalCommitUtilities.js change the arguments for the changelog cli in updateFixedChangelog to remove --pkg, --commit-path and add --context.

    I think 2-2.b. (overwrite version through custom context inside lerna) would be the best way to go, because option 1 would change the behaviour of lerna quite a lot and option 2.a. would duplicate some code from the conventional-changelog-cli - but would in my opinion also be a viable alternative.

    I could create a PR for any of these changes, but would like some feedback on the proposed solution / other options first.

    What are your thoughts on this @rsouthgate & @evocateur ?

  2. rsouthgate commented on Oct 15, 2017

    @rsouthgate
    Author

    I'm no expert, but it would seem sensible to remain with the cli conventional changelog tool since it's actively maintained. That would lead to 2-2-b being the only sensible option, and as far as I understand - a good one for my use case.

  3. ZauberNerd commented on Oct 16, 2017

    @ZauberNerd
    Contributor

    Another question: When in fixed mode - do we want to have just one single changelog.md in the root or do we want to have a changelog.md for each package and a root changelog.md?

  4. rsouthgate commented on Oct 16, 2017

    @rsouthgate
    Author

    Seems like it could be configurable. For my use case i’d only want the root changelog. And duplicating the same changes in each package would just create more noise, but I can imagine other use cases where packages are bundled and also published individually where both would be required.

  5. added a commit that references this issue on Oct 16, 2017
    07f1063
  6. ZauberNerd commented on Oct 16, 2017

    @ZauberNerd
    Contributor

    @rsouthgate I created this PR: #1078 and I decided to keep the behaviour the same as before and generate one changelog per package and one consolidated changelog in the root.
    I didn't want to complicate the surface of lerna by introducing more options to configure and in your case you could simply put the package changelogs in your .gitignore file.

  7. added a commit that references this issue on Oct 16, 2017
    1172c82
  8. lock commented on Dec 28, 2018

    @lock

    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.

  9. locked as resolved and limited conversation to collaborators on Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions