chore(package): re-init package with commitizen and standard-release

This commit is contained in:
Pavel Pertsev
2018-05-16 12:54:46 +03:00
parent cb4e7a5643
commit eaf2328575
10640 changed files with 609660 additions and 117 deletions

307
node_modules/conventional-commits-parser/CHANGELOG.md generated vendored Normal file
View File

@@ -0,0 +1,307 @@
# Change Log
All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
<a name="2.1.7"></a>
## [2.1.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.6...conventional-commits-parser@2.1.7) (2018-03-27)
**Note:** Version bump only for package conventional-commits-parser
<a name="2.1.6"></a>
## [2.1.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.5...conventional-commits-parser@2.1.6) (2018-03-22)
**Note:** Version bump only for package conventional-commits-parser
<a name="2.1.5"></a>
## [2.1.5](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.4...conventional-commits-parser@2.1.5) (2018-02-24)
**Note:** Version bump only for package conventional-commits-parser
<a name="2.1.4"></a>
## [2.1.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.3...conventional-commits-parser@2.1.4) (2018-02-20)
**Note:** Version bump only for package conventional-commits-parser
<a name="2.1.3"></a>
## [2.1.3](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.1.2...conventional-commits-parser@2.1.3) (2018-02-13)
**Note:** Version bump only for package conventional-commits-parser
<a name="2.1.2"></a>
## [2.1.2](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.1.1...conventional-commits-parser@2.1.2) (2018-02-13)
**Note:** Version bump only for package conventional-commits-parser
<a name="2.1.1"></a>
## [2.1.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.1.0...conventional-commits-parser@2.1.1) (2018-02-05)
### Bug Fixes
* truncate after scissors line ([#267](https://github.com/conventional-changelog/conventional-commits-parser/issues/267)) ([e09df10](https://github.com/conventional-changelog/conventional-commits-parser/commit/e09df10))
<a name="2.1.0"></a>
# [2.1.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.0.1...conventional-commits-parser@2.1.0) (2017-12-08)
### Bug Fixes
* always parse references ([e84a9ae](https://github.com/conventional-changelog/conventional-commits-parser/commit/e84a9ae)), closes [#248](https://github.com/conventional-changelog/conventional-commits-parser/issues/248)
### Features
* make comment stripping optional ([db5b711](https://github.com/conventional-changelog/conventional-commits-parser/commit/db5b711)), closes [#251](https://github.com/conventional-changelog/conventional-commits-parser/issues/251)
<a name="2.0.1"></a>
## [2.0.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/conventional-commits-parser@2.0.0...conventional-commits-parser@2.0.1) (2017-11-13)
### Bug Fixes
* **conventional-commits-parser:** ignore comments ([#231](https://github.com/conventional-changelog/conventional-commits-parser/issues/231)) ([9db53e3](https://github.com/conventional-changelog/conventional-commits-parser/commit/9db53e3)), closes [#224](https://github.com/conventional-changelog/conventional-commits-parser/issues/224)
<a name="2.0.0"></a>
# 2.0.0 (2017-07-17)
### Bug Fixes
* **cli:** commit can be split when testing a commit file ([f3b3a3f](https://github.com/conventional-changelog/conventional-commits-parser/commit/f3b3a3f))
* **cli:** error handling for ENOENT is fixed ([3c92233](https://github.com/conventional-changelog/conventional-commits-parser/commit/3c92233))
* **cli:** fix "undefined" in json string ([0680e42](https://github.com/conventional-changelog/conventional-commits-parser/commit/0680e42))
* **cli:** options format ([491357e](https://github.com/conventional-changelog/conventional-commits-parser/commit/491357e))
* **deps:** require split2 ([1941c37](https://github.com/conventional-changelog/conventional-commits-parser/commit/1941c37))
* **error:** change error type and wordings ([d8be5e5](https://github.com/conventional-changelog/conventional-commits-parser/commit/d8be5e5))
* **footer:** notes contains more than one paragraphs after references ([d744ec7](https://github.com/conventional-changelog/conventional-commits-parser/commit/d744ec7))
* **headerCorrespondence:** string value for cli ([fb774fc](https://github.com/conventional-changelog/conventional-commits-parser/commit/fb774fc))
* **headerPattern:** change how capturing groups works ([fe1fe0c](https://github.com/conventional-changelog/conventional-commits-parser/commit/fe1fe0c))
* **issuePrefixes:** should return noMatch if falsy ([72db2bf](https://github.com/conventional-changelog/conventional-commits-parser/commit/72db2bf))
* **mention:** fix mention matching ([965986b](https://github.com/conventional-changelog/conventional-commits-parser/commit/965986b)), closes [#26](https://github.com/conventional-changelog/conventional-commits-parser/issues/26)
* **newlines:** preserve newlines in a part ([06b8c7c](https://github.com/conventional-changelog/conventional-commits-parser/commit/06b8c7c)), closes [#15](https://github.com/conventional-changelog/conventional-commits-parser/issues/15)
* **notes:** note keywords must appear at the beginning of a sentence ([5a2059e](https://github.com/conventional-changelog/conventional-commits-parser/commit/5a2059e)), closes [#23](https://github.com/conventional-changelog/conventional-commits-parser/issues/23)
* **parser:** do not trim spaces but newlines ([1e8c4c5](https://github.com/conventional-changelog/conventional-commits-parser/commit/1e8c4c5))
* **parser:** it returns null if there is no header ([8571c9e](https://github.com/conventional-changelog/conventional-commits-parser/commit/8571c9e))
* **regex:** do not treat it as note if there are texts after keywords ([571b03e](https://github.com/conventional-changelog/conventional-commits-parser/commit/571b03e))
* **regex:** make getReferencePartsRegex stricter ([62adf54](https://github.com/conventional-changelog/conventional-commits-parser/commit/62adf54)), closes [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [#30](https://github.com/conventional-changelog/conventional-commits-parser/issues/30) [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [#28](https://github.com/conventional-changelog/conventional-commits-parser/issues/28)
* **revertPattern:** correct regex ([8628983](https://github.com/conventional-changelog/conventional-commits-parser/commit/8628983))
* **util:** remove an accidentally commited file ([3710a8c](https://github.com/conventional-changelog/conventional-commits-parser/commit/3710a8c))
* **warn:** should tell which commit cannot be parsed ([04b0a9b](https://github.com/conventional-changelog/conventional-commits-parser/commit/04b0a9b))
### Chores
* init ([a529841](https://github.com/conventional-changelog/conventional-commits-parser/commit/a529841))
### Code Refactoring
* **breaks:** change `breaks` to `notes` ([5189a61](https://github.com/conventional-changelog/conventional-commits-parser/commit/5189a61)), closes [#2](https://github.com/conventional-changelog/conventional-commits-parser/issues/2)
* **merge:** pull-request should be merge ([4e7c61c](https://github.com/conventional-changelog/conventional-commits-parser/commit/4e7c61c))
* **regex:** regex now takes `options` ([eea319a](https://github.com/conventional-changelog/conventional-commits-parser/commit/eea319a))
### Features
* **cli:** able to have two files, separator works for interactive ([db1e3b5](https://github.com/conventional-changelog/conventional-commits-parser/commit/db1e3b5))
* **cli:** add aliases, more help details and tests ([eb654a2](https://github.com/conventional-changelog/conventional-commits-parser/commit/eb654a2))
* **cli:** add missing options ([8ac1cf7](https://github.com/conventional-changelog/conventional-commits-parser/commit/8ac1cf7))
* **cli:** add warn function for interactive shell ([84fe31f](https://github.com/conventional-changelog/conventional-commits-parser/commit/84fe31f))
* **correspondence:** add `headerCorrespondence` and improve commit parts ([aca9e95](https://github.com/conventional-changelog/conventional-commits-parser/commit/aca9e95)), closes [#6](https://github.com/conventional-changelog/conventional-commits-parser/issues/6)
* **fieldPattern:** should support string format ([b6b6b52](https://github.com/conventional-changelog/conventional-commits-parser/commit/b6b6b52))
* **hash:** drop support ([1ccc751](https://github.com/conventional-changelog/conventional-commits-parser/commit/1ccc751))
* **headerParts:** headerParts can be anything ([31e1c11](https://github.com/conventional-changelog/conventional-commits-parser/commit/31e1c11)), closes [#10](https://github.com/conventional-changelog/conventional-commits-parser/issues/10)
* **issuePrefixes:** init and referenceKeywords -> referenceActions ([86bf798](https://github.com/conventional-changelog/conventional-commits-parser/commit/86bf798)), closes [#11](https://github.com/conventional-changelog/conventional-commits-parser/issues/11)
* **maxSubjectLength:** removed ([3448582](https://github.com/conventional-changelog/conventional-commits-parser/commit/3448582))
* **mentions:** [@someone](https://github.com/someone) in commit ([d60fe76](https://github.com/conventional-changelog/conventional-commits-parser/commit/d60fe76)), closes [#24](https://github.com/conventional-changelog/conventional-commits-parser/issues/24)
* **newline:** fields does not contain leading or trailing newlines ([6db453b](https://github.com/conventional-changelog/conventional-commits-parser/commit/6db453b)), closes [#14](https://github.com/conventional-changelog/conventional-commits-parser/issues/14)
* **note:** noteKeywords is case insensitive ([f779a29](https://github.com/conventional-changelog/conventional-commits-parser/commit/f779a29)), closes [#21](https://github.com/conventional-changelog/conventional-commits-parser/issues/21)
* **options:** all options can be a string ([0fa17b4](https://github.com/conventional-changelog/conventional-commits-parser/commit/0fa17b4))
* **otherFields:** other fields are possible to be included ([9e06278](https://github.com/conventional-changelog/conventional-commits-parser/commit/9e06278))
* improvements and bug fixes ([1cde104](https://github.com/conventional-changelog/conventional-commits-parser/commit/1cde104)), closes [#5](https://github.com/conventional-changelog/conventional-commits-parser/issues/5)
* migrate repo to lerna mono-repo ([793e823](https://github.com/conventional-changelog/conventional-commits-parser/commit/793e823))
* **regex:** matching JIRA-123 like references ([20f1f7a](https://github.com/conventional-changelog/conventional-commits-parser/commit/20f1f7a)), closes [#19](https://github.com/conventional-changelog/conventional-commits-parser/issues/19)
* support squash commits ([#31](https://github.com/conventional-changelog/conventional-changelog/issues/31)) ([fff60c0](https://github.com/conventional-changelog/conventional-commits-parser/commit/fff60c0))
* **owner:** yield owner field ([d8d0334](https://github.com/conventional-changelog/conventional-commits-parser/commit/d8d0334)), closes [#12](https://github.com/conventional-changelog/conventional-commits-parser/issues/12)
* **parser:** notes can have more than one paragraph ([733bfa9](https://github.com/conventional-changelog/conventional-commits-parser/commit/733bfa9)), closes [#3](https://github.com/conventional-changelog/conventional-commits-parser/issues/3)
* **pullRequest:** Allow to skip and parse pull request header ([a2e929f](https://github.com/conventional-changelog/conventional-commits-parser/commit/a2e929f)), closes [#20](https://github.com/conventional-changelog/conventional-commits-parser/issues/20)
* **reference:** able to reference an issue without an action ([6474123](https://github.com/conventional-changelog/conventional-commits-parser/commit/6474123)), closes [#22](https://github.com/conventional-changelog/conventional-commits-parser/issues/22)
* **reference:** expose prefix ([47df766](https://github.com/conventional-changelog/conventional-commits-parser/commit/47df766)), closes [#17](https://github.com/conventional-changelog/conventional-commits-parser/issues/17)
* **references:** allow header to reference an issue ([df18a24](https://github.com/conventional-changelog/conventional-commits-parser/commit/df18a24))
* **references:** support other formats of references ([7c70213](https://github.com/conventional-changelog/conventional-commits-parser/commit/7c70213)), closes [#4](https://github.com/conventional-changelog/conventional-commits-parser/issues/4) [#8](https://github.com/conventional-changelog/conventional-commits-parser/issues/8)
* **regex:** leading and trailing space for closes and breaks keywords are trimmed ([9639860](https://github.com/conventional-changelog/conventional-commits-parser/commit/9639860))
* **revert:** parse a commit that reverts ([2af7233](https://github.com/conventional-changelog/conventional-commits-parser/commit/2af7233))
* **stream:** emmit an empty string to down stream if commit cannot be parsed ([76bf84e](https://github.com/conventional-changelog/conventional-commits-parser/commit/76bf84e))
* **sync:** add the sync function ([82071c6](https://github.com/conventional-changelog/conventional-commits-parser/commit/82071c6)), closes [#13](https://github.com/conventional-changelog/conventional-commits-parser/issues/13)
* **warn:** optionally warn user what is wrong when commit cannot be parsed ([32b3cda](https://github.com/conventional-changelog/conventional-commits-parser/commit/32b3cda))
### Performance Improvements
* **regex:** regex should be constructed in index.html ([15afd26](https://github.com/conventional-changelog/conventional-commits-parser/commit/15afd26))
### BREAKING CHANGES
* **merge:** `pull request` should be `merge`. Also make the parsed result to be consistent with other parts.
* This module is imported from https://github.com/ajoslin/conventional-changelog, and is originally written by @vojtajina, @btford and @ajoslin.
* **hash:** hash is no longer supported. This parser should just parse raw commit messages. Also text fields are appended with a newline "
".
* **regex:** It returns a nomatch regex if it's keywords are missing.
* **headerParts:** `headerParts` does not limit to `type`, `scope` and `subject`. They can now be defined in `options.headerCorrespondence` and the order is the order of capturing group in `options.headerPattern`. If part is missing in `options.headerCorrespondence` it is `undefined`. If part is not captured but is not missing in `options.headerCorrespondence` it is `null`.
* **maxSubjectLength:** `maxSubjectLength` is not available any more.
* **issuePrefixes:** `options.referenceKeywords` is now `options.referenceActions`
* **references:** `closes` now becomes `references` and it is loosely based the links above.
* **parser:** The regex for matching notes are loosen. The semicolon and space are optional. The `notes` object is no longer a key-value object but an array of note object, such as
```js
{
title: 'BREAKING AMEND',
text: 'some breaking change'
}
```
The detection of notes, closes, continueNote and isBody are mutually exclusive.
* **breaks:** Variable name related to `breaks` changes to `notes`, because "Important Notes" a more generic term. There is no functional changes.
* **stream:** It no longer skips the chunk if commit cannot be parsed. An empty string is passed to down stream
* **correspondence:** body and footer will be null if they are not found. type and subject are nullable too.
<a name="1.3.0"></a>
# [1.3.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.3...v1.3.0) (2016-10-15)
### Features
* support squash commits (#31) ([860c7a1](https://github.com/conventional-changelog/conventional-commits-parser/commit/860c7a1))
<a name="1.2.3"></a>
## [1.2.3](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.2...v1.2.3) (2016-08-06)
### Bug Fixes
* **regex:** do not treat it as note if there are texts after keywords ([9cb56bc](https://github.com/conventional-changelog/conventional-commits-parser/commit/9cb56bc))
<a name="1.2.2"></a>
## [1.2.2](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.1...v1.2.2) (2016-05-04)
### Bug Fixes
* **regex:** make getReferencePartsRegex stricter ([b8a9fda](https://github.com/conventional-changelog/conventional-commits-parser/commit/b8a9fda)), closes [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [(#30](https://github.com/(/issues/30) [#27](https://github.com/conventional-changelog/conventional-commits-parser/issues/27) [#28](https://github.com/conventional-changelog/conventional-commits-parser/issues/28)
<a name="1.2.1"></a>
## [1.2.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.0...v1.2.1) (2016-04-24)
### Bug Fixes
* **mention:** fix mention matching ([43b32e7](https://github.com/conventional-changelog/conventional-commits-parser/commit/43b32e7)), closes [#26](https://github.com/conventional-changelog/conventional-commits-parser/issues/26)
<a name="1.2.0"></a>
# [1.2.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.1.0...v1.2.0) (2016-04-15)
### Features
* **mentions:** @someone in commit ([b2eabbf](https://github.com/conventional-changelog/conventional-commits-parser/commit/b2eabbf)), closes [#24](https://github.com/conventional-changelog/conventional-commits-parser/issues/24)
<a name="1.1.0"></a>
# [1.1.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.0.1...v1.1.0) (2016-04-10)
### Bug Fixes
* **notes:** note keywords must appear at the beginning of a sentence ([6e13789](https://github.com/conventional-changelog/conventional-commits-parser/commit/6e13789)), closes [#23](https://github.com/conventional-changelog/conventional-commits-parser/issues/23)
### Features
* **reference:** able to reference an issue without an action ([cf847b1](https://github.com/conventional-changelog/conventional-commits-parser/commit/cf847b1)), closes [#22](https://github.com/conventional-changelog/conventional-commits-parser/issues/22)
<a name="1.0.1"></a>
## [1.0.1](https://github.com/stevemao/conventional-commits-parser/compare/v1.0.0...v1.0.1) (2016-02-05)
### Bug Fixes
* **deps:** require split2 ([ad55810](https://github.com/stevemao/conventional-commits-parser/commit/ad55810))
<a name="1.0.0"></a>
# [1.0.0](https://github.com/stevemao/conventional-commits-parser/compare/v0.2.0...v1.0.0) (2016-02-05)
<a name="0.2.0"></a>
# [0.2.0](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.2...v0.2.0) (2016-02-04)
### Features
* **note:** noteKeywords is case insensitive ([4442b86](https://github.com/stevemao/conventional-commits-parser/commit/4442b86)), closes [#21](https://github.com/stevemao/conventional-commits-parser/issues/21)
* **pullRequest:** Allow to skip and parse pull request header ([aa85033](https://github.com/stevemao/conventional-commits-parser/commit/aa85033)), closes [#20](https://github.com/stevemao/conventional-commits-parser/issues/20)
* **regex:** matching JIRA-123 like references ([5342f45](https://github.com/stevemao/conventional-commits-parser/commit/5342f45)), closes [#19](https://github.com/stevemao/conventional-commits-parser/issues/19)
<a name="0.1.2"></a>
## [0.1.2](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.1...v0.1.2) (2015-09-18)
### Bug Fixes
* **parser:** do not trim spaces but newlines ([62e7bf5](https://github.com/stevemao/conventional-commits-parser/commit/62e7bf5))
<a name="0.1.1"></a>
## [0.1.1](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.0...v0.1.1) (2015-09-12)
### Bug Fixes
* **newlines:** preserve newlines in a part ([beb3d05](https://github.com/stevemao/conventional-commits-parser/commit/beb3d05)), closes [#15](https://github.com/stevemao/conventional-commits-parser/issues/15)
### Features
* **reference:** expose prefix ([9962dda](https://github.com/stevemao/conventional-commits-parser/commit/9962dda)), closes [#17](https://github.com/stevemao/conventional-commits-parser/issues/17)

21
node_modules/conventional-commits-parser/LICENSE.md generated vendored Normal file
View File

@@ -0,0 +1,21 @@
### MIT License
Copyright © [conventional-changelog team](https://github.com/conventional-changelog)
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

370
node_modules/conventional-commits-parser/README.md generated vendored Normal file
View File

@@ -0,0 +1,370 @@
# [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
> Parse raw conventional commits
## Conventional Commit Message Format
A minimum input should contain a raw message.
Each commit message consists of a **merge header**, a **header** (mandatory), a **body** and a **footer**. **Mention** (optional) someone using the `@` notation.
```
<merge>
<header>
<body>
<footer>
```
### merge
The merge header may optionally have a special format that includes other parts, such as **branch**, **issueId** or **source**.
```
Merge branch <branch>
Merge pull request <issue-id> from <source>
```
### header
The header may optionally have a special format that includes other parts, such as **type**, **scope** and **subject**. You could **reference** (optional) issues here.
```
<type>(<scope>): <subject>
```
### footer
The footer should contain any information about **Important Notes** (optional) and is also the place to **reference** (optional) issues.
```
<important note>
<references>
```
### other parts
This module will only parse the message body. However, it is possible to include other fields such as hash, committer or date.
```
My commit message
-sideNotes-
It should warn the correct unfound file names.
Also it should continue if one file cannot be found.
Tests are added for these
```
Then `sideNotes` will be `It should warn the correct unfound file names.\nAlso it should continue if one file cannot be found.\nTests are added for these`. You can customize the `fieldPattern`.
## Install
```sh
$ npm install --save conventional-commits-parser
```
## Usage
```js
var conventionalCommitsParser = require('conventional-commits-parser');
conventionalCommitsParser(options);
```
It returns a transform stream and expects an upstream that looks something like this:
```
'feat(scope): broadcast $destroy event on scope destruction\nCloses #1'
'feat(ng-list): Allow custom separator\nbla bla bla\n\nBREAKING CHANGE: some breaking change.\nThanks @stevemao\n'
```
Each chunk should be a commit. The downstream will look something like this:
```js
{ type: 'feat',
scope: 'scope',
subject: 'broadcast $destroy event on scope destruction',
merge: null,
header: 'feat(scope): broadcast $destroy event on scope destruction',
body: null,
footer: 'Closes #1',
notes: [],
references:
[ { action: 'Closes',
owner: null,
repository: null,
issue: '1',
raw: '#1',
prefix: '#' } ],
mentions: [],
revert: null }
{ type: 'feat',
scope: 'ng-list',
subject: 'Allow custom separator',
merge: null,
header: 'feat(ng-list): Allow custom separator',
body: 'bla bla bla',
footer: 'BREAKING CHANGE: some breaking change.\nThanks @stevemao',
notes:
[ { title: 'BREAKING CHANGE',
text: 'some breaking change.\nThanks @stevemao' } ],
references: [],
mentions: [ 'stevemao' ],
revert: null }
```
## API
### conventionalCommitsParser([options])
Returns an transform stream. If there is any malformed commits it will be gracefully ignored (an empty data will be emitted so down stream can notice).
#### options
Type: `object`
##### mergePattern
Type: `regex` or `string` Default: null
Pattern to match merge headers. EG: branch merge, GitHub or GitLab like pull requests headers. When a merge header is parsed, the next line is used for conventionnal header parsing.
For example, if we have a commit
```
Merge pull request #1 from user/feature/feature-name
feat(scope): broadcast $destroy event on scope destruction
```
We can parse it with these options and the default headerPattern:
```js
{
mergePattern: /^Merge pull request #(\d+) from (.*)$/,
mergeCorrespondence: ['id', 'source']
}
```
##### mergeCorrespondence
Type: `array` of `string` or `string` Default: null
Used to define what capturing group of `mergePattern`.
If it's a `string` it will be converted to an `array` separated by a comma.
##### headerPattern
Type: `regex` or `string` Default: `/^(\w*)(?:\(([\w\$\.\-\* ]*)\))?\: (.*)$/`
Used to match header pattern.
##### headerCorrespondence
Type: `array` of `string` or `string` Default `['type', 'scope', 'subject']`
Used to define what capturing group of `headerPattern` captures what header part. The order of the array should correspond to the order of `headerPattern`'s capturing group. If the part is not captured it is `null`. If it's a `string` it will be converted to an `array` separated by a comma.
##### referenceActions
Type: `array` of `string` or `string` Default:
`[
'close',
'closes',
'closed',
'fix',
'fixes',
'fixed',
'resolve',
'resolves',
'resolved'
]`
Keywords to reference an issue. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
Set it to `null` to reference an issue without any action.
##### issuePrefixes
Type: `array` of `string` or `string` Default: `['#']`
The prefixes of an issue. EG: In `gh-123` `gh-` is the prefix.
##### noteKeywords
Type: `array` of `string` or `string` Default: `['BREAKING CHANGE']`
Keywords for important notes. This value is case **insensitive**. If it's a `string` it will be converted to an `array` separated by a comma.
##### fieldPattern
Type: `regex` or `string` Default: `/^-(.*?)-$/`
Pattern to match other fields.
##### revertPattern
Type: `regex` or `string` Default: `/^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./`
Pattern to match what this commit reverts.
##### revertCorrespondence
Type: `array` of `string` or `string` Default: `['header', 'hash']`
Used to define what capturing group of `revertPattern` captures what reverted commit fields. The order of the array should correspond to the order of `revertPattern`'s capturing group.
For example, if we had commit
```
Revert "throw an error if a callback is passed"
This reverts commit 9bb4d6c.
```
If configured correctly, the parsed result would be
```js
{
revert: {
header: 'throw an error if a callback is passed',
hash: '9bb4d6c'
}
}
```
It implies that this commit reverts a commit with header `'throw an error if a callback is passed'` and hash `'9bb4d6c'`.
If it's a `string` it will be converted to an `array` separated by a comma.
##### commentChar
Type: `string` or `null` Default: null
What commentChar to use. By default it is `null`, so no comments are stripped.
Set to `#` if you pass the contents of `.git/COMMIT_EDITMSG` directly.
If you have configured the git commentchar via `git config core.commentchar` you'll want to pass what you have set there.
##### warn
Type: `function` or `boolean` Default: `function() {}`
What warn function to use. For example, `console.warn.bind(console)` or `grunt.log.writeln`. By default, it's a noop. If it is `true`, it will error if commit cannot be parsed (strict).
### conventionalCommitsParser.sync(commit, [options])
The sync version. Useful when parsing a single commit. Returns the result.
#### commit
A single commit to be parsed.
#### options
Same as the `options` of `conventionalCommitsParser`.
## CLI
You can use cli to practice writing commit messages or parse messages from files. Note: the sample output might be different. It's just for demonstration purposes.
```sh
$ npm install --global conventional-commits-parser
```
If you run `conventional-commits-parser` without any arguments
```sh
$ conventional-commits-parser
```
You will enter an interactive shell. To show your parsed output enter "return" three times (or enter your specified separator).
```sh
> fix(title): a title is fixed
{"type":"fix","scope":"title","subject":"a title is fixed","header":"fix(title): a title is fixed","body":null,"footer":null,"notes":[],"references":[],"revert":null}
```
You can also use cli to parse messages from files.
If you have log.txt
```text
feat(ngMessages): provide support for dynamic message resolution
Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.
BREAKING CHANGE: The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.
Closes #10036
Closes #9338
```
And you run
```sh
$ conventional-commits-parser log.txt
# or
$ cat log.txt | conventional-commits-parser
```
An array of json will be printed to stdout.
```sh
[
{"type":"feat","scope":"ngMessages","subject":"provide support for dynamic message resolution","header":"feat(ngMessages): provide support for dynamic message resolution","body":"Prior to this fix it was impossible to apply a binding to a the ngMessage directive to represent the name of the error.","footer":"BREAKING CHANGE: The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive.\nCloses #10036\nCloses #9338","notes":[{"title":"BREAKING CHANGE","text":"The `ngMessagesInclude` attribute is now its own directive and that must be placed as a **child** element within the element with the ngMessages directive."}],"references":[{"action":"Closes","owner":null,"repository":null,"issue":"10036","raw":"#10036"},{"action":"Closes","owner":null,"repository":null,"issue":"9338","raw":"#9338"}],"revert":null}
]
```
Commits should be split by at least three newlines (`\n\n\n`) or you can specify a separator as the second argument.
Eg: in log2.txt
```text
docs(ngMessageExp): split ngMessage docs up to show its alias more clearly
===
fix($animate): applyStyles from options on leave
Closes #10068
```
And you run
```sh
$ conventional-commits-parser log2.txt '==='
```
```sh
[
{"type":"docs","scope":"ngMessageExp","subject":"split ngMessage docs up to show its alias more clearly","header":"docs(ngMessageExp): split ngMessage docs up to show its alias more clearly","body":null,"footer":null,"notes":[],"references":[],"revert":null}
,
{"type":"fix","scope":"$animate","subject":"applyStyles from options on leave","header":"fix($animate): applyStyles from options on leave","body":null,"footer":"Closes #10068","notes":[],"references":[{"action":"Closes","owner":null,"repository":null,"issue":"10068","raw":"#10068"}],"revert":null}
]
```
Will be printed out.
You can specify one or more files. The output array will be in order of the input file paths. If you specify more than one separator, the last one will be used.
## License
MIT © [Steve Mao](https://github.com/stevemao)
[npm-image]: https://badge.fury.io/js/conventional-commits-parser.svg
[npm-url]: https://npmjs.org/package/conventional-commits-parser
[travis-image]: https://travis-ci.org/conventional-changelog/conventional-commits-parser.svg?branch=master
[travis-url]: https://travis-ci.org/conventional-changelog/conventional-commits-parser
[daviddm-image]: https://david-dm.org/conventional-changelog/conventional-commits-parser.svg?theme=shields.io
[daviddm-url]: https://david-dm.org/conventional-changelog/conventional-commits-parser
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-commits-parser/badge.svg
[coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-commits-parser

147
node_modules/conventional-commits-parser/cli.js generated vendored Executable file
View File

@@ -0,0 +1,147 @@
#!/usr/bin/env node
'use strict'
var conventionalCommitsParser = require('./')
var forEach = require('lodash').forEach
var fs = require('fs')
var isTextPath = require('is-text-path')
var JSONStream = require('JSONStream')
var meow = require('meow')
var readline = require('readline')
var split = require('split2')
var through = require('through2')
var filePaths = []
var separator = '\n\n\n'
var cli = meow(`
Practice writing commit messages or parse messages from files.
If used without specifying a text file path, you will enter an interactive shell.
Otherwise the commit messages in the files are parsed and printed
By default, commits will be split by three newlines ('\\n\\n\\n') or you can specify a separator.
Usage
conventional-commits-parser [<commit-separator>]
conventional-commits-parser [<commit-separator>] <path> [<path> ...]
cat <path> | conventional-commits-parser [<commit-separator>]
Example
conventional-commits-parser
conventional-commits-parser log.txt
cat log.txt | conventional-commits-parser
conventional-commits-parser log2.txt '===' >> parsed.txt
Options
-p, --header-pattern Regex to match header pattern
-c, --header-correspondence Comma separated parts used to define what capturing group of 'headerPattern' captures what
-r, --reference-actions Comma separated keywords that used to reference issues
-i, --issue-prefixes Comma separated prefixes of an issue
-n, --note-keywords Comma separated keywords for important notes
-f, --field-pattern Regex to match other fields
--revert-pattern Regex to match revert pattern
--revert-correspondence Comma separated fields used to define what the commit reverts
-v, --verbose Verbose output
`, {
flags: {
'header-pattern': {
alias: `p`
},
'header-correspondence': {
alias: `c`
},
'reference-actions': {
alias: `r`
},
'issue-prefixes': {
alias: `i`
},
'note-keywords': {
alias: `n`
},
'field-pattern': {
alias: `f`
},
verbose: {
alias: `v`
}
}
})
forEach(cli.input, function (arg) {
if (isTextPath(arg)) {
filePaths.push(arg)
} else {
separator = arg
}
})
var length = filePaths.length
var options = cli.flags
if (options.verbose) {
options.warn = console.log.bind(console)
}
function processFile (fileIndex) {
var filePath = filePaths[fileIndex]
fs.createReadStream(filePath)
.on('error', function (err) {
console.warn('Failed to read file ' + filePath + '\n' + err)
if (++fileIndex < length) {
processFile(fileIndex)
}
})
.pipe(split(separator))
.pipe(conventionalCommitsParser(options))
.pipe(JSONStream.stringify())
.on('end', function () {
if (++fileIndex < length) {
processFile(fileIndex)
}
})
.pipe(process.stdout)
}
if (process.stdin.isTTY) {
if (length > 0) {
processFile(0)
} else {
var commit = ''
var stream = through()
var rl = readline.createInterface({
input: process.stdin,
output: process.stdout,
terminal: true
})
stream.pipe(conventionalCommitsParser(options))
.pipe(JSONStream.stringify('', '', ''))
.pipe(through(function (chunk, enc, cb) {
if (chunk.toString() === '""') {
cb(null, 'Commit cannot be parsed\n')
} else {
cb(null, chunk + '\n')
}
}))
.pipe(process.stdout)
rl.on('line', function (line) {
commit += line + '\n'
if (commit.indexOf(separator) === -1) {
return
}
stream.write(commit)
commit = ''
})
}
} else {
options.warn = true
process.stdin
.pipe(conventionalCommitsParser(options))
.on('error', function (err) {
console.error(err.toString())
process.exit(1)
})
.pipe(JSONStream.stringify())
.pipe(process.stdout)
}

101
node_modules/conventional-commits-parser/index.js generated vendored Normal file
View File

@@ -0,0 +1,101 @@
'use strict'
var parser = require('./lib/parser')
var regex = require('./lib/regex')
var through = require('through2')
var _ = require('lodash')
function assignOpts (options) {
options = _.extend({
headerPattern: /^(\w*)(?:\(([\w$.\-* ]*)\))?: (.*)$/,
headerCorrespondence: ['type', 'scope', 'subject'],
referenceActions: [
'close',
'closes',
'closed',
'fix',
'fixes',
'fixed',
'resolve',
'resolves',
'resolved'
],
issuePrefixes: ['#'],
noteKeywords: ['BREAKING CHANGE'],
fieldPattern: /^-(.*?)-$/,
revertPattern: /^Revert\s"([\s\S]*)"\s*This reverts commit (\w*)\./,
revertCorrespondence: ['header', 'hash'],
warn: function () {},
mergePattern: null,
mergeCorrespondence: null
}, options)
if (typeof options.headerPattern === 'string') {
options.headerPattern = new RegExp(options.headerPattern)
}
if (typeof options.headerCorrespondence === 'string') {
options.headerCorrespondence = options.headerCorrespondence.split(',')
}
if (typeof options.referenceActions === 'string') {
options.referenceActions = options.referenceActions.split(',')
}
if (typeof options.issuePrefixes === 'string') {
options.issuePrefixes = options.issuePrefixes.split(',')
}
if (typeof options.noteKeywords === 'string') {
options.noteKeywords = options.noteKeywords.split(',')
}
if (typeof options.fieldPattern === 'string') {
options.fieldPattern = new RegExp(options.fieldPattern)
}
if (typeof options.revertPattern === 'string') {
options.revertPattern = new RegExp(options.revertPattern)
}
if (typeof options.revertCorrespondence === 'string') {
options.revertCorrespondence = options.revertCorrespondence.split(',')
}
if (typeof options.mergePattern === 'string') {
options.mergePattern = new RegExp(options.mergePattern)
}
return options
}
function conventionalCommitsParser (options) {
options = assignOpts(options)
var reg = regex(options)
return through.obj(function (data, enc, cb) {
var commit
try {
commit = parser(data.toString(), options, reg)
cb(null, commit)
} catch (err) {
if (options.warn === true) {
cb(err)
} else {
options.warn(err.toString())
cb(null, '')
}
}
})
}
function sync (commit, options) {
options = assignOpts(options)
var reg = regex(options)
return parser(commit, options, reg)
}
module.exports = conventionalCommitsParser
module.exports.sync = sync

292
node_modules/conventional-commits-parser/lib/parser.js generated vendored Normal file
View File

@@ -0,0 +1,292 @@
'use strict'
var trimOffNewlines = require('trim-off-newlines')
var _ = require('lodash')
var CATCH_ALL = /()(.+)/gi
var SCISSOR = '# ------------------------ >8 ------------------------'
function append (src, line) {
if (src) {
src += '\n' + line
} else {
src = line
}
return src
}
function getCommentFilter (char) {
return function (line) {
return line.charAt(0) !== char
}
}
function truncateToScissor (lines) {
var scissorIndex = lines.indexOf(SCISSOR)
if (scissorIndex === -1) {
return lines
}
return lines.slice(0, scissorIndex)
}
function getReferences (input, regex) {
var references = []
var referenceSentences
var referenceMatch
var reApplicable = input.match(regex.references) !== null
? regex.references
: CATCH_ALL
while ((referenceSentences = reApplicable.exec(input))) {
var action = referenceSentences[1] || null
var sentence = referenceSentences[2]
while ((referenceMatch = regex.referenceParts.exec(sentence))) {
var owner = null
var repository = referenceMatch[1] || ''
var ownerRepo = repository.split('/')
if (ownerRepo.length > 1) {
owner = ownerRepo.shift()
repository = ownerRepo.join('/')
}
var reference = {
action: action,
owner: owner,
repository: repository || null,
issue: referenceMatch[3],
raw: referenceMatch[0],
prefix: referenceMatch[2]
}
references.push(reference)
}
}
return references
}
function passTrough () {
return true
}
function parser (raw, options, regex) {
if (!raw || !raw.trim()) {
throw new TypeError('Expected a raw commit')
}
if (_.isEmpty(options)) {
throw new TypeError('Expected options')
}
if (_.isEmpty(regex)) {
throw new TypeError('Expected regex')
}
var headerMatch
var mergeMatch
var currentProcessedField
var mentionsMatch
var revertMatch
var otherFields = {}
var commentFilter = typeof options.commentChar === 'string'
? getCommentFilter(options.commentChar)
: passTrough
var rawLines = trimOffNewlines(raw).split(/\r?\n/)
var lines = truncateToScissor(rawLines).filter(commentFilter)
var continueNote = false
var isBody = true
var headerCorrespondence = _.map(options.headerCorrespondence, function (part) {
return part.trim()
})
var revertCorrespondence = _.map(options.revertCorrespondence, function (field) {
return field.trim()
})
var mergeCorrespondence = _.map(options.mergeCorrespondence, function (field) {
return field.trim()
})
var body = null
var footer = null
var header = null
var mentions = []
var merge = null
var notes = []
var references = []
var revert = null
if (lines.length === 0) {
return {
body: body,
footer: footer,
header: header,
mentions: mentions,
merge: merge,
notes: notes,
references: references,
revert: revert,
scope: null,
subject: null,
type: null
}
}
// msg parts
merge = lines.shift()
var mergeParts = {}
var headerParts = {}
body = ''
footer = ''
mergeMatch = merge.match(options.mergePattern)
if (mergeMatch && options.mergePattern) {
merge = mergeMatch[0]
header = lines.shift()
while (!header.trim()) {
header = lines.shift()
}
_.forEach(mergeCorrespondence, function (partName, index) {
var partValue = mergeMatch[index + 1] || null
mergeParts[partName] = partValue
})
} else {
header = merge
merge = null
_.forEach(mergeCorrespondence, function (partName) {
mergeParts[partName] = null
})
}
headerMatch = header.match(options.headerPattern)
if (headerMatch) {
_.forEach(headerCorrespondence, function (partName, index) {
var partValue = headerMatch[index + 1] || null
headerParts[partName] = partValue
})
} else {
_.forEach(headerCorrespondence, function (partName) {
headerParts[partName] = null
})
}
Array.prototype.push.apply(references, getReferences(header, {
references: regex.references,
referenceParts: regex.referenceParts
}))
// body or footer
_.forEach(lines, function (line) {
if (options.fieldPattern) {
var fieldMatch = options.fieldPattern.exec(line)
if (fieldMatch) {
currentProcessedField = fieldMatch[1]
return
}
if (currentProcessedField) {
otherFields[currentProcessedField] = append(otherFields[currentProcessedField], line)
return
}
}
var referenceMatched
// this is a new important note
var notesMatch = line.match(regex.notes)
if (notesMatch) {
continueNote = true
isBody = false
footer = append(footer, line)
var note = {
title: notesMatch[1],
text: notesMatch[2]
}
notes.push(note)
return
}
var lineReferences = getReferences(line, {
references: regex.references,
referenceParts: regex.referenceParts
})
if (lineReferences.length > 0) {
isBody = false
referenceMatched = true
continueNote = false
}
Array.prototype.push.apply(references, lineReferences)
if (referenceMatched) {
footer = append(footer, line)
return
}
if (continueNote) {
notes[notes.length - 1].text = append(notes[notes.length - 1].text, line)
footer = append(footer, line)
return
}
if (isBody) {
body = append(body, line)
} else {
footer = append(footer, line)
}
})
while ((mentionsMatch = regex.mentions.exec(raw))) {
mentions.push(mentionsMatch[1])
}
// does this commit revert any other commit?
revertMatch = raw.match(options.revertPattern)
if (revertMatch) {
revert = {}
_.forEach(revertCorrespondence, function (partName, index) {
var partValue = revertMatch[index + 1] || null
revert[partName] = partValue
})
} else {
revert = null
}
_.map(notes, function (note) {
note.text = trimOffNewlines(note.text)
return note
})
var msg = _.merge(headerParts, mergeParts, {
merge: merge,
header: header,
body: body ? trimOffNewlines(body) : null,
footer: footer ? trimOffNewlines(footer) : null,
notes: notes,
references: references,
mentions: mentions,
revert: revert
}, otherFields)
return msg
}
module.exports = parser

54
node_modules/conventional-commits-parser/lib/regex.js generated vendored Normal file
View File

@@ -0,0 +1,54 @@
'use strict'
var reNomatch = /(?!.*)/
function join (array, joiner) {
return array
.map(function (val) {
return val.trim()
})
.filter(function (val) {
return val.length
})
.join(joiner)
}
function getNotesRegex (noteKeywords) {
if (!noteKeywords) {
return reNomatch
}
return new RegExp('^[\\s|*]*(' + join(noteKeywords, '|') + ')[:\\s]+(.*)', 'i')
}
function getReferencePartsRegex (issuePrefixes) {
if (!issuePrefixes) {
return reNomatch
}
return new RegExp('(?:.*?)??\\s*([\\w-\\.\\/]*?)??(' + join(issuePrefixes, '|') + ')([\\w-]*\\d+)', 'gi')
}
function getReferencesRegex (referenceActions) {
if (!referenceActions) {
// matches everything
return /()(.+)/gi
}
var joinedKeywords = join(referenceActions, '|')
return new RegExp('(' + joinedKeywords + ')(?:\\s+(.*?))(?=(?:' + joinedKeywords + ')|$)', 'gi')
}
module.exports = function (options) {
options = options || {}
var reNotes = getNotesRegex(options.noteKeywords)
var reReferenceParts = getReferencePartsRegex(options.issuePrefixes)
var reReferences = getReferencesRegex(options.referenceActions)
return {
notes: reNotes,
referenceParts: reReferenceParts,
references: reReferences,
mentions: /@([\w-]+)/g
}
}

View File

@@ -0,0 +1 @@
../../../JSONStream/bin.js

52
node_modules/conventional-commits-parser/package.json generated vendored Normal file
View File

@@ -0,0 +1,52 @@
{
"name": "conventional-commits-parser",
"version": "2.1.7",
"description": "Parse raw conventional commits",
"bugs": {
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
},
"homepage": "https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#readme",
"author": {
"name": "Steve Mao",
"email": "maochenyan@gmail.com",
"url": "https://github.com/stevemao"
},
"repository": {
"type": "git",
"url": "https://github.com/conventional-changelog/conventional-changelog.git"
},
"license": "MIT",
"files": [
"index.js",
"cli.js",
"lib"
],
"keywords": [
"conventional-commits-parser",
"changelog",
"conventional",
"parser",
"parsing",
"logs"
],
"dependencies": {
"JSONStream": "^1.0.4",
"is-text-path": "^1.0.0",
"lodash": "^4.2.1",
"meow": "^4.0.0",
"split2": "^2.0.0",
"through2": "^2.0.0",
"trim-off-newlines": "^1.0.0"
},
"devDependencies": {
"concat-stream": "^1.6.0"
},
"scripts": {
"lint": "eslint --fix .",
"test": "npm run lint && mocha --timeout=30000",
"test-windows": "echo 'make work on windows'"
},
"bin": {
"conventional-commits-parser": "cli.js"
}
}