Skip to content

add support for conventional-changelog format commit messages #662

Closed

Description

@bcoe

I've become a convert to this whole monorepo thing. I see it as a great tool for simplifying the development, and perhaps more importantly, the management of two of the ecosystems I maintain (conventional-changelog was recently ported over to lerna, and we're in the process of moving over Istanbul).

.... my problem.

Problem Statement

I've become fairly dependent on conventional-commit-messages, I adhere to a few simple rules when squashing commits:

  • prefix with fix: for patches.
  • prefix with feat: for new features.
  • add BREAKING CHANGE: on a newline to describe a breaking API change.

By doing this I'm able to:

When running lerna in independent mode, I lose this valued functionality.

Proposal

I've been hard at work adding support to conventional-changelog for a lerna-style-git-history:

conventional-changelog/conventional-changelog#168

I would like to add an additional flag for publishing in independent mode (--conventional-commits?) when running in this mode, two things would happen:

  1. we would not prompt the user for version increments, we'd detect this based on the commit history (instead having a confirm step).
  2. we would auto-generate the CHANGELOG in each ./pacakge/:name.

I think adding this functionality would be pretty straightforward, and could be facilitated by pulling in a couple of the conventional-changelog core libraries, and augmenting the functionality of PublishCommand.js.


thoughts, comments, concerns (CC: @hzoo, @evocateur).

Activity

  1. evocateur commented on Mar 10, 2017

    @evocateur
    Member

    I am generally in favor of this (also p excited that you're getting excited about lerna :D). As I mentioned in #643, this feels like a plugin system, but I am not opposed to a more focused solution to avoid larger, more complicated refactoring.

    --conventional-commits seems like a reasonable flag. It would also be configurable in lerna.json as "conventionalCommits": true, either at the root or command.publish namespace.

  2. bcoe commented on Mar 12, 2017

    @bcoe
    ContributorAuthor

    @evocateur lifecycle scripts and/or a plugin system does feel like it would be a pretty awesome eventual feature.

    It felt to me that using conventional commit messages is a common enough practice, and that it improves the independent workflow enough, that it would be worth implementing the approach outlined in #665 -- it also turns out that it doesn't take too much code to wire things together 😄

  3. hzoo commented on Mar 15, 2017

    @hzoo
    Contributor

    Curious how this will interop/relate to https://github.com/lerna/lerna-changelog, I guess unrelated then since this assumes the commit message format?

  4. evocateur commented on Mar 15, 2017

    @evocateur
    Member

    We could certainly open up more customization to the --conventional-commits args (not everyone uses the angular style?), but I don't see it necessarily conflicting with lerna-changelog.

    In fact, I'm kind of interested in seeing how this could be "dogfooded" on an eventual lerna-as-lerna-monorepo ( #174, aka "yo dawg, i heard you liked lerna...").

    For one thing, it's nice (for unfortunate folks like me who will forever yearn for their company's code to be rescued from Bitbucketian horrors) that conventional-changelog doesn't depend explicitly on GitHub metadata to operate.

  5. bcoe commented on Mar 15, 2017

    @bcoe
    ContributorAuthor

    @hzoo I think they probably pair nicely, and could eventually be combined? It seems to me that:

    • if you're running in independent mode, it's pretty nice to have a per-module CHANGELOG.md (makes it easier to pull in legacy projects for starters); Also, it can be tedious bumping each version manually so using a convention is nice.
    • it seems like an approach like lerna-changelog works better for fixed/locked mode -- where I think it potentially makes more sense to report changes in a single top level document?

    It seems like the angular conventional-commit format (which is used by semantic-release by default, and standard-version) is getting pretty healthy adoption, is probably worth parsing for both use-cases?

    tldr; I don't think there's any conflict 👍

  6. evocateur commented on Mar 15, 2017

    @evocateur
    Member

    @bcoe oh hey, forgot to mention:

    $ npm dist-tag ls lerna
    canary: 2.0.0-beta.38-18-g5043ad2
    latest: 2.0.0-beta.38
  7. traviskaufman commented on Mar 23, 2017

    @traviskaufman
    Contributor

    Been waiting for something like this to land 🙌 I'm hoping it can replace a lot of the infra we built manually to do this ourselves. Thanks @bcoe and @evocateur!

  8. bcoe commented on Mar 24, 2017

    @bcoe
    ContributorAuthor

    @traviskaufman awesome, please don't hesitate to flag me in issues on lerna as you test stuff out; I'm excited to make this feature kick butt.

  9. myfairsyer commented on May 25, 2017

    @myfairsyer

    How is atlassian/cz-lerna-changelog (not) related and/or relevant to this?

  10. 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.

  11. 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