conventional-changelog-conventionalcommits 4.2.3 → 4.3.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 CHANGED
@@ -3,6 +3,17 @@
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
+ # [4.3.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.2.3...conventional-changelog-conventionalcommits@4.3.0) (2020-05-08)
7
+
8
+
9
+ ### Features
10
+
11
+ * add support for 'feature' as alias for 'feat' ([#582](https://github.com/conventional-changelog/conventional-changelog/issues/582)) ([94c40f7](https://github.com/conventional-changelog/conventional-changelog/commit/94c40f755e6c329311d89a47c634b91cf0276da3))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [4.2.3](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.2.2...conventional-changelog-conventionalcommits@4.2.3) (2019-11-07)
7
18
 
8
19
 
@@ -1,8 +1,8 @@
1
1
  'use strict'
2
2
 
3
- const Q = require(`q`)
4
- const parserOpts = require(`./parser-opts`)
5
- const writerOpts = require(`./writer-opts`)
3
+ const Q = require('q')
4
+ const parserOpts = require('./parser-opts')
5
+ const writerOpts = require('./writer-opts')
6
6
 
7
7
  module.exports = function (config) {
8
8
  return Q.all([parserOpts, writerOpts])
@@ -1,7 +1,7 @@
1
1
  'use strict'
2
2
 
3
3
  const addBangNotes = require('./add-bang-notes')
4
- const parserOpts = require(`./parser-opts`)
4
+ const parserOpts = require('./parser-opts')
5
5
 
6
6
  module.exports = function (config) {
7
7
  return {
@@ -20,7 +20,7 @@ module.exports = function (config) {
20
20
  if (commit.notes.length > 0) {
21
21
  breakings += commit.notes.length
22
22
  level = 0
23
- } else if (commit.type === `feat`) {
23
+ } else if (commit.type === 'feat' || commit.type === 'feature') {
24
24
  features += 1
25
25
  if (level === 2) {
26
26
  level = 1
package/index.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict'
2
- const Q = require(`q`)
3
- const _ = require(`lodash`)
4
- const conventionalChangelog = require(`./conventional-changelog`)
5
- const parserOpts = require(`./parser-opts`)
6
- const recommendedBumpOpts = require(`./conventional-recommended-bump`)
7
- const writerOpts = require(`./writer-opts`)
2
+ const Q = require('q')
3
+ const _ = require('lodash')
4
+ const conventionalChangelog = require('./conventional-changelog')
5
+ const parserOpts = require('./parser-opts')
6
+ const recommendedBumpOpts = require('./conventional-recommended-bump')
7
+ const writerOpts = require('./writer-opts')
8
8
 
9
9
  module.exports = function (parameter) {
10
10
  // parameter passed can be either a config object or a callback function
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conventional-changelog-conventionalcommits",
3
- "version": "4.2.3",
3
+ "version": "4.3.0",
4
4
  "description": "conventional-changelog conventionalcommits.org preset",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "author": "Ben Coe",
28
28
  "engines": {
29
- "node": ">=6.9.0"
29
+ "node": ">=10"
30
30
  },
31
31
  "license": "ISC",
32
32
  "bugs": {
@@ -38,5 +38,5 @@
38
38
  "lodash": "^4.17.15",
39
39
  "q": "^1.5.1"
40
40
  },
41
- "gitHead": "741e90744cdb58e82e71feb36018047d7baca768"
41
+ "gitHead": "83643c5a0d2c4d7c9ba14cbf990ffbc577a51e8c"
42
42
  }
package/parser-opts.js CHANGED
@@ -6,13 +6,13 @@ module.exports = function (config) {
6
6
  headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/,
7
7
  breakingHeaderPattern: /^(\w*)(?:\((.*)\))?!: (.*)$/,
8
8
  headerCorrespondence: [
9
- `type`,
10
- `scope`,
11
- `subject`
9
+ 'type',
10
+ 'scope',
11
+ 'subject'
12
12
  ],
13
- noteKeywords: [`BREAKING CHANGE`],
13
+ noteKeywords: ['BREAKING CHANGE'],
14
14
  revertPattern: /^(?:Revert|revert:)\s"?([\s\S]+?)"?\s*This reverts commit (\w*)\./i,
15
- revertCorrespondence: [`header`, `hash`],
15
+ revertCorrespondence: ['header', 'hash'],
16
16
  issuePrefixes: config.issuePrefixes
17
17
  }
18
18
  }
package/writer-opts.js CHANGED
@@ -1,10 +1,10 @@
1
1
  'use strict'
2
2
 
3
3
  const addBangNotes = require('./add-bang-notes')
4
- const compareFunc = require(`compare-func`)
5
- const Q = require(`q`)
6
- const readFile = Q.denodeify(require(`fs`).readFile)
7
- const resolve = require(`path`).resolve
4
+ const compareFunc = require('compare-func')
5
+ const Q = require('q')
6
+ const readFile = Q.denodeify(require('fs').readFile)
7
+ const resolve = require('path').resolve
8
8
 
9
9
  /**
10
10
  * Handlebar partials for various property substitutions based on commit context.
@@ -34,10 +34,10 @@ module.exports = function (config) {
34
34
  })
35
35
 
36
36
  return Q.all([
37
- readFile(resolve(__dirname, `./templates/template.hbs`), `utf-8`),
38
- readFile(resolve(__dirname, `./templates/header.hbs`), `utf-8`),
39
- readFile(resolve(__dirname, `./templates/commit.hbs`), `utf-8`),
40
- readFile(resolve(__dirname, `./templates/footer.hbs`), `utf-8`)
37
+ readFile(resolve(__dirname, './templates/template.hbs'), 'utf-8'),
38
+ readFile(resolve(__dirname, './templates/header.hbs'), 'utf-8'),
39
+ readFile(resolve(__dirname, './templates/commit.hbs'), 'utf-8'),
40
+ readFile(resolve(__dirname, './templates/footer.hbs'), 'utf-8')
41
41
  ])
42
42
  .spread((template, header, commit, footer) => {
43
43
  const writerOpts = getWriterOpts(config)
@@ -73,7 +73,7 @@ function getWriterOpts (config) {
73
73
  addBangNotes(commit)
74
74
 
75
75
  commit.notes.forEach(note => {
76
- note.title = `BREAKING CHANGES`
76
+ note.title = 'BREAKING CHANGES'
77
77
  discard = false
78
78
  })
79
79
 
@@ -83,19 +83,19 @@ function getWriterOpts (config) {
83
83
 
84
84
  if (typesLookup[typeKey]) commit.type = typesLookup[typeKey].section
85
85
 
86
- if (commit.scope === `*`) {
87
- commit.scope = ``
86
+ if (commit.scope === '*') {
87
+ commit.scope = ''
88
88
  }
89
89
 
90
- if (typeof commit.hash === `string`) {
90
+ if (typeof commit.hash === 'string') {
91
91
  commit.shortHash = commit.hash.substring(0, 7)
92
92
  }
93
93
 
94
- if (typeof commit.subject === `string`) {
94
+ if (typeof commit.subject === 'string') {
95
95
  // Issue URLs.
96
96
  config.issuePrefixes.join('|')
97
- let issueRegEx = '(' + config.issuePrefixes.join('|') + ')' + '([0-9]+)'
98
- let re = new RegExp(issueRegEx, 'g')
97
+ const issueRegEx = '(' + config.issuePrefixes.join('|') + ')' + '([0-9]+)'
98
+ const re = new RegExp(issueRegEx, 'g')
99
99
 
100
100
  commit.subject = commit.subject.replace(re, (_, prefix, issue) => {
101
101
  issues.push(prefix + issue)
@@ -137,7 +137,7 @@ function getWriterOpts (config) {
137
137
 
138
138
  return commit
139
139
  },
140
- groupBy: `type`,
140
+ groupBy: 'type',
141
141
  // the groupings of commit messages, e.g., Features vs., Bug Fixes, are
142
142
  // sorted based on their probable importance:
143
143
  commitGroupsSort: (a, b) => {
@@ -150,8 +150,8 @@ function getWriterOpts (config) {
150
150
  return 1
151
151
  }
152
152
  },
153
- commitsSort: [`scope`, `subject`],
154
- noteGroupsSort: `title`,
153
+ commitsSort: ['scope', 'subject'],
154
+ noteGroupsSort: 'title',
155
155
  notesSort: compareFunc
156
156
  }
157
157
  }
@@ -161,6 +161,7 @@ function defaultConfig (config) {
161
161
  config = config || {}
162
162
  config.types = config.types || [
163
163
  { type: 'feat', section: 'Features' },
164
+ { type: 'feature', section: 'Features' },
164
165
  { type: 'fix', section: 'Bug Fixes' },
165
166
  { type: 'perf', section: 'Performance Improvements' },
166
167
  { type: 'revert', section: 'Reverts' },