From 1f19dee0ea641e76c61c1143bcc1e3ecdb1d2419 Mon Sep 17 00:00:00 2001 From: lubber-de Date: Thu, 30 Jan 2025 22:07:16 +0100 Subject: [PATCH] feat(chore): new changelog wip --- changelog-setup.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/changelog-setup.js b/changelog-setup.js index 3bd7045422..73794e2372 100644 --- a/changelog-setup.js +++ b/changelog-setup.js @@ -6,7 +6,7 @@ module.exports = function (Handlebars) { exclude, message, subject, - heading + heading, } = options.hash; if (!context || context.length === 0 || !heading) { @@ -24,16 +24,19 @@ module.exports = function (Handlebars) { } if (message) { const pattern = new RegExp(message, 'm'); + return pattern.test(commit.message); } if (subject) { const pattern = new RegExp(subject); + return pattern.test(commit.subject); } + return true; }) - .map(item => options.fn(item)) - .join('') + .map((item) => options.fn(item)) + .join(''); if (!list) { return ''; @@ -42,12 +45,11 @@ module.exports = function (Handlebars) { return `${heading}\n\n`; }) - Handlebars.registerHelper("noprefix", function(text) { + Handlebars.registerHelper('noprefix', function (text) { var result = text.replace(/^(fix|feat|build)\(.*\): */,''); return new Handlebars.SafeString(result); }); - Handlebars.registerHelper('commit-list-heading-only', (context, options) => { const { exclude, message, subject, heading } = options.hash; let changelogDeps = {}; @@ -106,7 +108,9 @@ module.exports = function (Handlebars) { // build\(deps.*\): bump (.*) from.*to (.*) - if (!context || !context.subject) return ''; + if (!context || !context.subject) { + return ''; + } let subjectDetails = context.subject.match(/build\(deps.*\): bump (.*) from.*to (.*)/), depPackage = subjectDetails[1], depVersion = subjectDetails[2],