Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .bumpy/changelog-bump-labels.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@varlock/bumpy': patch
---

Always show bump type label on each changelog item instead of only when it differs from the release type
4 changes: 2 additions & 2 deletions docs/differences-from-changesets.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ Changesets uses `npm publish` even in Yarn/pnpm workspaces, so `workspace:^` and
- [changesets#979](https://github.com/changesets/changesets/issues/979) — non-interactive mode (15 thumbs-up)
- [changesets#1118](https://github.com/changesets/changesets/discussions/1118) — CLI automation support

### Provenance and custom publish args
### Provenance, staged publishing, and custom publish args

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

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

Expand Down
2 changes: 1 addition & 1 deletion packages/bumpy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

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

- [#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.
- [#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).

## 1.10.0

Expand Down
2 changes: 1 addition & 1 deletion packages/bumpy/config-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
"publishArgs": {
"type": "array",
"items": { "type": "string" },
"description": "Extra args appended to the publish command (e.g., \"--provenance\")",
"description": "Extra args appended to the publish command (e.g., \"--tag next\")",
"default": []
},
"protocolResolution": {
Expand Down
16 changes: 12 additions & 4 deletions packages/bumpy/src/core/changelog-github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export function createGithubFormatter(options: GithubChangelogOptions = {}): Cha
if (!bf.summary) continue;

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

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

if (release.isGroupBump) {
lines.push(sourceList ? `- Version bump from group with ${sourceList}` : '- Version bump from group');
lines.push(
sourceList
? `- *(${release.type})* Version bump from group with ${sourceList}`
: `- *(${release.type})* Version bump from group`,
);
}

if (release.isCascadeBump && !release.isDependencyBump && !release.isGroupBump) {
lines.push(sourceList ? `- Version bump from ${sourceList}` : '- Version bump via cascade rule');
lines.push(
sourceList
? `- *(${release.type})* Version bump from ${sourceList}`
: `- *(${release.type})* Version bump via cascade rule`,
);
}

lines.push('');
Expand Down
19 changes: 13 additions & 6 deletions packages/bumpy/src/core/changelog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,8 @@ export const defaultFormatter: ChangelogFormatter = (ctx) => {
for (const bf of sorted) {
if (!bf.summary) continue;
const type = getBumpTypeForPackage(bf, release.name);
const tag = type !== release.type ? `*(${type})* ` : '';
const summaryLines = bf.summary.split('\n');
lines.push(`- ${tag}${summaryLines[0]}`);
lines.push(`- *(${type})* ${summaryLines[0]}`);
for (let i = 1; i < summaryLines.length; i++) {
if (summaryLines[i]!.trim()) {
lines.push(` ${summaryLines[i]}`);
Expand All @@ -73,16 +72,24 @@ export const defaultFormatter: ChangelogFormatter = (ctx) => {
(max, s) => maxBump(max, s.bumpType),
undefined,
);
const tag = depBumpType && depBumpType !== release.type ? `*(${depBumpType})* ` : '';
lines.push(`- ${tag}Updated dependency ${sourceList || '(internal)'}`);
const depBumpTag = depBumpType ? `*(${depBumpType})* ` : '';
lines.push(`- ${depBumpTag}Updated dependency ${sourceList || '(internal)'}`);
}

if (release.isGroupBump) {
lines.push(sourceList ? `- Version bump from group with ${sourceList}` : '- Version bump from group');
lines.push(
sourceList
? `- *(${release.type})* Version bump from group with ${sourceList}`
: `- *(${release.type})* Version bump from group`,
);
}

if (release.isCascadeBump && !release.isDependencyBump && !release.isGroupBump) {
lines.push(sourceList ? `- Version bump from ${sourceList}` : '- Version bump via cascade rule');
lines.push(
sourceList
? `- *(${release.type})* Version bump from ${sourceList}`
: `- *(${release.type})* Version bump via cascade rule`,
);
}

lines.push('');
Expand Down
2 changes: 1 addition & 1 deletion packages/bumpy/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export interface PublishConfig {
packManager: 'auto' | 'npm' | 'pnpm' | 'bun' | 'yarn';
/** Command to use for publishing. "npm" uses npm publish (supports OIDC). Default: "npm" */
publishManager: 'npm' | 'pnpm' | 'bun' | 'yarn';
/** Extra args appended to the publish command (e.g., "--provenance") */
/** Extra args appended to the publish command (e.g., "--tag next") */
publishArgs: string[];
/**
* How to handle workspace:/catalog: protocol resolution.
Expand Down
10 changes: 5 additions & 5 deletions packages/bumpy/test/core/changelog-github.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe('createGithubFormatter', () => {

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

expect(result).toContain('Updated dependency `core` v2.0.0');
expect(result).toContain('*(patch)* Updated dependency `core` v2.0.0');
});

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

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

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

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

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

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

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

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

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

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

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

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

test('resolves bump file info from git log', async () => {
Expand Down
28 changes: 14 additions & 14 deletions packages/bumpy/test/core/changelog.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ describe('defaultFormatter', () => {

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

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

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

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

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

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

expect(result).toContain('- Updated dependency (internal)');
expect(result).toContain('Updated dependency (internal)');
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

expect(result).toContain('Updated dependency');
expect(result).toContain('Version bump from group with');
expect(result).toContain('*(minor)* Version bump from group with');
});

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

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

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

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

expect(result).toContain('- First line');
expect(result).toContain('- *(minor)* First line');
expect(result).toContain(' Second paragraph');
});

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

expect(result).toContain('## 1.0.1');
expect(result).toContain('- Fix');
expect(result).toContain('- *(patch)* Fix');
});

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

expect(result).toContain('## 1.0.0');
expect(result).toContain('- A fix');
expect(result).toContain('- *(patch)* A fix');
});
});