Skip to content

codexico/changelogkeeper

Repository files navigation

changelogkeeper NPM version Build Status Dependency Status Coverage percentage

Write changelog using keepachangelog conventions

Installation

$ npm install --save-dev changelogkeeper

Usage

Add these scripts to package.json:

// package.json
"scripts": {
  ...
  "commitChangelog": "git add CHANGELOG.md && git commit -m 'Bump changelog'",
  "postversion": "changelogkeeper && npm run commitChangelog",
  ...
}

And then run npm version:

npm version [major | minor | patch | ...]

It will read the package version and update the changelog accordingly.

Options

If you have your changelog in another location you can pass the relative path like this:

// package.json
"postversion": "changelogkeeper '../CHANGELOG.md' && npm run commitChangelog"

Example

Before:

// package.json
{
  ...
  "version": "3.1.4",
  ...
}
// CHANGELOG.md

# Changelog

## [Unreleased]

### Added

- Some new Feature

## [3.1.4] - 2018-02-04

### Fixed

- Fixed something

## [3.1.3] - 2018-02-03

...

Then run:

npm version minor

After:

// package.json
{
  ...
  "version": "3.2.0",
  ...
}
// CHANGELOG.md

# Changelog

## [Unreleased]

## [3.2.0] - 2018-02-04

### Added

- Some new Feature

## [3.1.4] - 2018-02-04

### Fixed

- Fixed something

## [3.1.3] - 2018-02-03

...

Development

Don't forget to run npm link so changelogkeeper can run itself.

License

MIT © Francisco Kahil

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published