Skip to content

Commit 11b87ea

Browse files
authored
Merge pull request #43 from dmno-dev/fix/gmail-dark-mode-frog-inversion
Fix Gmail dark mode frog inversion + changelog formatter tweaks
2 parents 9aa7be1 + 7d2a8b6 commit 11b87ea

6 files changed

Lines changed: 69 additions & 20 deletions

File tree

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+
Fix frog images getting color-inverted in Gmail dark mode by wrapping in anchor tags. Make commit links opt-in via `includeCommitLink` option in GitHub changelog formatter, and add default list of bot/AI authors to skip "Thanks" attribution for.

docs/changelog-formatters.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ No options are available for the default formatter.
2525

2626
### `github`
2727

28-
Enhanced formatter that adds PR links, commit links, and contributor attribution. Requires the `gh` CLI to be installed and authenticated.
28+
Enhanced formatter that adds PR links and contributor attribution. Optionally includes commit links. Requires the `gh` CLI to be installed and authenticated.
2929

3030
Enable in your `.bumpy/_config.json` using `"changelog": "github",`
3131

@@ -44,15 +44,16 @@ Or with options using a tuple format:
4444

4545
_2026-04-19_
4646

47-
- [#42](https://github.com/myorg/myrepo/pull/42) [`abc1234`](https://github.com/myorg/myrepo/commit/abc1234) Thanks [@contributor](https://github.com/contributor)! - Added support for custom themes
48-
- [#43](https://github.com/myorg/myrepo/pull/43) [`def5678`](https://github.com/myorg/myrepo/commit/def5678) - Fixed a bug with config loading
47+
- [#42](https://github.com/myorg/myrepo/pull/42) Thanks [@contributor](https://github.com/contributor)! - Added support for custom themes
48+
- [#43](https://github.com/myorg/myrepo/pull/43) - Fixed a bug with config loading
4949
```
5050

5151
#### Options
5252

5353
| Option | Type | Default | Description |
5454
| ------------------- | ---------- | ------- | ----------------------------------------------------------------- |
5555
| `repo` | `string` || `"owner/repo"` slug. Auto-detected from `gh` CLI if not provided. |
56+
| `includeCommitLink` | `boolean` | `false` | Whether to include commit hash links in changelog entries. |
5657
| `thankContributors` | `boolean` | `true` | Whether to include "Thanks @user" messages for contributors. |
5758
| `internalAuthors` | `string[]` | `[]` | GitHub usernames (without `@`) to skip "Thanks" messages for. |
5859

packages/bumpy/CHANGELOG.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,19 @@
44

55
_2026-04-22_
66

7-
- [#36](https://github.com/dmno-dev/bumpy/pull/36) [`43ee7ee`](https://github.com/dmno-dev/bumpy/commit/43ee7eed7e1d80a7b4aafd012b616d93c496a348) - Support JSONC in config file — allows // line comments, block comments, and trailing commas in .bumpy/\_config.json
8-
- [#37](https://github.com/dmno-dev/bumpy/pull/37) [`9b74ae4`](https://github.com/dmno-dev/bumpy/commit/9b74ae4dfb07a3df5ff14c513b88797007d51e9e) - Rework `bumpy check` and `bumpy ci check` behavior: default mode now only fails when no bump files exist at all (matching changesets), new `--strict` flag requires every changed package to be covered, and `--no-fail` makes checks advisory-only. Also fix false positive "empty bump file found" when deleted bump files appear in git diff.
7+
- [#36](https://github.com/dmno-dev/bumpy/pull/36) - Support JSONC in config file — allows // line comments, block comments, and trailing commas in .bumpy/\_config.json
8+
- [#37](https://github.com/dmno-dev/bumpy/pull/37) - Rework `bumpy check` and `bumpy ci check` behavior: default mode now only fails when no bump files exist at all (matching changesets), new `--strict` flag requires every changed package to be covered, and `--no-fail` makes checks advisory-only. Also fix false positive "empty bump file found" when deleted bump files appear in git diff.
99

1010
## 1.1.0
1111

1212
_2026-04-22_
1313

14-
- [#29](https://github.com/dmno-dev/bumpy/pull/29) [`8a3006f`](https://github.com/dmno-dev/bumpy/commit/8a3006fca143810d71f418a58c65c7a2ee6c0135) - Generate comprehensive README.md in .bumpy/ during init with auto-detected package manager commands
15-
- [#30](https://github.com/dmno-dev/bumpy/pull/30) [`f53a71d`](https://github.com/dmno-dev/bumpy/commit/f53a71d598176182f1a0b4be24d473467a94150f) - Fix check command to only count bump files from current branch, and handle empty bump files correctly in both local and CI check
16-
- [#32](https://github.com/dmno-dev/bumpy/pull/32) [`d800783`](https://github.com/dmno-dev/bumpy/commit/d8007837c80afe1ac5cd383050eb5bffbf440e97) - Fix empty bump files not being deleted during versioning
17-
- [#33](https://github.com/dmno-dev/bumpy/pull/33) [`3b23fcd`](https://github.com/dmno-dev/bumpy/commit/3b23fcd62b366c9ecafb3a10308da9fa45d8c6a0) - Generate command now detects bumps from all commits, not just conventional commits.
18-
- [#34](https://github.com/dmno-dev/bumpy/pull/34) [`ea14829`](https://github.com/dmno-dev/bumpy/commit/ea14829ccb346e05b6d284ff80c0d76d074f25fb) - Add published JSON schema for config file with editor autocomplete/validation. New config options: `changedFilePatterns` (root + per-package) for filtering which file changes trigger package detection, `commit` object form for custom commit messages, and `changelog: false` to disable changelog generation.
19-
- [#35](https://github.com/dmno-dev/bumpy/pull/35) [`3415164`](https://github.com/dmno-dev/bumpy/commit/3415164b9388456e130b14ca21f2c90a042055c6) - Merge migrate command into init — `bumpy init` now auto-detects `.changeset/` and handles migration. Added 🐸 emoji to success messages across all commands.
14+
- [#29](https://github.com/dmno-dev/bumpy/pull/29) - Generate comprehensive README.md in .bumpy/ during init with auto-detected package manager commands
15+
- [#30](https://github.com/dmno-dev/bumpy/pull/30) - Fix check command to only count bump files from current branch, and handle empty bump files correctly in both local and CI check
16+
- [#32](https://github.com/dmno-dev/bumpy/pull/32) - Fix empty bump files not being deleted during versioning
17+
- [#33](https://github.com/dmno-dev/bumpy/pull/33) - Generate command now detects bumps from all commits, not just conventional commits.
18+
- [#34](https://github.com/dmno-dev/bumpy/pull/34) - Add published JSON schema for config file with editor autocomplete/validation. New config options: `changedFilePatterns` (root + per-package) for filtering which file changes trigger package detection, `commit` object form for custom commit messages, and `changelog: false` to disable changelog generation.
19+
- [#35](https://github.com/dmno-dev/bumpy/pull/35) - Merge migrate command into init — `bumpy init` now auto-detects `.changeset/` and handles migration. Added 🐸 emoji to success messages across all commands.
2020

2121
## 🎉 1.0.0 <img src="https://raw.githubusercontent.com/dmno-dev/bumpy/main/images/frog-party.png" alt="bumpy-frog-party" width="80" style="image-rendering: pixelated;" align="right" />
2222

@@ -27,7 +27,7 @@ Initial stable release of bumpy — a modern monorepo versioning and changelog t
2727
- Flexible dependency bump propagation with cascade control
2828
- Fixed and linked package group strategies
2929
- Flexible opt-in out for packages, custom deployment commands
30-
- Pluggable changelog formatters with built-in GitHub formatter (PR links, commit links, contributor attribution)
30+
- Pluggable changelog formatters with built-in GitHub formatter (PR links, optional commit links, contributor attribution)
3131
- Interactive and non-interactive changeset creation (`bumpy add`)
3232
- Conventional commits bridge for automatic changeset generation
3333
- GitHub CI integration for PR checks and automated releases (`bumpy ci check`, `bumpy ci release`)

packages/bumpy/src/commands/ci.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,10 @@ function formatNoBumpFilesComment(prBranch: string | null, pm: PackageManager):
535535

536536
function bumpSectionHeader(type: string): string {
537537
// I think pixelated css gets stripped but may as well leave it
538-
const frog = `<img src="${FROG_IMG_BASE}/frog-${type}.png" alt="${type}" width="52" style="image-rendering: pixelated;" align="right" />`;
539-
return `### ${frog} ${type.charAt(0).toUpperCase() + type.slice(1)} releases`;
538+
// wrapping in <a> prevents Gmail dark mode from inverting the image
539+
const label = `${type.charAt(0).toUpperCase() + type.slice(1)} releases`;
540+
const frog = `<a href="https://bumpy.varlock.dev" title="${label}"><img src="${FROG_IMG_BASE}/frog-${type}.png" alt="${type}" width="52" style="image-rendering: pixelated;" align="right" /></a>`;
541+
return `### ${frog} ${label}`;
540542
}
541543

542544
/** Build inline diff links for a package's changed files in the PR */

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

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
11
import { tryRunArgs } from '../utils/shell.ts';
22
import type { ChangelogContext, ChangelogFormatter } from './changelog.ts';
33

4+
/** Authors filtered from "Thanks" attribution by default (e.g. bots) */
5+
/** Authors filtered from "Thanks" attribution by default (e.g. AI/automation bots) */
6+
const DEFAULT_INTERNAL_AUTHORS = [
7+
'copilot',
8+
'app/copilot-swe-agent',
9+
'claude',
10+
'dependabot',
11+
'dependabot[bot]',
12+
'app/dependabot',
13+
'renovate[bot]',
14+
'app/renovate',
15+
'github-actions[bot]',
16+
'snyk-bot',
17+
];
18+
419
export interface GithubChangelogOptions {
520
/** "owner/repo" — auto-detected from gh CLI if not provided */
621
repo?: string;
22+
/** Whether to include commit hash links in changelog entries (default: false) */
23+
includeCommitLink?: boolean;
724
/** Whether to include "Thanks @user" messages for contributors (default: true) */
825
thankContributors?: boolean;
926
/** GitHub usernames (without @) to skip "Thanks" messages for (e.g. internal team members) */
@@ -12,7 +29,7 @@ export interface GithubChangelogOptions {
1229

1330
/**
1431
* GitHub-enhanced changelog formatter.
15-
* Adds PR links, commit links, and contributor attribution when git/gh info is available.
32+
* Adds PR links, contributor attribution, and optionally commit links when git/gh info is available.
1633
*
1734
* Usage in config:
1835
* "changelog": "github"
@@ -21,8 +38,11 @@ export interface GithubChangelogOptions {
2138
* "changelog": ["github", { "internalAuthors": ["theoephraim"] }]
2239
*/
2340
export function createGithubFormatter(options: GithubChangelogOptions = {}): ChangelogFormatter {
41+
const includeCommitLink = options.includeCommitLink ?? false;
2442
const thankContributors = options.thankContributors ?? true;
25-
const internalAuthorsSet = new Set((options.internalAuthors ?? []).map((a) => a.toLowerCase()));
43+
const internalAuthorsSet = new Set(
44+
[...DEFAULT_INTERNAL_AUTHORS, ...(options.internalAuthors ?? [])].map((a) => a.toLowerCase()),
45+
);
2646

2747
return async (ctx: ChangelogContext) => {
2848
const { release, bumpFiles, date } = ctx;
@@ -51,7 +71,14 @@ export function createGithubFormatter(options: GithubChangelogOptions = {}): Cha
5171
const firstLine = linkifyIssueRefs(summaryLines[0]!, serverUrl, repoSlug);
5272

5373
// Build the prefix: PR link, commit link, thanks
54-
const prefix = formatPrefix(gitInfo, serverUrl, repoSlug, thankContributors, internalAuthorsSet);
74+
const prefix = formatPrefix(
75+
gitInfo,
76+
serverUrl,
77+
repoSlug,
78+
includeCommitLink,
79+
thankContributors,
80+
internalAuthorsSet,
81+
);
5582

5683
lines.push(`-${prefix ? ` ${prefix} -` : ''} ${firstLine}`);
5784

@@ -243,6 +270,7 @@ function formatPrefix(
243270
info: BumpFileGitInfo,
244271
serverUrl: string,
245272
repo: string | undefined,
273+
includeCommitLink: boolean,
246274
thankContributors: boolean,
247275
internalAuthors: Set<string>,
248276
): string {
@@ -252,7 +280,7 @@ function formatPrefix(
252280
parts.push(`[#${info.prNumber}](${info.prUrl})`);
253281
}
254282

255-
if (info.commitHash && repo) {
283+
if (includeCommitLink && info.commitHash && repo) {
256284
const short = info.commitHash.slice(0, 7);
257285
parts.push(`[\`${short}\`](${serverUrl}/${repo}/commit/${info.commitHash})`);
258286
}

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

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ describe('createGithubFormatter', () => {
5151
expect(result).toContain('https://github.com/dmno-dev/bumpy/pull/42');
5252
});
5353

54-
test('includes commit link when bump file has commit metadata', async () => {
54+
test('excludes commit link by default', async () => {
5555
addMockRule({ match: /^git log/, response: '' });
5656

5757
const formatter = createGithubFormatter({ repo: 'dmno-dev/bumpy' });
@@ -60,6 +60,19 @@ describe('createGithubFormatter', () => {
6060

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

63+
expect(result).not.toContain('[`abc1234`]');
64+
expect(result).not.toContain('/commit/abc1234567890');
65+
});
66+
67+
test('includes commit link when includeCommitLink is true', async () => {
68+
addMockRule({ match: /^git log/, response: '' });
69+
70+
const formatter = createGithubFormatter({ repo: 'dmno-dev/bumpy', includeCommitLink: true });
71+
const release = makeRelease('pkg-a', '1.0.1', { bumpFiles: ['cs1'] });
72+
const bumpFiles = [makeBumpFile('cs1', [{ name: 'pkg-a', type: 'patch' }], 'commit: abc1234567890\nFixed it')];
73+
74+
const result = await formatter({ release, bumpFiles, date: '2026-04-14' });
75+
6376
expect(result).toContain('[`abc1234`]');
6477
expect(result).toContain('/commit/abc1234567890');
6578
});
@@ -167,7 +180,7 @@ describe('createGithubFormatter', () => {
167180
const result = await formatter({ release, bumpFiles, date: '2026-04-14' });
168181

169182
expect(result).toContain('[#99]');
170-
expect(result).toContain('[`deadbee`]');
183+
expect(result).not.toContain('[`deadbee`]');
171184
expect(result).toContain('Thanks [@contributor]');
172185
});
173186

0 commit comments

Comments
 (0)