( pkgName: string, isPrivate: boolean, config: BumpyConfig, pkgBumpy?: PackageConfig, )
| 182 | |
| 183 | /** |
| 184 | * Determine if a package should be managed by bumpy. |
| 185 | * Resolution order: |
| 186 | * 1. Per-package `managed: false` → skip (explicit opt-out) |
| 187 | * 2. `config.ignore` glob match → skip |
| 188 | * 3. Per-package `managed: true` → include (explicit opt-in, overrides private) |
| 189 | * 4. `config.include` glob match → include (overrides private) |
| 190 | * 5. Private package + `config.privatePackages.version` false → skip |
| 191 | * 6. Otherwise → include |
| 192 | */ |
| 193 | export function isPackageManaged( |
| 194 | pkgName: string, |
| 195 | isPrivate: boolean, |
| 196 | config: BumpyConfig, |
| 197 | pkgBumpy?: PackageConfig, |
| 198 | ): boolean { |
| 199 | // 1. Explicit opt-out via per-package config |
| 200 | if (pkgBumpy?.managed === false) return false; |
| 201 | |
| 202 | // 2. Ignored by glob |
| 203 | if (config.ignore.some((pattern) => matchGlob(pkgName, pattern))) { |
| 204 | // ...unless explicitly opted in |
| 205 | if (pkgBumpy?.managed === true) return true; |
| 206 | if (config.include.some((pattern) => matchGlob(pkgName, pattern))) return true; |
| 207 | return false; |
| 208 | } |
| 209 | |
| 210 | // 3. Explicit opt-in via per-package config |
| 211 | if (pkgBumpy?.managed === true) return true; |
| 212 | |
| 213 | // 4. Included by glob (overrides private) |
| 214 | if (config.include.some((pattern) => matchGlob(pkgName, pattern))) return true; |
| 215 |
no test coverage detected
searching dependent graphs…