diff --git a/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.component.spec.ts.mustache b/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.component.spec.ts.mustache index 10842b433c3..c430f8c0b5c 100644 --- a/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.component.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.component.spec.ts.mustache @@ -1,8 +1,9 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { HarnessLoader } from '@angular/cdk/testing'; import { MatDialogHarness } from '@angular/material/dialog/testing'; import { TestbedHarnessEnvironment } from '@angular/cdk/testing/testbed'; +import { provideHttpClient } from '@angular/common/http'; import { of } from 'rxjs'; import HealthComponent from './health.component'; @@ -17,7 +18,7 @@ describe('HealthComponent', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], + providers: [provideHttpClient(), provideHttpClientTesting()], }) .overrideTemplate(HealthComponent, '') .compileComponents(); diff --git a/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.service.spec.ts.mustache b/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.service.spec.ts.mustache index fc477f5a17f..235b226362c 100644 --- a/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.service.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/admin/src/main/webapp/app/admin/health/health.service.spec.ts.mustache @@ -1,5 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { provideHttpClientTesting, HttpTestingController } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; import { HealthService } from './health.service'; import { ApplicationConfigService } from './../../config/application-config.service'; @@ -11,7 +12,7 @@ describe('HealthService Service', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], + providers: [provideHttpClient(), provideHttpClientTesting()], }); service = TestBed.inject(HealthService); diff --git a/src/main/resources/generator/client/angular/core/angular.json.mustache b/src/main/resources/generator/client/angular/core/angular.json.mustache index e3253bb482c..4c72f90f69b 100644 --- a/src/main/resources/generator/client/angular/core/angular.json.mustache +++ b/src/main/resources/generator/client/angular/core/angular.json.mustache @@ -10,7 +10,7 @@ "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:application", + "builder": "@angular/build:application", "options": { "outputPath": { "base": "{{projectBuildDirectory}}/classes/static", @@ -69,7 +69,7 @@ "buildTarget": "project:build", "proxyConfig": "proxy.conf.json" }, - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@angular/build:dev-server", "configurations": { "production": { "buildTarget": "project:build:production" @@ -87,7 +87,7 @@ } }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", + "builder": "@angular/build:extract-i18n", "options": { "buildTarget": "project:build" } diff --git a/src/main/resources/generator/client/angular/core/src/main/webapp/index.html.mustache b/src/main/resources/generator/client/angular/core/src/main/webapp/index.html.mustache index 7fe12b318ea..7fefd9dde17 100644 --- a/src/main/resources/generator/client/angular/core/src/main/webapp/index.html.mustache +++ b/src/main/resources/generator/client/angular/core/src/main/webapp/index.html.mustache @@ -11,6 +11,6 @@ - + diff --git a/src/main/resources/generator/client/angular/core/tsconfig.json b/src/main/resources/generator/client/angular/core/tsconfig.json index 215c84c8e2d..5e2f4145a75 100644 --- a/src/main/resources/generator/client/angular/core/tsconfig.json +++ b/src/main/resources/generator/client/angular/core/tsconfig.json @@ -11,7 +11,6 @@ "noFallthroughCasesInSwitch": true, "sourceMap": true, "declaration": false, - "downlevelIteration": true, "esModuleInterop": true, "experimentalDecorators": true, "useDefineForClassFields": false, diff --git a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/account.service.spec.ts.mustache b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/account.service.spec.ts.mustache index 7582089fee6..0f6b6eb2f15 100644 --- a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/account.service.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/account.service.spec.ts.mustache @@ -1,6 +1,7 @@ -import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { provideHttpClientTesting, HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; import { provideRouter } from '@angular/router'; +import { provideHttpClient } from '@angular/common/http'; import { Account } from './account.model'; @@ -29,8 +30,7 @@ describe('Account Service', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], - providers: [provideRouter([])], + providers: [provideRouter([]), provideHttpClient(), provideHttpClientTesting()], }); service = TestBed.inject(AccountService); diff --git a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth-jwt.service.spec.ts.mustache b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth-jwt.service.spec.ts.mustache index d6bac35fcd4..3a5ac5412eb 100644 --- a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth-jwt.service.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth-jwt.service.spec.ts.mustache @@ -1,5 +1,6 @@ import { TestBed } from '@angular/core/testing'; -import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { provideHttpClientTesting, HttpTestingController } from '@angular/common/http/testing'; +import { provideHttpClient } from '@angular/common/http'; import { AuthServerProvider } from './auth-jwt.service'; describe('Auth JWT', () => { @@ -8,7 +9,7 @@ describe('Auth JWT', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], + providers: [provideHttpClient(), provideHttpClientTesting()], }); httpMock = TestBed.inject(HttpTestingController); diff --git a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth.interceptor.spec.ts.mustache b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth.interceptor.spec.ts.mustache index 4e477555ab6..a1fcf90af25 100644 --- a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth.interceptor.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/auth/auth.interceptor.spec.ts.mustache @@ -1,6 +1,6 @@ import { TestBed } from '@angular/core/testing'; import { provideHttpClient, withInterceptors } from '@angular/common/http'; -import { HttpClientTestingModule, HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; +import { HttpTestingController, provideHttpClientTesting } from '@angular/common/http/testing'; import { AuthServerProvider } from './auth-jwt.service'; import { AuthInterceptor } from './auth.interceptor'; @@ -11,7 +11,6 @@ describe('Auth Interceptor', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], providers: [ provideHttpClient( withInterceptors([AuthInterceptor]) diff --git a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.spec.ts.mustache b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.spec.ts.mustache index cd72992bc49..3731a070baf 100644 --- a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.component.spec.ts.mustache @@ -1,6 +1,7 @@ import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing'; -import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { provideHttpClientTesting } from '@angular/common/http/testing'; import { FormBuilder } from '@angular/forms'; +import { provideHttpClient } from '@angular/common/http'; import { of, Subject } from 'rxjs'; import { LoginService } from './login.service'; import { AccountService } from '../auth/account.service'; @@ -25,8 +26,9 @@ describe('Login Component', () => { beforeEach(waitForAsync(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], providers: [ + provideHttpClient(), + provideHttpClientTesting(), FormBuilder, AccountService, { diff --git a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.service.spec.ts.mustache b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.service.spec.ts.mustache index 50f5e71d2b6..1fff25faea9 100644 --- a/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.service.spec.ts.mustache +++ b/src/main/resources/generator/client/angular/security/jwt/src/main/webapp/app/login/login.service.spec.ts.mustache @@ -1,6 +1,7 @@ import { provideRouter } from '@angular/router'; -import { HttpClientTestingModule, HttpTestingController } from '@angular/common/http/testing'; +import { provideHttpClientTesting, HttpTestingController } from '@angular/common/http/testing'; import { TestBed } from '@angular/core/testing'; +import { provideHttpClient } from '@angular/common/http'; import { LoginService } from './login.service'; import { AuthServerProvider } from '../auth/auth-jwt.service'; @@ -15,8 +16,7 @@ describe('Login Service', () => { beforeEach(() => { TestBed.configureTestingModule({ - imports: [HttpClientTestingModule], - providers: [AccountService, provideRouter([])], + providers: [AccountService, provideRouter([]), provideHttpClient(), provideHttpClientTesting()], }); service = TestBed.inject(LoginService); diff --git a/src/main/resources/generator/dependencies/angular/package.json b/src/main/resources/generator/dependencies/angular/package.json index 947fa5a656a..06f68c80cc2 100644 --- a/src/main/resources/generator/dependencies/angular/package.json +++ b/src/main/resources/generator/dependencies/angular/package.json @@ -1,23 +1,23 @@ { "dependencies": { - "@angular/cdk": "17.3.9", - "@angular/core": "17.3.9", - "@angular/material": "17.3.9", + "@angular/cdk": "18.0.1", + "@angular/core": "18.0.1", + "@angular/material": "18.0.1", "keycloak-js": "24.0.4", "rxjs": "7.8.1", "tslib": "2.6.2", "zone.js": "0.14.6" }, "devDependencies": { - "@angular-builders/jest": "17.0.3", - "@angular-devkit/build-angular": "17.3.7", - "@angular-eslint/builder": "17.4.1", - "@angular-eslint/eslint-plugin": "17.4.1", - "@angular-eslint/eslint-plugin-template": "17.4.1", - "@angular-eslint/schematics": "17.4.1", - "@angular-eslint/template-parser": "17.4.1", - "@angular/cli": "17.3.7", - "@angular/compiler-cli": "17.3.9", + "@angular-builders/jest": "18.0.0-beta.3", + "@angular-devkit/build-angular": "18.0.2", + "@angular-eslint/builder": "18.0.1", + "@angular-eslint/eslint-plugin": "18.0.1", + "@angular-eslint/eslint-plugin-template": "18.0.1", + "@angular-eslint/schematics": "18.0.1", + "@angular-eslint/template-parser": "18.0.1", + "@angular/cli": "18.0.2", + "@angular/compiler-cli": "18.0.1", "jest-environment-jsdom": "29.7.0", "jest-preset-angular": "14.1.0", "jest-sonar-reporter": "2.0.0" diff --git a/src/test/resources/projects/angular/angular.json b/src/test/resources/projects/angular/angular.json index 3822c1a4bb3..0240d4f34a8 100644 --- a/src/test/resources/projects/angular/angular.json +++ b/src/test/resources/projects/angular/angular.json @@ -10,9 +10,12 @@ "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:application", + "builder": "@angular/build:application", "options": { - "outputPath": "dist/project", + "outputPath": { + "base": "target/classes/static", + "browser": "" + }, "index": "src/main/webapp/index.html", "browser": "src/main/webapp/main.ts", "polyfills": ["zone.js"], @@ -66,7 +69,7 @@ "buildTarget": "project:build", "proxyConfig": "proxy.conf.json" }, - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@angular/build:dev-server", "configurations": { "production": { "buildTarget": "project:build:production" @@ -84,7 +87,7 @@ } }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", + "builder": "@angular/build:extract-i18n", "options": { "buildTarget": "project:build" } diff --git a/src/test/resources/projects/angular/empty-angular.json b/src/test/resources/projects/angular/empty-angular.json index 71297668d3b..4059ec02a8d 100644 --- a/src/test/resources/projects/angular/empty-angular.json +++ b/src/test/resources/projects/angular/empty-angular.json @@ -3,21 +3,19 @@ "version": 1, "newProjectRoot": "projects", "projects": { - "angular-project": { + "project": { "projectType": "application", - "schematics": { - "@schematics/angular:application": { - "strict": true - } - }, "root": "", "sourceRoot": "src", "prefix": "app", "architect": { "build": { - "builder": "@angular-devkit/build-angular:application", + "builder": "@angular/build:application", "options": { - "outputPath": "dist/angular-project", + "outputPath": { + "base": "target/classes/static", + "browser": "" + }, "index": "src/main/webapp/index.html", "browser": "src/main/webapp/main.ts", "polyfills": ["zone.js"], @@ -68,15 +66,16 @@ "serve": { "options": { "port": 9000, + "buildTarget": "project:build", "proxyConfig": "proxy.conf.json" }, - "builder": "@angular-devkit/build-angular:dev-server", + "builder": "@angular/build:dev-server", "configurations": { "production": { - "buildTarget": "angular-project:build:production" + "buildTarget": "project:build:production" }, "development": { - "buildTarget": "angular-project:build:development" + "buildTarget": "project:build:development" } }, "defaultConfiguration": "development" @@ -88,9 +87,9 @@ } }, "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", + "builder": "@angular/build:extract-i18n", "options": { - "buildTarget": "angular-project:build" + "buildTarget": "project:build" } }, "lint": { @@ -101,6 +100,5 @@ } } } - }, - "defaultProject": "angular-project" + } }