MCPcopy Create free account
hub / github.com/dmno-dev/bumpy / formatReleasePlanComment

Function formatReleasePlanComment

packages/bumpy/src/commands/ci.ts:1320–1451  ·  view source on GitHub ↗
(
  plan: ReleasePlan,
  bumpFiles: BumpFile[],
  prNumber: string,
  prBranch: string | null,
  pm: PackageManager,
  warnings: string[] = [],
  parseErrors: string[] = [],
  emptyBumpFileIds: string[] = [],
  channel: ResolvedChannel | null = null,
  allChannels: Map<string, ResolvedChannel> | null = null,
)

Source from the content-addressed store, hash-verified

1318 published: { name: string; version: string }[],
1319 pm: PackageManager,
1320): string {
1321 const lines: string[] = [
1322 `<a href="https://bumpy.varlock.dev"><img src="${FROG_IMG_BASE}/frog-clipboard.png" alt="bumpy-frog" width="60" align="left" style="image-rendering: pixelated;" title="Hi! I'm bumpy!" /></a>`,
1323 '',
1324 `**Snapshot published** to the \`@${snapshot.tag}\` dist-tag — a throwaway preview of this PR, not a stable release.`,
1325 '<br clear="left" />',
1326 '',
1327 '#### Published packages',
1328 '',
1329 ];
1330 for (const p of published) {
1331 lines.push(`- \`${p.name}@${p.version}\``);
1332 }
1333 lines.push('');
1334 lines.push('Install the latest snapshot for this PR:');
1335 lines.push('');
1336 lines.push('```bash');
1337 for (const p of published) {
1338 lines.push(pmInstallCommand(pm, `${p.name}@${snapshot.tag}`));
1339 }
1340 lines.push('```');
1341 lines.push('');
1342 lines.push(
1343 `> The \`@${snapshot.tag}\` tag always points at the newest snapshot from this PR — pushing new commits republishes it. ` +
1344 `Exact versions above are pinned to each other so they install as a coherent set.`,
1345 );
1346 lines.push('');
1347 lines.push('---');
1348 lines.push(`_This comment is maintained by [bumpy](https://bumpy.varlock.dev)._`);
1349 return lines.join('\n');
1350}
1351
1352export function formatReleasePlanComment(
1353 plan: ReleasePlan,
1354 bumpFiles: BumpFile[],
1355 prNumber: string,
1356 prBranch: string | null,
1357 pm: PackageManager,
1358 warnings: string[] = [],
1359 parseErrors: string[] = [],
1360 emptyBumpFileIds: string[] = [],
1361 channel: ResolvedChannel | null = null,
1362 allChannels: Map<string, ResolvedChannel> | null = null,
1363): string {
1364 const repo = process.env.GITHUB_REPOSITORY;
1365 const lines: string[] = [];
1366
1367 // When targeting a prerelease channel, the version display carries a wildcard
1368 // `-<preid>.x` suffix (the exact counter is derived from the registry at publish time).
1369 const versionSuffix = channel ? `-${channel.preid}.x` : '';
1370
1371 // Promotion PR: stable-targeted, carrying bump files that already shipped on a
1372 // channel (e.g. `next` → `main`). Merging it ends the cycle and ships stable.
1373 const promotedChannels = channel ? [] : [...new Set(bumpFiles.map((bf) => bf.channel))].filter((c) => c != null);
1374 const channelTag = (name: string) => `\`@${allChannels?.get(name)?.tag ?? name}\``;
1375
1376 const headline = channel
1377 ? `**This PR targets the \`${channel.name}\` prerelease channel** — merging it ships these packages as a **prerelease** to the \`@${channel.tag}\` dist-tag, not a stable release.`

Callers 2

ciCheckCommandFunction · 0.85

Calls 5

bumpSectionHeaderFunction · 0.85
channelTagFunction · 0.85
sha256HexFunction · 0.85
buildAddBumpFileLinkFunction · 0.85
pmRunCommandFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…