(pattern)
| 34 | } |
| 35 | |
| 36 | function expandWorkspacePattern(pattern) { |
| 37 | // Supports the small set of workspace patterns used in this repo: |
| 38 | // - explicit paths (packages/core) |
| 39 | // - one-level globs (examples/*) |
| 40 | if (!pattern.includes("*")) return [pattern]; |
| 41 | |
| 42 | const star = pattern.indexOf("*"); |
| 43 | const base = pattern.slice(0, star); |
| 44 | const baseDir = resolve(ROOT, base); |
| 45 | if (!isDir(baseDir)) return []; |
| 46 | |
| 47 | const out = []; |
| 48 | const entries = readdirSync(baseDir).slice().sort(); |
| 49 | for (const name of entries) { |
| 50 | const full = join(baseDir, name); |
| 51 | if (!isDir(full)) continue; |
| 52 | out.push(join(base, name)); |
| 53 | } |
| 54 | return out; |
| 55 | } |
| 56 | |
| 57 | function listWorkspaceDirs() { |
| 58 | const rootPkg = readJson(join(ROOT, "package.json")); |
no test coverage detected