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

Function applyBump

packages/bumpy/src/core/release-plan.ts:376–403  ·  view source on GitHub ↗

Apply a bump to a package, upgrading if already planned. Returns true if anything changed.

(
  planned: Map<string, PlannedBump>,
  name: string,
  type: BumpType,
  isDependencyBump: boolean,
  isCascadeBump: boolean,
  sourcePackageName: string,
)

Source from the content-addressed store, hash-verified

374
375/** Apply a bump to a package, upgrading if already planned. Returns true if anything changed. */
376function applyBump(
377 planned: Map<string, PlannedBump>,
378 name: string,
379 type: BumpType,
380 isDependencyBump: boolean,
381 isCascadeBump: boolean,
382 sourcePackageName: string,
383): boolean {
384 const existing = planned.get(name);
385 if (existing) {
386 const newType = maxBump(existing.type, type);
387 if (newType === existing.type) return false;
388 existing.type = newType;
389 if (isDependencyBump) existing.isDependencyBump = true;
390 if (isCascadeBump) existing.isCascadeBump = true;
391 existing.bumpSources.set(sourcePackageName, type);
392 return true;
393 }
394 planned.set(name, {
395 type,
396 isDependencyBump,
397 isCascadeBump,
398 isGroupBump: false,
399 bumpFiles: new Set(),
400 bumpSources: new Map([[sourcePackageName, type]]),
401 });
402 return true;
403}
404
405/**
406 * Apply normalized cascade rules (used for both cascadeTo and cascadeFrom).

Callers 3

assembleReleasePlanFunction · 0.85
applyCascadeRulesFunction · 0.85
applyCascadeFromFunction · 0.85

Calls 1

maxBumpFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…