Skip to content

Commit 225ca12

Browse files
theoephraimclaude
andcommitted
Add custom changelog formatter with frog emoji
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 064e960 commit 225ca12

2 files changed

Lines changed: 40 additions & 1 deletion

File tree

.bumpy/changelog-formatter.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import type { ChangelogFormatter } from '../packages/bumpy/src/core/changelog.ts';
2+
3+
const formatter: ChangelogFormatter = (ctx) => {
4+
const { release, changesets, date } = ctx;
5+
const lines: string[] = [];
6+
lines.push(`## 🐸 ${release.newVersion}`);
7+
lines.push('');
8+
lines.push(`_${date}_`);
9+
lines.push('');
10+
11+
const relevantChangesets = changesets.filter((cs) => release.changesets.includes(cs.id));
12+
13+
if (relevantChangesets.length > 0) {
14+
for (const cs of relevantChangesets) {
15+
if (cs.summary) {
16+
const summaryLines = cs.summary.split('\n');
17+
lines.push(`- ${summaryLines[0]}`);
18+
for (let i = 1; i < summaryLines.length; i++) {
19+
if (summaryLines[i]!.trim()) {
20+
lines.push(` ${summaryLines[i]}`);
21+
}
22+
}
23+
}
24+
}
25+
}
26+
27+
if (release.isDependencyBump && relevantChangesets.length === 0) {
28+
lines.push('- Updated dependencies');
29+
}
30+
31+
if (release.isCascadeBump && !release.isDependencyBump && relevantChangesets.length === 0) {
32+
lines.push('- Version bump via cascade rule');
33+
}
34+
35+
lines.push('');
36+
return lines.join('\n');
37+
};
38+
39+
export default formatter;

.bumpy/config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"baseBranch": "main",
3-
"changelog": "default"
3+
"changelog": "./changelog-formatter.ts"
44
}

0 commit comments

Comments
 (0)