MCPcopy Create free account
hub / github.com/Houseofmvps/codesight / getWorkspacePatterns

Function getWorkspacePatterns

src/scanner.ts:1087–1107  ·  view source on GitHub ↗
(
  root: string,
  pkg: Record<string, any>
)

Source from the content-addressed store, hash-verified

1085}
1086
1087async function getWorkspacePatterns(
1088 root: string,
1089 pkg: Record<string, any>
1090): Promise<string[]> {
1091 // pnpm-workspace.yaml
1092 try {
1093 const yaml = await readFile(join(root, "pnpm-workspace.yaml"), "utf-8");
1094 const patterns: string[] = [];
1095 for (const line of yaml.split("\n")) {
1096 const match = line.match(/^\s*-\s*['"]?([^'"]+)['"]?\s*$/);
1097 if (match) patterns.push(match[1].trim());
1098 }
1099 if (patterns.length > 0) return patterns;
1100 } catch {}
1101
1102 // package.json workspaces
1103 if (Array.isArray(pkg.workspaces)) return pkg.workspaces;
1104 if (pkg.workspaces?.packages) return pkg.workspaces.packages;
1105
1106 return [];
1107}
1108
1109async function parsePythonRequirements(content: string, root: string, deps: string[]): Promise<void> {
1110 for (const line of content.split("\n")) {

Callers 1

detectProjectFunction · 0.85

Calls 1

joinFunction · 0.85

Tested by

no test coverage detected