conventional-commits-parser 3.2.4 → 5.0.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/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url]
1
+ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coverage-image]][coverage-url]
2
2
 
3
3
  > Parse raw conventional commits
4
4
 
@@ -379,5 +379,5 @@ MIT © [Steve Mao](https://github.com/stevemao)
379
379
  [travis-url]: https://travis-ci.org/conventional-changelog/conventional-commits-parser
380
380
  [daviddm-image]: https://david-dm.org/conventional-changelog/conventional-commits-parser.svg?theme=shields.io
381
381
  [daviddm-url]: https://david-dm.org/conventional-changelog/conventional-commits-parser
382
- [coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-commits-parser/badge.svg
383
- [coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-commits-parser
382
+ [coverage-image]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master
383
+ [coverage-url]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master
@@ -1,17 +1,12 @@
1
1
  #!/usr/bin/env node
2
- 'use strict'
3
- const conventionalCommitsParser = require('./')
4
- const forEach = require('lodash').forEach
5
- const fs = require('fs')
6
- const isTextPath = require('is-text-path')
7
- const JSONStream = require('JSONStream')
8
- const meow = require('meow')
9
- const readline = require('readline')
10
- const split = require('split2')
11
- const through = require('through2')
12
-
13
- const filePaths = []
14
- let separator = '\n\n\n'
2
+ import fs from 'fs'
3
+ import readline from 'readline'
4
+ import { Transform } from 'stream'
5
+ import isTextPath from 'is-text-path'
6
+ import JSONStream from 'JSONStream'
7
+ import split from 'split2'
8
+ import meow from 'meow'
9
+ import conventionalCommitsParser from './index.js'
15
10
 
16
11
  const cli = meow(`
17
12
  Practice writing commit messages or parse messages from files.
@@ -42,48 +37,52 @@ const cli = meow(`
42
37
  --revert-correspondence Comma separated fields used to define what the commit reverts
43
38
  -v, --verbose Verbose output
44
39
  `, {
40
+ importMeta: import.meta,
45
41
  flags: {
46
- 'header-pattern': {
47
- alias: 'p',
42
+ headerPattern: {
43
+ shortFlag: 'p',
48
44
  type: 'string'
49
45
  },
50
- 'header-correspondence': {
51
- alias: 'c',
46
+ headerCorrespondence: {
47
+ shortFlag: 'c',
52
48
  type: 'string'
53
49
  },
54
- 'reference-actions': {
55
- alias: 'r',
50
+ referenceActions: {
51
+ shortFlag: 'r',
56
52
  type: 'string'
57
53
  },
58
- 'issue-prefixes': {
59
- alias: 'i',
54
+ issuePrefixes: {
55
+ shortFlag: 'i',
60
56
  type: 'string'
61
57
  },
62
- 'issue-prefixes-case-sensitive': {
58
+ issuePrefixesCaseSensitive: {
63
59
  type: 'boolean'
64
60
  },
65
- 'note-keywords': {
66
- alias: 'n',
61
+ noteKeywords: {
62
+ shortFlag: 'n',
67
63
  type: 'string'
68
64
  },
69
- 'field-pattern': {
70
- alias: 'f',
65
+ fieldPattern: {
66
+ shortFlag: 'f',
71
67
  type: 'string'
72
68
  },
73
- 'revert-pattern': {
69
+ revertPattern: {
74
70
  type: 'string'
75
71
  },
76
- 'revert-correspondence': {
72
+ revertCorrespondence: {
77
73
  type: 'string'
78
74
  },
79
75
  verbose: {
80
- alias: 'v',
76
+ shortFlag: 'v',
81
77
  type: 'boolean'
82
78
  }
83
79
  }
84
80
  })
85
81
 
86
- forEach(cli.input, function (arg) {
82
+ const filePaths = []
83
+ let separator = '\n\n\n'
84
+
85
+ cli.input.forEach((arg) => {
87
86
  if (isTextPath(arg)) {
88
87
  filePaths.push(arg)
89
88
  } else {
@@ -101,7 +100,7 @@ if (options.verbose) {
101
100
  function processFile (fileIndex) {
102
101
  const filePath = filePaths[fileIndex]
103
102
  fs.createReadStream(filePath)
104
- .on('error', function (err) {
103
+ .on('error', (err) => {
105
104
  console.warn('Failed to read file ' + filePath + '\n' + err)
106
105
  if (++fileIndex < length) {
107
106
  processFile(fileIndex)
@@ -110,7 +109,7 @@ function processFile (fileIndex) {
110
109
  .pipe(split(separator))
111
110
  .pipe(conventionalCommitsParser(options))
112
111
  .pipe(JSONStream.stringify())
113
- .on('end', function () {
112
+ .on('end', () => {
114
113
  if (++fileIndex < length) {
115
114
  processFile(fileIndex)
116
115
  }
@@ -123,7 +122,9 @@ if (process.stdin.isTTY) {
123
122
  processFile(0)
124
123
  } else {
125
124
  let commit = ''
126
- const stream = through()
125
+ const stream = new Transform({
126
+ transform: (chunk, enc, cb) => cb(null, chunk)
127
+ })
127
128
  const rl = readline.createInterface({
128
129
  input: process.stdin,
129
130
  output: process.stdout,
@@ -132,16 +133,20 @@ if (process.stdin.isTTY) {
132
133
 
133
134
  stream.pipe(conventionalCommitsParser(options))
134
135
  .pipe(JSONStream.stringify('', '', ''))
135
- .pipe(through(function (chunk, enc, cb) {
136
- if (chunk.toString() === '""') {
137
- cb(null, 'Commit cannot be parsed\n')
138
- } else {
139
- cb(null, chunk + '\n')
140
- }
141
- }))
136
+ .pipe(
137
+ new Transform({
138
+ transform (chunk, enc, cb) {
139
+ if (chunk.toString() === '""') {
140
+ cb(null, 'Commit cannot be parsed\n')
141
+ } else {
142
+ cb(null, chunk + '\n')
143
+ }
144
+ }
145
+ })
146
+ )
142
147
  .pipe(process.stdout)
143
148
 
144
- rl.on('line', function (line) {
149
+ rl.on('line', (line) => {
145
150
  commit += line + '\n'
146
151
  if (commit.indexOf(separator) === -1) {
147
152
  return
@@ -156,7 +161,7 @@ if (process.stdin.isTTY) {
156
161
  process.stdin
157
162
  .pipe(split(separator))
158
163
  .pipe(conventionalCommitsParser(options))
159
- .on('error', function (err) {
164
+ .on('error', (err) => {
160
165
  console.error(err.toString())
161
166
  process.exit(1)
162
167
  })
package/index.js CHANGED
@@ -1,12 +1,11 @@
1
1
  'use strict'
2
2
 
3
+ const { Transform } = require('stream')
3
4
  const parser = require('./lib/parser')
4
5
  const regex = require('./lib/regex')
5
- const through = require('through2')
6
- const _ = require('lodash')
7
6
 
8
7
  function assignOpts (options) {
9
- options = _.extend({
8
+ options = {
10
9
  headerPattern: /^(\w*)(?:\(([\w$.\-*/ ]*)\))?: (.*)$/,
11
10
  headerCorrespondence: ['type', 'scope', 'subject'],
12
11
  referenceActions: [
@@ -27,8 +26,9 @@ function assignOpts (options) {
27
26
  revertCorrespondence: ['header', 'hash'],
28
27
  warn: function () {},
29
28
  mergePattern: null,
30
- mergeCorrespondence: null
31
- }, options)
29
+ mergeCorrespondence: null,
30
+ ...options
31
+ }
32
32
 
33
33
  if (typeof options.headerPattern === 'string') {
34
34
  options.headerPattern = new RegExp(options.headerPattern)
@@ -73,18 +73,22 @@ function conventionalCommitsParser (options) {
73
73
  options = assignOpts(options)
74
74
  const reg = regex(options)
75
75
 
76
- return through.obj(function (data, enc, cb) {
77
- let commit
78
-
79
- try {
80
- commit = parser(data.toString(), options, reg)
81
- cb(null, commit)
82
- } catch (err) {
83
- if (options.warn === true) {
84
- cb(err)
85
- } else {
86
- options.warn(err.toString())
87
- cb(null, '')
76
+ return new Transform({
77
+ objectMode: true,
78
+ highWaterMark: 16,
79
+ transform (data, enc, cb) {
80
+ let commit
81
+
82
+ try {
83
+ commit = parser(data.toString(), options, reg)
84
+ cb(null, commit)
85
+ } catch (err) {
86
+ if (options.warn === true) {
87
+ cb(err)
88
+ } else {
89
+ options.warn(err.toString())
90
+ cb(null, '')
91
+ }
88
92
  }
89
93
  }
90
94
  })
package/lib/parser.js CHANGED
@@ -1,5 +1,4 @@
1
1
  'use strict'
2
- const _ = require('lodash')
3
2
 
4
3
  const CATCH_ALL = /()(.+)/gi
5
4
  const SCISSOR = '# ------------------------ >8 ------------------------'
@@ -67,8 +66,8 @@ function getReferences (input, regex) {
67
66
  }
68
67
 
69
68
  const reference = {
70
- action: action,
71
- owner: owner,
69
+ action,
70
+ owner,
72
71
  repository: repository || null,
73
72
  issue: referenceMatch[3],
74
73
  raw: referenceMatch[0],
@@ -91,11 +90,11 @@ function parser (raw, options, regex) {
91
90
  throw new TypeError('Expected a raw commit')
92
91
  }
93
92
 
94
- if (_.isEmpty(options)) {
93
+ if (!options || (typeof options === 'object' && !Object.keys(options).length)) {
95
94
  throw new TypeError('Expected options')
96
95
  }
97
96
 
98
- if (_.isEmpty(regex)) {
97
+ if (!regex) {
99
98
  throw new TypeError('Expected regex')
100
99
  }
101
100
 
@@ -112,15 +111,15 @@ function parser (raw, options, regex) {
112
111
 
113
112
  let continueNote = false
114
113
  let isBody = true
115
- const headerCorrespondence = _.map(options.headerCorrespondence, function (part) {
114
+ const headerCorrespondence = options.headerCorrespondence?.map(function (part) {
116
115
  return part.trim()
117
- })
118
- const revertCorrespondence = _.map(options.revertCorrespondence, function (field) {
116
+ }) || []
117
+ const revertCorrespondence = options.revertCorrespondence?.map(function (field) {
119
118
  return field.trim()
120
- })
121
- const mergeCorrespondence = _.map(options.mergeCorrespondence, function (field) {
119
+ }) || []
120
+ const mergeCorrespondence = options.mergeCorrespondence?.map(function (field) {
122
121
  return field.trim()
123
- })
122
+ }) || []
124
123
 
125
124
  let body = null
126
125
  let footer = null
@@ -133,14 +132,14 @@ function parser (raw, options, regex) {
133
132
 
134
133
  if (lines.length === 0) {
135
134
  return {
136
- body: body,
137
- footer: footer,
138
- header: header,
139
- mentions: mentions,
140
- merge: merge,
141
- notes: notes,
142
- references: references,
143
- revert: revert,
135
+ body,
136
+ footer,
137
+ header,
138
+ mentions,
139
+ merge,
140
+ notes,
141
+ references,
142
+ revert,
144
143
  scope: null,
145
144
  subject: null,
146
145
  type: null
@@ -166,7 +165,7 @@ function parser (raw, options, regex) {
166
165
  header = ''
167
166
  }
168
167
 
169
- _.forEach(mergeCorrespondence, function (partName, index) {
168
+ mergeCorrespondence.forEach(function (partName, index) {
170
169
  const partValue = mergeMatch[index + 1] || null
171
170
  mergeParts[partName] = partValue
172
171
  })
@@ -174,30 +173,30 @@ function parser (raw, options, regex) {
174
173
  header = merge
175
174
  merge = null
176
175
 
177
- _.forEach(mergeCorrespondence, function (partName) {
176
+ mergeCorrespondence.forEach(function (partName) {
178
177
  mergeParts[partName] = null
179
178
  })
180
179
  }
181
180
 
182
181
  const headerMatch = header.match(options.headerPattern)
183
182
  if (headerMatch) {
184
- _.forEach(headerCorrespondence, function (partName, index) {
183
+ headerCorrespondence.forEach(function (partName, index) {
185
184
  const partValue = headerMatch[index + 1] || null
186
185
  headerParts[partName] = partValue
187
186
  })
188
187
  } else {
189
- _.forEach(headerCorrespondence, function (partName) {
188
+ headerCorrespondence.forEach(function (partName) {
190
189
  headerParts[partName] = null
191
190
  })
192
191
  }
193
192
 
194
- Array.prototype.push.apply(references, getReferences(header, {
193
+ references.push(...getReferences(header, {
195
194
  references: regex.references,
196
195
  referenceParts: regex.referenceParts
197
196
  }))
198
197
 
199
198
  // body or footer
200
- _.forEach(lines, function (line) {
199
+ lines.forEach(function (line) {
201
200
  if (options.fieldPattern) {
202
201
  const fieldMatch = options.fieldPattern.exec(line)
203
202
 
@@ -285,7 +284,7 @@ function parser (raw, options, regex) {
285
284
  const revertMatch = raw.match(options.revertPattern)
286
285
  if (revertMatch) {
287
286
  revert = {}
288
- _.forEach(revertCorrespondence, function (partName, index) {
287
+ revertCorrespondence.forEach(function (partName, index) {
289
288
  const partValue = revertMatch[index + 1] || null
290
289
  revert[partName] = partValue
291
290
  })
@@ -293,22 +292,23 @@ function parser (raw, options, regex) {
293
292
  revert = null
294
293
  }
295
294
 
296
- _.map(notes, function (note) {
295
+ notes.forEach(function (note) {
297
296
  note.text = trimOffNewlines(note.text)
298
-
299
- return note
300
297
  })
301
298
 
302
- const msg = _.merge(headerParts, mergeParts, {
303
- merge: merge,
304
- header: header,
299
+ const msg = {
300
+ ...headerParts,
301
+ ...mergeParts,
302
+ merge,
303
+ header,
305
304
  body: body ? trimOffNewlines(body) : null,
306
305
  footer: footer ? trimOffNewlines(footer) : null,
307
- notes: notes,
308
- references: references,
309
- mentions: mentions,
310
- revert: revert
311
- }, otherFields)
306
+ notes,
307
+ references,
308
+ mentions,
309
+ revert,
310
+ ...otherFields
311
+ }
312
312
 
313
313
  return msg
314
314
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conventional-commits-parser",
3
- "version": "3.2.4",
3
+ "version": "5.0.0",
4
4
  "description": "Parse raw conventional commits",
5
5
  "bugs": {
6
6
  "url": "https://github.com/conventional-changelog/conventional-changelog/issues"
@@ -17,11 +17,11 @@
17
17
  },
18
18
  "license": "MIT",
19
19
  "engines": {
20
- "node": ">=10"
20
+ "node": ">=16"
21
21
  },
22
22
  "files": [
23
23
  "index.js",
24
- "cli.js",
24
+ "cli.mjs",
25
25
  "lib"
26
26
  ],
27
27
  "keywords": [
@@ -33,20 +33,15 @@
33
33
  "logs"
34
34
  ],
35
35
  "dependencies": {
36
- "is-text-path": "^1.0.1",
37
- "JSONStream": "^1.0.4",
38
- "lodash": "^4.17.15",
39
- "meow": "^8.0.0",
40
- "split2": "^3.0.0",
41
- "through2": "^4.0.0"
42
- },
43
- "scripts": {
44
- "test-windows": "echo 'make work on windows'"
36
+ "JSONStream": "^1.3.5",
37
+ "is-text-path": "^2.0.0",
38
+ "meow": "^12.0.1",
39
+ "split2": "^4.0.0"
45
40
  },
46
41
  "bin": {
47
- "conventional-commits-parser": "cli.js"
42
+ "conventional-commits-parser": "cli.mjs"
48
43
  },
49
44
  "devDependencies": {
50
45
  "forceable-tty": "^0.1.0"
51
46
  }
52
- }
47
+ }
package/CHANGELOG.md DELETED
@@ -1,463 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [3.2.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.1.0...conventional-commits-parser@3.2.0) (2020-11-05)
7
-
8
-
9
- ### Bug Fixes
10
-
11
- * ignore gpg lines ([#685](https://github.com/conventional-changelog/conventional-changelog/issues/685)) ([f8fcbc2](https://github.com/conventional-changelog/conventional-changelog/commit/f8fcbc2e8b0834c29178ace6382b438a020ad828))
12
- * **deps:** update dependency through2 to v4 ([#657](https://github.com/conventional-changelog/conventional-changelog/issues/657)) ([7ae618c](https://github.com/conventional-changelog/conventional-changelog/commit/7ae618c81491841e5b1d796d3933aac0c54bc312))
13
-
14
-
15
- ### Features
16
-
17
- * allows notes pattern to be customized ([#586](https://github.com/conventional-changelog/conventional-changelog/issues/586)) ([9c00f32](https://github.com/conventional-changelog/conventional-changelog/commit/9c00f3242d916be1774a618d943f908f8d9699a6))
18
-
19
-
20
-
21
-
22
-
23
- # [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)
24
-
25
-
26
- ### Bug Fixes
27
-
28
- * **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))
29
-
30
-
31
- ### Features
32
-
33
- * **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))
34
- * support slash in headerPattern default options ([93a547d](https://github.com/conventional-changelog/conventional-changelog/commit/93a547d742634d8676f499cfa2a274bc3792d020))
35
-
36
-
37
-
38
-
39
-
40
- ### [3.2.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.3...conventional-commits-parser-v3.2.4) (2021-12-29)
41
-
42
-
43
- ### Bug Fixes
44
-
45
- * support BREAKING-CHANGE alongside BREAKING CHANGE ([#882](https://github.com/conventional-changelog/conventional-changelog/issues/882)) ([e6f44ad](https://github.com/conventional-changelog/conventional-changelog/commit/e6f44adcf1ac5abbb85bdac73237c331c6594177))
46
-
47
- ### [3.2.3](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.2...conventional-commits-parser-v3.2.3) (2021-10-23)
48
-
49
-
50
- ### Bug Fixes
51
-
52
- * address ReDoS issue ([#861](https://www.github.com/conventional-changelog/conventional-changelog/issues/861)) ([c696fa3](https://www.github.com/conventional-changelog/conventional-changelog/commit/c696fa35f93e0ee13728d6cf1221587ac6386311))
53
-
54
- ### [3.2.2](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser-v3.2.1...conventional-commits-parser-v3.2.2) (2021-09-09)
55
-
56
-
57
- ### Bug Fixes
58
-
59
- * **conventional-commits-parser:** address CVE-2021-23425 ([#841](https://www.github.com/conventional-changelog/conventional-changelog/issues/841)) ([02b3d53](https://www.github.com/conventional-changelog/conventional-changelog/commit/02b3d53a0c142f0c28ee7d190d210c76a62887c2))
60
-
61
- ### [3.2.1](https://www.github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.2.0...v3.2.1) (2021-02-15)
62
-
63
-
64
- ### Bug Fixes
65
-
66
- * handle missing header in merge commit ([#757](https://www.github.com/conventional-changelog/conventional-changelog/issues/757)) ([d189d3e](https://www.github.com/conventional-changelog/conventional-changelog/commit/d189d3e45b82e7141115ce8eccd95c8cf2d7db77))
67
-
68
- ## [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)
69
-
70
-
71
- ### Bug Fixes
72
-
73
- * add types for cli flags ([#551](https://github.com/conventional-changelog/conventional-changelog/issues/551)) ([bf1d64a](https://github.com/conventional-changelog/conventional-changelog/commit/bf1d64aeaf8f262d4b2beec02d2aebb78df7343b))
74
-
75
-
76
-
77
-
78
-
79
- ## [3.0.7](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.6...conventional-commits-parser@3.0.7) (2019-11-07)
80
-
81
-
82
- ### Bug Fixes
83
-
84
- * **conventional-commits-parser:** add breaking change notes if header match `breakingHeaderPattern` ([#544](https://github.com/conventional-changelog/conventional-changelog/issues/544)) ([efdf3cb](https://github.com/conventional-changelog/conventional-changelog/commit/efdf3cbc9de3278b180a48beebb74e596e3c5f94))
85
- * **conventional-commits-parser:** add missing separator pipe to non tty parser ([#546](https://github.com/conventional-changelog/conventional-changelog/issues/546)) ([c522743](https://github.com/conventional-changelog/conventional-changelog/commit/c5227437b0b300f30a57e8ba5df2a8ab8d163af0))
86
-
87
-
88
-
89
-
90
-
91
- ## [3.0.6](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.5...conventional-commits-parser@3.0.6) (2019-10-24)
92
-
93
-
94
- ### Bug Fixes
95
-
96
- * **conventional-commits-parser:** downgrade is-text-path due to node 6 incompatibility ([#536](https://github.com/conventional-changelog/conventional-changelog/issues/536)) ([3aa2637](https://github.com/conventional-changelog/conventional-changelog/commit/3aa2637a1c65bb4db3d8bf2c6ce17e6f5abe1ca1))
97
- * **deps:** update lodash to fix security issues ([#535](https://github.com/conventional-changelog/conventional-changelog/issues/535)) ([ac43f51](https://github.com/conventional-changelog/conventional-changelog/commit/ac43f51de1f3b597c32f7f8442917a2d06199018))
98
-
99
-
100
-
101
-
102
-
103
- ## [3.0.4](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.3...conventional-commits-parser@3.0.4) (2019-10-02)
104
-
105
- **Note:** Version bump only for package conventional-commits-parser
106
-
107
-
108
-
109
-
110
-
111
- ## [3.0.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.2...conventional-commits-parser@3.0.3) (2019-05-18)
112
-
113
-
114
- ### Bug Fixes
115
-
116
- * **deps:** update dependency is-text-path to v2 ([#455](https://github.com/conventional-changelog/conventional-changelog/issues/455)) ([0f40ec3](https://github.com/conventional-changelog/conventional-changelog/commit/0f40ec3))
117
-
118
-
119
-
120
-
121
-
122
- ## [3.0.2](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.1...conventional-commits-parser@3.0.2) (2019-04-10)
123
-
124
-
125
- ### Bug Fixes
126
-
127
- * **deps:** update dependency through2 to v3 ([#392](https://github.com/conventional-changelog/conventional-changelog/issues/392)) ([26fe91f](https://github.com/conventional-changelog/conventional-changelog/commit/26fe91f))
128
-
129
-
130
-
131
-
132
-
133
- ## [3.0.1](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@3.0.0...conventional-commits-parser@3.0.1) (2018-11-01)
134
-
135
-
136
- ### Bug Fixes
137
-
138
- * Upgrade to Lerna 3, fix Node.js v11 error ([#385](https://github.com/conventional-changelog/conventional-changelog/issues/385)) ([cdef282](https://github.com/conventional-changelog/conventional-changelog/commit/cdef282))
139
-
140
-
141
-
142
-
143
-
144
- <a name="3.0.0"></a>
145
- # [3.0.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-commits-parser@2.1.7...conventional-commits-parser@3.0.0) (2018-05-29)
146
-
147
-
148
- ### Chores
149
-
150
- * **package:** set Node requirement to oldest supported LTS ([#329](https://github.com/conventional-changelog/conventional-changelog/issues/329)) ([cae2fe0](https://github.com/conventional-changelog/conventional-changelog/commit/cae2fe0))
151
-
152
-
153
- ### BREAKING CHANGES
154
-
155
- * **package:** Set the package's minimum required Node version to be the oldest LTS
156
- currently supported by the Node Release working group. At this time,
157
- that is Node 6 (which is in its Maintenance LTS phase).
158
-
159
-
160
-
161
-
162
- <a name="2.1.7"></a>
163
- ## [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)
164
-
165
-
166
-
167
-
168
- **Note:** Version bump only for package conventional-commits-parser
169
-
170
- <a name="2.1.6"></a>
171
- ## [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)
172
-
173
-
174
-
175
-
176
- **Note:** Version bump only for package conventional-commits-parser
177
-
178
- <a name="2.1.5"></a>
179
- ## [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)
180
-
181
-
182
-
183
-
184
- **Note:** Version bump only for package conventional-commits-parser
185
-
186
- <a name="2.1.4"></a>
187
- ## [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)
188
-
189
-
190
-
191
-
192
- **Note:** Version bump only for package conventional-commits-parser
193
-
194
- <a name="2.1.3"></a>
195
- ## [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)
196
-
197
-
198
-
199
-
200
- **Note:** Version bump only for package conventional-commits-parser
201
-
202
- <a name="2.1.2"></a>
203
- ## [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)
204
-
205
-
206
-
207
-
208
- **Note:** Version bump only for package conventional-commits-parser
209
-
210
- <a name="2.1.1"></a>
211
- ## [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)
212
-
213
-
214
- ### Bug Fixes
215
-
216
- * 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))
217
-
218
-
219
-
220
-
221
- <a name="2.1.0"></a>
222
- # [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)
223
-
224
-
225
- ### Bug Fixes
226
-
227
- * 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)
228
-
229
-
230
- ### Features
231
-
232
- * 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)
233
-
234
-
235
-
236
-
237
- <a name="2.0.1"></a>
238
- ## [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)
239
-
240
-
241
- ### Bug Fixes
242
-
243
- * **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)
244
-
245
-
246
-
247
-
248
- <a name="2.0.0"></a>
249
- # 2.0.0 (2017-07-17)
250
-
251
-
252
- ### Bug Fixes
253
-
254
- * **cli:** commit can be split when testing a commit file ([f3b3a3f](https://github.com/conventional-changelog/conventional-commits-parser/commit/f3b3a3f))
255
- * **cli:** error handling for ENOENT is fixed ([3c92233](https://github.com/conventional-changelog/conventional-commits-parser/commit/3c92233))
256
- * **cli:** fix "undefined" in json string ([0680e42](https://github.com/conventional-changelog/conventional-commits-parser/commit/0680e42))
257
- * **cli:** options format ([491357e](https://github.com/conventional-changelog/conventional-commits-parser/commit/491357e))
258
- * **deps:** require split2 ([1941c37](https://github.com/conventional-changelog/conventional-commits-parser/commit/1941c37))
259
- * **error:** change error type and wordings ([d8be5e5](https://github.com/conventional-changelog/conventional-commits-parser/commit/d8be5e5))
260
- * **footer:** notes contains more than one paragraphs after references ([d744ec7](https://github.com/conventional-changelog/conventional-commits-parser/commit/d744ec7))
261
- * **headerCorrespondence:** string value for cli ([fb774fc](https://github.com/conventional-changelog/conventional-commits-parser/commit/fb774fc))
262
- * **headerPattern:** change how capturing groups works ([fe1fe0c](https://github.com/conventional-changelog/conventional-commits-parser/commit/fe1fe0c))
263
- * **issuePrefixes:** should return noMatch if falsy ([72db2bf](https://github.com/conventional-changelog/conventional-commits-parser/commit/72db2bf))
264
- * **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)
265
- * **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)
266
- * **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)
267
- * **parser:** do not trim spaces but newlines ([1e8c4c5](https://github.com/conventional-changelog/conventional-commits-parser/commit/1e8c4c5))
268
- * **parser:** it returns null if there is no header ([8571c9e](https://github.com/conventional-changelog/conventional-commits-parser/commit/8571c9e))
269
- * **regex:** do not treat it as note if there are texts after keywords ([571b03e](https://github.com/conventional-changelog/conventional-commits-parser/commit/571b03e))
270
- * **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)
271
- * **revertPattern:** correct regex ([8628983](https://github.com/conventional-changelog/conventional-commits-parser/commit/8628983))
272
- * **util:** remove an accidentally commited file ([3710a8c](https://github.com/conventional-changelog/conventional-commits-parser/commit/3710a8c))
273
- * **warn:** should tell which commit cannot be parsed ([04b0a9b](https://github.com/conventional-changelog/conventional-commits-parser/commit/04b0a9b))
274
-
275
-
276
- ### Chores
277
-
278
- * init ([a529841](https://github.com/conventional-changelog/conventional-commits-parser/commit/a529841))
279
-
280
-
281
- ### Code Refactoring
282
-
283
- * **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)
284
- * **merge:** pull-request should be merge ([4e7c61c](https://github.com/conventional-changelog/conventional-commits-parser/commit/4e7c61c))
285
- * **regex:** regex now takes `options` ([eea319a](https://github.com/conventional-changelog/conventional-commits-parser/commit/eea319a))
286
-
287
-
288
- ### Features
289
-
290
- * **cli:** able to have two files, separator works for interactive ([db1e3b5](https://github.com/conventional-changelog/conventional-commits-parser/commit/db1e3b5))
291
- * **cli:** add aliases, more help details and tests ([eb654a2](https://github.com/conventional-changelog/conventional-commits-parser/commit/eb654a2))
292
- * **cli:** add missing options ([8ac1cf7](https://github.com/conventional-changelog/conventional-commits-parser/commit/8ac1cf7))
293
- * **cli:** add warn function for interactive shell ([84fe31f](https://github.com/conventional-changelog/conventional-commits-parser/commit/84fe31f))
294
- * **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)
295
- * **fieldPattern:** should support string format ([b6b6b52](https://github.com/conventional-changelog/conventional-commits-parser/commit/b6b6b52))
296
- * **hash:** drop support ([1ccc751](https://github.com/conventional-changelog/conventional-commits-parser/commit/1ccc751))
297
- * **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)
298
- * **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)
299
- * **maxSubjectLength:** removed ([3448582](https://github.com/conventional-changelog/conventional-commits-parser/commit/3448582))
300
- * **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)
301
- * **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)
302
- * **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)
303
- * **options:** all options can be a string ([0fa17b4](https://github.com/conventional-changelog/conventional-commits-parser/commit/0fa17b4))
304
- * **otherFields:** other fields are possible to be included ([9e06278](https://github.com/conventional-changelog/conventional-commits-parser/commit/9e06278))
305
- * 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)
306
- * migrate repo to lerna mono-repo ([793e823](https://github.com/conventional-changelog/conventional-commits-parser/commit/793e823))
307
- * **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)
308
- * support squash commits ([#31](https://github.com/conventional-changelog/conventional-changelog/issues/31)) ([fff60c0](https://github.com/conventional-changelog/conventional-commits-parser/commit/fff60c0))
309
- * **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)
310
- * **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)
311
- * **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)
312
- * **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)
313
- * **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)
314
- * **references:** allow header to reference an issue ([df18a24](https://github.com/conventional-changelog/conventional-commits-parser/commit/df18a24))
315
- * **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)
316
- * **regex:** leading and trailing space for closes and breaks keywords are trimmed ([9639860](https://github.com/conventional-changelog/conventional-commits-parser/commit/9639860))
317
- * **revert:** parse a commit that reverts ([2af7233](https://github.com/conventional-changelog/conventional-commits-parser/commit/2af7233))
318
- * **stream:** emmit an empty string to down stream if commit cannot be parsed ([76bf84e](https://github.com/conventional-changelog/conventional-commits-parser/commit/76bf84e))
319
- * **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)
320
- * **warn:** optionally warn user what is wrong when commit cannot be parsed ([32b3cda](https://github.com/conventional-changelog/conventional-commits-parser/commit/32b3cda))
321
-
322
-
323
- ### Performance Improvements
324
-
325
- * **regex:** regex should be constructed in index.html ([15afd26](https://github.com/conventional-changelog/conventional-commits-parser/commit/15afd26))
326
-
327
-
328
- ### BREAKING CHANGES
329
-
330
- * **merge:** `pull request` should be `merge`. Also make the parsed result to be consistent with other parts.
331
- * This module is imported from https://github.com/ajoslin/conventional-changelog, and is originally written by @vojtajina, @btford and @ajoslin.
332
- * **hash:** hash is no longer supported. This parser should just parse raw commit messages. Also text fields are appended with a newline "
333
- ".
334
- * **regex:** It returns a nomatch regex if it's keywords are missing.
335
- * **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`.
336
- * **maxSubjectLength:** `maxSubjectLength` is not available any more.
337
- * **issuePrefixes:** `options.referenceKeywords` is now `options.referenceActions`
338
- * **references:** `closes` now becomes `references` and it is loosely based the links above.
339
- * **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
340
- ```js
341
- {
342
- title: 'BREAKING AMEND',
343
- text: 'some breaking change'
344
- }
345
- ```
346
- The detection of notes, closes, continueNote and isBody are mutually exclusive.
347
- * **breaks:** Variable name related to `breaks` changes to `notes`, because "Important Notes" a more generic term. There is no functional changes.
348
- * **stream:** It no longer skips the chunk if commit cannot be parsed. An empty string is passed to down stream
349
- * **correspondence:** body and footer will be null if they are not found. type and subject are nullable too.
350
-
351
- <a name="1.3.0"></a>
352
- # [1.3.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.3...v1.3.0) (2016-10-15)
353
-
354
-
355
- ### Features
356
-
357
- * support squash commits (#31) ([860c7a1](https://github.com/conventional-changelog/conventional-commits-parser/commit/860c7a1))
358
-
359
-
360
-
361
- <a name="1.2.3"></a>
362
- ## [1.2.3](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.2...v1.2.3) (2016-08-06)
363
-
364
-
365
- ### Bug Fixes
366
-
367
- * **regex:** do not treat it as note if there are texts after keywords ([9cb56bc](https://github.com/conventional-changelog/conventional-commits-parser/commit/9cb56bc))
368
-
369
-
370
-
371
- <a name="1.2.2"></a>
372
- ## [1.2.2](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.1...v1.2.2) (2016-05-04)
373
-
374
-
375
- ### Bug Fixes
376
-
377
- * **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)
378
-
379
-
380
-
381
- <a name="1.2.1"></a>
382
- ## [1.2.1](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.2.0...v1.2.1) (2016-04-24)
383
-
384
-
385
- ### Bug Fixes
386
-
387
- * **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)
388
-
389
-
390
-
391
- <a name="1.2.0"></a>
392
- # [1.2.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.1.0...v1.2.0) (2016-04-15)
393
-
394
-
395
- ### Features
396
-
397
- * **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)
398
-
399
-
400
-
401
- <a name="1.1.0"></a>
402
- # [1.1.0](https://github.com/conventional-changelog/conventional-commits-parser/compare/v1.0.1...v1.1.0) (2016-04-10)
403
-
404
-
405
- ### Bug Fixes
406
-
407
- * **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)
408
-
409
- ### Features
410
-
411
- * **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)
412
-
413
-
414
-
415
- <a name="1.0.1"></a>
416
- ## [1.0.1](https://github.com/stevemao/conventional-commits-parser/compare/v1.0.0...v1.0.1) (2016-02-05)
417
-
418
-
419
- ### Bug Fixes
420
-
421
- * **deps:** require split2 ([ad55810](https://github.com/stevemao/conventional-commits-parser/commit/ad55810))
422
-
423
-
424
-
425
- <a name="1.0.0"></a>
426
- # [1.0.0](https://github.com/stevemao/conventional-commits-parser/compare/v0.2.0...v1.0.0) (2016-02-05)
427
-
428
-
429
-
430
-
431
- <a name="0.2.0"></a>
432
- # [0.2.0](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.2...v0.2.0) (2016-02-04)
433
-
434
-
435
- ### Features
436
-
437
- * **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)
438
- * **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)
439
- * **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)
440
-
441
-
442
-
443
- <a name="0.1.2"></a>
444
- ## [0.1.2](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.1...v0.1.2) (2015-09-18)
445
-
446
-
447
- ### Bug Fixes
448
-
449
- * **parser:** do not trim spaces but newlines ([62e7bf5](https://github.com/stevemao/conventional-commits-parser/commit/62e7bf5))
450
-
451
-
452
-
453
- <a name="0.1.1"></a>
454
- ## [0.1.1](https://github.com/stevemao/conventional-commits-parser/compare/v0.1.0...v0.1.1) (2015-09-12)
455
-
456
-
457
- ### Bug Fixes
458
-
459
- * **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)
460
-
461
- ### Features
462
-
463
- * **reference:** expose prefix ([9962dda](https://github.com/stevemao/conventional-commits-parser/commit/9962dda)), closes [#17](https://github.com/stevemao/conventional-commits-parser/issues/17)