Build a map of scope aliases → package names from config and package names
(packages: Map<string, WorkspacePackage>, _config: BumpyConfig)
| 248 | body: commit.body, |
| 249 | }; |
| 250 | } |
| 251 | |
| 252 | /** Build a map of scope aliases → package names from config and package names */ |
| 253 | function buildScopeMap(packages: Map<string, WorkspacePackage>, _config: BumpyConfig): Map<string, string[]> { |
| 254 | const map = new Map<string, string[]>(); |
| 255 | |
| 256 | for (const [name, pkg] of packages) { |
| 257 | // Use the last segment of the package name as a scope alias |
| 258 | // e.g., @myorg/core → "core", my-pkg → "my-pkg" |
| 259 | const shortName = name.includes('/') ? name.split('/').pop()! : name; |
| 260 | if (!map.has(shortName)) map.set(shortName, []); |
| 261 | map.get(shortName)!.push(name); |
| 262 | |
| 263 | // Also register the full name |
| 264 | if (!map.has(name)) map.set(name, []); |
| 265 | map.get(name)!.push(name); |
| 266 | |
| 267 | // Use the directory name as an alias too |
| 268 | const dirName = pkg.relativeDir.split('/').pop()!; |
| 269 | if (dirName !== shortName) { |
| 270 | if (!map.has(dirName)) map.set(dirName, []); |
| 271 | map.get(dirName)!.push(name); |
| 272 | } |
| 273 | } |
| 274 | |
| 275 | return map; |
| 276 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…