From 9eb6abe6e2e3d7377575a3908ea80594eed3a2e5 Mon Sep 17 00:00:00 2001 From: erdemcaygor Date: Wed, 10 Dec 2025 14:39:00 +0300 Subject: [PATCH] nx version migration --- npm/ng-packs/apps/dev-app/project.json | 4 +- npm/ng-packs/apps/dev-app/src/main.server.ts | 4 +- npm/ng-packs/migrations.json | 123 ++++++++++++++---- npm/ng-packs/package.json | 74 +++++------ .../packages/account-core/project.json | 6 +- npm/ng-packs/packages/account/project.json | 6 +- npm/ng-packs/packages/components/project.json | 6 +- npm/ng-packs/packages/core/project.json | 4 +- .../packages/feature-management/project.json | 6 +- npm/ng-packs/packages/generators/project.json | 4 +- npm/ng-packs/packages/identity/project.json | 6 +- npm/ng-packs/packages/oauth/project.json | 6 +- .../permission-management/project.json | 6 +- npm/ng-packs/packages/schematics/project.json | 4 +- .../packages/setting-management/project.json | 6 +- .../packages/tenant-management/project.json | 6 +- .../packages/theme-basic/project.json | 6 +- .../packages/theme-shared/project.json | 6 +- 18 files changed, 177 insertions(+), 106 deletions(-) diff --git a/npm/ng-packs/apps/dev-app/project.json b/npm/ng-packs/apps/dev-app/project.json index 37f0502dde..bea3bf6612 100644 --- a/npm/ng-packs/apps/dev-app/project.json +++ b/npm/ng-packs/apps/dev-app/project.json @@ -176,9 +176,7 @@ }, "test": { "executor": "@nx/jest:jest", - "outputs": [ - "{workspaceRoot}/coverage/apps/dev-app" - ], + "outputs": ["{workspaceRoot}/coverage/apps/dev-app"], "options": { "jestConfig": "apps/dev-app/jest.config.ts" } diff --git a/npm/ng-packs/apps/dev-app/src/main.server.ts b/npm/ng-packs/apps/dev-app/src/main.server.ts index 4b9d4d1545..fbd3e9dbd7 100644 --- a/npm/ng-packs/apps/dev-app/src/main.server.ts +++ b/npm/ng-packs/apps/dev-app/src/main.server.ts @@ -1,7 +1,7 @@ -import { bootstrapApplication } from '@angular/platform-browser'; +import { bootstrapApplication, BootstrapContext } from '@angular/platform-browser'; import { AppComponent } from './app/app.component'; import { config } from './app/app.config.server'; -const bootstrap = () => bootstrapApplication(AppComponent, config); +const bootstrap = (context: BootstrapContext) => bootstrapApplication(AppComponent, config, context); export default bootstrap; diff --git a/npm/ng-packs/migrations.json b/npm/ng-packs/migrations.json index 49df20928b..3615f35e50 100644 --- a/npm/ng-packs/migrations.json +++ b/npm/ng-packs/migrations.json @@ -1,45 +1,118 @@ { "migrations": [ + { + "version": "22.0.0-beta.1", + "description": "Updates release version config based on the breaking changes in Nx v22", + "implementation": "./src/migrations/update-22-0-0/release-version-config-changes", + "package": "nx", + "name": "22-0-0-release-version-config-changes" + }, + { + "version": "22.0.0-beta.2", + "description": "Consolidates releaseTag* options into nested releaseTag object structure", + "implementation": "./src/migrations/update-22-0-0/consolidate-release-tag-config", + "package": "nx", + "name": "22-0-0-consolidate-release-tag-config" + }, { "cli": "nx", - "version": "21.2.0-beta.3", - "requires": { "@angular/core": ">=20.0.0" }, - "description": "Update the @angular/cli package version to ~20.0.0.", - "factory": "./src/migrations/update-21-2-0/update-angular-cli", + "version": "22.1.0-beta.5", + "description": "Updates the nx wrapper.", + "implementation": "./src/migrations/update-22-1-0/update-nx-wrapper", + "package": "nx", + "name": "22-1-0-update-nx-wrapper" + }, + { + "version": "21.5.0-beta.2", + "description": "Migrate the legacy 'development' custom condition to a workspace-unique custom condition name.", + "factory": "./src/migrations/update-21-5-0/migrate-development-custom-condition", + "package": "@nx/js", + "name": "migrate-development-custom-condition" + }, + { + "version": "22.0.0-beta.0", + "description": "Remove the deprecated `external` and `externalBuildTargets` options from the `@nx/js:swc` and `@nx/js:tsc` executors.", + "factory": "./src/migrations/update-22-0-0/remove-external-options-from-js-executors", + "package": "@nx/js", + "name": "remove-external-options-from-js-executors" + }, + { + "version": "22.1.0-rc.1", + "description": "Removes redundant TypeScript project references from project's tsconfig.json files when runtime tsconfig files (e.g., tsconfig.lib.json, tsconfig.app.json) exist.", + "factory": "./src/migrations/update-22-1-0/remove-redundant-ts-project-references", + "package": "@nx/js", + "name": "remove-redundant-ts-project-references" + }, + { + "version": "21.3.0-beta.3", + "description": "Rename the CLI option `testPathPattern` to `testPathPatterns`.", + "implementation": "./src/migrations/update-21-3-0/rename-test-path-pattern", + "package": "@nx/jest", + "name": "rename-test-path-pattern" + }, + { + "version": "22.2.0-beta.2", + "description": "Convert jest.config.ts files from ESM to CJS syntax (export default -> module.exports, import -> require) for projects using CommonJS resolution to ensure correct loading under Node.js type-stripping.", + "implementation": "./src/migrations/update-22-2-0/convert-jest-config-to-cjs", + "package": "@nx/jest", + "name": "convert-jest-config-to-cjs" + }, + { + "cli": "nx", + "version": "21.3.0-beta.4", + "requires": { "@angular/core": ">=20.1.0" }, + "description": "Update the @angular/cli package version to ~20.1.0.", + "factory": "./src/migrations/update-21-3-0/update-angular-cli", "package": "@nx/angular", - "name": "update-angular-cli-version-20-0-0" + "name": "update-angular-cli-version-20-1-0" }, { - "version": "21.2.0-beta.3", - "requires": { "@angular/core": ">=20.0.0" }, - "description": "Migrate imports of `provideServerRendering` from `@angular/platform-server` to `@angular/ssr`.", - "factory": "./src/migrations/update-21-2-0/migrate-provide-server-rendering-import", + "version": "21.5.0-beta.0", + "description": "Set the 'tsConfig' option to build and test targets to help with Angular migration issues.", + "factory": "./src/migrations/update-21-5-0/set-tsconfig-option", "package": "@nx/angular", - "name": "migrate-provide-server-rendering-import" + "name": "set-tsconfig-option" }, { - "version": "21.2.0-beta.3", - "requires": { "@angular/core": ">=20.0.0" }, - "description": "Replace `provideServerRouting` and `provideServerRoutesConfig` with `provideServerRendering` using `withRoutes`.", - "factory": "./src/migrations/update-21-2-0/replace-provide-server-routing", + "cli": "nx", + "version": "21.5.0-beta.2", + "requires": { "@angular/core": ">=20.2.0" }, + "description": "Update the @angular/cli package version to ~20.2.0.", + "factory": "./src/migrations/update-21-5-0/update-angular-cli", "package": "@nx/angular", - "name": "replace-provide-server-routing" + "name": "update-angular-cli-version-20-2-0" }, { - "version": "21.2.0-beta.3", - "requires": { "@angular/core": ">=20.0.0" }, - "description": "Update the generator defaults to maintain the previous style guide behavior.", - "factory": "./src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide", + "version": "21.5.0-beta.2", + "requires": { "@angular/core": ">=20.2.0" }, + "description": "Remove any Karma configuration files that only contain the default content. The default configuration is automatically available without a specific project configurationfile.", + "factory": "./src/migrations/update-21-5-0/remove-default-karma-configuration-files", "package": "@nx/angular", - "name": "set-generator-defaults-for-previous-style-guide" + "name": "remove-default-karma-configuration-files" }, { - "version": "21.2.0-beta.3", - "requires": { "@angular/core": ">=20.0.0" }, - "description": "Update 'moduleResolution' to 'bundler' in TypeScript configurations. You can read more about this here: https://www.typescriptlang.org/tsconfig/#moduleResolution.", - "factory": "./src/migrations/update-21-2-0/update-module-resolution", + "cli": "nx", + "version": "21.6.1-beta.2", + "requires": { "@angular/core": ">=20.3.0" }, + "description": "Update the @angular/cli package version to ~20.3.0.", + "factory": "./src/migrations/update-21-6-1/update-angular-cli", "package": "@nx/angular", - "name": "update-module-resolution" + "name": "update-angular-cli-version-20-3-0" + }, + { + "version": "20.2.0", + "description": "Replaces usages of the deprecated Router.getCurrentNavigation method with the Router.currentNavigation signal", + "factory": "./bundles/router-current-navigation.cjs#migrate", + "optional": true, + "package": "@angular/core", + "name": "router-current-navigation" + }, + { + "version": "20.3.0", + "description": "Adds `BootstrapContext` to `bootstrapApplication` calls in `main.server.ts` to support server rendering.", + "factory": "./bundles/add-bootstrap-context-to-server-main.cjs#migrate", + "package": "@angular/core", + "name": "add-bootstrap-context-to-server-main" } ] } diff --git a/npm/ng-packs/package.json b/npm/ng-packs/package.json index f0019eb726..286ca75ae6 100644 --- a/npm/ng-packs/package.json +++ b/npm/ng-packs/package.json @@ -48,44 +48,44 @@ "devDependencies": { "@abp/ng.theme.lepton-x": "~5.0.1", "@abp/utils": "~10.0.1", - "@angular-devkit/build-angular": "~20.0.0", - "@angular-devkit/core": "~20.0.0", - "@angular-devkit/schematics": "~20.0.0", - "@angular-devkit/schematics-cli": "~20.0.0", - "@angular-eslint/eslint-plugin": "~20.0.0", - "@angular-eslint/eslint-plugin-template": "~20.0.0", - "@angular-eslint/template-parser": "~20.0.0", - "@angular/animations": "~20.0.0", - "@angular/build": "~20.0.0", - "@angular/cli": "~20.0.0", - "@angular/common": "~20.0.0", - "@angular/compiler": "~20.0.0", - "@angular/compiler-cli": "~20.0.0", - "@angular/core": "~20.0.0", - "@angular/forms": "~20.0.0", - "@angular/language-service": "~20.0.0", - "@angular/localize": "~20.0.0", - "@angular/platform-browser": "~20.0.0", - "@angular/platform-browser-dynamic": "~20.0.0", - "@angular/platform-server": "~20.0.0", - "@angular/router": "~20.0.0", - "@angular/ssr": "~20.0.0", + "@angular-devkit/build-angular": "~21.0.0", + "@angular-devkit/core": "~21.0.0", + "@angular-devkit/schematics": "~21.0.0", + "@angular-devkit/schematics-cli": "~21.0.0", + "@angular-eslint/eslint-plugin": "~21.0.0", + "@angular-eslint/eslint-plugin-template": "~21.0.0", + "@angular-eslint/template-parser": "~21.0.0", + "@angular/animations": "21.0.0", + "@angular/build": "~21.0.0", + "@angular/cli": "~21.0.0", + "@angular/common": "~21.0.0", + "@angular/compiler": "~21.0.0", + "@angular/compiler-cli": "~21.0.0", + "@angular/core": "~21.0.0", + "@angular/forms": "~21.0.0", + "@angular/language-service": "~21.0.0", + "@angular/localize": "~21.0.0", + "@angular/platform-browser": "~21.0.0", + "@angular/platform-browser-dynamic": "~21.0.0", + "@angular/platform-server": "~21.0.0", + "@angular/router": "~21.0.0", + "@angular/ssr": "21.0.0", "@fortawesome/fontawesome-free": "^6.0.0", "@ng-bootstrap/ng-bootstrap": "~19.0.0", "@ngneat/spectator": "~19.6.2", "@ngx-validate/core": "^0.2.0", - "@nx/angular": "~21.2.0", - "@nx/cypress": "~21.2.0", - "@nx/devkit": "~21.2.0", - "@nx/eslint": "~21.2.0", - "@nx/eslint-plugin": "~21.2.0", - "@nx/jest": "~21.2.0", - "@nx/js": "~21.2.0", - "@nx/plugin": "~21.2.0", - "@nx/web": "~21.2.0", - "@nx/workspace": "~21.2.0", + "@nx/angular": "~22.2.0", + "@nx/cypress": "~22.2.0", + "@nx/devkit": "~22.2.0", + "@nx/eslint": "~22.2.0", + "@nx/eslint-plugin": "~22.2.0", + "@nx/jest": "~22.2.0", + "@nx/js": "~22.2.0", + "@nx/plugin": "~22.2.0", + "@nx/web": "~22.2.0", + "@nx/workspace": "~22.2.0", "@popperjs/core": "~2.11.0", - "@schematics/angular": "~20.0.0", + "@schematics/angular": "~21.0.0", "@swc-node/register": "1.9.2", "@swc/cli": "0.6.0", "@swc/core": "~1.5.0", @@ -120,9 +120,9 @@ "just-compare": "^2.0.0", "lerna": "^4.0.0", "lint-staged": "^13.0.0", - "ng-packagr": "~20.0.0", + "ng-packagr": "~21.0.0", "ng-zorro-antd": "~20.0.0", - "nx": "~21.2.0", + "nx": "~22.2.0", "postcss": "^8.0.0", "postcss-import": "14.1.0", "postcss-preset-env": "7.5.0", @@ -131,12 +131,12 @@ "protractor": "~7.0.0", "rxjs": "~7.8.0", "should-quote": "^1.0.0", - "ts-jest": "29.1.0", + "ts-jest": "29.4.6", "ts-node": "10.9.1", "ts-toolbelt": "^9.0.0", "tslib": "^2.3.0", "tslint": "~6.1.0", - "typescript": "~5.8.0", + "typescript": "~5.9.0", "zone.js": "~0.15.0" }, "lint-staged": { diff --git a/npm/ng-packs/packages/account-core/project.json b/npm/ng-packs/packages/account-core/project.json index 3e60410088..312bdd30e9 100644 --- a/npm/ng-packs/packages/account-core/project.json +++ b/npm/ng-packs/packages/account-core/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/account-core/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared"] + } } diff --git a/npm/ng-packs/packages/account/project.json b/npm/ng-packs/packages/account/project.json index 9514a59dc6..41c6597e2a 100644 --- a/npm/ng-packs/packages/account/project.json +++ b/npm/ng-packs/packages/account/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/account/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared", "account-core"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared", "account-core"] + } } diff --git a/npm/ng-packs/packages/components/project.json b/npm/ng-packs/packages/components/project.json index 4a61b72ab4..671fabe461 100644 --- a/npm/ng-packs/packages/components/project.json +++ b/npm/ng-packs/packages/components/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/components/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared"] + } } diff --git a/npm/ng-packs/packages/core/project.json b/npm/ng-packs/packages/core/project.json index 9efdfd9d83..a6b7789814 100644 --- a/npm/ng-packs/packages/core/project.json +++ b/npm/ng-packs/packages/core/project.json @@ -4,6 +4,7 @@ "projectType": "library", "sourceRoot": "packages/core/src", "prefix": "abp", + "tags": [], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,6 +33,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [] + } } diff --git a/npm/ng-packs/packages/feature-management/project.json b/npm/ng-packs/packages/feature-management/project.json index b2f0e61b08..7712d1b67b 100644 --- a/npm/ng-packs/packages/feature-management/project.json +++ b/npm/ng-packs/packages/feature-management/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/feature-management/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared"] + } } diff --git a/npm/ng-packs/packages/generators/project.json b/npm/ng-packs/packages/generators/project.json index 06244af3d0..5924f7caac 100644 --- a/npm/ng-packs/packages/generators/project.json +++ b/npm/ng-packs/packages/generators/project.json @@ -3,6 +3,7 @@ "$schema": "../../node_modules/nx/schemas/project-schema.json", "sourceRoot": "packages/generators/src", "projectType": "library", + "tags": [], "targets": { "build": { "executor": "@nx/js:tsc", @@ -51,6 +52,5 @@ "jestConfig": "packages/generators/jest.config.ts" } } - }, - "tags": [] + } } diff --git a/npm/ng-packs/packages/identity/project.json b/npm/ng-packs/packages/identity/project.json index d51409ac2a..e67a92ba2a 100644 --- a/npm/ng-packs/packages/identity/project.json +++ b/npm/ng-packs/packages/identity/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/identity/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared", "permission-management"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared", "permission-management"] + } } diff --git a/npm/ng-packs/packages/oauth/project.json b/npm/ng-packs/packages/oauth/project.json index 61662f4811..858ec5947c 100644 --- a/npm/ng-packs/packages/oauth/project.json +++ b/npm/ng-packs/packages/oauth/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/oauth/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core"], "targets": { "build": { "executor": "@nx/angular:package", @@ -31,7 +33,5 @@ "lint": { "executor": "@nx/eslint:lint" } - }, - "tags": [], - "implicitDependencies": ["core"] + } } diff --git a/npm/ng-packs/packages/permission-management/project.json b/npm/ng-packs/packages/permission-management/project.json index eb09ef6178..3e3287256d 100644 --- a/npm/ng-packs/packages/permission-management/project.json +++ b/npm/ng-packs/packages/permission-management/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/permission-management/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared"] + } } diff --git a/npm/ng-packs/packages/schematics/project.json b/npm/ng-packs/packages/schematics/project.json index 7e3f6a8fd3..74a01e9f03 100644 --- a/npm/ng-packs/packages/schematics/project.json +++ b/npm/ng-packs/packages/schematics/project.json @@ -4,6 +4,7 @@ "projectType": "library", "sourceRoot": "packages/schematics/src", "prefix": "abp", + "tags": [], "targets": { "test": { "executor": "@nx/jest:jest", @@ -16,6 +17,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [] + } } diff --git a/npm/ng-packs/packages/setting-management/project.json b/npm/ng-packs/packages/setting-management/project.json index 334e58be26..57f72234fb 100644 --- a/npm/ng-packs/packages/setting-management/project.json +++ b/npm/ng-packs/packages/setting-management/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/setting-management/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared", "components"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared", "components"] + } } diff --git a/npm/ng-packs/packages/tenant-management/project.json b/npm/ng-packs/packages/tenant-management/project.json index c2f4c3bc8c..2394793380 100644 --- a/npm/ng-packs/packages/tenant-management/project.json +++ b/npm/ng-packs/packages/tenant-management/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/tenant-management/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared", "feature-management"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared", "feature-management"] + } } diff --git a/npm/ng-packs/packages/theme-basic/project.json b/npm/ng-packs/packages/theme-basic/project.json index 5c2936576f..be0464cc18 100644 --- a/npm/ng-packs/packages/theme-basic/project.json +++ b/npm/ng-packs/packages/theme-basic/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/theme-basic/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "theme-shared", "account-core"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "theme-shared", "account-core"] + } } diff --git a/npm/ng-packs/packages/theme-shared/project.json b/npm/ng-packs/packages/theme-shared/project.json index 6ad2a9db6d..a77551187c 100644 --- a/npm/ng-packs/packages/theme-shared/project.json +++ b/npm/ng-packs/packages/theme-shared/project.json @@ -4,6 +4,8 @@ "projectType": "library", "sourceRoot": "packages/theme-shared/src", "prefix": "abp", + "tags": [], + "implicitDependencies": ["core", "oauth"], "targets": { "build": { "executor": "@nx/angular:package", @@ -32,7 +34,5 @@ "executor": "@nx/eslint:lint", "outputs": ["{options.outputFile}"] } - }, - "tags": [], - "implicitDependencies": ["core", "oauth"] + } }