conventional-changelog-angular
Advanced tools
Comparing version 1.6.6 to 3.0.0
@@ -1,10 +0,10 @@ | ||
'use strict'; | ||
'use strict' | ||
const Q = require(`q`); | ||
const parserOpts = require(`./parser-opts`); | ||
const writerOpts = require(`./writer-opts`); | ||
const Q = require(`q`) | ||
const parserOpts = require(`./parser-opts`) | ||
const writerOpts = require(`./writer-opts`) | ||
module.exports = Q.all([parserOpts, writerOpts]) | ||
.spread((parserOpts, writerOpts) => { | ||
return {parserOpts, writerOpts}; | ||
}); | ||
return {parserOpts, writerOpts} | ||
}) |
@@ -1,29 +0,31 @@ | ||
'use strict'; | ||
'use strict' | ||
module.exports = { | ||
whatBump: (commits) => { | ||
let level = 2; | ||
let breakings = 0; | ||
let features = 0; | ||
let level = 2 | ||
let breakings = 0 | ||
let features = 0 | ||
commits.forEach(commit => { | ||
if (commit.notes.length > 0) { | ||
breakings += commit.notes.length; | ||
level = 0; | ||
breakings += commit.notes.length | ||
level = 0 | ||
} else if (commit.type === `feat`) { | ||
features += 1; | ||
features += 1 | ||
if (level === 2) { | ||
level = 1; | ||
level = 1 | ||
} | ||
} | ||
}); | ||
}) | ||
return { | ||
level: level, | ||
reason: `There are ${breakings} BREAKING CHANGES and ${features} features` | ||
}; | ||
reason: breakings === 1 ? | ||
`There are ${breakings} BREAKING CHANGE and ${features} features` : | ||
`There are ${breakings} BREAKING CHANGES and ${features} features` | ||
} | ||
}, | ||
parserOpts: { | ||
headerPattern: /^(\w*)(?:\((.*)\))?\: (.*)$/, | ||
headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/, | ||
headerCorrespondence: [ | ||
@@ -38,2 +40,2 @@ `type`, | ||
} | ||
}; | ||
} |
16
index.js
@@ -1,11 +0,11 @@ | ||
'use strict'; | ||
const Q = require(`q`); | ||
const conventionalChangelog = require(`./conventional-changelog`); | ||
const parserOpts = require(`./parser-opts`); | ||
const recommendedBumpOpts = require(`./conventional-recommended-bump`); | ||
const writerOpts = require(`./writer-opts`); | ||
'use strict' | ||
const Q = require(`q`) | ||
const conventionalChangelog = require(`./conventional-changelog`) | ||
const parserOpts = require(`./parser-opts`) | ||
const recommendedBumpOpts = require(`./conventional-recommended-bump`) | ||
const writerOpts = require(`./writer-opts`) | ||
module.exports = Q.all([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) | ||
.spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { | ||
return {conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts}; | ||
}); | ||
return {conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts} | ||
}) |
{ | ||
"name": "conventional-changelog-angular", | ||
"version": "1.6.6", | ||
"version": "3.0.0", | ||
"description": "conventional-changelog angular preset", | ||
"main": "index.js", | ||
"scripts": { | ||
"lint": "jshint *.js --exclude node_modules && jscs *.js", | ||
"lint": "eslint --fix .", | ||
"test": "mocha --timeout 30000 && npm run-script lint", | ||
@@ -9,0 +9,0 @@ "test-windows": "mocha --timeout 30000" |
@@ -1,5 +0,5 @@ | ||
'use strict'; | ||
'use strict' | ||
module.exports = { | ||
headerPattern: /^(\w*)(?:\((.*)\))?\: (.*)$/, | ||
headerPattern: /^(\w*)(?:\((.*)\))?: (.*)$/, | ||
headerCorrespondence: [ | ||
@@ -10,5 +10,5 @@ `type`, | ||
], | ||
noteKeywords: [`BREAKING CHANGE`, `BREAKING CHANGES`], | ||
noteKeywords: [`BREAKING CHANGE`], | ||
revertPattern: /^revert:\s([\s\S]*?)\s*This reverts commit (\w*)\./, | ||
revertCorrespondence: [`header`, `hash`] | ||
}; | ||
} |
@@ -63,4 +63,6 @@ # [![NPM version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][daviddm-image]][daviddm-url] [![Coverage Status][coveralls-image]][coveralls-url] | ||
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks. | ||
Other prefixes are up to your discretion. Suggested prefixes are `build`, `ci`, `docs` ,`style`, `refactor`, and `test` for non-changelog related tasks. | ||
Details regarding these types can be found in the official [Angular Contributing Guidelines](https://github.com/angular/angular/blob/master/CONTRIBUTING.md#type) | ||
### Scope | ||
@@ -67,0 +69,0 @@ |
@@ -1,7 +0,7 @@ | ||
'use strict'; | ||
'use strict' | ||
const compareFunc = require(`compare-func`); | ||
const Q = require(`q`); | ||
const readFile = Q.denodeify(require(`fs`).readFile); | ||
const resolve = require(`path`).resolve; | ||
const compareFunc = require(`compare-func`) | ||
const Q = require(`q`) | ||
const readFile = Q.denodeify(require(`fs`).readFile) | ||
const resolve = require(`path`).resolve | ||
@@ -14,69 +14,71 @@ module.exports = Q.all([ | ||
]) | ||
.spread((template, header, commit, footer) => { | ||
const writerOpts = getWriterOpts(); | ||
.spread((template, header, commit, footer) => { | ||
const writerOpts = getWriterOpts() | ||
writerOpts.mainTemplate = template; | ||
writerOpts.headerPartial = header; | ||
writerOpts.commitPartial = commit; | ||
writerOpts.footerPartial = footer; | ||
writerOpts.mainTemplate = template | ||
writerOpts.headerPartial = header | ||
writerOpts.commitPartial = commit | ||
writerOpts.footerPartial = footer | ||
return writerOpts; | ||
}); | ||
return writerOpts | ||
}) | ||
function getWriterOpts() { | ||
function getWriterOpts () { | ||
return { | ||
transform: (commit, context) => { | ||
let discard = true; | ||
const issues = []; | ||
let discard = true | ||
const issues = [] | ||
commit.notes.forEach(note => { | ||
note.title = `BREAKING CHANGES`; | ||
discard = false; | ||
}); | ||
note.title = `BREAKING CHANGES` | ||
discard = false | ||
}) | ||
if (commit.type === `feat`) { | ||
commit.type = `Features`; | ||
commit.type = `Features` | ||
} else if (commit.type === `fix`) { | ||
commit.type = `Bug Fixes`; | ||
commit.type = `Bug Fixes` | ||
} else if (commit.type === `perf`) { | ||
commit.type = `Performance Improvements`; | ||
commit.type = `Performance Improvements` | ||
} else if (commit.type === `revert`) { | ||
commit.type = `Reverts`; | ||
commit.type = `Reverts` | ||
} else if (discard) { | ||
return; | ||
return | ||
} else if (commit.type === `docs`) { | ||
commit.type = `Documentation`; | ||
commit.type = `Documentation` | ||
} else if (commit.type === `style`) { | ||
commit.type = `Styles`; | ||
commit.type = `Styles` | ||
} else if (commit.type === `refactor`) { | ||
commit.type = `Code Refactoring`; | ||
commit.type = `Code Refactoring` | ||
} else if (commit.type === `test`) { | ||
commit.type = `Tests`; | ||
} else if (commit.type === `chore`) { | ||
commit.type = `Chores`; | ||
commit.type = `Tests` | ||
} else if (commit.type === `build`) { | ||
commit.type = `Build System` | ||
} else if (commit.type === `ci`) { | ||
commit.type = `Continuous Integration` | ||
} | ||
if (commit.scope === `*`) { | ||
commit.scope = ``; | ||
commit.scope = `` | ||
} | ||
if (typeof commit.hash === `string`) { | ||
commit.hash = commit.hash.substring(0, 7); | ||
commit.hash = commit.hash.substring(0, 7) | ||
} | ||
if (typeof commit.subject === `string`) { | ||
let url = context.repository ? | ||
`${context.host}/${context.owner}/${context.repository}` : | ||
context.repoUrl; | ||
let url = context.repository | ||
? `${context.host}/${context.owner}/${context.repository}` | ||
: context.repoUrl | ||
if (url) { | ||
url = `${url}/issues/`; | ||
url = `${url}/issues/` | ||
// Issue URLs. | ||
commit.subject = commit.subject.replace(/#([0-9]+)/g, (_, issue) => { | ||
issues.push(issue); | ||
return `[#${issue}](${url}${issue})`; | ||
}); | ||
issues.push(issue) | ||
return `[#${issue}](${url}${issue})` | ||
}) | ||
} | ||
if (context.host) { | ||
// User URLs. | ||
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9]){0,38})/g, `[@$1](${context.host}/$1)`); | ||
commit.subject = commit.subject.replace(/\B@([a-z0-9](?:-?[a-z0-9]){0,38})/g, `[@$1](${context.host}/$1)`) | ||
} | ||
@@ -88,9 +90,9 @@ } | ||
if (issues.indexOf(reference.issue) === -1) { | ||
return true; | ||
return true | ||
} | ||
return false; | ||
}); | ||
return false | ||
}) | ||
return commit; | ||
return commit | ||
}, | ||
@@ -102,3 +104,3 @@ groupBy: `type`, | ||
notesSort: compareFunc | ||
}; | ||
} | ||
} |
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
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
20313
156
106