Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

conventional-changelog-conventionalcommits

Package Overview
Dependencies
Maintainers
6
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

conventional-changelog-conventionalcommits - npm Package Compare versions

Comparing version 4.1.0 to 4.2.1

18

CHANGELOG.md

@@ -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),

5

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc