Changelog Bubbler


build status codecov Latest version on pub.dev



Compares two git refs and gathers changelogs from all dependencies

Overview

The goal of this package is to automate the process of creating a changelog diff for flutter and dart applications. This package is meant to be used to create a master changelog for each release. This package creates one document which contains both the root package changes as well as changes found in every sub-package.

How it Works

This package generates a single CHANGELOG_BUBBLED.md file which contains the changelog diff from this application and every depended on dart application.

This builder works as follows:

  1. Read passed in args (ie.. see args by running dart pub run changelog_bubbler --help)

  2. Copy source Repo into temp folder and check out at specified ref

  3. Gather info of repo in states current and previous

    1. Run pub get
    2. Read pubspec lock
    3. Build dep list based on pubspec lock and pub_cache
    4. Store path to pub_cache in dependency class for later reference
  4. Build list of changed dependencies

    1. Group by Host URL (ie.. pub.dev, git, or hosted refs)
    2. Only gather changed deps
    3. Print:
      1. name 1.0.0 -> 2.0.0
      2. Changelog diff from package
  5. Create a file with the information gathered above

Usage

  1. Add changelog_bubbler to dev_dependencies in pubspec.yaml

    name: example_cli
    dev_dependencies:
      changelog_bubbler: ^1.0.0
    
  2. Run a build

    > dart pub run changelog_bubbler
    
  3. CHANGELOG_BUBBLED.g.md will be generated with content:

Example app

## pub.dev

my_app_core 1.0.0 - 1.1.0

# 1.1.0
- chore: something changed

## pub.dev - Transitive

analyzer 1.0.0 - 2.0.0

\# 2.0.0
- chore: something changed

\# 1.3.0
- chore: something changed

\# 1.1.0
- chore: something changed

See a full example output here: Example App Output

Note If you are using this in Github Actions, you will need to set the fetch-depth of the checkout command to "0" so that tags are fetched

    steps:
      - uses: actions/checkout@v3
        with:
          # Fetch depth 0 so that tags are fetched
          fetch-depth: 0

Advanced

Previous Ref

By default the changelog will be generated based on a diff between the current git state and the previous tag.

To specify your own ref to compare with the current state, pass a flag named previous-ref with your desired git ref.

example:

dart pub run changelog_bubbler --previous-ref 8762db

example:

dart pub run changelog_bubbler --previous-ref v2.0.0

Output File

To change the path of the generated file, pass a flag named output.

example:

dart pub run changelog_bubbler --output MY_COOL_CHANGELOG_NAME.md

Templates

All output is built based on templates found in the Template Folder.

Any of the templates can be overriden by passing a path option.

example:

dart pub run changelog_bubbler --changelog-template-path '/Users/micaiah.skolnick/Repos/alkami/changelog_bubbler/asset_test/changelog_template.html'

Run dart pub run changelog_bubbler --help to see a list of all possible path overrides.

Maintainers

Libraries