storybooks/pr-log

Name: pr-log

Owner: Storybook

Description: :page_facing_up: Changelog generator based on GitHub Pull Requests

Forked from: lo1tuma/pr-log

Created: 2017-05-20 13:51:07.0

Updated: 2018-01-30 01:03:01.0

Pushed: 2018-04-20 18:28:38.0

Homepage:

Size: 127

Language: JavaScript

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Greenkeeper badge NPM Version Build Status Coverage Status Dependencies


pr-log

Changelog generator based on GitHub Pull Requests

The main features:

Install

Simply run this to install pr-log:

install pr-log
Setup and configuration

You have to follow these steps to use pr-log without problems.

GitHub

The default categories for the changelog are set in lib/validLabels.js. The following categories are predefined (<label name>: <human friendly name>):

 'Bug Fixes',
ade: 'Dependency Upgrades',
mentation: 'Documentation',
ure: 'Features',
ncement: 'Enhancements',
d: 'Build-Related',
king: 'Breaking Changes'

However, you can also create a custom mapping by adding a pr-log.validLabels section to your package.json. For example:

.
r-log": {
  "validLabels": {
      "core": "Core features",
      "addon": "Addons"
  }

.

To use pr-log your GitHub project needs some small configuration:

Project

As pr-log reads repository information from your project you have to add the repository information in your package.json

ository": {
"type": "git",
"url": "https://github.com/<your username>/<your repository name>.git"

Usage

To create or update your changelog run

ple:

n the following setup:

 GitHub a tag named `2.4.7` exists that is behind `master`
pull request (#13) was created since the last tag that has the label `breaking`
pull request (#22) was created since the last tag that has the label `documentation`

log 2.4.7` creates a changelog with the following example content:
2.4.7 (January 20, 2015)
Breaking Changes
Documentation
Options
–sloppy

The --sloppy option defaults to false. When set, it allows pr-log to generate a changelog even when you are not on the master branch. This should not be used in production!

Correct usage makes a clean and complete changelog

If you want your changelog to be complete and clean you have to follow these rules:

  1. Don't commit directly to master - if you do, your changes will not be covered in the changelog (this might be ok but you should know this implication)
  2. Use pull requests for your features that you want to be in your changelog
  3. Use the correct categories for your pull request: If you introduce a new feature that will be a breaking change, give it the according label breaking (which will later result in this feature being listed under the Breaking Changes point in your changelog)
Advanced reading: Reason for this project

Many projects have problems with their changelogs. Most of them try one of the following ways

Other challenges for good changelogs:

This project was initially started to solve these problems for mongobird.

More complete example CHANGELOG.md

After working for some time with the tool and having e.g. two releases, the file content could look like this:

.4.7 (January 20, 2015)

Breaking Changes

e new (backwards incompatible) version of module XYZ (#13)

Documentation

x some spelling mistakes in documentation. (#22)

.1.0 (November 3, 2014)

Feature

d fancy feature (#2)

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.