import fs from 'fs';
import path from 'path';
export function detectUIFramework(rootDir = process.cwd()): 'tailwind' | 'shadcn' | 'mui' | 'none' {
const pkgPath = path.join(rootDir, 'package.json');
if (!fs.existsSync(pkgPath)) return 'none';
const pkg = JSON.parse(fs.readFileSync(pkgPath, 'utf-8'));
const deps = {
...pkg.dependencies,
...pkg.devDependencies,
};
if (deps['tailwindcss']) return 'tailwind';
if (deps['@mui/material']) return 'mui';
if (deps['@radix-ui/react-avatar'] || deps['shadcn-ui']) return 'shadcn'; // heuristic for shadcn
return 'none';
}