From 307565737fc4c9efe5bd22916a4bc051292a239c Mon Sep 17 00:00:00 2001 From: Gert-Jan Naaktgeboren Date: Wed, 6 Mar 2024 16:03:34 +0100 Subject: [PATCH 1/8] feat: Added possibility to use regex to remove text from the commit message. --- .gitignore | 3 ++- package-lock.json | 6 +++--- package.json | 16 ++++++---------- 3 files changed, 11 insertions(+), 14 deletions(-) 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/package-lock.json b/package-lock.json index 121b5e65..5960defd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@semantic-release/commit-analyzer", - "version": "0.0.0-development", + "name": "@tweeat/commit-analyzer", + "version": "1.0.0", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@semantic-release/commit-analyzer", + "name": "@tweeat/commit-analyzer", "version": "0.0.0-development", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index cecc7fcf..b8e911f8 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,17 @@ { - "name": "@semantic-release/commit-analyzer", + "name": "@tweeat/commit-analyzer", "description": "semantic-release plugin to analyze commits with conventional-changelog", - "version": "0.0.0-development", + "version": "1.0.0", "type": "module", - "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", + "author": "Gert-Jan Naaktgeboren", "ava": { "files": [ "test/**/*.test.js" ] }, "bugs": { - "url": "https://github.com/semantic-release/commit-analyzer/issues" + "url": "https://github.com/Gert-Jan2AT/commit-analyzer" }, - "contributors": [ - "Stephan Bönnemann (http://boennemann.me)", - "Gregor Martynus (https://twitter.com/gr2m)" - ], "dependencies": { "conventional-changelog-angular": "^7.0.0", "conventional-commits-filter": "^4.0.0", @@ -45,7 +41,7 @@ "lib", "index.js" ], - "homepage": "https://github.com/semantic-release/commit-analyzer#readme", + "homepage": "https://github.com/Gert-Jan2AT/commit-analyzer#readme", "keywords": [ "changelog", "commit-analyzer", @@ -83,7 +79,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/semantic-release/commit-analyzer.git" + "url": "https://github.com/Gert-Jan2AT/commit-analyzer.git" }, "scripts": { "lint": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/*.js\"", From 26b9cb68fb04c38b49c0d53bd056305baab58e69 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:08:03 +0100 Subject: [PATCH 2/8] Revert "feat: Added possibility to use regex to remove text from the commit message." This reverts commit 307565737fc4c9efe5bd22916a4bc051292a239c. --- .gitignore | 3 +-- package-lock.json | 6 +++--- package.json | 16 ++++++++++------ 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 8ef3196b..3a2dba9f 100644 --- a/.gitignore +++ b/.gitignore @@ -125,5 +125,4 @@ $RECYCLE.BIN/ # Windows shortcuts *.lnk -# End of https://www.gitignore.io/api/macos,windows,linux,node -/.vs +# End of https://www.gitignore.io/api/macos,windows,linux,node \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 5960defd..121b5e65 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,11 +1,11 @@ { - "name": "@tweeat/commit-analyzer", - "version": "1.0.0", + "name": "@semantic-release/commit-analyzer", + "version": "0.0.0-development", "lockfileVersion": 3, "requires": true, "packages": { "": { - "name": "@tweeat/commit-analyzer", + "name": "@semantic-release/commit-analyzer", "version": "0.0.0-development", "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index b8e911f8..cecc7fcf 100644 --- a/package.json +++ b/package.json @@ -1,17 +1,21 @@ { - "name": "@tweeat/commit-analyzer", + "name": "@semantic-release/commit-analyzer", "description": "semantic-release plugin to analyze commits with conventional-changelog", - "version": "1.0.0", + "version": "0.0.0-development", "type": "module", - "author": "Gert-Jan Naaktgeboren", + "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", "ava": { "files": [ "test/**/*.test.js" ] }, "bugs": { - "url": "https://github.com/Gert-Jan2AT/commit-analyzer" + "url": "https://github.com/semantic-release/commit-analyzer/issues" }, + "contributors": [ + "Stephan Bönnemann (http://boennemann.me)", + "Gregor Martynus (https://twitter.com/gr2m)" + ], "dependencies": { "conventional-changelog-angular": "^7.0.0", "conventional-commits-filter": "^4.0.0", @@ -41,7 +45,7 @@ "lib", "index.js" ], - "homepage": "https://github.com/Gert-Jan2AT/commit-analyzer#readme", + "homepage": "https://github.com/semantic-release/commit-analyzer#readme", "keywords": [ "changelog", "commit-analyzer", @@ -79,7 +83,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/Gert-Jan2AT/commit-analyzer.git" + "url": "https://github.com/semantic-release/commit-analyzer.git" }, "scripts": { "lint": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/*.js\"", From 8af75ea28022414d3b58ca40e401b9e5a36f79d9 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:10:05 +0100 Subject: [PATCH 3/8] feat: Added possibility to use regex to remove text from the commit message. --- .gitignore | 3 ++- index.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) 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/index.js b/index.js index 98e36b22..7716e3b5 100644 --- a/index.js +++ b/index.js @@ -19,6 +19,7 @@ const debug = debugFactory("semantic-release:commit-analyzer"); * @param {String} pluginConfig.config Requireable npm package with a custom conventional-changelog preset * @param {String|Array} pluginConfig.releaseRules A `String` to load an external module or an `Array` of rules. * @param {Object} pluginConfig.parserOpts Additional `conventional-changelog-parser` options that will overwrite ones loaded by `preset` or `config`. + * @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 {String} context.cwd The current working directory. @@ -41,7 +42,7 @@ export async function analyzeCommits(pluginConfig, context) { return true; }) - .map(({ message, ...commitProps }) => ({ rawMsg: message, message, ...commitProps, ...parser(message, config) })) + .map(({ message, ...commitProps }) => ({ rawMsg: message, message, ...commitProps, ...parser(pluginConfig.regexRemove ? message.replace(new RegExp(pluginConfig.regexRemove), "") : message, config) })) ).every(({ rawMsg, ...commit }) => { logger.log(`Analyzing commit: %s`, rawMsg); let commitReleaseType; From 080cad3bf053d5112681def8e1d1e41669637b95 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Wed, 6 Mar 2024 16:17:10 +0100 Subject: [PATCH 4/8] Modified read.me --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d9c850b3..30f56366 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ With this example: | `parserOpts` | Additional [conventional-commits-parser](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-commits-parser#conventionalcommitsparseroptions) options that will extends the ones loaded by `preset` or `config`. This is convenient to use a [conventional-changelog](https://github.com/conventional-changelog/conventional-changelog) preset with some customizations without having to create a new module. | - | | `releaseRules` | An external module, a path to a module or an `Array` of rules. See [`releaseRules`](#releaserules). | See [`releaseRules`](#releaserules) | | `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`) From a0a7fa6a3d8faa349d1a39728ba6692c22f7cab5 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:04:36 +0100 Subject: [PATCH 5/8] Modified package.json --- package.json | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index cecc7fcf..0430a584 100644 --- a/package.json +++ b/package.json @@ -1,21 +1,17 @@ { - "name": "@semantic-release/commit-analyzer", + "name": "@tweeat/commit-analyzer", "description": "semantic-release plugin to analyze commits with conventional-changelog", "version": "0.0.0-development", "type": "module", - "author": "Pierre Vanduynslager (https://twitter.com/@pvdlg_)", + "author": "Gert-Jan Naaktgeboren", "ava": { "files": [ "test/**/*.test.js" ] }, "bugs": { - "url": "https://github.com/semantic-release/commit-analyzer/issues" + "url": "https://github.com/Gert-Jan2AT/commit-analyzer" }, - "contributors": [ - "Stephan Bönnemann (http://boennemann.me)", - "Gregor Martynus (https://twitter.com/gr2m)" - ], "dependencies": { "conventional-changelog-angular": "^7.0.0", "conventional-commits-filter": "^4.0.0", @@ -45,7 +41,7 @@ "lib", "index.js" ], - "homepage": "https://github.com/semantic-release/commit-analyzer#readme", + "homepage": "https://github.com/Gert-Jan2AT/commit-analyzer#readme", "keywords": [ "changelog", "commit-analyzer", @@ -83,7 +79,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/semantic-release/commit-analyzer.git" + "url": "https://github.com/Gert-Jan2AT/commit-analyzer.git" }, "scripts": { "lint": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/*.js\"", @@ -95,7 +91,7 @@ }, "renovate": { "extends": [ - "github>semantic-release/.github:renovate-config" + "github>@tweeat/.github:renovate-config" ] } } From bfda0171cab95d2091b4f93570eea477f0ea99ba Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:24:13 +0100 Subject: [PATCH 6/8] Removed renovate --- package.json | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/package.json b/package.json index 0430a584..c1435584 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@tweeat/commit-analyzer", "description": "semantic-release plugin to analyze commits with conventional-changelog", - "version": "0.0.0-development", + "version": "1.0.0", "type": "module", "author": "Gert-Jan Naaktgeboren", "ava": { @@ -88,10 +88,5 @@ "semantic-release": "semantic-release", "test": "c8 ava -v", "test:ci": "c8 ava -v" - }, - "renovate": { - "extends": [ - "github>@tweeat/.github:renovate-config" - ] } } From 4d25446802957084c518a654e75652b328b27744 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Wed, 6 Mar 2024 17:40:44 +0100 Subject: [PATCH 7/8] Add renovate.json (#1) --- renovate.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 renovate.json diff --git a/renovate.json b/renovate.json new file mode 100644 index 00000000..7190a60b --- /dev/null +++ b/renovate.json @@ -0,0 +1,3 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json" +} From 523e0b66b8e6b7f2b6364581298c45a55809f931 Mon Sep 17 00:00:00 2001 From: Gert-Jan2AT <150832848+Gert-Jan2AT@users.noreply.github.com> Date: Thu, 7 Mar 2024 12:17:59 +0100 Subject: [PATCH 8/8] Revert "Add renovate.json (#1)" This reverts commit 4d25446802957084c518a654e75652b328b27744. --- package.json | 2 +- renovate.json | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) delete mode 100644 renovate.json diff --git a/package.json b/package.json index c1435584..ab715375 100644 --- a/package.json +++ b/package.json @@ -79,7 +79,7 @@ }, "repository": { "type": "git", - "url": "https://github.com/Gert-Jan2AT/commit-analyzer.git" + "url": "git+https://github.com/Gert-Jan2AT/commit-analyzer.git" }, "scripts": { "lint": "prettier --check \"*.{js,json,md}\" \".github/**/*.{md,yml}\" \"{bin,lib,test}/*.js\"", diff --git a/renovate.json b/renovate.json deleted file mode 100644 index 7190a60b..00000000 --- a/renovate.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "$schema": "https://docs.renovatebot.com/renovate-schema.json" -}