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

Function applyCascadeRules

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

* Apply normalized cascade rules (used for both cascadeTo and cascadeFrom). * Keys in `rules` are target package name/glob patterns. * Returns true if any bump was applied.

(
  rules: Record<string, Required<{ trigger: BumpType; bumpAs: BumpType | 'match' }>>,
  sourceName: string,
  sourceType: BumpType,
  packages: Map<string, WorkspacePackage>,
  planned: Map<string, PlannedBump>,
)

Source from the content-addressed store, hash-verified

408
409 // Sort by name for stable output
410 releases.sort((a, b) => a.name.localeCompare(b.name));
411
412 // Static warning: workspace:* on peer deps
413 for (const [name, pkg] of packages) {
414 for (const [depName, range] of Object.entries(pkg.peerDependencies)) {
415 if (range === 'workspace:*' && packages.has(depName)) {
416 warnings.push(
417 `${name} has peer dep "${depName}": "workspace:*" — this will be published as a fixed range ` +
418 `which may not match your intent. Consider using "workspace:^" instead.`,
419 );
420 }
421 }
422 }
423
424 return { bumpFiles, releases, warnings };
425}
426
427/** Apply a bump to a package, upgrading if already planned. Returns true if anything changed. */
428function applyBump(
429 planned: Map<string, PlannedBump>,
430 name: string,
431 type: BumpType,
432 isDependencyBump: boolean,

Callers 1

assembleReleasePlanFunction · 0.85

Calls 3

matchGlobFunction · 0.90
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…