Skip to content

Commit defcbef

Browse files
authored
Integrate Lerna changelog (#26)
* Integrate Lerna changelog
1 parent 9d70088 commit defcbef

File tree

6 files changed

+209
-17
lines changed

6 files changed

+209
-17
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# misc
1313
.DS_Store
14+
.changelog
1415
npm-debug.log*
1516
lerna-debug.log*
1617
/**/*.tgz

README.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,56 @@ If you create a feature request, use the dedicated **Feature request** issue tem
5656

5757
If you have a bug to report, reproduce it in an online code editor. For example, use [CodeSandbox](https://codesandbox.io/). Attach the link to the reproduced bug to your issue. Log the bug using the **Bug report** template.
5858

59+
## Releasing
60+
61+
Follow these steps to create a changelog for the new release.
62+
63+
1. Generate the changelog using the [`lerna-changelog`](https://github.com/lerna/lerna-changelog) tool. Run the following command to generate the changelog content for PRs merged after creating the last Git tag:
64+
65+
```
66+
npm run changelog
67+
```
68+
69+
You can also generate the changelog content corresponding to PRs merged in-between particular Git tags:
70+
71+
```
72+
npm run changelog -- --from=v0.1.1 --to=v0.1.2
73+
```
74+
75+
The `lerna-changelog` tool detects changes based on PR labels and maps them to sections as per the configuration in the `package.json` file.
76+
77+
```
78+
"changelog": {
79+
"labels": {
80+
"breaking": ":boom: Breaking Changes",
81+
"enhancement": ":rocket: Enhancements",
82+
"bug": ":bug: Fixed",
83+
"area/library": ":zap: Library",
84+
"area/playground": ":video_game: Playground app",
85+
"area/documentation": ":memo: Documentation"
86+
}
87+
...
88+
}
89+
```
90+
91+
2. The generated code should look as follows:
92+
```
93+
## Unreleased (2018-12-13)
94+
95+
#### :bug: Fixed
96+
* [#24](https://github.com/asyncapi/asyncapi-react/pull/24) Downgrade required peer dependency version ([@pkosiec](https://github.com/pkosiec))
97+
98+
#### :zap: Library
99+
* [#24](https://github.com/asyncapi/asyncapi-react/pull/24) Downgrade required peer dependency version ([@pkosiec](https://github.com/pkosiec))
100+
101+
#### Committers: 1
102+
- Paweł Kosiec ([@pkosiec](https://github.com/pkosiec))
103+
```
104+
105+
3. Go to GitHub to [create a new release](https://github.com/asyncapi/asyncapi-react/releases) and paste the generated code as a description. Do not include the **Committers** section.
106+
107+
Make sure you change `## Unreleased ({date})` or `## {tag} ({date})` to `## Released ({date})`.
108+
59109
## Credits
60110
61111
<p align="center">

lerna.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@
77
}
88
},
99
"changelog": {
10+
"repo": "asyncapi/asyncapi-react",
1011
"labels": {
1112
"breaking": ":boom: Breaking Changes",
1213
"enhancement": ":rocket: Enhancements",
13-
"bug": ":bug: Bug Fixes",
14-
"documentation": ":memo: Documentation"
15-
}
14+
"bug": ":bug: Fixed",
15+
"area/library": ":zap: Library",
16+
"area/playground": ":video_game: Playground app",
17+
"area/documentation": ":memo: Documentation"
18+
},
19+
"cacheDir": ".changelog"
1620
},
1721
"lerna": "2.11.0"
18-
}
22+
}

library/package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"scripts": {
1515
"bootstrap": "lerna bootstrap",
16+
"changelog": "lerna-changelog",
1617
"clean": "lerna clean",
1718
"start": "lerna exec --parallel -- npm run start",
1819
"test": "lerna exec -- npm run test",

0 commit comments

Comments
 (0)