forked from conventional-changelog/conventional-changelog
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use smaller modules including git-raw-commits, conventional-commits-parser and conventional-commits-writer. It has better API and better project structures. BREAKING CHANGE: This module is rewritten so API is changed and it is not backward compatible. Please check conventional-commits-parser and conventional-commits-writer for more information.
- Loading branch information
Showing
38 changed files
with
1,009 additions
and
767 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,2 +1,3 @@ | ||
/node_modules/ | ||
npm-debug.log | ||
tmp |
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,85 @@ | ||
#!/usr/bin/env node | ||
'use strict'; | ||
var conventionalChangelog = require('./'); | ||
var fs = require('fs'); | ||
var meow = require('meow'); | ||
|
||
var cli = meow({ | ||
help: [ | ||
'Usage', | ||
' conventional-changelog [<path>]', | ||
' cat <path> | conventional-changelog', | ||
'', | ||
'Example', | ||
' conventional-changelog CHANGELOG.md > CHANGELOG.md', | ||
' cat CHANGELOG.md | conventional-changelog', | ||
'', | ||
'Options', | ||
' -o, --options A filepath of a javascript that is used to define options', | ||
' -t, --context A filepath of a javascript that is used to define template variables', | ||
' --gitRawCommitsOpts A filepath of a javascript that is used to define git-raw-commits options', | ||
' --parserOpts A filepath of a javascript that is used to define conventional-commits-parser options', | ||
' --writerOpts A filepath of a javascript that is used to define conventional-commits-writer options', | ||
].join('\n') | ||
}, { | ||
alias: { | ||
o: 'options', | ||
c: 'context' | ||
} | ||
}); | ||
|
||
var path = cli.input[0]; | ||
var flags = cli.flags; | ||
var options; | ||
var templateContext; | ||
var gitRawCommitsOpts; | ||
var parserOpts; | ||
var writerOpts; | ||
|
||
try { | ||
if (flags.options) { | ||
options = require(flags.options); | ||
} | ||
|
||
if (flags.context) { | ||
templateContext = require(flags.context); | ||
} | ||
|
||
if (flags.gitRawCommitsOpts) { | ||
gitRawCommitsOpts = require(flags.gitRawCommitsOpts); | ||
} | ||
|
||
if (flags.parserOpts) { | ||
parserOpts = require(flags.parserOpts); | ||
} | ||
|
||
if (flags.writerOpts) { | ||
writerOpts = require(flags.writerOpts); | ||
} | ||
} catch (err) { | ||
console.error('Failed to get file. ' + err); | ||
process.exit(1); | ||
} | ||
|
||
var stream = conventionalChangelog(options, templateContext, gitRawCommitsOpts, parserOpts, writerOpts); | ||
|
||
if (path) { | ||
if (options && options.append) { | ||
fs.createReadStream(path) | ||
.on('end', function() { | ||
stream | ||
.pipe(process.stdout); | ||
}) | ||
.pipe(process.stdout); | ||
} else { | ||
stream | ||
.on('end', function() { | ||
fs.createReadStream(path) | ||
.pipe(process.stdout); | ||
}) | ||
.pipe(process.stdout); | ||
} | ||
} else { | ||
stream | ||
.pipe(process.stdout); | ||
} |
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,24 @@ | ||
## Git Commit Messages | ||
|
||
* Use the present tense ("Add feature" not "Added feature") | ||
* Use the imperative mood ("Move cursor to..." not "Moves cursor to...") | ||
* Limit the first line to 72 characters or less | ||
* Reference issues and pull requests liberally | ||
* Consider starting the commit message with an applicable emoji: | ||
* :art: `:art:` when improving the format/structure of the code | ||
* :racehorse: `:racehorse:` when improving performance | ||
* :non-potable_water: `:non-potable_water:` when plugging memory leaks | ||
* :memo: `:memo:` when writing docs | ||
* :penguin: `:penguin:` when fixing something on Linux | ||
* :apple: `:apple:` when fixing something on Mac OS | ||
* :checkered_flag: `:checkered_flag:` when fixing something on Windows | ||
* :bug: `:bug:` when fixing a bug | ||
* :fire: `:fire:` when removing code or files | ||
* :green_heart: `:green_heart:` when fixing the CI build | ||
* :white_check_mark: `:white_check_mark:` when adding tests | ||
* :lock: `:lock:` when dealing with security | ||
* :arrow_up: `:arrow_up:` when upgrading dependencies | ||
* :arrow_down: `:arrow_down:` when downgrading dependencies | ||
* :shirt: `:shirt:` when removing linter warnings | ||
|
||
Based on https://github.com/atom/atom/blob/master/CONTRIBUTING.md#git-commit-messages |
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,33 @@ | ||
Make the changes to the code and tests and then commit to your branch. Be sure to follow the commit message conventions. | ||
|
||
Commit message summaries must follow this basic format: | ||
|
||
``` | ||
Tag: Message (fixes #1234) | ||
``` | ||
|
||
`Tag` should not be confused with git tag. | ||
|
||
The `Tag` is one of the following: | ||
|
||
* `Fix` - for a bug fix. | ||
* `Update` - for a backwards-compatible enhancement. | ||
* `Breaking` - for a backwards-incompatible enhancement. | ||
* `Docs` - changes to documentation only. | ||
* `Build` - changes to build process only. | ||
* `New` - implemented a new feature. | ||
* `Upgrade` - for a dependency upgrade. | ||
|
||
The message summary should be a one-sentence description of the change. The issue number should be mentioned at the end. * The commit message should say "(fixes #1234)" at the end of the description if it closes out an existing issue (replace 1234 with the issue number). If the commit doesn't completely fix the issue, then use `(refs #1234)` instead of `(fixes #1234)`. | ||
|
||
Here are some good commit message summary examples: | ||
|
||
``` | ||
Build: Update Travis to only test Node 0.10 (refs #734) | ||
Fix: Semi rule incorrectly flagging extra semicolon (fixes #840) | ||
Upgrade: Esprima to 1.2, switch to using Esprima comment attachment (fixes #730) | ||
``` | ||
|
||
The commit message format is important because these messages are used to create a changelog for each release. The tag and issue number help to create more consistent and useful changelogs. | ||
|
||
Based on https://github.com/eslint/eslint.github.io/blob/master/docs/developer-guide/contributing.md#step-2-make-your-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,39 @@ | ||
## Commit Guidelines | ||
|
||
Commits should be atomic. If three separate issues are being fixed (unless they are all fixed by one change), they need to be done as three separate commits. This also applies to whitespace changes, which should be done in their own commit. Whitespace commits should not include code or content changes. Accordingly, code change commits should not include whitespace changes (unless the whitespace changes are on the same lines as the code being changed). | ||
|
||
Commit messages should describe what changed, and reference the issue number if the commit closes or is associated with a particular issue. Commit messages for all jQuery projects should look like this: | ||
|
||
``` | ||
Component: Short Description | ||
Optional Long Description | ||
Fixes #xxx | ||
Closes gh-yyy | ||
Ref #zzz | ||
``` | ||
|
||
Every commit must have a subject (the first line). Everything else is optional. | ||
|
||
### Subject | ||
|
||
This is the first line. It consists of a component, like "Event" or "Autocomplete". This line must be 72 characters or less. There should be no full stop (period) at the end. | ||
|
||
### Long description | ||
|
||
There are two line breaks between the subject and the long description. The description can have any length and formatting, like lists, but it must be hard-wrapped at 80 characters. | ||
|
||
### References | ||
|
||
References to issues or pull requests go after the long description, each one on their own line. | ||
|
||
* Use **Fixes** when the commit fixes an open issue. | ||
|
||
* Use **Closes** when the commit closes an open pull request. | ||
|
||
* Use **Ref** when referencing an issue or pull request that is already closed or should remain open. Examples include partial fixes and commits that add a test but not a fix. | ||
|
||
* Always use "gh-xxx" for GitHub issues and pull requests within the same repository. Use "\[user\]/\[repo\]#xxx" when referencing an issue or pull request in another repository, e.g., "Closes jquery/jquery-ui#175". | ||
|
||
Based on https://github.com/jquery/contribute.jquery.org/blob/master/pages/commits-and-pull-requests.md#commit-guidelines |
Oops, something went wrong.