flake.nix only rewrote @/ aliases but left extensionless relative imports (./router) in compiled dist/. node dist/index.js (how prod runs) cannot resolve extensionless ESM specifiers -> ERR_MODULE_NOT_FOUND -> backend crashlooped (444 restarts, port 4001 dead). Extract the fixer into a shared scripts/fix-imports.mjs that appends .js to extensionless relative imports and rewrites @/ aliases, and wire it into backend + discord-gateway build phases. Verified: fresh tsc + fixer -> node dist/index.js boots; oRPC over /trpc serves both HTTP POST and WebSocket (config/dashboard/voice/moderation/ media/chatbot/analysis) end-to-end against Postgres + Redis. next build passes with the oRPC client + partysocket.
42 lines
1.0 KiB
JSON
42 lines
1.0 KiB
JSON
{
|
|
"name": "discord-moderation-backend",
|
|
"version": "1.0.0",
|
|
"description": "Backend service for Discord moderation monitoring",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"scripts": {
|
|
"dev": "tsx watch src/index.ts",
|
|
"start": "node dist/index.js",
|
|
"build": "tsc",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "biome check --diagnostic-level=error .",
|
|
"format": "biome format --write .",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@discordjs/voice": "^0.19.2",
|
|
"@orpc/server": "1.15.0",
|
|
"axios": "^1.16.1",
|
|
"dotenv": "^17.4.2",
|
|
"drizzle-orm": "^0.45.2",
|
|
"express": "^5.2.1",
|
|
"helmet": "^8.1.0",
|
|
"ioredis": "^5.11.0",
|
|
"pg": "^8.21.0",
|
|
"pino": "^9.6.0",
|
|
"prom-client": "^15.1.3",
|
|
"ws": "^8.20.1",
|
|
"zod": "^4.4.3"
|
|
},
|
|
"devDependencies": {
|
|
"@biomejs/biome": "latest",
|
|
"@types/express": "^5.0.6",
|
|
"@types/node": "^25.9.0",
|
|
"@types/pg": "^8.20.0",
|
|
"@types/ws": "^8.18.1",
|
|
"tsx": "^4.22.2",
|
|
"typescript": "^5.9.3",
|
|
"vitest": "latest"
|
|
}
|
|
}
|