| 1085 | } |
| 1086 | |
| 1087 | async 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 | |
| 1109 | async function parsePythonRequirements(content: string, root: string, deps: string[]): Promise<void> { |
| 1110 | for (const line of content.split("\n")) { |