feat: stabilize API startup and lifecycle management
- Refactor server initialization to separate concerns and improve error handling. - Implement centralized environment validation using Zod. - Introduce database, Redis, and queue lifecycle management. - Add health check endpoints for liveness and readiness. - Enhance error handling middleware for better response structure. - Implement rate limiting for API endpoints. - Add request ID middleware for traceability. - Create Sequelize CLI configuration and baseline migration for schema management. - Establish CI workflow with Gitea for testing and syntax checks. - Document foundational changes and migration strategy in PHASE_0_FOUNDATION_STABILIZATION.md. - Add Docker Compose configuration for local development and testing. - Implement unit and integration tests for critical functionality.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
const { readdirSync, statSync } = require("fs");
|
||||
const { join } = require("path");
|
||||
const { spawnSync } = require("child_process");
|
||||
|
||||
const ignored = new Set(["node_modules", ".git", "coverage"]);
|
||||
const files = [];
|
||||
const walk = (directory) => {
|
||||
for (const name of readdirSync(directory)) {
|
||||
if (ignored.has(name)) continue;
|
||||
const target = join(directory, name);
|
||||
if (statSync(target).isDirectory()) walk(target);
|
||||
else if (name.endsWith(".js")) files.push(target);
|
||||
}
|
||||
};
|
||||
walk(process.cwd());
|
||||
for (const file of files) {
|
||||
const result = spawnSync(process.execPath, ["--check", file], { stdio: "inherit" });
|
||||
if (result.status !== 0) process.exit(result.status || 1);
|
||||
}
|
||||
console.log(`Syntax check passed for ${files.length} JavaScript files.`);
|
||||
Reference in New Issue
Block a user