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

Function computeModuleLabel

npm_modules/cli/src/preview/previewGenerator.ts:305–309  ·  view source on GitHub ↗
(moduleDir: string, workspaceRoot: string)

Source from the content-addressed store, hash-verified

303
304/** Compute the Bazel label for a module given its directory and workspace root */
305export function computeModuleLabel(moduleDir: string, workspaceRoot: string): string {
306 const relPath = path.relative(workspaceRoot, moduleDir);
307 const moduleName = readModuleName(moduleDir);
308 return `//${relPath}:${moduleName}`;
309}
310
311/** Find the base tsconfig relative path for external repos */
312function findBaseConfigRelativePath(workspaceRoot: string, fromDir: string): string {

Callers 2

valdiPreviewFunction · 0.90

Calls 1

readModuleNameFunction · 0.85

Tested by

no test coverage detected