diff --git a/build/Web.Dockerfile b/build/Web.Dockerfile index dba4ae0..2b9a290 100644 --- a/build/Web.Dockerfile +++ b/build/Web.Dockerfile @@ -1,4 +1,4 @@ -FROM node:19-alpine3.16 AS build-frontend +FROM node:22-alpine3.19 AS build-frontend WORKDIR /app @@ -8,7 +8,7 @@ RUN npm install --legacy-peer-deps COPY ./src/Frontend/ . -RUN npm run build +RUN npm run publish ARG BUILD_NUMBER diff --git a/src/Backend/Geen.Data/Geen.Data.csproj b/src/Backend/Geen.Data/Geen.Data.csproj index 9b1fa9d..2fed116 100644 --- a/src/Backend/Geen.Data/Geen.Data.csproj +++ b/src/Backend/Geen.Data/Geen.Data.csproj @@ -5,10 +5,10 @@ - - - - + + + + diff --git a/src/Backend/Geen.Data/Repositories/MentionRepository.cs b/src/Backend/Geen.Data/Repositories/MentionRepository.cs index 622a48f..2921523 100644 --- a/src/Backend/Geen.Data/Repositories/MentionRepository.cs +++ b/src/Backend/Geen.Data/Repositories/MentionRepository.cs @@ -338,8 +338,7 @@ public async Task> GetFreshTitledMentions(DateTime? dateStart public async Task> GetFreshRepliedMentionIds(DateTime? dateStart) { - if (!dateStart.HasValue) - dateStart = DateTime.UtcNow.Date; + dateStart ??= DateTime.UtcNow.Date; var repliesMentionIds = await _context.For() .Find(x => x.IsApproved && x.Date >= dateStart) diff --git a/src/Backend/Geen.Web/Startup.cs b/src/Backend/Geen.Web/Startup.cs index 236f73d..72104f1 100644 --- a/src/Backend/Geen.Web/Startup.cs +++ b/src/Backend/Geen.Web/Startup.cs @@ -2,6 +2,7 @@ using System.IO.Compression; using Geen.Web.Application; using Microsoft.AspNetCore.Builder; +using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.ResponseCompression; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -79,8 +80,8 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { OnPrepareResponse = context => { - context.Context.Response.Headers.Add("cache-control", new[] { "public,max-age=31536000" }); - context.Context.Response.Headers.Add("Expires", new[] { DateTime.UtcNow.AddYears(1).ToString("R") }); + context.Context.Response.Headers.Append("cache-control", new[] { "public,max-age=31536000" }); + context.Context.Response.Headers.Append("Expires", new[] { DateTime.UtcNow.AddYears(1).ToString("R") }); } }); @@ -95,8 +96,8 @@ public void Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) { OnPrepareResponse = context => { - context.Context.Response.Headers.Add("Cache-Control", "no-cache, no-store"); - context.Context.Response.Headers.Add("Expires", "-1"); + context.Context.Response.Headers.Append("Cache-Control", "no-cache, no-store"); + context.Context.Response.Headers.Append("Expires", "-1"); } }); diff --git a/src/Backend/Shared/Geen.ClientGenerator/Geen.ClientGenerator.csproj b/src/Backend/Shared/Geen.ClientGenerator/Geen.ClientGenerator.csproj index 580cddf..3593036 100644 --- a/src/Backend/Shared/Geen.ClientGenerator/Geen.ClientGenerator.csproj +++ b/src/Backend/Shared/Geen.ClientGenerator/Geen.ClientGenerator.csproj @@ -8,8 +8,8 @@ - - + + diff --git a/src/Frontend/package.json b/src/Frontend/package.json index 8205dd2..42fa6b0 100644 --- a/src/Frontend/package.json +++ b/src/Frontend/package.json @@ -4,36 +4,36 @@ "scripts": { "ng": "ng", "start": "ng build --watch --output-path=../Backend/Geen.Web/wwwroot", - "build": "ng build", + "publish": "ng build --configuration production --output-path=../Backend/Geen.Web/wwwroot", "lint": "ng lint" }, "private": true, "dependencies": { - "@angular/animations": "^15.1.5", - "@angular/common": "^15.1.5", - "@angular/compiler": "^15.1.5", - "@angular/core": "^15.1.5", - "@angular/forms": "^15.1.5", - "@angular/platform-browser": "^15.1.5", - "@angular/platform-browser-dynamic": "^15.1.5", - "@angular/router": "^15.1.5", - "ngx-cookie-service": "^15.0.0", - "ngx-infinite-scroll": "^15.0.0", - "rxjs": "^7.8.0", + "@angular/animations": "^17.3.7", + "@angular/common": "^17.3.7", + "@angular/compiler": "^17.3.7", + "@angular/core": "^17.3.7", + "@angular/forms": "^17.3.7", + "@angular/platform-browser": "^17.3.7", + "@angular/platform-browser-dynamic": "^17.3.7", + "@angular/router": "^17.3.7", + "ngx-cookie-service": "^17.1.0", + "ngx-infinite-scroll": "^17.0.0", + "rxjs": "^7.8.1", "underscore": "^1.13.6", - "zone.js": "~0.12.0" + "zone.js": "~0.14.5" }, "devDependencies": { - "@angular-devkit/build-angular": "~15.1.6", - "@angular/cli": "~15.1.6", - "@angular/compiler-cli": "^15.1.5", - "@angular/language-service": "^15.1.5", - "@nguniversal/express-engine": "^15.1.0", - "@types/node": "~18.14.0", - "codelyzer": "^6.0.2", - "ts-node": "~10.9.1", + "@angular-devkit/build-angular": "~17.3.6", + "@angular/cli": "~17.3.6", + "@angular/compiler-cli": "^17.3.7", + "@angular/language-service": "^17.3.7", + "@nguniversal/express-engine": "^16.2.0", + "@types/node": "~20.12.10", + "codelyzer": "^0.0.28", + "ts-node": "~10.9.2", "tslint": "~6.1.3", "tslint-config-airbnb": "^5.11.2", - "typescript": "4.9.5" + "typescript": "5.3.3" } } diff --git a/src/Frontend/src/polyfills.ts b/src/Frontend/src/polyfills.ts index 5740d5e..b426f2a 100644 --- a/src/Frontend/src/polyfills.ts +++ b/src/Frontend/src/polyfills.ts @@ -55,4 +55,4 @@ /*************************************************************************************************** * Zone JS is required by default for Angular itself. */ -import 'zone.js/dist/zone'; // Included with Angular CLI. \ No newline at end of file +import 'zone.js'; // Included with Angular CLI. diff --git a/src/Frontend/tsconfig.json b/src/Frontend/tsconfig.json index c3b47b2..f339a0a 100644 --- a/src/Frontend/tsconfig.json +++ b/src/Frontend/tsconfig.json @@ -9,12 +9,12 @@ "moduleResolution": "node", "emitDecoratorMetadata": true, "experimentalDecorators": true, - "target": "es2017", + "target": "ES2022", "typeRoots": [ "node_modules/@types" ], "lib": [ - "es2017", + "es2022", "dom" ] }