* 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>, )
| 434 | * Returns true if any bump was applied. |
| 435 | */ |
| 436 | function 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 */ |
| 458 | function shouldTrigger(bumpType: BumpType, trigger: BumpType): boolean { |
no test coverage detected
searching dependent graphs…