From 380c89213a2af0e8a7c864f6343daf76820f51a2 Mon Sep 17 00:00:00 2001 From: Carlos Rodrigues Date: Fri, 29 May 2020 16:58:11 +0100 Subject: [PATCH 1/4] chore: add changelog generation and verifyCommit --- .github/commit-convention.md | 91 +++++ CHANGELOG.md | 349 +++++------------ package.json | 10 +- scripts/verifyCommit.js | 28 ++ yarn.lock | 724 ++++++++++++++++++++++++++++++++--- 5 files changed, 887 insertions(+), 315 deletions(-) create mode 100644 .github/commit-convention.md create mode 100644 scripts/verifyCommit.js diff --git a/.github/commit-convention.md b/.github/commit-convention.md new file mode 100644 index 000000000..920a4f3d4 --- /dev/null +++ b/.github/commit-convention.md @@ -0,0 +1,91 @@ +## Git Commit Message Convention + +> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). + +#### TL;DR: + +Messages must be matched by the following regex: + +```js +/^(revert: )?(feat|fix|docs|dx|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,50}/; +``` + +#### Examples + +Appears under "Features" header, `usePromise` subheader: + +``` +feat(usePromise): add 'throwException' option +``` + +Appears under "Bug Fixes" header, `useWorker` subheader, with a link to issue #28: + +``` +fix(useWorker): handle worker case + +close #28 +``` + +Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation: + +``` +perf(useRetry): improve retry by removing 'foo' option + +BREAKING CHANGE: The 'foo' option has been removed. +``` + +The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header. + +``` +revert: feat(usePromise): add 'throwException' option + +This reverts commit 667ecc1654a317a13331b17617d973392f415f02. +``` + +### Full Message Format + +A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: + +``` +(): + + + +