* Minimal pnpm-workspace.yaml `packages:` extractor. Handles the only shape * pnpm actually uses: * packages: * - 'packages/*' * - "apps/*" * - tools/build
(yaml: string)
| 270 | * - tools/build |
| 271 | */ |
| 272 | function parsePnpmPackages(yaml: string): string[] { |
| 273 | const out: string[] = []; |
| 274 | const lines = yaml.split(/\r?\n/); |
| 275 | let inPackages = false; |
| 276 | for (const line of lines) { |
| 277 | if (/^\s*packages\s*:/.test(line)) { |
| 278 | inPackages = true; |
| 279 | continue; |
| 280 | } |
| 281 | if (inPackages) { |
| 282 | const item = line.match(/^\s*-\s*(.+?)\s*$/); |
| 283 | if (item) { |
| 284 | out.push(item[1]!.replace(/^['"]|['"]$/g, '')); |
| 285 | continue; |
| 286 | } |
| 287 | // A non-list, non-blank line ends the `packages:` block. |
| 288 | if (line.trim() !== '' && !/^\s/.test(line)) inPackages = false; |
| 289 | } |
| 290 | } |
| 291 | return out; |
| 292 | } |
| 293 | |
| 294 | /** Expand one level of a `packages/*` / `apps/**` glob to member dirs. */ |
| 295 | function expandWorkspaceGlob(projectRoot: string, pattern: string): string[] { |
no outgoing calls
no test coverage detected