Skip to content

Commit

Permalink
Merge pull request #142 from theodo-group/migrate-to-nest-10
Browse files Browse the repository at this point in the history
feat(backend): migrate to nest 10
  • Loading branch information
Jeremie-Chauvel authored Dec 19, 2023
2 parents d3bd584 + 2e77c19 commit f4c7ee0
Show file tree
Hide file tree
Showing 14 changed files with 2,761 additions and 1,866 deletions.
2 changes: 1 addition & 1 deletion documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@docusaurus/module-type-aliases": "2.2.0",
"@tsconfig/docusaurus": "1.0.7",
"@types/react": "18.0.25",
"typescript": "4.7.4"
"typescript": "5.1.3"
},
"engines": {
"node": "^20.10.0"
Expand Down
3 changes: 3 additions & 0 deletions examples/bifrost-starter/apps/backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,6 @@

npm-debug.log*
.eslintcache

# metadata autogenerated file
src/metadata.ts
33 changes: 33 additions & 0 deletions examples/bifrost-starter/apps/backend/.swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"$schema": "https://json.schemastore.org/swcrc",
"sourceMaps": true,
"jsc": {
"parser": {
"syntax": "typescript",
"decorators": true,
"dynamicImport": true
},
"baseUrl": "src",
"paths": {
"@helpers/*": [
"helpers/*"
],
"@auth/*": [
"modules/auth/*"
],
"@modules/*": [
"modules/*"
],
"@decorators/*": [
"decorators/*"
],
"@testUtils/*": [
"testUtils/*"
],
"@root/*": [
"./*"
]
}
},
"minify": false
}
5 changes: 2 additions & 3 deletions examples/bifrost-starter/apps/backend/nest-cli.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
{
"language": "ts",
"collection": "@nestjs/schematics",
"sourceRoot": "src",
"compilerOptions": {
"plugins": ["@nestjs/swagger/plugin"]
"builder": "swc",
"typeCheck": true
}
}
36 changes: 20 additions & 16 deletions examples/bifrost-starter/apps/backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@
"private": true,
"sideEffects": false,
"scripts": {
"build": "nest build -p tsconfig.build.json",
"build": "pnpm gen:metadata && nest build -p tsconfig.build.json",
"build:entities": "nest build -p tsconfig.entities.json",
"dev": ". ./.env.rc && docker-compose up -d && nest start -p ./tsconfig.json src/main.ts --watch --preserveWatchOutput",
"dev": ". ./.env.rc && docker-compose up -d && pnpm gen:metadata && nest start -p ./tsconfig.json src/main.ts --watch --preserveWatchOutput",
"gen:metadata": "ts-node src/generate-metadata.ts",
"explore": "pnpm start --entryFile repl",
"format": "prettier --write \"src/**/*.ts\"",
"lint": "eslint --cache './**/*.{js,ts,tsx}' --max-warnings 0",
Expand Down Expand Up @@ -34,15 +35,15 @@
"@adminjs/nestjs": "5.1.0",
"@adminjs/typeorm": "4.0.0",
"@bifrost-starter/interfaces": "workspace:*",
"@nestjs/common": "9.0.11",
"@nestjs/config": "2.2.0",
"@nestjs/core": "9.0.11",
"@nestjs/jwt": "10.0.1",
"@nestjs/mapped-types": "1.1.0",
"@nestjs/passport": "9.0.0",
"@nestjs/platform-express": "9.0.11",
"@nestjs/swagger": "6.1.2",
"@nestjs/typeorm": "9.0.1",
"@nestjs/common": "10.2.10",
"@nestjs/config": "3.1.1",
"@nestjs/core": "10.2.10",
"@nestjs/jwt": "10.2.0",
"@nestjs/mapped-types": "2.0.4",
"@nestjs/passport": "10.0.2",
"@nestjs/platform-express": "10.2.10",
"@nestjs/swagger": "7.1.17",
"@nestjs/typeorm": "10.0.1",
"adminjs": "6.7.5",
"bcrypt": "5.1.0",
"class-transformer": "0.5.1",
Expand All @@ -53,7 +54,7 @@
"express": "4.18.2",
"express-formidable": "1.2.0",
"express-session": "1.17.3",
"jsonwebtoken": "9.0.0",
"jsonwebtoken": "9.0.2",
"lodash": "4.17.21",
"passport": "0.6.0",
"passport-jwt": "4.0.1",
Expand All @@ -65,8 +66,10 @@
"winston": "3.9.0"
},
"devDependencies": {
"@nestjs/cli": "9.1.3",
"@nestjs/testing": "9.0.11",
"@nestjs/cli": "10.2.1",
"@nestjs/testing": "10.2.10",
"@swc/cli": "0.1.63",
"@swc/core": "1.3.99",
"@types/bcrypt": "5.0.0",
"@types/cli-color": "2.0.2",
"@types/cookie-parser": "1.4.3",
Expand All @@ -79,7 +82,7 @@
"@types/passport-jwt": "3.0.8",
"@types/supertest": "2.0.12",
"@types/validator": "13.7.17",
"dependency-cruiser": "11.15.0",
"dependency-cruiser": "15.5.0",
"dependency-cruiser-config-custom": "workspace:*",
"eslint-config-custom": "workspace:*",
"faker": "5.5.3",
Expand All @@ -88,8 +91,9 @@
"supertest": "6.3.3",
"ts-jest": "29.1.1",
"ts-loader": "9.4.4",
"ts-node": "10.9.1",
"tsconfig": "workspace:*",
"typescript": "4.7.4",
"typescript": "5.1.3",
"webpack": "5.88.1"
},
"engines": {
Expand Down
10 changes: 10 additions & 0 deletions examples/bifrost-starter/apps/backend/src/generate-metadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { PluginMetadataGenerator } from '@nestjs/cli/lib/compiler/plugins';
import { ReadonlyVisitor } from '@nestjs/swagger/dist/plugin';

const generator = new PluginMetadataGenerator();
generator.generate({
visitors: [new ReadonlyVisitor({ introspectComments: true, pathToSource: __dirname })],
outputDir: __dirname,
watch: false,
tsconfigPath: 'tsconfig.json',
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Repository } from 'typeorm';
import { ObjectLiteral, Repository } from 'typeorm';

export abstract class Factory<T> {
export abstract class Factory<T extends ObjectLiteral> {
private readonly repository?: Repository<T>;
constructor(repository?: Repository<T>) {
this.repository = repository;
Expand Down
4 changes: 2 additions & 2 deletions examples/bifrost-starter/apps/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"@types/react": "18.2.14",
"@types/react-dom": "18.2.6",
"bundlesize2": "0.0.31",
"dependency-cruiser": "11.15.0",
"dependency-cruiser": "15.5.0",
"dependency-cruiser-config-custom": "workspace:*",
"eslint-config-custom": "workspace:*",
"jest": "29.5.0",
Expand All @@ -57,7 +57,7 @@
"stylelint-declaration-strict-value": "1.9.2",
"ts-node": "10.9.1",
"tsconfig": "workspace:*",
"typescript": "4.7.4"
"typescript": "5.1.3"
},
"engines": {
"node": "^20.10.0"
Expand Down
4 changes: 2 additions & 2 deletions examples/bifrost-starter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@typescript-eslint/eslint-plugin": "5.60.1",
"@typescript-eslint/parser": "5.60.1",
"audit-ci": "6.6.1",
"dependency-cruiser": "11.18.0",
"dependency-cruiser": "15.5.0",
"eslint": "8.43.0",
"eslint-config-prettier": "8.8.0",
"eslint-import-resolver-typescript": "3.5.5",
Expand All @@ -38,7 +38,7 @@
"prettier": "2.8.8",
"syncpack": "8.2.4",
"turbo": "1.10.6",
"typescript": "4.7.4"
"typescript": "5.1.3"
},
"packageManager": "[email protected]",
"pnpm": {
Expand Down
14 changes: 7 additions & 7 deletions examples/bifrost-starter/packages/interfaces/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,20 @@
"test:type": "nest build -p tsconfig.json --noEmit"
},
"dependencies": {
"@nestjs/common": "9.0.11",
"@nestjs/swagger": "6.1.2",
"@nestjs/common": "10.2.10",
"@nestjs/swagger": "7.1.17",
"class-validator": "0.14.0"
},
"devDependencies": {
"@nestjs/cli": "9.1.3",
"@types/jest": "29.5.2",
"dependency-cruiser": "11.15.0",
"@nestjs/cli": "10.2.1",
"@types/jest": "29.5.9",
"dependency-cruiser": "15.5.0",
"dependency-cruiser-config-custom": "workspace:*",
"eslint-config-custom": "workspace:*",
"jest": "29.5.0",
"jest": "29.7.0",
"ts-jest": "29.1.1",
"tsconfig": "workspace:*",
"typescript": "4.7.4"
"typescript": "5.1.3"
},
"keywords": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"esModuleInterop": true,
"target": "es6",
"target": "es2021",
"sourceMap": true,
"allowJs": true
}
Expand Down
Loading

0 comments on commit f4c7ee0

Please sign in to comment.