conventional-changelog-sprucelabs
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -6,28 +6,40 @@ 'use strict' | ||
module.exports = { | ||
parserOpts, | ||
parserOpts, | ||
whatBump: (commits) => { | ||
let level = 2 | ||
let breakings = 0 | ||
let features = 0 | ||
whatBump: commits => { | ||
// level 0 = major | ||
// level 0 = minor | ||
// level 2 = patch | ||
commits.forEach(commit => { | ||
if (commit.notes.length > 0) { | ||
breakings += commit.notes.length | ||
level = 0 | ||
} else if (commit.type === `feat`) { | ||
features += 1 | ||
if (level === 2) { | ||
level = 1 | ||
} | ||
} | ||
}) | ||
let level = 2 | ||
let patch = 0 | ||
let minor = 0 | ||
let major = 0 | ||
return { | ||
level: level, | ||
reason: breakings === 1 | ||
? `There is ${breakings} BREAKING CHANGE and ${features} features` | ||
: `There are ${breakings} BREAKING CHANGES and ${features} features` | ||
} | ||
} | ||
commits.forEach(commit => { | ||
switch (commit.type) { | ||
case 'BREAKING': | ||
case 'breaking': | ||
major += 1 | ||
level = 0 | ||
break | ||
case 'major': | ||
case 'minor': | ||
case 'feat': | ||
minor += 1 | ||
if (level === 2) { | ||
level = 1 | ||
} | ||
break | ||
default: | ||
patch += 1 | ||
break | ||
} | ||
}) | ||
return { | ||
level: level, | ||
reason: `Major: ${major} | Minor: ${minor} | Patch: ${patch}` | ||
} | ||
} | ||
} |
{ | ||
"name": "conventional-changelog-sprucelabs", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "conventional-changelog for sprucelabs based on angular preset", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
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
172
27010
1