From 9934af7a6a8f1460909c8f7de281d2c06d091227 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:15:29 +0100 Subject: [PATCH 1/4] gitignore --- .gitignore | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 From d6c600701c99c611cffa13024bf361b2d5ce2696 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Thu, 7 Mar 2024 13:15:42 +0100 Subject: [PATCH 2/4] feat: Added possibility to use regex to remove text from the commit message --- README.md | 1 + index.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) 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; From 0a4dca096e9f63d0d8ed7bc0f993a3590e827624 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Mon, 18 Mar 2024 10:05:01 +0100 Subject: [PATCH 3/4] Modified package.json --- package.json | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 8b8dd7b6..37e4f050 100644 --- a/package.json +++ b/package.json @@ -1,15 +1,11 @@ { - "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", + "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 +44,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 +82,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\"", From b22e8be4d185f9dbae479529f0c0254910ff6a44 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Mon, 18 Mar 2024 13:36:57 +0100 Subject: [PATCH 4/4] added type module --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 37e4f050..28fda640 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "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/Gert-Jan2AT/release-notes-generator/issues"