conventional-changelog-conventionalcommits
Advanced tools
Comparing version 4.1.0 to 4.2.1
@@ -6,2 +6,20 @@ # Change Log | ||
# [4.2.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.1.0...conventional-changelog-conventionalcommits@4.2.0) (2019-10-02) | ||
### Bug Fixes | ||
* **preset, conventionalcommits:** fix handling conventionalcommits preset without config object ([c0566ce](https://github.com/conventional-changelog/conventional-changelog/commit/c0566ce)), closes [#512](https://github.com/conventional-changelog/conventional-changelog/issues/512) | ||
* **preset, conventionalcommits:** pass issuePrefixes to parser ([#510](https://github.com/conventional-changelog/conventional-changelog/issues/510)) ([958d243](https://github.com/conventional-changelog/conventional-changelog/commit/958d243)) | ||
* use full commit hash in commit link ([7a60dec](https://github.com/conventional-changelog/conventional-changelog/commit/7a60dec)), closes [#476](https://github.com/conventional-changelog/conventional-changelog/issues/476) | ||
### Features | ||
* sort sections of CHANGELOG based on priority ([#513](https://github.com/conventional-changelog/conventional-changelog/issues/513)) ([a3acc32](https://github.com/conventional-changelog/conventional-changelog/commit/a3acc32)) | ||
# [4.1.0](https://github.com/conventional-changelog/conventional-changelog/compare/conventional-changelog-conventionalcommits@4.0.0...conventional-changelog-conventionalcommits@4.1.0) (2019-07-29) | ||
@@ -8,0 +26,0 @@ |
23
index.js
'use strict' | ||
const Q = require(`q`) | ||
const _ = require(`lodash`) | ||
const conventionalChangelog = require(`./conventional-changelog`) | ||
@@ -8,3 +9,23 @@ const parserOpts = require(`./parser-opts`) | ||
module.exports = function (config) { | ||
module.exports = function (parameter) { | ||
// parameter passed can be either a config object or a callback function | ||
if (_.isFunction(parameter)) { | ||
// parameter is a callback object | ||
const config = {} | ||
// FIXME: use presetOpts(config) for callback | ||
Q.all([ | ||
conventionalChangelog(config), | ||
parserOpts(config), | ||
recommendedBumpOpts(config), | ||
writerOpts(config) | ||
]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { | ||
parameter(null, { gitRawCommitsOpts: { noMerges: null }, conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }) | ||
}) | ||
} else { | ||
const config = parameter || {} | ||
return presetOpts(config) | ||
} | ||
} | ||
function presetOpts (config) { | ||
return Q.all([ | ||
@@ -11,0 +32,0 @@ conventionalChangelog(config), |
{ | ||
"name": "conventional-changelog-conventionalcommits", | ||
"version": "4.1.0", | ||
"version": "4.2.1", | ||
"description": "conventional-changelog conventionalcommits.org preset", | ||
@@ -38,5 +38,6 @@ "main": "index.js", | ||
"compare-func": "^1.3.1", | ||
"lodash": "^4.2.1", | ||
"q": "^1.5.1" | ||
}, | ||
"gitHead": "dadbbf8b1acbe4b3a8f345633bde3f4a4ad0bea4" | ||
"gitHead": "7c1c8ad819b05c12c7d58c92ac386b45ada6f6a8" | ||
} |
'use strict' | ||
module.exports = function (config) { | ||
config = defaultConfig(config) | ||
return { | ||
@@ -14,4 +15,12 @@ headerPattern: /^(\w*)(?:\((.*)\))?!?: (.*)$/, | ||
revertPattern: /^revert:\s([\s\S]*?)\s*This reverts commit (\w*)\./, | ||
revertCorrespondence: [`header`, `hash`] | ||
revertCorrespondence: [`header`, `hash`], | ||
issuePrefixes: config.issuePrefixes | ||
} | ||
} | ||
// merge user set configuration with default configuration. | ||
function defaultConfig (config) { | ||
config = config || {} | ||
config.issuePrefixes = config.issuePrefixes || ['#'] | ||
return config | ||
} |
@@ -91,3 +91,3 @@ 'use strict' | ||
if (typeof commit.hash === `string`) { | ||
commit.hash = commit.hash.substring(0, 7) | ||
commit.shortHash = commit.hash.substring(0, 7) | ||
} | ||
@@ -142,3 +142,14 @@ | ||
groupBy: `type`, | ||
commitGroupsSort: `title`, | ||
// the groupings of commit messages, e.g., Features vs., Bug Fixes, are | ||
// sorted based on their probable importance: | ||
commitGroupsSort: (a, b) => { | ||
const commitGroupOrder = ['Reverts', 'Performance Improvements', 'Bug Fixes', 'Features'] | ||
const gRankA = commitGroupOrder.indexOf(a.title) | ||
const gRankB = commitGroupOrder.indexOf(b.title) | ||
if (gRankA >= gRankB) { | ||
return -1 | ||
} else { | ||
return 1 | ||
} | ||
}, | ||
commitsSort: [`scope`, `subject`], | ||
@@ -145,0 +156,0 @@ noteGroupsSort: `title`, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21225
288
3
14
1
+ Addedlodash@^4.2.1
+ Addedlodash@4.17.21(transitive)