From 6c43cb9432daadf5496c748a10796ee97b96ddc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mart=C3=ADnez?= Date: Fri, 10 Sep 2021 15:53:04 +0000 Subject: [PATCH 1/2] chore: improve changelog isVersionBump & commitID replacement regex --- scripts/changelog.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/scripts/changelog.js b/scripts/changelog.js index 071095cd4..f77b7a550 100644 --- a/scripts/changelog.js +++ b/scripts/changelog.js @@ -30,7 +30,7 @@ const isFeature = (s) => /feat(\(\w+\))?:/.test(s); const isUninformative = (s) => /(test|style|chore|docs|ci)(\([\w-]+\))?:/.test(s); /** Tests if this commit just bumped the version (via `npm version`). */ -const isVersionBump = (s) => /^\w{8} \d+\.\d+\.\d+$/.test(s); +const isVersionBump = (s) => /^\w+\s\d+\.\d+\.\d+$/.test(s); const changes = shell .exec(`git log --oneline "${PREVIOUS_TAG}"..`) @@ -51,7 +51,7 @@ const formatChanges = (changes) => .replace(/[a-z]+\((\w+)\)/, '$1') // Linkify commit refs. .replace( - /^(\w{8})/, + /^(\w+)\s/, '* [[$1](https://github.com/boardgameio/boardgame.io/commit/$1)]' ) // Linkify PR references. @@ -59,6 +59,7 @@ const formatChanges = (changes) => /\(#(\d{3,})\)/, '([#$1](https://github.com/boardgameio/boardgame.io/pull/$1))' ) + .replace(/\)](\w*)/, ')] $1') ) .join(EOL); From 001806f5d87ddd8dd380caa580f6164f652a68b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81lvaro=20Mart=C3=ADnez?= Date: Mon, 13 Sep 2021 07:35:58 +0000 Subject: [PATCH 2/2] chore: fix changelog space replacement --- scripts/changelog.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/scripts/changelog.js b/scripts/changelog.js index f77b7a550..0a9f769bc 100644 --- a/scripts/changelog.js +++ b/scripts/changelog.js @@ -51,7 +51,7 @@ const formatChanges = (changes) => .replace(/[a-z]+\((\w+)\)/, '$1') // Linkify commit refs. .replace( - /^(\w+)\s/, + /^(\w+)/, '* [[$1](https://github.com/boardgameio/boardgame.io/commit/$1)]' ) // Linkify PR references. @@ -59,7 +59,6 @@ const formatChanges = (changes) => /\(#(\d{3,})\)/, '([#$1](https://github.com/boardgameio/boardgame.io/pull/$1))' ) - .replace(/\)](\w*)/, ')] $1') ) .join(EOL);