1 | lerna-changelog
|
2 | ==============================================================================
|
3 |
|
4 | [![TravisCI Build Status][travis-badge]][travis-badge-url]
|
5 | [![Latest NPM release][npm-badge]][npm-badge-url]
|
6 |
|
7 | [npm-badge]: https://img.shields.io/npm/v/lerna-changelog.svg
|
8 | [npm-badge-url]: https://www.npmjs.com/package/lerna-changelog
|
9 | [travis-badge]: https://img.shields.io/travis/lerna/lerna-changelog/master.svg
|
10 | [travis-badge-url]: https://travis-ci.org/lerna/lerna-changelog
|
11 |
|
12 | PR-based changelog generator with monorepo support
|
13 |
|
14 |
|
15 | Usage
|
16 | ------------------------------------------------------------------------------
|
17 |
|
18 | ```bash
|
19 | npx lerna-changelog
|
20 | ```
|
21 |
|
22 | ```md
|
23 | ## Unreleased (2018-05-24)
|
24 |
|
25 | #### :bug: Bug Fix
|
26 | * [#198](https://github.com/my-org/my-repo/pull/198) Avoid an infinite loop ([@helpful-hacker](https://github.com/helpful-hacker))
|
27 |
|
28 | #### :house: Internal
|
29 | * [#183](https://github.com/my-org/my-repo/pull/183) Standardize error messages ([@careful-coder](https://github.com/careful-coder))
|
30 |
|
31 | #### Commiters: 2
|
32 | - Helpful Hacker ([@helpful-hacker](https://github.com/helpful-hacker))
|
33 | - [@careful-coder](https://github.com/careful-coder)
|
34 | ```
|
35 |
|
36 | By default `lerna-changelog` will show all pull requests that have been merged
|
37 | since the latest tagged commit in the repository. That is however only true for
|
38 | pull requests with certain labels applied. The labels that are supported by
|
39 | default are:
|
40 |
|
41 | - `breaking` (:boom: Breaking Change)
|
42 | - `enhancement` (:rocket: Enhancement)
|
43 | - `bug` (:bug: Bug Fix)
|
44 | - `documentation` (:memo: Documentation)
|
45 | - `internal` (:house: Internal)
|
46 |
|
47 | You can also use the `--from` and `--to` options to view a different
|
48 | range of pull requests:
|
49 |
|
50 | ```bash
|
51 | npx lerna-changelog --from=v1.0.0 --to=v2.0.0
|
52 | ```
|
53 |
|
54 | ### Monorepo support
|
55 |
|
56 | If you have a packages folder and your projects in subfolders of that folder `lerna-changelog` will detect it and include the package names in the changelog for the relevant changes.
|
57 |
|
58 | ### GitHub Token
|
59 |
|
60 | Since `lerna-changelog` interacts with the GitHub API you may run into rate
|
61 | limiting issues which can be resolved by supplying a "personal access token":
|
62 |
|
63 | ```
|
64 | export GITHUB_AUTH="..."
|
65 | ```
|
66 |
|
67 | You'll need a [personal access token](https://github.com/settings/tokens)
|
68 | for the GitHub API with the `repo` scope for private repositories or just
|
69 | `public_repo` scope for public repositories.
|
70 |
|
71 |
|
72 | Configuration
|
73 | ------------------------------------------------------------------------------
|
74 |
|
75 | You can configure `lerna-changelog` in various ways. The easiest way is by
|
76 | adding a `changelog` key to the `package.json` file of your project:
|
77 |
|
78 | ```json5
|
79 | {
|
80 | // ...
|
81 | "changelog": {
|
82 | "labels": {
|
83 | "feature": "New Feature",
|
84 | "bug": "Bug Fix"
|
85 | }
|
86 | }
|
87 | }
|
88 | ```
|
89 |
|
90 | The supported options are:
|
91 |
|
92 | - `repo`: Your "org/repo" on GitHub
|
93 | (automatically inferred from the `package.json` file)
|
94 |
|
95 | - `nextVersion`: Title for unreleased commits
|
96 | (e.g. `Unreleased`)
|
97 |
|
98 | - `labels`: GitHub PR labels mapped to changelog section headers
|
99 |
|
100 | - `ignoreCommitters`: List of committers to ignore (exact or partial match).
|
101 | Useful for example to ignore commits from bots.
|
102 |
|
103 | - `cacheDir`: Path to a GitHub API response cache to avoid throttling
|
104 | (e.g. `.changelog`)
|
105 |
|
106 |
|
107 | License
|
108 | ------------------------------------------------------------------------------
|
109 |
|
110 | `lerna-changelog` is released under the [MIT License](LICENSE).
|