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

Function applyCascadeFrom

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

* Apply consumer-side cascadeFrom rules. * Scans all packages for cascadeFrom entries where the pattern matches the bumped source. * Returns true if any bump was applied.

(
  sourceName: string,
  sourceType: BumpType,
  packages: Map<string, WorkspacePackage>,
  planned: Map<string, PlannedBump>,
)

Source from the content-addressed store, hash-verified

434 * Returns true if any bump was applied.
435 */
436function applyCascadeFrom(
437 sourceName: string,
438 sourceType: BumpType,
439 packages: Map<string, WorkspacePackage>,
440 planned: Map<string, PlannedBump>,
441): boolean {
442 let changed = false;
443 for (const [targetName, targetPkg] of packages) {
444 const rules = cascadeFromRules(targetPkg);
445 for (const [pattern, rule] of Object.entries(rules)) {
446 if (!matchGlob(sourceName, pattern)) continue;
447 if (!shouldTrigger(sourceType, rule.trigger)) continue;
448 const cascadeBump: BumpType = rule.bumpAs === 'match' ? sourceType : rule.bumpAs;
449 if (applyBump(planned, targetName, cascadeBump, false, true, sourceName)) {
450 changed = true;
451 }
452 }
453 }
454 return changed;
455}
456
457/** Check if a bump level meets the trigger threshold */
458function shouldTrigger(bumpType: BumpType, trigger: BumpType): boolean {

Callers 1

assembleReleasePlanFunction · 0.85

Calls 4

matchGlobFunction · 0.90
cascadeFromRulesFunction · 0.85
shouldTriggerFunction · 0.85
applyBumpFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…