(root: string, names: string[])
| 45 | } |
| 46 | |
| 47 | async function findFile(root: string, names: string[]): Promise<string | null> { |
| 48 | for (const name of names) { |
| 49 | const p = path.join(root, name); |
| 50 | if (await exists(p)) return p; |
| 51 | } |
| 52 | return null; |
| 53 | } |
| 54 | |
| 55 | const FRAMEWORKS: Array<{ name: string; pkg: string; detect?: (root: string) => Promise<string | null> }> = [ |
| 56 | { name: 'Next.js', pkg: 'next', detect: async (root) => { |