conventional-changelog-conventionalcommits
Advanced tools
Comparing version 6.1.0 to 7.0.0
64
index.js
'use strict' | ||
const conventionalChangelog = require('./conventional-changelog') | ||
const parserOpts = require('./parser-opts') | ||
const recommendedBumpOpts = require('./conventional-recommended-bump') | ||
const writerOpts = require('./writer-opts') | ||
module.exports = function (parameter) { | ||
// parameter passed can be either a config object or a callback function | ||
if (typeof parameter === 'function') { | ||
// parameter is a callback object | ||
const config = {} | ||
// FIXME: use presetOpts(config) for callback | ||
Promise.all([ | ||
conventionalChangelog(config), | ||
parserOpts(config), | ||
recommendedBumpOpts(config), | ||
writerOpts(config) | ||
]).then(([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => { | ||
parameter(null, { | ||
gitRawCommitsOpts: { | ||
noMerges: null | ||
}, | ||
conventionalChangelog, | ||
parserOpts, | ||
recommendedBumpOpts, | ||
writerOpts | ||
}) | ||
}) | ||
} else { | ||
const config = parameter || {} | ||
return presetOpts(config) | ||
} | ||
} | ||
const { DEFAULT_COMMIT_TYPES } = require('./constants') | ||
const { createParserOpts } = require('./parserOpts') | ||
const { createWriterOpts } = require('./writerOpts') | ||
const { createConventionalChangelogOpts } = require('./conventionalChangelog') | ||
const { createConventionalRecommendedBumpOpts } = require('./conventionalRecommendedBump') | ||
function presetOpts (config) { | ||
return Promise.all([ | ||
conventionalChangelog(config), | ||
parserOpts(config), | ||
recommendedBumpOpts(config), | ||
writerOpts(config) | ||
]).then(([conventionalChangelog, parserOpts, recommendedBumpOpts, writerOpts]) => ({ | ||
conventionalChangelog, | ||
async function createPreset (config) { | ||
const parserOpts = createParserOpts(config) | ||
const writerOpts = await createWriterOpts(config) | ||
const recommendedBumpOpts = createConventionalRecommendedBumpOpts(config, parserOpts) | ||
const conventionalChangelog = createConventionalChangelogOpts(parserOpts, writerOpts) | ||
return { | ||
gitRawCommitsOpts: { | ||
ignore: config?.ignoreCommits, | ||
noMerges: null | ||
}, | ||
parserOpts, | ||
writerOpts, | ||
recommendedBumpOpts, | ||
writerOpts | ||
})) | ||
conventionalChangelog | ||
} | ||
} | ||
module.exports = createPreset | ||
module.exports.DEFAULT_COMMIT_TYPES = DEFAULT_COMMIT_TYPES |
{ | ||
"name": "conventional-changelog-conventionalcommits", | ||
"version": "6.1.0", | ||
"version": "7.0.0", | ||
"description": "conventional-changelog conventionalcommits.org preset", | ||
@@ -16,8 +16,8 @@ "main": "index.js", | ||
"files": [ | ||
"add-bang-notes.js", | ||
"conventional-changelog.js", | ||
"conventional-recommended-bump.js", | ||
"utils.js", | ||
"conventionalChangelog.js", | ||
"conventionalRecommendedBump.js", | ||
"index.js", | ||
"parser-opts.js", | ||
"writer-opts.js", | ||
"parserOpts.js", | ||
"writerOpts.js", | ||
"templates" | ||
@@ -27,3 +27,3 @@ ], | ||
"engines": { | ||
"node": ">=14" | ||
"node": ">=16" | ||
}, | ||
@@ -37,6 +37,3 @@ "license": "ISC", | ||
"compare-func": "^2.0.0" | ||
}, | ||
"scripts": { | ||
"test-windows": "mocha --timeout 30000" | ||
} | ||
} |
@@ -1,10 +0,37 @@ | ||
# [![Build Status][travis-image]][travis-url] [![Coverage Status][coverage-image]][coverage-url] | ||
# conventional-changelog-conventionalcommits | ||
## conventionalcommits.org convention | ||
[![NPM version][npm]][npm-url] | ||
[![Node version][node]][node-url] | ||
[![Dependencies status][deps]][deps-url] | ||
[![Build status][build]][build-url] | ||
[![Coverage status][coverage]][coverage-url] | ||
A concrete implementation of the specification described at | ||
[conventionalcommits.org](https://conventionalcommits.org/) for automated | ||
CHANGELOG generation and version management. | ||
[npm]: https://img.shields.io/npm/v/conventional-changelog-conventionalcommits.svg | ||
[npm-url]: https://npmjs.com/package/conventional-changelog-conventionalcommits | ||
[node]: https://img.shields.io/node/v/conventional-changelog-conventionalcommits.svg | ||
[node-url]: https://nodejs.org | ||
[deps]: https://img.shields.io/librariesio/release/npm/conventional-changelog-conventionalcommits | ||
[deps-url]: https://libraries.io/npm/conventional-changelog-conventionalcommits/tree | ||
[build]: https://img.shields.io/github/actions/workflow/status/conventional-changelog/conventional-changelog/ci.yaml?branch=master | ||
[build-url]: https://github.com/conventional-changelog/conventional-changelog/actions | ||
[coverage]: 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 | ||
A concrete implementation of the specification described at [conventionalcommits.org](https://conventionalcommits.org/) for automated CHANGELOG generation and version management. | ||
## Install | ||
```bash | ||
# yarn | ||
yarn add -D conventional-changelog-conventionalcommits | ||
# pnpm | ||
pnpm add -D conventional-changelog-conventionalcommits | ||
# npm | ||
npm i -D conventional-changelog-conventionalcommits | ||
``` | ||
## Indirect Usage (as preset) | ||
@@ -16,10 +43,12 @@ | ||
If you want to use this package directly and pass options, you can use the [Conventional Changelog CLI Quick Start](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli#quick-start) and with the `--config` or `-n` parameter, pass a js config that looks like this | ||
``` | ||
'use strict' | ||
const config = require('conventional-changelog-conventionalcommits') | ||
If you want to use this package directly and pass options, you can use the [Conventional Changelog CLI Quick Start](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-cli#quick-start) and with the `--config` or `-n` parameter, pass a js config that looks like this: | ||
module.exports = config({ | ||
"issuePrefixes": ["TEST-"], | ||
"issueUrlFormat": "https://myBugTracker.com/{{prefix}}{{id}}" | ||
```js | ||
const createPreset = require('conventional-changelog-conventionalcommits') | ||
createPreset({ | ||
issuePrefixes: ['TEST-'], | ||
issueUrlFormat: 'https://myBugTracker.com/{{prefix}}{{id}}' | ||
}).then((config) => { | ||
// do something with the config | ||
}) | ||
@@ -29,24 +58,17 @@ ``` | ||
or json config like that: | ||
``` | ||
```json | ||
{ | ||
"options": { | ||
"preset": { | ||
"name": "conventionalchangelog", | ||
"issuePrefixes": ["TEST-"], | ||
"issueUrlFormat": "https://myBugTracker.com/{{prefix}}{{id}}" | ||
} | ||
"options": { | ||
"preset": { | ||
"name": "conventionalchangelog", | ||
"issuePrefixes": ["TEST-"], | ||
"issueUrlFormat": "https://myBugTracker.com/{{prefix}}{{id}}" | ||
} | ||
} | ||
} | ||
``` | ||
This last json config way passes the `preset` object to the `conventional-changelog-preset-loader` package, that in turn, passes this same `preset` object as the config for the `conventional-changelog-conventionalcommits`. | ||
See [conventional-changelog-config-spec](https://github.com/conventional-changelog/conventional-changelog-config-spec) for available | ||
configuration options. | ||
[travis-image]: https://travis-ci.org/conventional-changelog/conventional-changelog.svg?branch=master | ||
[travis-url]: https://travis-ci.org/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 | ||
See [conventional-changelog-config-spec](https://github.com/conventional-changelog/conventional-changelog-config-spec) for available configuration options. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
73
15265
266
1