(cwd: string, packageJsonPath: string)
| 482 | } |
| 483 | |
| 484 | function parseNxWorkspace(cwd: string, packageJsonPath: string): string[] { |
| 485 | if (fs.existsSync(packageJsonPath)) { |
| 486 | const packages = parsePackageJsonWorkspaces(packageJsonPath) |
| 487 | if (packages.length > 0) { |
| 488 | return packages |
| 489 | } |
| 490 | } |
| 491 | const defaultPatterns = ['apps/*', 'libs/*', 'packages/*'] |
| 492 | const existingPatterns: string[] = [] |
| 493 | for (const pattern of defaultPatterns) { |
| 494 | const basePath = path.join(cwd, pattern.replace('/*', '')) |
| 495 | if (fs.existsSync(basePath)) { |
| 496 | existingPatterns.push(pattern) |
| 497 | } |
| 498 | } |
| 499 | return existingPatterns |
| 500 | } |
| 501 | |
| 502 | function findNextjsInWorkspace(cwd: string, patterns: string[]): string | null { |
| 503 | const packagePaths = expandWorkspacePatterns(cwd, patterns) |
no test coverage detected