refactor: reorganize project structure and improve code quality
- Move CI/CD configs to config/ci/ directory - Reorganize scripts into categorized directories (deployment, monitoring, testing, utils) - Consolidate documentation into docs/ directory with proper structure - Update linting and testing configurations - Remove obsolete test reports and performance summaries - Add new documentation for code quality tools and contact form security - Improve project organization and maintainability - Fix lint-staged config to only lint JS/TS files - Disable react/react-in-jsx-scope rule for Next.js compatibility - Ignore scripts and test config directories in ESLint
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const coverageFilePath = path.join(__dirname, '..', 'coverage', 'coverage-final.json');
|
||||
|
||||
try {
|
||||
if (!fs.existsSync(coverageFilePath)) {
|
||||
console.error('Coverage file not found:', coverageFilePath);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const coverage = JSON.parse(fs.readFileSync(coverageFilePath, 'utf8'));
|
||||
|
||||
const metrics = {
|
||||
statements: coverage.total.statements.pct,
|
||||
branches: coverage.total.branches.pct,
|
||||
functions: coverage.total.functions.pct,
|
||||
lines: coverage.total.lines.pct,
|
||||
timestamp: new Date().toISOString(),
|
||||
};
|
||||
|
||||
console.log(JSON.stringify(metrics, null, 2));
|
||||
} catch (error) {
|
||||
console.error('Error reading coverage:', error.message);
|
||||
process.exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user