* Recursively get all Vue component files in a directory.
(dir: string, baseDir: string = dir)
| 69 | * Recursively get all Vue component files in a directory. |
| 70 | */ |
| 71 | function getVueFiles(dir: string, baseDir: string = dir): string[] { |
| 72 | const files: string[] = [] |
| 73 | const entries = fs.readdirSync(dir, { withFileTypes: true }) |
| 74 | |
| 75 | for (const entry of entries) { |
| 76 | const fullPath = path.join(dir, entry.name) |
| 77 | if (entry.isDirectory()) { |
| 78 | files.push(...getVueFiles(fullPath, baseDir)) |
| 79 | } else if (entry.isFile() && entry.name.endsWith('.vue')) { |
| 80 | // Get relative path from base components directory |
| 81 | files.push(normalizeComponentPath(path.relative(baseDir, fullPath))) |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | return files |
| 86 | } |
| 87 | |
| 88 | /** |
| 89 | * Parse .nuxt/components.d.ts to get the mapping from component names to file paths. |
no test coverage detected