Files
headquarter/apps/web/scripts/check-structure.js
T
Developer e434c439c9 refactor: rename files to PascalCase components and kebab-case APIs (Task 4.4)
- Rename all component files to PascalCase matching exported names
- Move components into feature directories (git/, session/, project/, terminal/, workspace/, ui/, layout/)
- Rename all page files to PascalCase with Page suffix
- Rename all API files to kebab-case
- Update all imports across codebase with corrected relative depths
- Preserve git history via git mv

Quality gates: tsc (pass), eslint (pass), 66/74 tests pass (8 pre-existing failures)
Refs: repo-restructure Task 4.4
2026-06-02 22:58:10 +00:00

57 lines
1.4 KiB
JavaScript

#!/usr/bin/env node
/* eslint-disable */
/**
* Verifies repository structure conventions.
* Run with: node scripts/check-structure.js
*/
import fs from "fs";
import path from "path";
import { fileURLToPath } from "url";
const __dirname = path.dirname(fileURLToPath(import.meta.url));
const SRC_DIR = path.join(__dirname, "..", "src");
let errors = 0;
let warnings = 0;
function checkFileSize(filePath, maxLines = 300) {
const content = fs.readFileSync(filePath, "utf-8");
const lines = content.split("\n").length;
if (lines > maxLines) {
console.error(
`❌ OVERSIZED (${lines} lines): ${path.relative(SRC_DIR, filePath)}`,
);
errors++;
}
}
function walk(dir, callback) {
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
const fullPath = path.join(dir, entry.name);
if (entry.isDirectory()) {
if (entry.name === "node_modules" || entry.name.startsWith(".")) continue;
walk(fullPath, callback);
} else {
callback(fullPath);
}
}
}
console.log("Checking file sizes...\n");
walk(SRC_DIR, (filePath) => {
const ext = path.extname(filePath);
if ([".ts", ".tsx", ".py", ".css"].includes(ext)) {
checkFileSize(filePath);
}
});
console.log("\n---");
if (errors === 0 && warnings === 0) {
console.log("✅ All checks passed!");
process.exit(0);
} else {
console.log(`${errors} error(s), ${warnings} warning(s)`);
process.exit(1);
}