Skip to content

Commit

Permalink
merged
Browse files Browse the repository at this point in the history
  • Loading branch information
JannikStreek committed Feb 5, 2025
2 parents 1d8a47e + 3ecce94 commit fb9523a
Show file tree
Hide file tree
Showing 39 changed files with 6,817 additions and 6,347 deletions.
2,766 changes: 1,598 additions & 1,168 deletions teammapper-backend/package-lock.json

Large diffs are not rendered by default.

75 changes: 36 additions & 39 deletions teammapper-backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
"private": true,
"license": "MIT",
"engines": {
"npm": "~10.7.0",
"node": "~22.2"
"npm": "~10.9.0",
"node": "~22.12.0"
},

"scripts": {
"prebuild": "rimraf dist",
"build": "nest build",
Expand All @@ -34,73 +35,69 @@
"prod:typeorm:migrate": "typeorm migration:run --dataSource dist/data-source.js"
},
"dependencies": {
"@nestjs/cache-manager": "^2.3.0",
"@nestjs/cli": "^10.4.9",
"@nestjs/common": "^10.4.15",
"@nestjs/config": "3.3.0",
"@nestjs/core": "^10.4.15",
"@nestjs/platform-express": "^10.4.15",
"@nestjs/platform-socket.io": "^10.4.15",
"@nestjs/schedule": "^4.1.2",
"@nestjs/serve-static": "^4.0.2",
"@nestjs/typeorm": "^10.0.2",
"@nestjs/websockets": "^10.4.15",
"@nestjs/cache-manager": "^3.0.0",
"@nestjs/cli": "^11.0.2",
"@nestjs/common": "^11.0.7",
"@nestjs/config": "4.0.0",
"@nestjs/core": "^11.0.7",
"@nestjs/platform-express": "^11.0.7",
"@nestjs/platform-socket.io": "^11.0.7",
"@nestjs/schedule": "^5.0.1",
"@nestjs/serve-static": "^5.0.1",
"@nestjs/typeorm": "^11.0.0",
"@nestjs/websockets": "^11.0.7",
"@types/uuid": "^10.0.0",
"cache-manager": "^5.7.4",
"cache-manager": "^6.4.0",
"class-validator": "^0.14.1",
"dotenv": "16.4.7",
"http-proxy-middleware": "3.0.3",
"npm-check-updates": "^17.1.11",
"pg": "^8.13.1",
"pq": "^0.0.3",
"reflect-metadata": "^0.2.2",
"rimraf": "^6.0.1",
"rxjs": "^7.8.1",
"socket.io": "4.8.1",
"typeorm": "^0.3.20",
"uuid": "11.0.3"
"uuid": "11.0.5"
},
"devDependencies": {
"@eslint/compat": "^1.2.0",
"@eslint/js": "^9.18.0",
"@golevelup/ts-jest": "^0.5.6",
"@nestjs/schematics": "^10.2.3",
"@nestjs/testing": "^10.4.8",
"@stylistic/eslint-plugin-ts": "^2.13.0",
"@types/cache-manager": "4.0.6",
"@eslint/compat": "^1.2.6",
"@eslint/js": "^9.19.0",
"@golevelup/ts-jest": "^0.6.2",
"@nestjs/schematics": "^11.0.0",
"@nestjs/testing": "^11.0.7",
"@stylistic/eslint-plugin-ts": "^3.0.1",
"@types/cache-manager": "5.0.0",
"@types/cron": "^2.4.3",
"@types/eslint__js": "^8.42.3",
"@types/express": "^4.17.21",
"@types/express-serve-static-core": "^4.19.5",
"@types/express": "^5.0.0",
"@types/express-serve-static-core": "^5.0.6",
"@types/jest": "29.5.14",
"@types/node": "^22.10.7",
"@types/node": "^22.13.1",
"@types/supertest": "^6.0.2",
"@typescript-eslint/eslint-plugin": "^8.19.0",
"@typescript-eslint/parser": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^8.23.0",
"@typescript-eslint/parser": "^8.23.0",
"concurrently": "9.1.2",
"eslint": "^9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint": "^9.19.0",
"eslint-config-prettier": "^10.0.1",
"eslint-import-resolver-typescript": "3.7.0",
"eslint-plugin-import": "2.31.0",
"eslint-plugin-jest": "28.9.0",
"eslint-plugin-jest": "28.11.0",
"eslint-plugin-nestjs": "1.2.3",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-prettier": "^5.2.3",
"eslint-plugin-typeorm": "0.0.19",
"globals": "^15.11.0",
"globals": "^15.14.0",
"jest": "29.7.0",
"jest-jasmine2": "29.7.0",
"prettier": "^3.4.2",
"socket.io-client": "^4.8.1",
"supertest": "^7.0.0",
"ts-jest": "29.2.5",
"ts-loader": "^9.5.1",
"ts-loader": "^9.5.2",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "~5.7.2",
"typescript-eslint": "^8.8.1"
},
"overrides": {
"path-to-regexp": "1.9.0"
"typescript": "~5.7.3",
"typescript-eslint": "^8.23.0"
},
"jest": {
"moduleFileExtensions": [
Expand Down
3 changes: 2 additions & 1 deletion teammapper-backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import configService from './config.service'
import { createProxyMiddleware } from 'http-proxy-middleware'
import { GlobalExceptionFilter } from './filters/global-exception.filter'
import { Logger } from '@nestjs/common'
import { NestExpressApplication } from '@nestjs/platform-express'

async function bootstrap() {
const logger = new Logger('Main Process')
Expand All @@ -20,7 +21,7 @@ async function bootstrap() {
logger.error('Unhandled Rejection. Stack trace: ', stack)
})

const app = await NestFactory.create(AppModule, {
const app = await NestFactory.create<NestExpressApplication>(AppModule, {
logger: ['log', 'error', 'warn', 'debug'],
})

Expand Down
4 changes: 3 additions & 1 deletion teammapper-backend/src/map/controllers/maps.gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,9 @@ export class MapsGateway implements OnGatewayDisconnect {

@SubscribeMessage('leave')
async handleDisconnect(client: Socket) {
const mapId: string | undefined = await this.cacheManager.get(client.id)
const mapId: string | undefined | null = await this.cacheManager.get(
client.id
)
if (!mapId) return

this.server.to(mapId).emit('clientDisconnect', client.id)
Expand Down
2 changes: 1 addition & 1 deletion teammapper-backend/test/app.e2e-spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Test, TestingModule } from '@nestjs/testing'
import { INestApplication } from '@nestjs/common'
import * as request from 'supertest'
import request from 'supertest'
import { MmpMap } from 'src/map/entities/mmpMap.entity'
import { MmpNode } from 'src/map/entities/mmpNode.entity'
import { getRepositoryToken, TypeOrmModule } from '@nestjs/typeorm'
Expand Down
21 changes: 10 additions & 11 deletions teammapper-backend/test/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,16 @@ const setupWorkerDatabase = async (workerId: string): Promise<string> => {
return databaseName
}

const createDataSourceConfig: PostgresConnectionOptions = {
type: 'postgres',
host: process.env.POSTGRES_TEST_HOST,
port: parseInt(process.env.POSTGRES_TEST_PORT || '3000', 10),
username: process.env.POSTGRES_TEST_USER,
password: process.env.POSTGRES_TEST_PASSWORD,
database: process.env.POSTGRES_TEST_DATABASE,
synchronize: false,
}

// this is the configuration for the main test database. this database is not used for actual tests.
// it is the entrypoint for each worker to be able to create their own worker database
const mainTestDataSource = async () => {
Expand All @@ -36,24 +46,13 @@ const workerDataSourceConfig = (databaseName: string): TypeOrmModuleOptions => {
synchronize: true,
autoLoadEntities: true,
dropSchema: true,
keepConnectionAlive: true,
extra: {
query_timeout: 1000,
statement_timeout: 1000,
},
}
}

const createDataSourceConfig: PostgresConnectionOptions = {
type: 'postgres',
host: process.env.POSTGRES_TEST_HOST,
port: parseInt(process.env.POSTGRES_TEST_PORT || '3000', 10),
username: process.env.POSTGRES_TEST_USER,
password: process.env.POSTGRES_TEST_PASSWORD,
database: process.env.POSTGRES_TEST_DATABASE,
synchronize: false,
}

export const destroyWorkerDatabase = async (
workerDataSource: DataSource,
workerId: string
Expand Down
4 changes: 3 additions & 1 deletion teammapper-backend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"baseUrl": "./",
"incremental": true,
"noImplicitAny": true,
"strictNullChecks": true
"strictNullChecks": true,
"esModuleInterop": true,
"skipLibCheck": true
}
}
23 changes: 13 additions & 10 deletions teammapper-frontend/angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,21 @@
},
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"builder": "@angular-devkit/build-angular:application",
"options": {
"outputPath": "dist",
"outputPath": {
"base": "dist"
},
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"polyfills": [
"src/polyfills.ts"
],
"tsConfig": "src/tsconfig.app.json",
"stylePreprocessorOptions": {
"includePaths": ["src"]
"includePaths": [
"src",
"."
]
},
"assets": [
"src/assets",
Expand All @@ -34,7 +40,8 @@
"node_modules/ngx-toastr/toastr.css"
],
"scripts": [],
"serviceWorker": false
"serviceWorker": false,
"browser": "src/main.ts"
},
"configurations": {
"production": {
Expand All @@ -57,8 +64,6 @@
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
Expand All @@ -68,9 +73,7 @@
]
},
"development": {
"buildOptimizer": false,
"optimization": false,
"vendorChunk": true,
"extractLicenses": false,
"sourceMap": true,
"namedChunks": true
Expand Down
1 change: 1 addition & 0 deletions teammapper-frontend/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ module.exports = tseslint.config(
processor: angular.processInlineTemplates,
// Override specific rules for TypeScript files (these will take priority over the extended configs above)
rules: {
'@angular-eslint/prefer-standalone': 'off',
'@angular-eslint/directive-selector': [
'error',
{
Expand Down
Loading

0 comments on commit fb9523a

Please sign in to comment.