MCPcopy Create free account
hub / github.com/Snapchat/Valdi / isValdiWorkspace

Function isValdiWorkspace

npm_modules/cli/src/preview/previewGenerator.ts:297–302  ·  view source on GitHub ↗
(workspaceRoot: string)

Source from the content-addressed store, hash-verified

295
296/** Detect whether this workspace is the core Valdi repo */
297export function isValdiWorkspace(workspaceRoot: string): boolean {
298 const wsFile = path.join(workspaceRoot, 'WORKSPACE');
299 if (!fs.existsSync(wsFile)) return false;
300 const content = fs.readFileSync(wsFile, 'utf8');
301 return /workspace\s*\(\s*name\s*=\s*"valdi"\s*\)/.test(content);
302}
303
304/** Compute the Bazel label for a module given its directory and workspace root */
305export function computeModuleLabel(moduleDir: string, workspaceRoot: string): string {

Callers 2

valdiPreviewFunction · 0.90

Calls 3

readFileSyncMethod · 0.80
joinMethod · 0.45
testMethod · 0.45

Tested by

no test coverage detected