conventional-commits-parser 3.0.8 → 3.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/README.md +6 -0
- package/cli.js +13 -9
- package/index.js +1 -1
- package/lib/regex.js +4 -3
- package/package.json +7 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [3.1.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.8...conventional-commits-parser@3.1.0) (2020-05-08)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **deps:** update yargs-parser to move off a flagged-vulnerable version. ([#635](https://github.com/conventional-changelog/conventional-changelog/issues/635)) ([aafc0f0](https://github.com/conventional-changelog/conventional-changelog/commit/aafc0f00412c3e4b23b8418300e5a570a48fe24d))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Features
|
|
15
|
+
|
|
16
|
+
* **conventional-commits-parser:** add issuePrefixesCaseSensitive parser option ([#580](https://github.com/conventional-changelog/conventional-changelog/issues/580)) ([526b282](https://github.com/conventional-changelog/conventional-changelog/commit/526b28214d12c55158eb2e4d44408378587ceb97))
|
|
17
|
+
* support slash in headerPattern default options ([93a547d](https://github.com/conventional-changelog/conventional-changelog/commit/93a547d742634d8676f499cfa2a274bc3792d020))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [3.0.8](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.7...conventional-commits-parser@3.0.8) (2019-11-14)
|
|
7
24
|
|
|
8
25
|
|
package/README.md
CHANGED
|
@@ -193,6 +193,12 @@ Type: `array` of `string` or `string` Default: `['#']`
|
|
|
193
193
|
|
|
194
194
|
The prefixes of an issue. EG: In `gh-123` `gh-` is the prefix.
|
|
195
195
|
|
|
196
|
+
##### issuePrefixesCaseSensitive
|
|
197
|
+
|
|
198
|
+
Type: `boolean` Default: false
|
|
199
|
+
|
|
200
|
+
Used to define if `issuePrefixes` should be considered case sensitive.
|
|
201
|
+
|
|
196
202
|
##### noteKeywords
|
|
197
203
|
|
|
198
204
|
Type: `array` of `string` or `string` Default: `['BREAKING CHANGE']`
|
package/cli.js
CHANGED
|
@@ -31,15 +31,16 @@ var cli = meow(`
|
|
|
31
31
|
conventional-commits-parser log2.txt '===' >> parsed.txt
|
|
32
32
|
|
|
33
33
|
Options
|
|
34
|
-
-p, --header-pattern
|
|
35
|
-
-c, --header-correspondence
|
|
36
|
-
-r, --reference-actions
|
|
37
|
-
-i, --issue-prefixes
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
--
|
|
41
|
-
--revert-
|
|
42
|
-
-
|
|
34
|
+
-p, --header-pattern Regex to match header pattern
|
|
35
|
+
-c, --header-correspondence Comma separated parts used to define what capturing group of 'headerPattern' captures what
|
|
36
|
+
-r, --reference-actions Comma separated keywords that used to reference issues
|
|
37
|
+
-i, --issue-prefixes Comma separated prefixes of an issue
|
|
38
|
+
--issue-prefixes-case-sensitive Treat issue prefixes as case sensitive
|
|
39
|
+
-n, --note-keywords Comma separated keywords for important notes
|
|
40
|
+
-f, --field-pattern Regex to match other fields
|
|
41
|
+
--revert-pattern Regex to match revert pattern
|
|
42
|
+
--revert-correspondence Comma separated fields used to define what the commit reverts
|
|
43
|
+
-v, --verbose Verbose output
|
|
43
44
|
`, {
|
|
44
45
|
flags: {
|
|
45
46
|
'header-pattern': {
|
|
@@ -58,6 +59,9 @@ var cli = meow(`
|
|
|
58
59
|
alias: 'i',
|
|
59
60
|
type: 'string'
|
|
60
61
|
},
|
|
62
|
+
'issue-prefixes-case-sensitive': {
|
|
63
|
+
type: 'boolean'
|
|
64
|
+
},
|
|
61
65
|
'note-keywords': {
|
|
62
66
|
alias: 'n',
|
|
63
67
|
type: 'string'
|
package/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var _ = require('lodash')
|
|
|
7
7
|
|
|
8
8
|
function assignOpts (options) {
|
|
9
9
|
options = _.extend({
|
|
10
|
-
headerPattern: /^(\w*)(?:\(([\w
|
|
10
|
+
headerPattern: /^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$/,
|
|
11
11
|
headerCorrespondence: ['type', 'scope', 'subject'],
|
|
12
12
|
referenceActions: [
|
|
13
13
|
'close',
|
package/lib/regex.js
CHANGED
|
@@ -21,12 +21,13 @@ function getNotesRegex (noteKeywords) {
|
|
|
21
21
|
return new RegExp('^[\\s|*]*(' + join(noteKeywords, '|') + ')[:\\s]+(.*)', 'i')
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
function getReferencePartsRegex (issuePrefixes) {
|
|
24
|
+
function getReferencePartsRegex (issuePrefixes, issuePrefixesCaseSensitive) {
|
|
25
25
|
if (!issuePrefixes) {
|
|
26
26
|
return reNomatch
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
var flags = issuePrefixesCaseSensitive ? 'g' : 'gi'
|
|
30
|
+
return new RegExp('(?:.*?)??\\s*([\\w-\\.\\/]*?)??(' + join(issuePrefixes, '|') + ')([\\w-]*\\d+)', flags)
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
function getReferencesRegex (referenceActions) {
|
|
@@ -42,7 +43,7 @@ function getReferencesRegex (referenceActions) {
|
|
|
42
43
|
module.exports = function (options) {
|
|
43
44
|
options = options || {}
|
|
44
45
|
var reNotes = getNotesRegex(options.noteKeywords)
|
|
45
|
-
var reReferenceParts = getReferencePartsRegex(options.issuePrefixes)
|
|
46
|
+
var reReferenceParts = getReferencePartsRegex(options.issuePrefixes, options.issuePrefixesCaseSensitive)
|
|
46
47
|
var reReferences = getReferencesRegex(options.referenceActions)
|
|
47
48
|
|
|
48
49
|
return {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "conventional-commits-parser",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "Parse raw conventional commits",
|
|
5
5
|
"bugs": {
|
|
6
6
|
"url": "https://github.com/conventional-changelog/conventional-changelog/issues"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
},
|
|
18
18
|
"license": "MIT",
|
|
19
19
|
"engines": {
|
|
20
|
-
"node": ">=
|
|
20
|
+
"node": ">=10"
|
|
21
21
|
},
|
|
22
22
|
"files": [
|
|
23
23
|
"index.js",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"JSONStream": "^1.0.4",
|
|
37
37
|
"is-text-path": "^1.0.1",
|
|
38
38
|
"lodash": "^4.17.15",
|
|
39
|
-
"meow": "^
|
|
39
|
+
"meow": "^7.0.0",
|
|
40
40
|
"split2": "^2.0.0",
|
|
41
41
|
"through2": "^3.0.0",
|
|
42
42
|
"trim-off-newlines": "^1.0.0"
|
|
@@ -47,5 +47,8 @@
|
|
|
47
47
|
"bin": {
|
|
48
48
|
"conventional-commits-parser": "cli.js"
|
|
49
49
|
},
|
|
50
|
-
"
|
|
50
|
+
"devDependencies": {
|
|
51
|
+
"forceable-tty": "^0.1.0"
|
|
52
|
+
},
|
|
53
|
+
"gitHead": "83643c5a0d2c4d7c9ba14cbf990ffbc577a51e8c"
|
|
51
54
|
}
|