* Minimal pnpm-workspace.yaml `packages:` extractor. Handles the only shape * pnpm actually uses: * packages: * - 'packages/*' * - "apps/*" * - tools/build
(yaml: string)
| 898 | * - tools/build |
| 899 | */ |
| 900 | function parsePnpmPackages(yaml: string): string[] { |
| 901 | const out: string[] = []; |
| 902 | const lines = yaml.split(/\r?\n/); |
| 903 | let inPackages = false; |
| 904 | for (const line of lines) { |
| 905 | if (/^\s*packages\s*:/.test(line)) { |
| 906 | inPackages = true; |
| 907 | continue; |
| 908 | } |
| 909 | if (inPackages) { |
| 910 | const item = line.match(/^\s*-\s*(.+?)\s*$/); |
| 911 | if (item) { |
| 912 | out.push(item[1]!.replace(/^['"]|['"]$/g, '')); |
| 913 | continue; |
| 914 | } |
| 915 | // A non-list, non-blank line ends the `packages:` block. |
| 916 | if (line.trim() !== '' && !/^\s/.test(line)) inPackages = false; |
| 917 | } |
| 918 | } |
| 919 | return out; |
| 920 | } |
| 921 | |
| 922 | /** Folders no wildcard matches: installed packages. */ |
| 923 | const GLOB_SKIP_DIRS = new Set(['node_modules', 'bower_components']); |
no test coverage detected