https://github.com/garrettmac/conventional-changelog-project
https://github.com/garrettmac/conventional-changelog-project
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/garrettmac/conventional-changelog-project
- Owner: garrettmac
- Created: 2019-04-19T15:29:19.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-19T15:30:12.000Z (about 6 years ago)
- Last Synced: 2024-10-06T01:23:19.888Z (8 months ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# V2
# conventional-changelog-project[](https://conventionalcommits.org)
Commits that follow a standard and descriptive format can be parsed programmitically to learn much about the state of the repository.
Most particularly...
- The next logical **Semantic Version** bump
- **CHANGLOG** (for Humans)(i.e. Releases)
While many commit formats exist and you can invent your own, this project templates (and examplifies) the most popular, **Conventional** format.
https://github.com/conventional-changelog/conventional-changelog
## How It Works
All tooling is provided via `npm` packages.
### Commits are Linted
In order for any of this to be worthwhile and work, commits have to consistently follow the desired, Conventional, format. Therefore, a pre-commit hook linter in order.
`package.json`
```json
{
"devDependencies": {
"@commitlint/cli": "^7.3.2",
"@commitlint/config-conventional": "^7.3.1",
"husky": "^1.3.1"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
}
```
`commitlint.config.js`
```js
module.exports = {extends: ['@commitlint/config-conventional']};
```https://marionebl.github.io/commitlint/#/guides-local-setup
### Commits are Assisted
Writing repetitive, descriptive commits is necessary for honoring the standard, Conventional, format. However, writing (let alone, learning) them *completely manually* is tiresome and *not* necessary.
Instead of using `git commit`, use...
```bash
> npm run cm
````package.json`
```json
{
"scripts": {
"cm": "git-cz"
},
"devDependencies": {
"commitizen": "^3.0.5",
"cz-conventional-changelog": "^2.1.0",
},
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
}
}
```https://github.com/commitizen/cz-cli
### Versioning is Scripted
Once you have a Conventional commit log, you are ready to enjoy auto-generated Changelog and Version bumps.
```bash
> npm run release
``````bash
> git push --follow-tags origin master
```
(`release` only tags commits locally, so they need to bu pushed up after)`package.json`
```json
{
"scripts": {
"release": "standard-version"
},
"devDependencies": {
"standard-version": "^4.4.0"
}
```https://github.com/conventional-changelog/standard-version