Skip to content

Commit

Permalink
chore(api): update NestJS packages to latest version
Browse files Browse the repository at this point in the history
  • Loading branch information
stephane-ruhlmann committed Jan 24, 2025
1 parent 79d4cad commit e61dc51
Show file tree
Hide file tree
Showing 4 changed files with 789 additions and 695 deletions.
25 changes: 10 additions & 15 deletions apps/api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,15 @@
},
"devDependencies": {
"@eslint/js": "~9.18.0",
"@nestjs/cli": "~10.4.9",
"@nestjs/schematics": "~10.1.4",
"@nestjs/testing": "~10.4.15",
"@nestjs/cli": "~11.0.2",
"@nestjs/schematics": "~11.0.0",
"@nestjs/testing": "~11.0.5",
"@trivago/prettier-plugin-sort-imports": "~5.2.1",
"@types/bcrypt": "~5.0.2",
"@types/express": "~5.0.0",
"@types/jest": "~29.5.14",
"@types/node": "~22.10.7",
"@types/passport-jwt": "~4.0.1",
"@types/pg": "~8.11.10",
"@types/node": "~22.10.10",
"@types/pg": "~8.11.11",
"@types/supertest": "~6.0.2",
"@types/uuid": "~10.0.0",
"dotenv": "~16.4.7",
Expand All @@ -56,20 +55,16 @@
"typescript-eslint": "~8.21.0"
},
"dependencies": {
"@nestjs/axios": "~3.1.3",
"@nestjs/common": "~10.4.15",
"@nestjs/config": "~3.3.0",
"@nestjs/core": "~10.4.15",
"@nestjs/jwt": "~10.2.0",
"@nestjs/passport": "~10.0.3",
"@nestjs/platform-express": "~10.4.15",
"@nestjs/axios": "~4.0.0",
"@nestjs/common": "~11.0.5",
"@nestjs/config": "~4.0.0",
"@nestjs/core": "~11.0.5",
"@nestjs/platform-express": "~11.0.5",
"axios": "~1.7.9",
"bcrypt": "~5.1.1",
"date-fns": "~4.1.0",
"knex": "~3.1.0",
"nestjs-zod": "~3.0.0",
"passport": "~0.7.0",
"passport-jwt": "~4.0.1",
"pg": "~8.13.1",
"reflect-metadata": "~0.2.2",
"rxjs": "~7.8.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { INestApplication } from "@nestjs/common";
import { ConfigModule } from "@nestjs/config";
import { NestExpressApplication } from "@nestjs/platform-express";
import { Test } from "@nestjs/testing";
import { Knex } from "knex";
import { Server } from "net";
Expand All @@ -20,7 +21,8 @@ describe("CarbonStorage controller", () => {
.useModule(ConfigModule.forRoot({ envFilePath: ".env.test" }))
.compile();

app = moduleRef.createNestApplication();
app = moduleRef.createNestApplication<NestExpressApplication>();
(app as NestExpressApplication).set("query parser", "extended");
await app.init();
sqlConnection = app.get(SqlConnection);
});
Expand Down
4 changes: 3 additions & 1 deletion apps/api/src/main.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import { ConfigService } from "@nestjs/config";
import { NestFactory } from "@nestjs/core";
import { NestExpressApplication } from "@nestjs/platform-express";
import { Knex } from "knex";

import { AppModule } from "./app.module";
import { SqlConnection } from "./shared-kernel/adapters/sql-knex/sqlConnection.module";

async function bootstrap() {
const app = await NestFactory.create(AppModule);
const app = await NestFactory.create<NestExpressApplication>(AppModule);
app.setGlobalPrefix("api");
app.set("query parser", "extended"); // allow nested query params like arrays and objects

// test SQL connection so we fail fast if DB is not accesible
const sqlConnection: Knex = app.get(SqlConnection);
Expand Down
Loading

0 comments on commit e61dc51

Please sign in to comment.