This repository has been archived by the owner on Feb 20, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 21
[WIP] conventional-commits-and-changelog #2
Open
jbmoelker
wants to merge
3
commits into
master
Choose a base branch
from
conventional-commits-and-changelog
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 @@ | ||
node_modules/ |
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 @@ | ||
Note: this changelog is automatically populated using `npm run changelog` which is used in `npm version`. |
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,46 @@ | ||
# Contributing | ||
|
||
... | ||
|
||
## Guidelines | ||
|
||
... | ||
|
||
|
||
### Commit message format | ||
|
||
Each commit message must have a *header* and optionally a *body*. The header has a special format that includes a type, a scope and a summary: | ||
|
||
``` | ||
<type>(<scope>): <summary> | ||
<BLANK LINE> | ||
<body> | ||
``` | ||
|
||
Note: you can use `npm run commit`, prompting you to fill out the git commit message step-by-step. | ||
|
||
#### Type | ||
Must be one of the following: | ||
|
||
* **feat**: A new feature | ||
* **fix**: A bug fix | ||
* **docs**: Documentation only changes | ||
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing | ||
semi-colons, etc) | ||
* **refactor**: A code change that neither fixes a bug nor adds a feature | ||
* **test**: Adding missing tests | ||
* **chore**: Changes to the build process or auxiliary tools and libraries such as documentation | ||
generation | ||
|
||
#### Scope | ||
The scope could be anything specifying place of the commit change. The scope is optional. | ||
|
||
In case of a feature or fix to a demo it would typically be the name of the module, e.g. `fix(todo-app):`. | ||
|
||
#### Summary | ||
The summary contains succinct description of the change. Keep it clear, but short. Put the rest in the body. | ||
|
||
#### Body | ||
The body should include the motivation for the change and contrast this with previous behavior. | ||
|
||
Note: the commit message format guidelines are based on [Angular's Git Commit Guidelines](https://github.com/angular/angular.js/blob/master/CONTRIBUTING.md#-git-commit-guidelines). |
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,38 @@ | ||
# Conventional commits and changelog | ||
|
||
## Functionality | ||
|
||
Help commit in a [standard format](CONTRIBUTING.md#commit-message-format) | ||
so the changelog can be updated automatically on every version bump. | ||
|
||
|
||
## Usage | ||
|
||
### Write standard commit messages | ||
|
||
Write your commit messages in [standard format](CONTRIBUTING.md#commit-message-format). | ||
You can do this in a step-by-step wizard by running: | ||
|
||
```bash | ||
npm run commit | ||
``` | ||
|
||
### Bump version with updated changelog | ||
|
||
When you bump the [version](https://docs.npmjs.com/cli/version) of the project, the [changelog](CHANGELOG.md) will be updated automatically. | ||
|
||
```bash | ||
npm version [major | minor | patch] | ||
``` | ||
|
||
### Scripts | ||
|
||
After installing dependencies (run `npm install`) the following scripts are available: | ||
|
||
`npm run ...` | Description | ||
---|--- | ||
`changelog` | Updates `CHANGELOG.md` based on commits. Done automatically via `version`. | ||
`commit` | Prompts you to fill out your git commit message step-by-step. | ||
`version patch` | Bump version with only backwards-compatible bug fixes. | ||
`version minor` | Bump version with new functionality (and bug fixes). | ||
`version major` | Bump version with breaking changes. |
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,24 @@ | ||
{ | ||
"name": "conventional-commits-and-changelog", | ||
"version": "1.0.0", | ||
"description": "", | ||
"scripts": { | ||
"build": "echo 'TODO: CREATE BUILD'", | ||
"test": "echo 'TODO: WRITE TESTS'", | ||
"changelog": "conventional-changelog --preset angular --infile CHANGELOG.md --same-file --output-unreleased", | ||
"commit": "git-cz", | ||
"preversion": "npm run build && npm test", | ||
"version": "npm run changelog && git add .", | ||
"postversion": "git commit -m \"chore(version): v$npm_package_version\n$(conventional-changelog --preset angular)\" && git tag -a v$npm_package_version -m \"$(conventional-changelog --preset angular)\"" | ||
}, | ||
"config": { | ||
"commitizen": { | ||
"path": "cz-conventional-changelog" | ||
} | ||
}, | ||
"devDependencies": { | ||
"commitizen": "2.8.1", | ||
"conventional-changelog-cli": "1.2.0", | ||
"cz-conventional-changelog": "1.1.6" | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should this be expanded?