// Planu — Project Completeness Checker
// Checks for presence of standard project files (readme, gitignore, tests, ci, etc.)
import { fileExists, hasAnyFile } from '../detection-utils.js';
/**
 * Check project completeness (has readme, gitignore, tests, ci, etc.)
 */
// eslint-disable-next-line max-lines-per-function -- checklist pattern, each line is a single check
export async function checkProjectCompleteness(projectPath) {
    const checks = await Promise.all([
        fileExists(projectPath, 'README.md'),
        fileExists(projectPath, '.gitignore'),
        fileExists(projectPath, '.env.example').then((r) => r || fileExists(projectPath, '.env.local.example')),
        fileExists(projectPath, 'LICENSE'),
        fileExists(projectPath, '.editorconfig'),
        hasAnyFile(projectPath, [
            '.eslintrc*',
            'eslint.config.*',
            'biome.json',
            '.pylintrc',
            'ruff.toml',
            '.golangci.yml',
            'Cargo.toml',
        ]),
        hasAnyFile(projectPath, ['.prettierrc*', 'biome.json', '.editorconfig']),
        hasAnyFile(projectPath, [
            'jest.config.*',
            'vitest.config.*',
            'pytest.ini',
            'pyproject.toml',
            'Cargo.toml',
            '*.test.*',
            '*.spec.*',
        ]),
        hasAnyFile(projectPath, [
            '.github/workflows/*',
            '.gitlab-ci.yml',
            'Jenkinsfile',
            '.circleci/config.yml',
        ]),
        hasAnyFile(projectPath, ['sentry.*.config.*', '.sentryclirc', 'bugsnag.*']),
        hasAnyFile(projectPath, ['tsconfig.json', 'mypy.ini', 'pyrightconfig.json', '.flowconfig']),
        hasAnyFile(projectPath, ['.snyk', '.trivyignore', 'security.md', 'SECURITY.md']),
        hasAnyFile(projectPath, ['docs/**/*.md', 'doc/**/*', 'documentation/**/*']),
        fileExists(projectPath, 'CONTRIBUTING.md'),
        hasAnyFile(projectPath, ['CHANGELOG.md', '.changeset/*', '.releaserc*']),
        hasAnyFile(projectPath, ['backup*', 'docker-compose.yml']),
        hasAnyFile(projectPath, ['*.a11y.*', 'axe*', 'pa11y*']),
        hasAnyFile(projectPath, ['robots.txt', 'sitemap.xml', 'next-sitemap.config.*']),
        hasAnyFile(projectPath, ['lighthouse*', 'bundle-analyzer*', 'webpack-bundle*']),
        hasAnyFile(projectPath, ['seed.*', 'seeds/*', 'fixtures/*', 'prisma/seed.*']),
    ]);
    const [hasReadme, hasGitignore, hasEnvExample, hasLicense, hasEditorConfig, hasLinting, hasFormatting, hasTesting, hasCiCd, hasErrorTracking, hasTypeChecking, hasSecurityScanning, hasDocumentation, hasContributing, hasChangelogStrategy, hasBackupStrategy, hasAccessibility, hasSeo, hasPerformanceBudget, hasSeedData,] = checks;
    const trueCount = checks.filter(Boolean).length;
    const completenessScore = Math.round((trueCount / checks.length) * 100);
    return {
        hasReadme,
        hasGitignore,
        hasEnvExample,
        hasLicense,
        hasEditorConfig,
        hasLinting,
        hasFormatting,
        hasTesting,
        hasCiCd,
        hasErrorTracking,
        hasTypeChecking,
        hasSecurityScanning,
        hasDocumentation,
        hasContributing,
        hasChangelogStrategy,
        hasBackupStrategy,
        hasAccessibility,
        hasSeo,
        hasPerformanceBudget,
        hasSeedData,
        completenessScore,
    };
}
//# sourceMappingURL=completeness-checker.js.map