MCPcopy Index your code
hub / github.com/dmno-dev/bumpy / writeBumpFile

Function writeBumpFile

packages/bumpy/src/core/bump-file.ts:233–256  ·  view source on GitHub ↗
(
  rootDir: string,
  filename: string,
  releases: BumpFileRelease[],
  summary: string,
)

Source from the content-addressed store, hash-verified

231
232/** Write a bump file */
233export async function writeBumpFile(
234 rootDir: string,
235 filename: string,
236 releases: BumpFileRelease[],
237 summary: string,
238): Promise<string> {
239 const dir = getBumpyDir(rootDir);
240 const filePath = resolve(dir, `${filename}.md`);
241
242 // Build frontmatter object
243 const frontmatter: Record<string, unknown> = {};
244 for (const release of releases) {
245 if ('cascade' in release && Object.keys(release.cascade).length > 0) {
246 frontmatter[release.name] = { bump: release.type, cascade: release.cascade };
247 } else {
248 frontmatter[release.name] = release.type;
249 }
250 }
251
252 const yamlStr = yaml.dump(frontmatter, { lineWidth: -1, quotingType: '"' }).trim();
253 const content = `---\n${yamlStr}\n---\n\n${summary}\n`;
254 await writeText(filePath, content);
255 return filePath;
256}
257
258/**
259 * Recover bump files that were deleted by the version commit.

Callers 2

generateCommandFunction · 0.90
addCommandFunction · 0.90

Calls 2

getBumpyDirFunction · 0.90
writeTextFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…