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

Function formatPrefix

packages/bumpy/src/core/changelog-github.ts:315–340  ·  view source on GitHub ↗

* Build the prefix portions of a changelog line, split into links and thanks * so the bump type tag can be inserted between them.

(
  info: BumpFileGitInfo,
  serverUrl: string,
  repo: string | undefined,
  includeCommitLink: boolean,
  thankContributors: boolean,
  internalAuthors: Set<string>,
)

Source from the content-addressed store, hash-verified

313 * so the bump type tag can be inserted between them.
314 */
315function formatPrefix(
316 info: BumpFileGitInfo,
317 serverUrl: string,
318 repo: string | undefined,
319 includeCommitLink: boolean,
320 thankContributors: boolean,
321 internalAuthors: Set<string>,
322): { links: string; thanks: string } {
323 const linkParts: string[] = [];
324
325 if (info.prNumber && info.prUrl) {
326 linkParts.push(`[#${info.prNumber}](${info.prUrl})`);
327 }
328
329 if (includeCommitLink && info.commitHash && repo) {
330 const short = info.commitHash.slice(0, 7);
331 linkParts.push(`[\`${short}\`](${serverUrl}/${repo}/commit/${info.commitHash})`);
332 }
333
334 let thanks = '';
335 if (thankContributors && info.author && !internalAuthors.has(info.author.toLowerCase())) {
336 thanks = `Thanks [@${info.author}](${serverUrl}/${info.author})!`;
337 }
338
339 return { links: linkParts.join(' '), thanks };
340}
341
342/**
343 * Linkify bare issue/PR references like #123 in text,

Callers 1

createGithubFormatterFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…