diff --git a/README.md b/README.md index b0536e9cb..c5ca1e8b6 100644 --- a/README.md +++ b/README.md @@ -99,8 +99,6 @@ You can configure `commit-and-tag-version` either by: - If you are using a `.versionrc.js` your default export must be a configuration object, or a function returning a configuration object. - - Any of the command line parameters accepted by `commit-and-tag-version` can instead be provided via configuration. Please refer to the [conventional-changelog-config-spec](https://github.com/conventional-changelog/conventional-changelog-config-spec/) for details on available configuration options. @@ -108,17 +106,9 @@ be provided via configuration. Please refer to the [conventional-changelog-confi By default, `commit-and-tag-version` uses the [conventionalcommits preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-conventionalcommits). -This preset: - -- Adheres closely to the [conventionalcommits.org](https://www.conventionalcommits.org) - specification. -- Is highly configurable, following the configuration specification - [maintained here](https://github.com/conventional-changelog/conventional-changelog-config-spec). - - _We've documented these config settings as a recommendation to other tooling makers._ - -There are a variety of dials and knobs you can turn related to CHANGELOG generation. +This preset adheres closely to the [conventionalcommits.org](https://www.conventionalcommits.org) specification. -As an example, suppose you're using GitLab, rather than GitHub, you might modify the following variables: +Suppose you're using GitLab, rather than GitHub, you might modify the following variables: - `commitUrlFormat`: the URL format of commit SHAs detected in commit messages. - `compareUrlFormat`: the URL format used to compare two tags. @@ -126,6 +116,20 @@ As an example, suppose you're using GitLab, rather than GitHub, you might modify Making these URLs match GitLab's format, rather than GitHub's. +### Deeper customization + +You can override both [parser](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser) and [writer](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer) options (they will be merged into the preset we just mentioned). As an example, to list commits in the order that they were committed: + +```json +{ + "standard-version": { + "writerOpts": { + "commitsSort": false + } + } +} +``` + ## CLI Usage > **NOTE:** To pass nested configurations to the CLI without defining them in the `package.json` use dot notation as the parameters `e.g. --skip.changelog`. diff --git a/lib/lifecycles/changelog.js b/lib/lifecycles/changelog.js index f3977f9a8..2069da9ff 100644 --- a/lib/lifecycles/changelog.js +++ b/lib/lifecycles/changelog.js @@ -35,7 +35,7 @@ function outputChangelog (args, newVersion) { debug: args.verbose && console.info.bind(console, 'conventional-changelog'), preset: presetLoader(args), tagPrefix: args.tagPrefix - }, context, { merges: null, path: args.path }) + }, context, { merges: null, path: args.path }, args.parserOpts, args.writerOpts) .on('error', function (err) { return reject(err) })