From 88e4c7b5d2db60b57df6dd6ea9cb526499375f27 Mon Sep 17 00:00:00 2001 From: Alex H Date: Mon, 15 Dec 2025 06:52:56 +0100 Subject: [PATCH 1/6] feat: before update --- apps/host-application/project.json | 3 +++ apps/mf1-application/.env | 1 + apps/mf1-application/project.json | 5 +++-- apps/mf2-application/.env | 1 + apps/mf2-application/project.json | 3 +++ 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 apps/mf1-application/.env create mode 100644 apps/mf2-application/.env diff --git a/apps/host-application/project.json b/apps/host-application/project.json index 4280b89..422d008 100644 --- a/apps/host-application/project.json +++ b/apps/host-application/project.json @@ -68,6 +68,9 @@ "serve": { "dependsOn": ["^build"], "executor": "./dist/libs/nx-angular-mf:serve", + "options": { + "port": 4200 + }, "configurations": { "production": { "buildTarget": "host-application:build:production" diff --git a/apps/mf1-application/.env b/apps/mf1-application/.env new file mode 100644 index 0000000..3dc00d1 --- /dev/null +++ b/apps/mf1-application/.env @@ -0,0 +1 @@ +DEPLOY_URL=http://loclahost:4201/ diff --git a/apps/mf1-application/project.json b/apps/mf1-application/project.json index 7f79810..7e59df2 100644 --- a/apps/mf1-application/project.json +++ b/apps/mf1-application/project.json @@ -18,7 +18,8 @@ "exposes": { "FirstRemoteRoute": "/apps/mf1-application/src/app/remote/first/index.ts", "SecondRemoteRoute": "/apps/mf1-application/src/app/remote/second/index.ts" - } + }, + "deployUrlEnvName": "DEPLOY_URL" }, "outputPath": "dist/apps/mf1-application", "index": "apps/mf1-application/src/index.html", @@ -40,7 +41,7 @@ { "type": "initial", "maximumWarning": "500kb", - "maximumError": "1mb" + "maximumError": "5mb" }, { "type": "anyComponentStyle", diff --git a/apps/mf2-application/.env b/apps/mf2-application/.env new file mode 100644 index 0000000..aa922a6 --- /dev/null +++ b/apps/mf2-application/.env @@ -0,0 +1 @@ +DEPLOY_URL=http://loclahost:4202/ diff --git a/apps/mf2-application/project.json b/apps/mf2-application/project.json index ff08e5a..2693852 100644 --- a/apps/mf2-application/project.json +++ b/apps/mf2-application/project.json @@ -52,6 +52,9 @@ "serve": { "dependsOn": ["^build"], "executor": "./dist/libs/nx-angular-mf:serve", + "options": { + "port": 4202 + }, "configurations": { "production": { "buildTarget": "mf2-application:build:production" From f4c04a3a01f12934ddb584032d104c106295b194 Mon Sep 17 00:00:00 2001 From: Alex H Date: Mon, 15 Dec 2025 10:20:50 +0100 Subject: [PATCH 2/6] chore: update dependencies and configurations Upgraded Angular 20, Nx 21, and related packages. --- .gitignore | 2 + README.md | 1 + apps/host-application/project.json | 3 +- .../src/app/app.config.server.ts | 8 +- .../src/app/nx-welcome.component.ts | 4 +- apps/host-application/src/main.server.ts | 4 +- apps/host-application/tsconfig.app.json | 15 +- apps/mf1-application/project.json | 3 +- .../src/app/nx-welcome.component.ts | 4 +- .../src/app/remote/first/first.component.ts | 4 +- .../src/app/remote/second/second.component.ts | 4 +- apps/mf1-application/tsconfig.app.json | 13 +- apps/mf2-application/project.json | 3 +- .../src/app/nx-welcome.component.ts | 4 +- apps/mf2-application/tsconfig.app.json | 13 +- libs/test-shared-library/project.json | 3 +- .../test-shared-library.component.ts | 4 +- nx.json | 59 +- package-lock.json | 39230 ++++++++++------ package.json | 83 +- 20 files changed, 24399 insertions(+), 15065 deletions(-) diff --git a/.gitignore b/.gitignore index 36efcdd..ba461d1 100644 --- a/.gitignore +++ b/.gitignore @@ -42,3 +42,5 @@ Thumbs.db .nx/workspace-data .angular +.cursor/rules/nx-rules.mdc +.github/instructions/nx.instructions.md diff --git a/README.md b/README.md index 922aad7..2947538 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # @klerick/nx-angular-mf - [Readme about lib](./libs/nx-angular-mf/README.md) +- [Article about this project](https://dev.to/klerick/custom-builder-for-angular-my-way-12hd) ## Local Development diff --git a/apps/host-application/project.json b/apps/host-application/project.json index 422d008..93af7fd 100644 --- a/apps/host-application/project.json +++ b/apps/host-application/project.json @@ -94,7 +94,8 @@ "executor": "@nx/jest:jest", "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], "options": { - "jestConfig": "apps/host-application/jest.config.ts" + "jestConfig": "apps/host-application/jest.config.ts", + "tsConfig": "apps/host-application/tsconfig.spec.json" } }, "build-static": { diff --git a/apps/host-application/src/app/app.config.server.ts b/apps/host-application/src/app/app.config.server.ts index d5c4490..608887d 100644 --- a/apps/host-application/src/app/app.config.server.ts +++ b/apps/host-application/src/app/app.config.server.ts @@ -1,14 +1,10 @@ import { mergeApplicationConfig, ApplicationConfig } from '@angular/core'; -import { provideServerRendering } from '@angular/platform-server'; -import { provideServerRoutesConfig } from '@angular/ssr'; +import { provideServerRendering, withRoutes } from '@angular/ssr'; import { appConfig } from './app.config'; import { serverRoutes } from './app.routes.server'; const serverConfig: ApplicationConfig = { - providers: [ - provideServerRendering(), - provideServerRoutesConfig(serverRoutes), - ], + providers: [provideServerRendering(withRoutes(serverRoutes))], }; export const config = mergeApplicationConfig(appConfig, serverConfig); diff --git a/apps/host-application/src/app/nx-welcome.component.ts b/apps/host-application/src/app/nx-welcome.component.ts index b37a99d..c92ed59 100644 --- a/apps/host-application/src/app/nx-welcome.component.ts +++ b/apps/host-application/src/app/nx-welcome.component.ts @@ -1,9 +1,9 @@ import { Component, ViewEncapsulation } from '@angular/core'; -import { CommonModule } from '@angular/common'; + @Component({ selector: 'app-nx-welcome', - imports: [CommonModule], + imports: [], template: `