-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: add conventional commit, update release-it config
- Loading branch information
Showing
7 changed files
with
1,075 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,22 @@ | ||
{ | ||
"git": { | ||
"changelog": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs", | ||
"tagName": "v${version}" | ||
}, | ||
"github": { | ||
"release": true, | ||
"releaseName": "${version}", | ||
"releaseNotes": "npx auto-changelog --stdout --commit-limit false -u --template https://raw.githubusercontent.com/release-it/release-it/master/templates/changelog-compact.hbs" | ||
"releaseName": "${version}" | ||
}, | ||
"npm": { | ||
"publish": true, | ||
"skipChecks": true | ||
}, | ||
"hooks": { | ||
"before:init": "yarn test", | ||
"after:bump": "npx auto-changelog --commit-limit false -p && yarn build" | ||
"before:init": "yarn test" | ||
}, | ||
"plugins": { | ||
"@release-it/conventional-changelog": { | ||
"preset": "angular", | ||
"infile": "CHANGELOG.md" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# Commit Messages Format | ||
|
||
This project uses the (conventional commit specification)[https://www.conventionalcommits.org/en/v1.0.0/#specification] for consistent commit messages. | ||
|
||
All commit messages should have the following form: | ||
|
||
```` | ||
<type>: <description> | ||
```` | ||
|
||
## Fix | ||
|
||
A fix (PATCH in semantic versioning) looks like this: | ||
|
||
```` | ||
fix: correct minor typos in code | ||
```` | ||
|
||
## Feature | ||
|
||
A new feature (MINOR in semantic versioning) looks like this: | ||
|
||
```` | ||
feat: add catalan language | ||
```` | ||
|
||
## Breaking Change | ||
|
||
Breaking changes can be indicated by either appending a "!" to the type: | ||
|
||
```` | ||
refactor!: drop support for Node 6 | ||
```` | ||
|
||
Or adding "BREAKING CHANGE" to the commit message body text: | ||
|
||
```` | ||
refactor!: drop support for Node 6 | ||
BREAKING CHANGE: refactor to use JavaScript features not available in Node 6. | ||
```` | ||
|
||
## Available Types | ||
|
||
In addition to "fix" and "feat" the following types are allowed: | ||
build:, chore:, ci:, docs:, style:, refactor:, perf:, test: | ||
|
||
|
||
|
||
Install commitlint: | ||
|
||
```` | ||
npm install --save-dev @commitlint/{config-conventional,cli} | ||
```` | ||
|
||
or via yarn: | ||
|
||
```` | ||
yarn add @commitlint/{config-conventional,cli} | ||
```` | ||
|
||
Create a commitlint.config.js file: | ||
|
||
```` | ||
echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js | ||
```` | ||
|
||
Add husky to package.json: | ||
|
||
```` | ||
{ | ||
"husky": { | ||
"hooks": { | ||
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS" | ||
} | ||
} | ||
} | ||
```` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
module.exports = {extends: ['@commitlint/config-conventional']} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.