* 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>,
)
| 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. */ |
| 428 | function applyBump( |
| 429 | planned: Map<string, PlannedBump>, |
| 430 | name: string, |
| 431 | type: BumpType, |
| 432 | isDependencyBump: boolean, |
no test coverage detected
searching dependent graphs…