Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
feat: upgrade to nestjs 10 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomwwinter authored Feb 27, 2024
1 parent 6241989 commit 9732920
Show file tree
Hide file tree
Showing 14 changed files with 1,084 additions and 746 deletions.
1,737 changes: 1,038 additions & 699 deletions package-lock.json

Large diffs are not rendered by default.

68 changes: 31 additions & 37 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,50 +21,44 @@
"test:e2e": "jest --config ./test/jest-e2e.json"
},
"dependencies": {
"@nestjs/axios": "^3.0.1",
"@nestjs/common": "^9.3.10",
"@nestjs/config": "^3.1.1",
"@nestjs/core": "^9.3.10",
"@nestjs/platform-express": "^9.3.10",
"@nestjs/schedule": "4.0.0",
"@ntegral/nestjs-sentry": "^4.0.0",
"@sentry/node": "^7.38.0",
"@nestjs/axios": "^3.0.2",
"@nestjs/common": "^10.3.3",
"@nestjs/config": "^3.2.0",
"@nestjs/core": "^10.3.3",
"@nestjs/platform-express": "^10.3.3",
"@nestjs/schedule": "4.0.1",
"@ntegral/nestjs-sentry": "^4.0.1",
"@sentry/node": "^7.102.1",
"@sentry/tracing": "^7.102.1",
"js-yaml": "4.1.0",
"reflect-metadata": "^0.1.13",
"rimraf": "^3.0.2",
"rxjs": "^7.8.0",
"rxjs": "^7.8.1",
"uuid": "9.0.1"
},
"devDependencies": {
"@nestjs/cli": "^9.2.0",
"@nestjs/schematics": "^9.0.4",
"@nestjs/testing": "^9.3.9",
"@types/express": "^4.17.17",
"@types/jest": "^29.4.0",
"@nestjs/cli": "^10.3.2",
"@nestjs/schematics": "^10.1.1",
"@nestjs/testing": "^10.3.3",
"@types/express": "^4.17.21",
"@types/jest": "^29.5.12",
"@types/js-yaml": "4.0.9",
"@types/node": "^18.13.0",
"@types/supertest": "^2.0.12",
"@types/node": "^20.11.20",
"@types/supertest": "^6.0.2",
"@types/uuid": "9.0.8",
"@typescript-eslint/eslint-plugin": "^5.52.0",
"@typescript-eslint/parser": "^5.52.0",
"eslint": "^8.34.0",
"eslint-config-prettier": "^8.6.0",
"eslint-plugin-prettier": "^4.2.1",
"jest": "29.4.3",
"prettier": "^2.8.4",
"supertest": "^6.3.3",
"ts-jest": "^29.0.5",
"ts-loader": "^9.4.2",
"ts-node": "^10.9.1",
"tsconfig-paths": "^4.1.2",
"typescript": "^4.9.5"
},
"overrides": {
"@ntegral/nestjs-sentry": {
"@nestjs/common": "$@nestjs/common",
"@nestjs/core": "$@nestjs/core",
"@sentry/node": "$@sentry/node"
}
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.1.3",
"jest": "29.7.0",
"prettier": "^3.2.5",
"rimraf": "^3.0.2",
"supertest": "^6.3.4",
"ts-jest": "^29.1.2",
"ts-loader": "^9.5.1",
"ts-node": "^10.9.2",
"tsconfig-paths": "^4.2.0",
"typescript": "^5.3.3"
},
"jest": {
"moduleFileExtensions": [
Expand Down
2 changes: 1 addition & 1 deletion src/couchdb/couch-db-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class CouchDbClient {
return headers['etag'].replaceAll('"', '');
}
}),
catchError((err) => {
catchError(() => {
return of(undefined);
}),
);
Expand Down
1 change: 1 addition & 0 deletions src/notification/controller/webhook.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class WebhookController {

@Get()
fetchWebhooksOfUser(
// eslint-disable-next-line @typescript-eslint/no-unused-vars
@Headers('Authorization') token: string,
): Observable<WebhookDto[]> {
return this.webhookStorage.fetchAllWebhooks('user-token').pipe(
Expand Down
1 change: 1 addition & 0 deletions src/notification/storage/webhook-storage.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ export class WebhookStorage {
* Get all registered webhooks subscribe by the user authenticated with the given token
* @param token
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
fetchAllWebhooks(token?: string): Observable<Webhook[]> {
return this.webhookRepository
.fetchAllWebhooks()
Expand Down
4 changes: 2 additions & 2 deletions src/report-changes/core/report-change-detector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export class ReportChangeDetector {
}

affectsReport(doc: DocChangeDetails): boolean {
// TODO: consider removing the ReportChangeDetector class completely:
// do all query parsing in ReportSchemaGenerator and implement the conditions directly in ReportChangesService?
// TODO: consider removing the ReportChangeDetector class completely:
// do all query parsing in ReportSchemaGenerator and implement the conditions directly in ReportChangesService?
const entityType = doc.change.id.split(':')[0];
if (!this.sqlTableNames.includes(entityType)) {
return false;
Expand Down
1 change: 1 addition & 0 deletions src/report-changes/core/report-changes.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { CreateReportCalculationUseCase } from '../../report/core/use-cases/crea
import { DatabaseChangeResult } from '../storage/database-changes.service';

describe('ReportChangesService', () => {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
let service: ReportChangesService;
let mockNotificationService: Partial<NotificationService>;

Expand Down
4 changes: 3 additions & 1 deletion src/report-changes/core/report-changes.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ export class ReportChangesService {
.activeReports()
.subscribe((reports: Reference[]) => {
reports.forEach((r) => this.registerReportMonitoring(r));
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const [id, monitor] of this.reportMonitors.entries()) {
if (!reports.some((r) => r.id === id)) {
this.reportMonitors.delete(id);
Expand Down Expand Up @@ -104,6 +105,7 @@ export class ReportChangesService {
): Observable<ReportDataChangeEvent[]> {
const affectedReports: Observable<ReportDataChangeEvent>[] = [];

// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const [reportId, changeDetector] of this.reportMonitors.entries()) {
if (!changeDetector.affectsReport(docChange)) {
continue;
Expand Down Expand Up @@ -165,7 +167,7 @@ export class ReportChangesService {
({
report: result.report,
calculation: result,
} as ReportDataChangeEvent),
}) as ReportDataChangeEvent,
),
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ describe('ReportCalculationController', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/controller/report.controller.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('ReportController', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/repository/report-repository.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ describe('ReportRepositoryService', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/storage/reporting-storage.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ describe('DefaultReportStorage', () => {
{
provide: ConfigService,
useValue: {
getOrThrow: jest.fn((key) => {
getOrThrow: jest.fn(() => {
return 'foo';
}),
},
Expand Down
2 changes: 1 addition & 1 deletion src/report/tasks/report-calculation-processor.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class ReportCalculationProcessor {
),
);
}),
catchError((err, caught) => {
catchError((err) => {
console.log(err);
return of();
}),
Expand Down
2 changes: 1 addition & 1 deletion src/report/tasks/report-calculation-task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export class ReportCalculationTask {
throw err;
}),
)
.subscribe((_) => {
.subscribe(() => {
this.logger.log('done');
});
}
Expand Down

0 comments on commit 9732920

Please sign in to comment.