Browse Source

Upgrade Angular, NestJS and Nx

pull/2156/head
Thomas 2 years ago
parent
commit
dacf17372c
  1. 2
      apps/api/project.json
  2. 3
      apps/api/src/app/redis-cache/redis-cache.module.ts
  3. 8
      apps/api/src/app/redis-cache/redis-cache.service.ts
  4. 2
      apps/api/tsconfig.app.json
  5. 16
      apps/client/project.json
  6. 3
      apps/client/src/app/core/auth.guard.ts
  7. 7
      nx.json
  8. 111
      package.json
  9. 8810
      yarn.lock

2
apps/api/project.json

@ -33,7 +33,7 @@
"outputs": ["{options.outputPath}"] "outputs": ["{options.outputPath}"]
}, },
"serve": { "serve": {
"executor": "@nx/node:node", "executor": "@nx/js:node",
"options": { "options": {
"buildTarget": "api:build" "buildTarget": "api:build"
} }

3
apps/api/src/app/redis-cache/redis-cache.module.ts

@ -1,6 +1,7 @@
import { ConfigurationModule } from '@ghostfolio/api/services/configuration/configuration.module'; import { ConfigurationModule } from '@ghostfolio/api/services/configuration/configuration.module';
import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service'; import { ConfigurationService } from '@ghostfolio/api/services/configuration/configuration.service';
import { CacheManagerOptions, CacheModule, Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { CacheManagerOptions, CacheModule } from '@nestjs/cache-manager';
import * as redisStore from 'cache-manager-redis-store'; import * as redisStore from 'cache-manager-redis-store';
import { RedisCacheService } from './redis-cache.service'; import { RedisCacheService } from './redis-cache.service';

8
apps/api/src/app/redis-cache/redis-cache.service.ts

@ -35,8 +35,10 @@ export class RedisCacheService {
} }
public async set(key: string, value: string, ttlInSeconds?: number) { public async set(key: string, value: string, ttlInSeconds?: number) {
await this.cache.set(key, value, { await this.cache.set(
ttl: ttlInSeconds ?? this.configurationService.get('CACHE_TTL') key,
}); value,
ttlInSeconds ?? this.configurationService.get('CACHE_TTL')
);
} }
} }

2
apps/api/tsconfig.app.json

@ -4,7 +4,7 @@
"outDir": "../../dist/out-tsc", "outDir": "../../dist/out-tsc",
"types": ["node"], "types": ["node"],
"emitDecoratorMetadata": true, "emitDecoratorMetadata": true,
"target": "es2015" "target": "es2021"
}, },
"exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], "exclude": ["**/*.spec.ts", "**/*.test.ts", "jest.config.ts"],
"include": ["**/*.ts"] "include": ["**/*.ts"]

16
apps/client/project.json

@ -22,12 +22,12 @@
{ {
"glob": "assetlinks.json", "glob": "assetlinks.json",
"input": "apps/client/src/assets", "input": "apps/client/src/assets",
"output": "./../.well-known" "output": "{workspaceRoot}/dist/apps/client/.well-known"
}, },
{ {
"glob": "CHANGELOG.md", "glob": "CHANGELOG.md",
"input": "", "input": "",
"output": "./../assets" "output": "{workspaceRoot}/dist/apps/client/assets"
}, },
{ {
"glob": "favicon.ico", "glob": "favicon.ico",
@ -37,32 +37,32 @@
{ {
"glob": "LICENSE", "glob": "LICENSE",
"input": "", "input": "",
"output": "./../assets" "output": "{workspaceRoot}/dist/apps/client/assets"
}, },
{ {
"glob": "robots.txt", "glob": "robots.txt",
"input": "apps/client/src/assets", "input": "apps/client/src/assets",
"output": "./../" "output": "{workspaceRoot}/dist/apps/client/"
}, },
{ {
"glob": "site.webmanifest", "glob": "site.webmanifest",
"input": "apps/client/src/assets", "input": "apps/client/src/assets",
"output": "./../" "output": "{workspaceRoot}/dist/apps/client/"
}, },
{ {
"glob": "**/*", "glob": "**/*",
"input": "node_modules/ionicons/dist/ionicons", "input": "node_modules/ionicons/dist/ionicons",
"output": "./../ionicons" "output": "{workspaceRoot}/dist/apps/client/ionicons"
}, },
{ {
"glob": "**/*.js", "glob": "**/*.js",
"input": "node_modules/ionicons/dist/", "input": "node_modules/ionicons/dist/",
"output": "./../" "output": "{workspaceRoot}/dist/apps/client/"
}, },
{ {
"glob": "**/*", "glob": "**/*",
"input": "apps/client/src/assets", "input": "apps/client/src/assets",
"output": "./../assets/" "output": "{workspaceRoot}/dist/apps/client/assets/"
} }
], ],
"styles": [ "styles": [

3
apps/client/src/app/core/auth.guard.ts

@ -1,7 +1,6 @@
import { Injectable } from '@angular/core'; import { Injectable } from '@angular/core';
import { import {
ActivatedRouteSnapshot, ActivatedRouteSnapshot,
CanActivate,
Router, Router,
RouterStateSnapshot RouterStateSnapshot
} from '@angular/router'; } from '@angular/router';
@ -12,7 +11,7 @@ import { EMPTY } from 'rxjs';
import { catchError } from 'rxjs/operators'; import { catchError } from 'rxjs/operators';
@Injectable({ providedIn: 'root' }) @Injectable({ providedIn: 'root' })
export class AuthGuard implements CanActivate { export class AuthGuard {
private static PUBLIC_PAGE_ROUTES = [ private static PUBLIC_PAGE_ROUTES = [
'/about', '/about',
'/about/changelog', '/about/changelog',

7
nx.json

@ -50,7 +50,8 @@
"default", "default",
"^production", "^production",
"{workspaceRoot}/.storybook/**/*", "{workspaceRoot}/.storybook/**/*",
"!{projectRoot}/.storybook/**/*" "{projectRoot}/.storybook/**/*",
"{projectRoot}/tsconfig.storybook.json"
] ]
} }
}, },
@ -67,7 +68,9 @@
"!{projectRoot}/tsconfig.spec.json", "!{projectRoot}/tsconfig.spec.json",
"!{projectRoot}/jest.config.[jt]s", "!{projectRoot}/jest.config.[jt]s",
"!{projectRoot}/.storybook/**/*", "!{projectRoot}/.storybook/**/*",
"!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)" "!{projectRoot}/**/*.stories.@(js|jsx|ts|tsx|mdx)",
"!{projectRoot}/tsconfig.storybook.json",
"!{projectRoot}/src/test-setup.[jt]s"
] ]
} }
} }

111
package.json

@ -36,7 +36,7 @@
"lint": "nx workspace-lint && ng lint", "lint": "nx workspace-lint && ng lint",
"ng": "nx", "ng": "nx",
"nx": "nx", "nx": "nx",
"postinstall": "prisma generate && ngcc --properties es2020 browser module main", "postinstall": "prisma generate",
"replace-placeholders-in-build": "node ./replace.build.js", "replace-placeholders-in-build": "node ./replace.build.js",
"start": "node dist/apps/api/main", "start": "node dist/apps/api/main",
"start:client": "nx run client:serve --configuration=development-en --hmr -o", "start:client": "nx run client:serve --configuration=development-en --hmr -o",
@ -52,17 +52,17 @@
"workspace-generator": "nx workspace-generator" "workspace-generator": "nx workspace-generator"
}, },
"dependencies": { "dependencies": {
"@angular/animations": "15.2.5", "@angular/animations": "16.1.5",
"@angular/cdk": "15.2.6", "@angular/cdk": "16.1.5",
"@angular/common": "15.2.5", "@angular/common": "16.1.5",
"@angular/compiler": "15.2.5", "@angular/compiler": "16.1.5",
"@angular/core": "15.2.5", "@angular/core": "16.1.5",
"@angular/forms": "15.2.5", "@angular/forms": "16.1.5",
"@angular/material": "15.2.6", "@angular/material": "16.1.5",
"@angular/platform-browser": "15.2.5", "@angular/platform-browser": "16.1.5",
"@angular/platform-browser-dynamic": "15.2.5", "@angular/platform-browser-dynamic": "16.1.5",
"@angular/router": "15.2.5", "@angular/router": "16.1.5",
"@angular/service-worker": "15.2.5", "@angular/service-worker": "16.1.5",
"@codewithdan/observable-store": "2.2.15", "@codewithdan/observable-store": "2.2.15",
"@dfinity/agent": "0.15.7", "@dfinity/agent": "0.15.7",
"@dfinity/auth-client": "0.15.7", "@dfinity/auth-client": "0.15.7",
@ -70,14 +70,15 @@
"@dfinity/identity": "0.15.7", "@dfinity/identity": "0.15.7",
"@dfinity/principal": "0.15.7", "@dfinity/principal": "0.15.7",
"@dinero.js/currencies": "2.0.0-alpha.8", "@dinero.js/currencies": "2.0.0-alpha.8",
"@nestjs/bull": "0.6.3", "@nestjs/bull": "10.0.1",
"@nestjs/common": "9.1.4", "@nestjs/cache-manager": "2.0.1",
"@nestjs/common": "10.0.5",
"@nestjs/config": "2.2.0", "@nestjs/config": "2.2.0",
"@nestjs/core": "9.1.4", "@nestjs/core": "10.0.5",
"@nestjs/jwt": "9.0.0", "@nestjs/jwt": "10.1.0",
"@nestjs/passport": "9.0.0", "@nestjs/passport": "10.0.0",
"@nestjs/platform-express": "9.1.4", "@nestjs/platform-express": "10.0.5",
"@nestjs/schedule": "2.1.0", "@nestjs/schedule": "3.0.1",
"@nestjs/serve-static": "3.0.0", "@nestjs/serve-static": "3.0.0",
"@prisma/client": "4.16.2", "@prisma/client": "4.16.2",
"@simplewebauthn/browser": "5.2.1", "@simplewebauthn/browser": "5.2.1",
@ -89,8 +90,8 @@
"body-parser": "1.20.1", "body-parser": "1.20.1",
"bootstrap": "4.6.0", "bootstrap": "4.6.0",
"bull": "4.10.4", "bull": "4.10.4",
"cache-manager": "3.4.3", "cache-manager": "5.2.3",
"cache-manager-redis-store": "2.0.0", "cache-manager-redis-store": "3.0.1",
"chart.js": "4.2.0", "chart.js": "4.2.0",
"chartjs-adapter-date-fns": "3.0.0", "chartjs-adapter-date-fns": "3.0.0",
"chartjs-plugin-annotation": "2.1.2", "chartjs-plugin-annotation": "2.1.2",
@ -128,37 +129,37 @@
"twitter-api-v2": "1.14.2", "twitter-api-v2": "1.14.2",
"uuid": "9.0.0", "uuid": "9.0.0",
"yahoo-finance2": "2.4.3", "yahoo-finance2": "2.4.3",
"zone.js": "0.12.0" "zone.js": "0.13.1"
}, },
"devDependencies": { "devDependencies": {
"@angular-devkit/build-angular": "15.2.5", "@angular-devkit/build-angular": "16.1.4",
"@angular-devkit/core": "15.2.5", "@angular-devkit/core": "16.1.4",
"@angular-devkit/schematics": "15.2.5", "@angular-devkit/schematics": "16.1.4",
"@angular-eslint/eslint-plugin": "15.2.0", "@angular-eslint/eslint-plugin": "16.0.3",
"@angular-eslint/eslint-plugin-template": "15.2.0", "@angular-eslint/eslint-plugin-template": "16.0.3",
"@angular-eslint/template-parser": "15.2.0", "@angular-eslint/template-parser": "16.0.3",
"@angular/cli": "15.2.5", "@angular/cli": "16.1.4",
"@angular/compiler-cli": "15.2.5", "@angular/compiler-cli": "16.1.5",
"@angular/language-service": "15.2.5", "@angular/language-service": "16.1.5",
"@angular/localize": "15.2.5", "@angular/localize": "16.1.5",
"@angular/pwa": "15.2.5", "@angular/pwa": "16.1.4",
"@nestjs/schematics": "9.1.0", "@nestjs/schematics": "10.0.1",
"@nestjs/testing": "9.4.0", "@nestjs/testing": "10.0.5",
"@nx/angular": "16.0.3", "@nx/angular": "16.5.2",
"@nx/cypress": "16.0.3", "@nx/cypress": "16.5.2",
"@nx/eslint-plugin": "16.0.3", "@nx/eslint-plugin": "16.5.2",
"@nx/jest": "16.0.3", "@nx/jest": "16.5.2",
"@nx/js": "16.0.3", "@nx/js": "16.5.2",
"@nx/nest": "16.0.3", "@nx/nest": "16.5.2",
"@nx/node": "16.0.3", "@nx/node": "16.5.2",
"@nx/storybook": "16.0.3", "@nx/storybook": "16.5.2",
"@nx/web": "16.0.3", "@nx/web": "16.5.2",
"@nx/workspace": "16.0.3", "@nx/workspace": "16.5.2",
"@schematics/angular": "15.2.5", "@schematics/angular": "16.1.4",
"@simplewebauthn/typescript-types": "5.2.1", "@simplewebauthn/typescript-types": "5.2.1",
"@storybook/addon-essentials": "7.0.9", "@storybook/addon-essentials": "7.0.27",
"@storybook/angular": "7.0.9", "@storybook/angular": "7.0.27",
"@storybook/core-server": "7.0.9", "@storybook/core-server": "7.0.27",
"@types/big.js": "6.1.6", "@types/big.js": "6.1.6",
"@types/body-parser": "1.19.2", "@types/body-parser": "1.19.2",
"@types/cache-manager": "3.4.2", "@types/cache-manager": "3.4.2",
@ -167,7 +168,7 @@
"@types/jest": "29.4.4", "@types/jest": "29.4.4",
"@types/lodash": "4.14.195", "@types/lodash": "4.14.195",
"@types/marked": "4.0.8", "@types/marked": "4.0.8",
"@types/node": "18.11.18", "@types/node": "20.4.2",
"@types/papaparse": "5.3.7", "@types/papaparse": "5.3.7",
"@types/passport-google-oauth20": "2.0.11", "@types/passport-google-oauth20": "2.0.11",
"@typescript-eslint/eslint-plugin": "5.51.0", "@typescript-eslint/eslint-plugin": "5.51.0",
@ -184,9 +185,9 @@
"import-sort-style-module": "6.0.0", "import-sort-style-module": "6.0.0",
"jest": "29.4.3", "jest": "29.4.3",
"jest-environment-jsdom": "29.4.3", "jest-environment-jsdom": "29.4.3",
"jest-preset-angular": "13.0.0", "jest-preset-angular": "13.1.1",
"nx": "16.0.3", "nx": "16.5.2",
"nx-cloud": "16.0.5", "nx-cloud": "16.1.0",
"prettier": "2.8.4", "prettier": "2.8.4",
"prettier-plugin-organize-attributes": "0.0.5", "prettier-plugin-organize-attributes": "0.0.5",
"react": "18.2.0", "react": "18.2.0",
@ -195,8 +196,8 @@
"storybook": "7.0.9", "storybook": "7.0.9",
"ts-jest": "29.1.0", "ts-jest": "29.1.0",
"ts-node": "10.9.1", "ts-node": "10.9.1",
"tslib": "2.0.0", "tslib": "2.6.0",
"typescript": "4.9.5" "typescript": "5.1.6"
}, },
"engines": { "engines": {
"node": ">=18" "node": ">=18"

8810
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save