(moduleDir: string)
| 285 | |
| 286 | /** Read the valdi_module name from a BUILD.bazel file in the given directory */ |
| 287 | export function readModuleName(moduleDir: string): string { |
| 288 | const buildContent = fs.readFileSync(path.join(moduleDir, 'BUILD.bazel'), 'utf8'); |
| 289 | const nameMatch = buildContent.match(/valdi_module\s*\([^)]*name\s*=\s*"(\w+)"/s); |
| 290 | if (!nameMatch) { |
| 291 | throw new Error(`Could not find valdi_module name in ${moduleDir}/BUILD.bazel`); |
| 292 | } |
| 293 | return nameMatch[1]!; |
| 294 | } |
| 295 | |
| 296 | /** Detect whether this workspace is the core Valdi repo */ |
| 297 | export function isValdiWorkspace(workspaceRoot: string): boolean { |
no test coverage detected