Skip to content

Commit

Permalink
[core] Add function to generate changelog messages for Discord
Browse files Browse the repository at this point in the history
  • Loading branch information
rtivital committed Jan 7, 2025
1 parent 75d2c25 commit 476b417
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions scripts/docs/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ function getPreviousRelease(message: string) {
return splitted[splitted.length - 1];
}

function removeIssueReferences(markdown: string) {
return markdown.replace(/\(#\d+\)/g, '').trim();
}

async function getChangelog() {
const logs = await git.log({ maxCount: 100 });
const messages = logs.all.map((commit) => commit.message);
Expand All @@ -29,8 +33,12 @@ async function getChangelog() {
.filter((message) => /\[@mantine/.test(message))
.map((message) => message.replace('[', '- `[').replace(']', ']`'))
.join('\n');

process.stdout.write(`${notes || 'No significant changes yet'}\n\n`);
if (notes) {
process.stdout.write(`${notes}\n\n\n\n\n`);
process.stdout.write(removeIssueReferences(notes));
} else {
process.stdout.write(`No significant changes yet\n\n`);
}
}

getChangelog();

0 comments on commit 476b417

Please sign in to comment.