(baseDir: string)
| 88 | } |
| 89 | |
| 90 | export function detectProjectState(baseDir: string): ProjectState { |
| 91 | const schemaPath = findSchemaPath(baseDir) |
| 92 | const hasSchemaFile = schemaPath !== null |
| 93 | let hasModels = false |
| 94 | |
| 95 | if (schemaPath) { |
| 96 | try { |
| 97 | const content = fs.readFileSync(schemaPath, 'utf-8') |
| 98 | hasModels = MODEL_PATTERN.test(content) |
| 99 | } catch {} |
| 100 | } |
| 101 | |
| 102 | return { |
| 103 | hasPackageJson: fs.existsSync(path.join(baseDir, 'package.json')), |
| 104 | hasSchemaFile, |
| 105 | hasPrismaConfig: fs.existsSync(path.join(baseDir, 'prisma.config.ts')), |
| 106 | hasEnvFile: fs.existsSync(path.join(baseDir, '.env')), |
| 107 | hasModels, |
| 108 | hasSeedScript: checkSeedScript(baseDir), |
| 109 | } |
| 110 | } |
no test coverage detected