diff --git a/.gitignore b/.gitignore index 3a2dba9f..8ef3196b 100644 --- a/.gitignore +++ b/.gitignore @@ -125,4 +125,5 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# End of https://www.gitignore.io/api/macos,windows,linux,node \ No newline at end of file +# End of https://www.gitignore.io/api/macos,windows,linux,node +/.vs diff --git a/README.md b/README.md index 68f5279f..1d053e6a 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ With this example: | `commit` | Keyword used to generate commit links (formatted as `////`). See [conventional-changelog-writer#commit](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#commit). | `commits` for Bitbucket repositories, `commit` otherwise | | `issue` | Keyword used to generate issue links (formatted as `////`). See [conventional-changelog-writer#issue](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-writer#issue). | `issue` for Bitbucket repositories, `issues` otherwise | | `presetConfig` | Additional configuration passed to the [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset. Used for example with [conventional-changelog-conventionalcommits](https://github.com/conventional-changelog/conventional-changelog-config-spec/blob/master/versions/2.0.0/README.md). | - | +| `regexRemove` | Optional regular that will be used to clean up de message in the commit. For example to remove the Merged PR xxxx: part from a devops commit | - | **Notes**: in order to use a `preset` it must be installed (for example to use the [eslint preset](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-eslint) you must install it with `npm install conventional-changelog-eslint -D`) diff --git a/index.js b/index.js index f2e4b717..44d0241c 100644 --- a/index.js +++ b/index.js @@ -20,7 +20,7 @@ const debug = debugFactory("semantic-release:release-notes-generator"); * @param {String} pluginConfig.config Requireable npm package with a custom conventional-changelog preset * @param {Object} pluginConfig.parserOpts Additional `conventional-changelog-parser` options that will overwrite ones loaded by `preset` or `config`. * @param {Object} pluginConfig.writerOpts Additional `conventional-changelog-writer` options that will overwrite ones loaded by `preset` or `config`. - * @param {Object} context The semantic-release context. + * @param {Object} pluginConfig.regexRemove Optional regular that will be used to clean up de message in the commit. For example to remove the Merged PR xxxx: part from a devops commit* * @param {Object} context The semantic-release context. * @param {Array} context.commits The commits to analyze. * @param {Object} context.lastRelease The last release with `gitHead` corresponding to the commit hash used to make the last release and `gitTag` corresponding to the git tag associated with `gitHead`. * @param {Object} context.nextRelease The next release with `gitHead` corresponding to the commit hash used to make the release, the release `version` and `gitTag` corresponding to the git tag associated with `gitHead`. @@ -55,7 +55,7 @@ export async function generateNotes(pluginConfig, context) { }) .map((rawCommit) => ({ ...rawCommit, - ...parser(rawCommit.message, { referenceActions, issuePrefixes, ...parserOpts }), + ...parser(pluginConfig.regexRemove ? rawCommit.message.replace(new RegExp(pluginConfig.regexRemove), "") : rawCommit.message, { referenceActions, issuePrefixes, ...parserOpts }), })) ); const previousTag = lastRelease.gitTag || lastRelease.gitHead; diff --git a/package.json b/package.json index 8b8dd7b6..28fda640 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,12 @@ { - "name": "@semantic-release/release-notes-generator", - "description": "semantic-release plugin to generate changelog content with conventional-changelog", - "version": "0.0.0-development", - "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", + "name": "@tweeat/release-notes-generator", + "description": "tweeat plugin to generate changelog content with conventional-changelog", + "version": "1.0.0", + "type": "module", + "author": "Gert-Jan Naaktgeboren", "bugs": { - "url": "https://github.com/semantic-release/release-notes-generator/issues" + "url": "https://github.com/Gert-Jan2AT/release-notes-generator/issues" }, - "contributors": [ - "Stephan Bönnemann (http://boennemann.me)", - "Gregor Martynus (https://twitter.com/gr2m)" - ], "dependencies": { "conventional-changelog-angular": "^7.0.0", "conventional-changelog-writer": "^7.0.0", @@ -48,7 +45,7 @@ "wrappers", "index.js" ], - "homepage": "https://github.com/semantic-release/release-notes-generator#readme", + "homepage": "https://github.com/Gert-Jan2AT/release-notes-generator#readme", "keywords": [ "changelog", "conventional-changelog", @@ -86,7 +83,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/semantic-release/release-notes-generator.git" + "url": "https://github.com/Gert-Jan2AT/release-notes-generator.git" }, "scripts": { "lint": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/*.js\"",