Skip to content

Commit 841483f

Browse files
authored
feat: always show bump type label on changelog items (#89)
## Summary - Always display the bump type tag (e.g. `*(minor)*`) on every changelog item, not just when it differs from the release's overall bump type - Dependency, cascade, and group bump lines also now include the bump type tag - Items were already sorted major > minor > patch (no change needed) - Includes minor doc/schema fixes from prior work ## Example **Before:** ``` - Added new feature - *(patch)* Fixed a bug ``` **After:** ``` - *(minor)* Added new feature - *(patch)* Fixed a bug ```
1 parent bf0e1d0 commit 841483f

9 files changed

Lines changed: 54 additions & 34 deletions

File tree

.bumpy/changelog-bump-labels.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@varlock/bumpy': patch
3+
---
4+
5+
Always show bump type label on each changelog item instead of only when it differs from the release type

docs/differences-from-changesets.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ Changesets uses `npm publish` even in Yarn/pnpm workspaces, so `workspace:^` and
6868
- [changesets#979](https://github.com/changesets/changesets/issues/979) — non-interactive mode (15 thumbs-up)
6969
- [changesets#1118](https://github.com/changesets/changesets/discussions/1118) — CLI automation support
7070

71-
### Provenance and custom publish args
71+
### Provenance, staged publishing, and custom publish args
7272

73-
Bumpy supports passing extra args (like `--provenance`) to the publish command via config.
73+
Bumpy has first-class `provenance` and `npmStaged` config options, plus support for passing extra args to the publish command.
7474

7575
- [changesets#1152](https://github.com/changesets/changesets/issues/1152) — provenance support (36 thumbs-up, 26 comments)
7676

packages/bumpy/CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<sub>2026-05-27</sub>
66

7-
- [#87](https://github.com/dmno-dev/bumpy/pull/87) - Fix draft release functions (`createDraftRelease`, `updateReleaseBody`, `finalizeRelease`, `deleteRelease`) to use `BUMPY_GH_TOKEN` via `withReleaseToken` so that GitHub release events trigger downstream workflows. Also disables npm staged publishing (not yet ready) and removes the npm upgrade step from the release workflow.
7+
- [#87](https://github.com/dmno-dev/bumpy/pull/87) - Fix draft release functions (`createDraftRelease`, `updateReleaseBody`, `finalizeRelease`, `deleteRelease`) to use `BUMPY_GH_TOKEN` via `withReleaseToken` so that GitHub release events trigger downstream workflows. Also disables npm staged publishing (not yet ready).
88

99
## 1.10.0
1010

packages/bumpy/config-schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"publishArgs": {
144144
"type": "array",
145145
"items": { "type": "string" },
146-
"description": "Extra args appended to the publish command (e.g., \"--provenance\")",
146+
"description": "Extra args appended to the publish command (e.g., \"--tag next\")",
147147
"default": []
148148
},
149149
"protocolResolution": {

packages/bumpy/src/core/changelog-github.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ export function createGithubFormatter(options: GithubChangelogOptions = {}): Cha
6464
if (!bf.summary) continue;
6565

6666
const type = getBumpTypeForPackage(bf, release.name);
67-
const tag = type !== release.type ? ` *(${type})*` : '';
67+
const tag = ` *(${type})*`;
6868

6969
// Extract metadata overrides from summary (pr, commit, author lines)
7070
const { cleanSummary, overrides } = extractSummaryMeta(bf.summary);
@@ -106,16 +106,24 @@ export function createGithubFormatter(options: GithubChangelogOptions = {}): Cha
106106
(max, s) => maxBump(max, s.bumpType),
107107
undefined,
108108
);
109-
const depTag = depBumpType && depBumpType !== release.type ? ` *(${depBumpType})* -` : '';
109+
const depTag = depBumpType ? ` *(${depBumpType})*` : '';
110110
lines.push(`-${depTag} Updated dependency ${sourceList || '(internal)'}`);
111111
}
112112

113113
if (release.isGroupBump) {
114-
lines.push(sourceList ? `- Version bump from group with ${sourceList}` : '- Version bump from group');
114+
lines.push(
115+
sourceList
116+
? `- *(${release.type})* Version bump from group with ${sourceList}`
117+
: `- *(${release.type})* Version bump from group`,
118+
);
115119
}
116120

117121
if (release.isCascadeBump && !release.isDependencyBump && !release.isGroupBump) {
118-
lines.push(sourceList ? `- Version bump from ${sourceList}` : '- Version bump via cascade rule');
122+
lines.push(
123+
sourceList
124+
? `- *(${release.type})* Version bump from ${sourceList}`
125+
: `- *(${release.type})* Version bump via cascade rule`,
126+
);
119127
}
120128

121129
lines.push('');

packages/bumpy/src/core/changelog.ts

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,8 @@ export const defaultFormatter: ChangelogFormatter = (ctx) => {
5555
for (const bf of sorted) {
5656
if (!bf.summary) continue;
5757
const type = getBumpTypeForPackage(bf, release.name);
58-
const tag = type !== release.type ? `*(${type})* ` : '';
5958
const summaryLines = bf.summary.split('\n');
60-
lines.push(`- ${tag}${summaryLines[0]}`);
59+
lines.push(`- *(${type})* ${summaryLines[0]}`);
6160
for (let i = 1; i < summaryLines.length; i++) {
6261
if (summaryLines[i]!.trim()) {
6362
lines.push(` ${summaryLines[i]}`);
@@ -73,16 +72,24 @@ export const defaultFormatter: ChangelogFormatter = (ctx) => {
7372
(max, s) => maxBump(max, s.bumpType),
7473
undefined,
7574
);
76-
const tag = depBumpType && depBumpType !== release.type ? `*(${depBumpType})* ` : '';
77-
lines.push(`- ${tag}Updated dependency ${sourceList || '(internal)'}`);
75+
const depBumpTag = depBumpType ? `*(${depBumpType})* ` : '';
76+
lines.push(`- ${depBumpTag}Updated dependency ${sourceList || '(internal)'}`);
7877
}
7978

8079
if (release.isGroupBump) {
81-
lines.push(sourceList ? `- Version bump from group with ${sourceList}` : '- Version bump from group');
80+
lines.push(
81+
sourceList
82+
? `- *(${release.type})* Version bump from group with ${sourceList}`
83+
: `- *(${release.type})* Version bump from group`,
84+
);
8285
}
8386

8487
if (release.isCascadeBump && !release.isDependencyBump && !release.isGroupBump) {
85-
lines.push(sourceList ? `- Version bump from ${sourceList}` : '- Version bump via cascade rule');
88+
lines.push(
89+
sourceList
90+
? `- *(${release.type})* Version bump from ${sourceList}`
91+
: `- *(${release.type})* Version bump via cascade rule`,
92+
);
8693
}
8794

8895
lines.push('');

packages/bumpy/src/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export interface PublishConfig {
6969
packManager: 'auto' | 'npm' | 'pnpm' | 'bun' | 'yarn';
7070
/** Command to use for publishing. "npm" uses npm publish (supports OIDC). Default: "npm" */
7171
publishManager: 'npm' | 'pnpm' | 'bun' | 'yarn';
72-
/** Extra args appended to the publish command (e.g., "--provenance") */
72+
/** Extra args appended to the publish command (e.g., "--tag next") */
7373
publishArgs: string[];
7474
/**
7575
* How to handle workspace:/catalog: protocol resolution.

packages/bumpy/test/core/changelog-github.test.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe('createGithubFormatter', () => {
145145

146146
const result = await formatter({ release, bumpFiles: [], date: '2026-04-14' });
147147

148-
expect(result).toContain('Updated dependency `core` v2.0.0');
148+
expect(result).toContain('*(patch)* Updated dependency `core` v2.0.0');
149149
});
150150

151151
test('handles dependency bump without source packages (fallback)', async () => {
@@ -170,7 +170,7 @@ describe('createGithubFormatter', () => {
170170

171171
const result = await formatter({ release, bumpFiles: [], date: '2026-04-14' });
172172

173-
expect(result).toContain('- Version bump from `core` v1.1.0');
173+
expect(result).toContain('- *(patch)* Version bump from `core` v1.1.0');
174174
});
175175

176176
test('handles cascade bump without source packages (fallback)', async () => {
@@ -182,7 +182,7 @@ describe('createGithubFormatter', () => {
182182

183183
const result = await formatter({ release, bumpFiles: [], date: '2026-04-14' });
184184

185-
expect(result).toContain('- Version bump via cascade rule');
185+
expect(result).toContain('- *(patch)* Version bump via cascade rule');
186186
});
187187

188188
test('handles group bump with source packages', async () => {
@@ -196,7 +196,7 @@ describe('createGithubFormatter', () => {
196196

197197
const result = await formatter({ release, bumpFiles: [], date: '2026-04-14' });
198198

199-
expect(result).toContain('- Version bump from group with `core` v1.1.0');
199+
expect(result).toContain('- *(minor)* Version bump from group with `core` v1.1.0');
200200
});
201201

202202
test('handles group bump without source packages (fallback)', async () => {
@@ -209,7 +209,7 @@ describe('createGithubFormatter', () => {
209209

210210
const result = await formatter({ release, bumpFiles: [], date: '2026-04-14' });
211211

212-
expect(result).toContain('- Version bump from group');
212+
expect(result).toContain('- *(minor)* Version bump from group');
213213
});
214214

215215
test('resolves bump file info from git log', async () => {

packages/bumpy/test/core/changelog.test.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ describe('defaultFormatter', () => {
2424

2525
expect(result).toContain('## 1.1.0');
2626
expect(result).toContain('<sub>2026-04-14</sub>');
27-
expect(result).toContain('- Added new feature');
27+
expect(result).toContain('- *(minor)* Added new feature');
2828
expect(result).toContain('- *(patch)* Fixed a bug');
29-
// Minor (matching release type, no tag) should come before patch
29+
// Major should come before minor, before patch
3030
expect(result.indexOf('Added new feature')).toBeLessThan(result.indexOf('Fixed a bug'));
3131
});
3232

@@ -39,7 +39,7 @@ describe('defaultFormatter', () => {
3939

4040
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
4141

42-
expect(result).toContain('- Updated dependency `core` v2.0.0');
42+
expect(result).toContain('*(patch)* Updated dependency `core` v2.0.0');
4343
});
4444

4545
test('formats dependency bump without source packages (fallback)', async () => {
@@ -50,7 +50,7 @@ describe('defaultFormatter', () => {
5050

5151
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
5252

53-
expect(result).toContain('- Updated dependency (internal)');
53+
expect(result).toContain('Updated dependency (internal)');
5454
});
5555

5656
test('formats cascade bump with source packages', async () => {
@@ -62,7 +62,7 @@ describe('defaultFormatter', () => {
6262

6363
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
6464

65-
expect(result).toContain('- Version bump from `core` v1.1.0');
65+
expect(result).toContain('- *(patch)* Version bump from `core` v1.1.0');
6666
});
6767

6868
test('formats cascade bump without source packages (fallback)', async () => {
@@ -73,7 +73,7 @@ describe('defaultFormatter', () => {
7373

7474
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
7575

76-
expect(result).toContain('- Version bump via cascade rule');
76+
expect(result).toContain('- *(patch)* Version bump via cascade rule');
7777
});
7878

7979
test('formats group bump with source packages', async () => {
@@ -86,7 +86,7 @@ describe('defaultFormatter', () => {
8686

8787
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
8888

89-
expect(result).toContain('- Version bump from group with `core` v1.1.0');
89+
expect(result).toContain('- *(minor)* Version bump from group with `core` v1.1.0');
9090
});
9191

9292
test('formats group bump without source packages (fallback)', async () => {
@@ -98,7 +98,7 @@ describe('defaultFormatter', () => {
9898

9999
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
100100

101-
expect(result).toContain('- Version bump from group');
101+
expect(result).toContain('- *(minor)* Version bump from group');
102102
});
103103

104104
test('dependency + cascade shows only dependency message', async () => {
@@ -111,7 +111,7 @@ describe('defaultFormatter', () => {
111111

112112
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
113113

114-
expect(result).toContain('- Updated dependency `core` v2.0.0');
114+
expect(result).toContain('*(patch)* Updated dependency `core` v2.0.0');
115115
expect(result).not.toContain('cascade');
116116
});
117117

@@ -130,7 +130,7 @@ describe('defaultFormatter', () => {
130130
const result = await defaultFormatter({ release, bumpFiles: [], date: '2026-04-14' });
131131

132132
expect(result).toContain('Updated dependency');
133-
expect(result).toContain('Version bump from group with');
133+
expect(result).toContain('*(minor)* Version bump from group with');
134134
});
135135

136136
test('direct changes + group upgrade shows both', async () => {
@@ -145,7 +145,7 @@ describe('defaultFormatter', () => {
145145
const result = await defaultFormatter({ release, bumpFiles, date: '2026-04-14' });
146146

147147
expect(result).toContain('*(patch)* Fixed a typo');
148-
expect(result).toContain('Version bump from group with `pkg-a` v1.1.0');
148+
expect(result).toContain('*(minor)* Version bump from group with `pkg-a` v1.1.0');
149149
});
150150

151151
test('handles multi-line bump file summaries', async () => {
@@ -157,7 +157,7 @@ describe('defaultFormatter', () => {
157157

158158
const result = await defaultFormatter({ release, bumpFiles, date: '2026-04-14' });
159159

160-
expect(result).toContain('- First line');
160+
expect(result).toContain('- *(minor)* First line');
161161
expect(result).toContain(' Second paragraph');
162162
});
163163

@@ -183,7 +183,7 @@ describe('generateChangelogEntry', () => {
183183
const result = await generateChangelogEntry(release, bumpFiles);
184184

185185
expect(result).toContain('## 1.0.1');
186-
expect(result).toContain('- Fix');
186+
expect(result).toContain('- *(patch)* Fix');
187187
});
188188

189189
test('uses custom formatter', async () => {
@@ -291,6 +291,6 @@ describe('loadFormatter', () => {
291291
const result = await formatter({ release, bumpFiles, date: '2026-04-14' });
292292

293293
expect(result).toContain('## 1.0.0');
294-
expect(result).toContain('- A fix');
294+
expect(result).toContain('- *(patch)* A fix');
295295
});
296296
});

0 commit comments

Comments
 (0)