( files: string[], packages: Map<string, WorkspacePackage>, rootDir: string, )
| 192 | |
| 193 | /** Map file paths to package names based on directory containment */ |
| 194 | export function mapFilesToPackages( |
| 195 | files: string[], |
| 196 | packages: Map<string, WorkspacePackage>, |
| 197 | rootDir: string, |
| 198 | ): string[] { |
| 199 | const matched = new Set<string>(); |
| 200 | for (const file of files) { |
| 201 | for (const [name, pkg] of packages) { |
| 202 | const pkgRelDir = relative(rootDir, pkg.dir); |
| 203 | // Root package (single-package repo) has an empty relative dir, so every |
| 204 | // file belongs to it. Otherwise the file must live under the package dir. |
| 205 | if (pkgRelDir === '' || file.startsWith(pkgRelDir + '/')) { |
| 206 | matched.add(name); |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | return [...matched]; |
| 211 | } |
| 212 | |
| 213 | /** Parse raw git log output into individual commits */ |
| 214 | function parseGitLog(raw: string): { hash: string; subject: string; body: string }[] { |
no outgoing calls
no test coverage detected
searching dependent graphs…