Skip to content

Commit 98368bd

Browse files
committed
[skip ci] Add auto-changelog stamping, update contributing.md
1 parent c6c47e3 commit 98368bd

File tree

4 files changed

+296
-12
lines changed

4 files changed

+296
-12
lines changed

.changelog.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,11 @@ module.exports = {
1212
return 'CHANGELOG.md'
1313
},
1414
// ==== Options specific to prepare ====
15-
newUnreleasedText: '### UNRELEASED\n\n',
15+
newUnreleasedText: `# UNRELEASED
16+
17+
## {{subject}}
18+
19+
{{body}}`,
1620
unreleasedTag: () => {
1721
return 'UNRELEASED'
1822
},

CONTRIBUTING.md

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
11
# Contributing
22

3-
- Do *not* version bump package.json unless directed to.
4-
- Make sure you have appropriate unit tests that cover your feature.
5-
- Make sure coverage % is maintained.
6-
- Make sure the `CHANGELOG.md` file is updated.
3+
- Make sure you have appropriate unit tests that cover your feature
4+
- Make sure coverage % is maintained
75

8-
Before you open your PR, run:
6+
# Changelog
97

10-
`npm run changelog:prepare`
8+
If a git commit message looks like this:
119

12-
and edit `CHANGELOG.md`
10+
```text
11+
This is my commit subject
1312
14-
Place information about what your changes are under section
15-
marked `# UNRELEASED`.
13+
This is my commit body
14+
```
15+
16+
Then the changelog will be stamped in the following fashion on merge:
17+
18+
```text
19+
# <version> - <date>
20+
21+
## <git subject>
22+
23+
<git body>
24+
```
1625

1726
# Merging
1827

19-
Once merged, the CI will auto-publish and version bump to npm.
28+
Once merged, the CI will auto-publish to npm and the changelog will be updated
29+
with the subject of your commit.

package-lock.json

Lines changed: 268 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@
1919
"toc": "toc-md README.md README.md",
2020
"add-readme": "git add README.md",
2121
"lint-staged": "lint-staged",
22-
"prepare-publish": "npm run changelog:verify && version-bump && npm run changelog:release",
22+
"prepare-publish": "npm run changelog:prepare && version-bump && npm run changelog:release && npm run changelog:stamp",
2323
"version-bump": "version-bump",
2424
"changelog:help": "changelog-version",
2525
"changelog:verify": "changelog-version verify",
2626
"changelog:prepare": "changelog-version prepare",
27+
"changelog:stamp": "git-commit-stamper parse CHANGELOG.md",
2728
"changelog:release": "changelog-version release",
2829
"lint": "prettier-standard src/**/*.ts && standardx src/**/*.ts",
2930
"ts-node-dev": "ts-node-dev"
@@ -73,6 +74,7 @@
7374
"@typescript-eslint/eslint-plugin": "^2.24.0",
7475
"@typescript-eslint/parser": "^2.24.0",
7576
"eslint": "6.8.0",
77+
"git-commit-stamper": "^1.0.5",
7678
"jest": "25.1.0",
7779
"jest-cli": "25.1.0",
7880
"jest-junit-reporter": "1.1.0",

0 commit comments

Comments
 (0)