feat: upgrade major dependencies to latest versions

- Prisma 6.19 → 7.7 (driver adapter pattern, prisma.config.ts)
- TypeScript 5.9 → 6.0 (ignoreDeprecations, CSS type declarations)
- Vitest 3.2 → 4.1
- Pino 9.14 → 10.3
- @types/node 22.x → 25.x

All 307 tests pass, typecheck clean, build succeeds.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-08 13:15:36 +07:00
parent 8e82d346aa
commit af71270a2e
15 changed files with 1004 additions and 440 deletions

View File

@@ -25,7 +25,8 @@
"@nestjs/swagger": "^11.2.6",
"@nestjs/throttler": "^6.5.0",
"@paralleldrive/cuid2": "^3.3.0",
"@prisma/client": "^6.0.0",
"@prisma/adapter-pg": "^7.7.0",
"@prisma/client": "^7.7.0",
"@willsoto/nestjs-prometheus": "^6.1.0",
"bcrypt": "^6.0.0",
"class-transformer": "^0.5.1",
@@ -39,7 +40,8 @@
"passport": "^0.7.0",
"passport-jwt": "^4.0.1",
"passport-local": "^1.0.0",
"pino": "^9.0.0",
"pg": "^8.20.0",
"pino": "^10.3.1",
"pino-pretty": "^13.0.0",
"prom-client": "^15.1.3",
"reflect-metadata": "^0.2.0",
@@ -55,15 +57,16 @@
"@types/bcrypt": "^6.0.0",
"@types/cookie-parser": "^1.4.10",
"@types/express": "^5.0.0",
"@types/node": "^22.0.0",
"@types/node": "^25.5.2",
"@types/nodemailer": "^8.0.0",
"@types/passport-jwt": "^4.0.1",
"@types/passport-local": "^1.0.38",
"@types/pg": "^8.20.0",
"@types/sanitize-html": "^2.16.1",
"@types/supertest": "^7.2.0",
"prisma": "^6.0.0",
"prisma": "^7.7.0",
"supertest": "^7.2.2",
"typescript": "^5.7.0",
"vitest": "^3.0.0"
"typescript": "^6.0.2",
"vitest": "^4.1.3"
}
}

View File

@@ -1,13 +1,25 @@
import { Injectable, type OnModuleInit, type OnModuleDestroy } from '@nestjs/common';
import { PrismaPg } from '@prisma/adapter-pg';
import { PrismaClient } from '@prisma/client';
import pg from 'pg';
@Injectable()
export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy {
private pool: pg.Pool;
constructor() {
const pool = new pg.Pool({ connectionString: process.env['DATABASE_URL'] });
const adapter = new PrismaPg(pool);
super({ adapter });
this.pool = pool;
}
async onModuleInit(): Promise<void> {
await this.$connect();
}
async onModuleDestroy(): Promise<void> {
await this.$disconnect();
await this.pool.end();
}
}

View File

@@ -3,6 +3,7 @@
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "Node",
"ignoreDeprecations": "6.0",
"outDir": "./dist",
"rootDir": "./src",
"emitDecoratorMetadata": true,

1
apps/web/global.d.ts vendored Normal file
View File

@@ -0,0 +1 @@
declare module '*.css';

View File

@@ -26,13 +26,13 @@
},
"devDependencies": {
"@types/mapbox-gl": "^3.5.0",
"@types/node": "^22.0.0",
"@types/node": "^25.5.2",
"@types/react": "^18.3.0",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.0",
"postcss": "^8.4.0",
"tailwindcss": "^3.4.0",
"tailwindcss-animate": "^1.0.7",
"typescript": "^5.7.0"
"typescript": "^6.0.2"
}
}

View File

@@ -20,7 +20,8 @@
"sourceMap": false,
"noEmit": true,
"allowJs": true,
"isolatedModules": true
"isolatedModules": true,
"allowArbitraryExtensions": true
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules", ".next"]