Skip to content

Commit

Permalink
feat(chore): new changelog wip
Browse files Browse the repository at this point in the history
  • Loading branch information
lubber-de committed Jan 30, 2025
1 parent 0ffb7f4 commit 1f19dee
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions changelog-setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = function (Handlebars) {
exclude,
message,
subject,
heading
heading,
} = options.hash;

if (!context || context.length === 0 || !heading) {
Expand All @@ -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 '';
Expand All @@ -42,12 +45,11 @@ module.exports = function (Handlebars) {
return `${heading}\n\n`;
})

Check failure on line 46 in changelog-setup.js

View workflow job for this annotation

GitHub Actions / Lint

Missing semicolon

Handlebars.registerHelper("noprefix", function(text) {
Handlebars.registerHelper('noprefix', function (text) {
var result = text.replace(/^(fix|feat|build)\(.*\): */,'');

Check failure on line 49 in changelog-setup.js

View workflow job for this annotation

GitHub Actions / Lint

A space is required after ','
return new Handlebars.SafeString(result);

Check failure on line 50 in changelog-setup.js

View workflow job for this annotation

GitHub Actions / Lint

Expected blank line before this statement
});


Handlebars.registerHelper('commit-list-heading-only', (context, options) => {
const { exclude, message, subject, heading } = options.hash;

Check failure on line 54 in changelog-setup.js

View workflow job for this annotation

GitHub Actions / Lint

Expected a line break after this opening brace

Check failure on line 54 in changelog-setup.js

View workflow job for this annotation

GitHub Actions / Lint

Expected a line break before this closing brace
let changelogDeps = {};
Expand Down Expand Up @@ -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],
Expand Down

0 comments on commit 1f19dee

Please sign in to comment.