refactor: Convert project from JavaScript to TypeScript

- Converted all .js files to .ts
- Added TypeScript configuration (tsconfig.json)
- Added ESLint and Prettier configuration
- Updated package.json dependencies
- Modified Docker and application configurations
This commit is contained in:
2025-04-24 13:48:10 +08:00
parent 75185a59c3
commit 3c4dc51855
32 changed files with 1212 additions and 1004 deletions

37
tsconfig.json Normal file
View File

@@ -0,0 +1,37 @@
{
"compilerOptions": {
/* Base Options: */
"esModuleInterop": true,
"skipLibCheck": true,
"target": "ES2022",
"allowJs": true,
"resolveJsonModule": true,
"moduleDetection": "force",
"isolatedModules": true,
/* Strictness */
"strict": true,
"noUncheckedIndexedAccess": true,
"checkJs": true,
/* If NOT transpiling with TypeScript: */
"module": "NodeNext",
"noEmit": true,
/* If your code runs in the DOM: */
// "lib": ["es2022", "dom", "dom.iterable"],
/* If your code doesn't run in the DOM: */
"lib": ["ES2022"],
/* If transpiling with TypeScript: */
"module": "CommonJS", // Use CommonJS for Node.js compatibility
"outDir": "dist", // Output compiled JS to dist/
"sourceMap": true, // Generate source maps
/* Project Structure */
// "rootDir": "src", // Remove rootDir as include covers files outside src
"baseUrl": ".", // Allows for path aliases if needed
"paths": {
"@/*": ["src/*"] // Example path alias - keep if used, adjust if needed
}
},
"include": ["src/**/*.ts", "deploy-commands.ts", "tests/**/*.ts"], // Include source, deploy script, and tests
"exclude": ["node_modules", "dist"] // Exclude build output and dependencies
}