conventional-changelog-conventionalcommits
Advanced tools
Comparing version 5.0.0 to 6.0.0
'use strict' | ||
const Q = require('q') | ||
const parserOpts = require('./parser-opts') | ||
@@ -8,6 +7,7 @@ const writerOpts = require('./writer-opts') | ||
module.exports = function (config) { | ||
return Q.all([parserOpts(config), writerOpts(config)]) | ||
.spread((parserOpts, writerOpts) => { | ||
return { parserOpts, writerOpts } | ||
}) | ||
return Promise.all([parserOpts(config), writerOpts(config)]) | ||
.then(([parserOpts, writerOpts]) => ({ | ||
parserOpts, | ||
writerOpts | ||
})) | ||
} |
29
index.js
'use strict' | ||
const Q = require('q') | ||
const _ = require('lodash') | ||
const conventionalChangelog = require('./conventional-changelog') | ||
@@ -11,7 +9,7 @@ const parserOpts = require('./parser-opts') | ||
// parameter passed can be either a config object or a callback function | ||
if (_.isFunction(parameter)) { | ||
if (typeof parameter === 'function') { | ||
// parameter is a callback object | ||
const config = {} | ||
// FIXME: use presetOpts(config) for callback | ||
Q.all([ | ||
Promise.all([ | ||
conventionalChangelog(config), | ||
@@ -21,4 +19,12 @@ parserOpts(config), | ||
writerOpts(config) | ||
]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { | ||
parameter(null, { gitRawCommitsOpts: { noMerges: null }, conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts }) | ||
]).then(([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => { | ||
parameter(null, { | ||
gitRawCommitsOpts: { | ||
noMerges: null | ||
}, | ||
conventionalChangelog, | ||
parserOpts, | ||
recommendedBumpOpts, | ||
writerOpts | ||
}) | ||
}) | ||
@@ -32,3 +38,3 @@ } else { | ||
function presetOpts (config) { | ||
return Q.all([ | ||
return Promise.all([ | ||
conventionalChangelog(config), | ||
@@ -38,5 +44,8 @@ parserOpts(config), | ||
writerOpts(config) | ||
]).spread((conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts) => { | ||
return { conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts } | ||
}) | ||
]).then(([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => ({ | ||
conventionalChangelog, | ||
parserOpts, | ||
recommendedBumpOpts, | ||
writerOpts | ||
})) | ||
} |
{ | ||
"name": "conventional-changelog-conventionalcommits", | ||
"version": "5.0.0", | ||
"version": "6.0.0", | ||
"description": "conventional-changelog conventionalcommits.org preset", | ||
"main": "index.js", | ||
"scripts": { | ||
"test-windows": "mocha --timeout 30000" | ||
}, | ||
"repository": { | ||
@@ -29,3 +26,3 @@ "type": "git", | ||
"engines": { | ||
"node": ">=10" | ||
"node": ">=14" | ||
}, | ||
@@ -38,6 +35,7 @@ "license": "ISC", | ||
"dependencies": { | ||
"compare-func": "^2.0.0", | ||
"lodash": "^4.17.15", | ||
"q": "^1.5.1" | ||
"compare-func": "^2.0.0" | ||
}, | ||
"scripts": { | ||
"test-windows": "mocha --timeout 30000" | ||
} | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# [![Build Status][travis-image]][travis-url] [![Coverage Status][coveralls-image]][coveralls-url] | ||
# [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url] | ||
@@ -49,3 +49,3 @@ ## conventionalcommits.org convention | ||
[travis-url]: https://travis-ci.org/conventional-changelog/conventional-changelog | ||
[coveralls-image]: https://coveralls.io/repos/conventional-changelog/conventional-changelog/badge.svg | ||
[coveralls-url]: https://coveralls.io/r/conventional-changelog/conventional-changelog | ||
[coverage-image]: https://coveralls.io/repos/github/conventional-changelog/conventional-changelog/badge.svg?branch=master | ||
[coverage-url]: https://coveralls.io/github/conventional-changelog/conventional-changelog?branch=master |
@@ -5,5 +5,4 @@ 'use strict' | ||
const compareFunc = require('compare-func') | ||
const Q = require('q') | ||
const readFile = Q.denodeify(require('fs').readFile) | ||
const resolve = require('path').resolve | ||
const { readFile } = require('fs').promises | ||
const { resolve } = require('path') | ||
const releaseAsRe = /release-as:\s*\w*@?([0-9]+\.[0-9]+\.[0-9a-z]+(-[0-9a-z.]+)?)\s*/i | ||
@@ -18,3 +17,3 @@ | ||
module.exports = function (config) { | ||
module.exports = async (config) => { | ||
config = defaultConfig(config) | ||
@@ -39,3 +38,8 @@ const commitUrlFormat = expandTemplate(config.commitUrlFormat, { | ||
return Q.all([ | ||
const [ | ||
template, | ||
header, | ||
commit, | ||
footer | ||
] = await Promise.all([ | ||
readFile(resolve(__dirname, './templates/template.hbs'), 'utf-8'), | ||
@@ -46,15 +50,13 @@ readFile(resolve(__dirname, './templates/header.hbs'), 'utf-8'), | ||
]) | ||
.spread((template, header, commit, footer) => { | ||
const writerOpts = getWriterOpts(config) | ||
const writerOpts = getWriterOpts(config) | ||
writerOpts.mainTemplate = template | ||
writerOpts.headerPartial = header | ||
.replace(/{{compareUrlFormat}}/g, compareUrlFormat) | ||
writerOpts.commitPartial = commit | ||
.replace(/{{commitUrlFormat}}/g, commitUrlFormat) | ||
.replace(/{{issueUrlFormat}}/g, issueUrlFormat) | ||
writerOpts.footerPartial = footer | ||
writerOpts.mainTemplate = template | ||
writerOpts.headerPartial = header | ||
.replace(/{{compareUrlFormat}}/g, compareUrlFormat) | ||
writerOpts.commitPartial = commit | ||
.replace(/{{commitUrlFormat}}/g, commitUrlFormat) | ||
.replace(/{{issueUrlFormat}}/g, issueUrlFormat) | ||
writerOpts.footerPartial = footer | ||
return writerOpts | ||
}) | ||
return writerOpts | ||
} | ||
@@ -61,0 +63,0 @@ |
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
1
315
15991
13
- Removedlodash@^4.17.15
- Removedq@^1.5.1
- Removedlodash@4.17.21(transitive)
- Removedq@1.5.1(transitive)