@nx/angular 23.0.0-beta.21 → 23.0.0-beta.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +62 -31
- package/package.json +8 -8
- package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.md +44 -0
- package/src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone.md +475 -0
- package/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.md +19 -0
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.md +25 -0
- package/src/migrations/update-20-2-0/remove-angular-eslint-rules.md +37 -0
- package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.md +69 -0
- package/src/migrations/update-20-2-0/update-angular-cli.md +49 -0
- package/src/migrations/update-20-2-0/update-angular-ssr-imports-to-use-node-entry-point.md +27 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.md +23 -0
- package/src/migrations/update-20-4-0/update-angular-cli.md +49 -0
- package/src/migrations/update-20-5-0/update-angular-cli.md +23 -0
- package/src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence.md +113 -0
- package/src/migrations/update-21-0-0/set-continuous-option.md +90 -0
- package/src/migrations/update-21-2-0/migrate-provide-server-rendering-import.md +56 -0
- package/src/migrations/update-21-2-0/replace-provide-server-routing.md +107 -0
- package/src/migrations/update-21-2-0/set-generator-defaults-for-previous-style-guide.md +164 -0
- package/src/migrations/update-21-2-0/update-angular-cli.md +23 -0
- package/src/migrations/update-21-2-0/update-module-resolution.md +53 -0
- package/src/migrations/update-21-3-0/update-angular-cli.md +23 -0
- package/src/migrations/update-21-5-0/remove-default-karma-configuration-files.md +122 -0
- package/src/migrations/update-21-5-0/set-tsconfig-option.md +114 -0
- package/src/migrations/update-21-5-0/update-angular-cli.md +23 -0
- package/src/migrations/update-21-6-1/update-angular-cli.md +23 -0
- package/src/migrations/update-22-3-0/set-isolated-modules.md +76 -0
- package/src/migrations/update-22-3-0/update-jest-preset-angular-setup.md +21 -0
- package/src/migrations/update-22-3-0/update-module-resolution.md +81 -0
- package/src/migrations/update-22-3-0/update-ssr-webpack-config.md +71 -0
- package/src/migrations/update-22-3-0/update-typescript-lib.md +103 -0
- package/src/migrations/update-22-3-0/update-unit-test-runner-option.md +33 -0
- package/src/migrations/update-23-0-0/migrate-ngrx-generator-defaults.md +46 -0
- package/src/migrations/update-23-0-0/migrate-with-mf-import-to-new-package.md +27 -0
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#### Ensure the @nx/module-federation Package is Installed
|
|
2
|
+
|
|
3
|
+
If workspace includes Module Federation projects, ensure the new `@nx/module-federation` package is installed.
|
|
4
|
+
|
|
5
|
+
#### Sample Code Changes
|
|
6
|
+
|
|
7
|
+
##### Before
|
|
8
|
+
|
|
9
|
+
```json title="package.json"
|
|
10
|
+
{
|
|
11
|
+
"dependencies": {}
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```json title="package.json"
|
|
18
|
+
{
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"@nx/module-federation": "20.3.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
#### Update `@angular/cli` to `~19.1.0`
|
|
2
|
+
|
|
3
|
+
Update the version of the Angular CLI if it is specified in `package.json`
|
|
4
|
+
|
|
5
|
+
#### Sample Code Changes
|
|
6
|
+
|
|
7
|
+
Update in `devDependencies`:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="package.json"
|
|
12
|
+
{
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@angular/cli": "~13.3.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
##### After
|
|
20
|
+
|
|
21
|
+
```json title="package.json"
|
|
22
|
+
{
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@angular/cli": "~19.1.0"
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
Update in `dependencies`:
|
|
30
|
+
|
|
31
|
+
##### Before
|
|
32
|
+
|
|
33
|
+
```json title="package.json"
|
|
34
|
+
{
|
|
35
|
+
"dependencies": {
|
|
36
|
+
"@angular/cli": "~13.3.0"
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
##### After
|
|
42
|
+
|
|
43
|
+
```json title="package.json"
|
|
44
|
+
{
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@angular/cli": "~19.1.0"
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#### Sample Code Changes
|
|
2
|
+
|
|
3
|
+
Update the `@angular/cli` package version in the `package.json` file at the workspace root to **~19.2.0**.
|
|
4
|
+
|
|
5
|
+
##### Before
|
|
6
|
+
|
|
7
|
+
```json title="package.json"
|
|
8
|
+
{
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@angular/cli": "~19.1.0"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```json title="package.json" {3}
|
|
18
|
+
{
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@angular/cli": "~19.2.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
#### Change the Data Persistence Operator Imports from `@nx/angular` to `@ngrx/router-store/data-persistence`
|
|
2
|
+
|
|
3
|
+
The data persistence operators (`fetch`, `navigation`, `optimisticUpdate`, and `pessimisticUpdate`) have been deprecated for a while and are now removed from the `@nx/angular` package. This migration automatically updates your import statements to use the `@ngrx/router-store/data-persistence` module and adds `@ngrx/router-store` to your dependencies if needed.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
If you import only data persistence operators from `@nx/angular`, the migration will update the import path to `@ngrx/router-store/data-persistence`.
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="apps/app1/src/app/users/users.effects.ts" {2}
|
|
12
|
+
import { Actions, createEffect, ofType } from '@ngrx/effects';
|
|
13
|
+
import { fetch } from '@nx/angular';
|
|
14
|
+
|
|
15
|
+
@Injectable()
|
|
16
|
+
export class UsersEffects {
|
|
17
|
+
// ...
|
|
18
|
+
}
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
##### After
|
|
22
|
+
|
|
23
|
+
```ts title="apps/app1/src/app/users/users.effects.ts" {2}
|
|
24
|
+
import { Injectable } from '@angular/core';
|
|
25
|
+
import { fetch } from '@ngrx/router-store/data-persistence';
|
|
26
|
+
|
|
27
|
+
@Injectable()
|
|
28
|
+
export class UsersEffects {
|
|
29
|
+
// ...
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you import multiple data persistence operators from `@nx/angular`, the migration will update the import path for all of them.
|
|
34
|
+
|
|
35
|
+
##### Before
|
|
36
|
+
|
|
37
|
+
```ts title="apps/app1/src/app/users/users.effects.ts" {2}
|
|
38
|
+
import { Injectable } from '@angular/core';
|
|
39
|
+
import { fetch, navigation } from '@nx/angular';
|
|
40
|
+
|
|
41
|
+
@Injectable()
|
|
42
|
+
export class UsersEffects {
|
|
43
|
+
// ...
|
|
44
|
+
}
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
##### After
|
|
48
|
+
|
|
49
|
+
```ts title="apps/app1/src/app/users/users.effects.ts" {2}
|
|
50
|
+
import { Injectable } from '@angular/core';
|
|
51
|
+
import { fetch, navigation } from '@ngrx/router-store/data-persistence';
|
|
52
|
+
|
|
53
|
+
@Injectable()
|
|
54
|
+
export class UsersEffects {
|
|
55
|
+
// ...
|
|
56
|
+
}
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
If your imports mix data persistence operators with other utilities from `@nx/angular`, the migration will split them into separate import statements.
|
|
60
|
+
|
|
61
|
+
##### Before
|
|
62
|
+
|
|
63
|
+
```ts title="apps/app1/src/app/users/users.effects.ts" {2}
|
|
64
|
+
import { Injectable } from '@angular/core';
|
|
65
|
+
import { fetch, someExtraUtility, navigation } from '@nx/angular';
|
|
66
|
+
|
|
67
|
+
@Injectable()
|
|
68
|
+
export class UsersEffects {
|
|
69
|
+
// ...
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
##### After
|
|
74
|
+
|
|
75
|
+
```ts title="apps/app1/src/app/users/users.effects.ts" {2-3}
|
|
76
|
+
import { Injectable } from '@angular/core';
|
|
77
|
+
import { fetch, navigation } from '@ngrx/router-store/data-persistence';
|
|
78
|
+
import { someExtraUtility } from '@nx/angular';
|
|
79
|
+
|
|
80
|
+
@Injectable()
|
|
81
|
+
export class UsersEffects {
|
|
82
|
+
// ...
|
|
83
|
+
}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
If you don't already have `@ngrx/router-store` in your dependencies, the migration will add it to your package.json.
|
|
87
|
+
|
|
88
|
+
##### Before
|
|
89
|
+
|
|
90
|
+
```jsonc title="package.json"
|
|
91
|
+
{
|
|
92
|
+
"dependencies": {
|
|
93
|
+
"@nx/angular": "^21.0.0",
|
|
94
|
+
"@ngrx/store": "^19.1.0",
|
|
95
|
+
"@ngrx/effects": "^19.1.0",
|
|
96
|
+
// ...
|
|
97
|
+
},
|
|
98
|
+
}
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
##### After
|
|
102
|
+
|
|
103
|
+
```jsonc title="package.json" {6}
|
|
104
|
+
{
|
|
105
|
+
"dependencies": {
|
|
106
|
+
"@nx/angular": "^21.0.0",
|
|
107
|
+
"@ngrx/store": "^19.1.0",
|
|
108
|
+
"@ngrx/effects": "^19.1.0",
|
|
109
|
+
"@ngrx/router-store": "^19.1.0",
|
|
110
|
+
// ...
|
|
111
|
+
},
|
|
112
|
+
}
|
|
113
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
#### Set `continuous` Option for Continuous Tasks
|
|
2
|
+
|
|
3
|
+
This migration sets the `continuous` option to `true` for tasks that are known to run continuously, and only if the option is not already explicitly set.
|
|
4
|
+
|
|
5
|
+
Specifically, it updates Angular targets using the following executors:
|
|
6
|
+
|
|
7
|
+
- `@angular-devkit/build-angular:dev-server`
|
|
8
|
+
- `@angular-devkit/build-angular:ssr-dev-server`
|
|
9
|
+
- `@nx/angular:dev-server`
|
|
10
|
+
- `@nx/angular:module-federation-dev-server`
|
|
11
|
+
- `@nx/angular:module-federation-dev-ssr`
|
|
12
|
+
|
|
13
|
+
#### Examples
|
|
14
|
+
|
|
15
|
+
##### Before
|
|
16
|
+
|
|
17
|
+
```json title="apps/app1/project.json"
|
|
18
|
+
{
|
|
19
|
+
// ...
|
|
20
|
+
"targets": {
|
|
21
|
+
// ...
|
|
22
|
+
"serve": {
|
|
23
|
+
"executor": "@angular-devkit/build-angular:dev-server",
|
|
24
|
+
"options": {
|
|
25
|
+
"buildTarget": "my-app:build",
|
|
26
|
+
"port": 4200
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
##### After
|
|
34
|
+
|
|
35
|
+
```json title="apps/app1/project.json" {6}
|
|
36
|
+
{
|
|
37
|
+
// ...
|
|
38
|
+
"targets": {
|
|
39
|
+
// ...
|
|
40
|
+
"serve": {
|
|
41
|
+
"continuous": true,
|
|
42
|
+
"executor": "@angular-devkit/build-angular:dev-server",
|
|
43
|
+
"options": {
|
|
44
|
+
"buildTarget": "my-app:build",
|
|
45
|
+
"port": 4200
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
When a target is already explicitly configured with a `continuous` option, the migration will not modify it:
|
|
53
|
+
|
|
54
|
+
##### Before
|
|
55
|
+
|
|
56
|
+
```json title="apps/app1/project.json" {6}
|
|
57
|
+
{
|
|
58
|
+
// ...
|
|
59
|
+
"targets": {
|
|
60
|
+
// ...
|
|
61
|
+
"serve": {
|
|
62
|
+
"continuous": false,
|
|
63
|
+
"executor": "@nx/angular:dev-server",
|
|
64
|
+
"options": {
|
|
65
|
+
"buildTarget": "my-app:build",
|
|
66
|
+
"port": 4200
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
##### After
|
|
74
|
+
|
|
75
|
+
```json title="apps/app1/project.json" {6}
|
|
76
|
+
{
|
|
77
|
+
// ...
|
|
78
|
+
"targets": {
|
|
79
|
+
// ...
|
|
80
|
+
"serve": {
|
|
81
|
+
"continuous": false,
|
|
82
|
+
"executor": "@nx/angular:dev-server",
|
|
83
|
+
"options": {
|
|
84
|
+
"buildTarget": "my-app:build",
|
|
85
|
+
"port": 4200
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
#### Migrate Imports of `provideServerRendering` from `@angular/platform-server` to `@angular/ssr`
|
|
2
|
+
|
|
3
|
+
Migrate the imports of `provideServerRendering` from `@angular/platform-server` to `@angular/ssr`. This migration will also add the `@angular/ssr` package to your dependencies if needed.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
Change the import of `provideServerRendering` from `@angular/platform-server` to `@angular/ssr`:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="app/app.config.server.ts" {2}
|
|
12
|
+
import { ApplicationConfig } from '@angular/core';
|
|
13
|
+
import { provideServerRendering } from '@angular/platform-server';
|
|
14
|
+
|
|
15
|
+
const serverConfig: ApplicationConfig = {
|
|
16
|
+
providers: [provideServerRendering()],
|
|
17
|
+
};
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
##### After
|
|
21
|
+
|
|
22
|
+
```ts title="app/app.config.server.ts" {2}
|
|
23
|
+
import { ApplicationConfig } from '@angular/core';
|
|
24
|
+
import { provideServerRendering } from '@angular/ssr';
|
|
25
|
+
|
|
26
|
+
const serverConfig: ApplicationConfig = {
|
|
27
|
+
providers: [provideServerRendering()],
|
|
28
|
+
};
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If you already have imports from `@angular/ssr`, the migration will add `provideServerRendering` to the existing import:
|
|
32
|
+
|
|
33
|
+
##### Before
|
|
34
|
+
|
|
35
|
+
```ts title="app/app.config.server.ts" {2-3}
|
|
36
|
+
import { ApplicationConfig } from '@angular/core';
|
|
37
|
+
import { provideServerRendering } from '@angular/platform-server';
|
|
38
|
+
import { provideServerRouting } from '@angular/ssr';
|
|
39
|
+
import { serverRoutes } from './app.routes.server';
|
|
40
|
+
|
|
41
|
+
const serverConfig: ApplicationConfig = {
|
|
42
|
+
providers: [provideServerRendering(), provideServerRouting(serverRoutes)],
|
|
43
|
+
};
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
##### After
|
|
47
|
+
|
|
48
|
+
```ts title="app/app.config.server.ts" {2}
|
|
49
|
+
import { ApplicationConfig } from '@angular/core';
|
|
50
|
+
import { provideServerRouting, provideServerRendering } from '@angular/ssr';
|
|
51
|
+
import { serverRoutes } from './app.routes.server';
|
|
52
|
+
|
|
53
|
+
const serverConfig: ApplicationConfig = {
|
|
54
|
+
providers: [provideServerRendering(), provideServerRouting(serverRoutes)],
|
|
55
|
+
};
|
|
56
|
+
```
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
#### Replace `provideServerRouting` and `provideServerRoutesConfig` with `provideServerRendering`
|
|
2
|
+
|
|
3
|
+
Replace `provideServerRouting` and `provideServerRoutesConfig` calls with `provideServerRendering` using `withRoutes`.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
Remove `provideServerRouting` from your providers array and update the `provideServerRendering` call to use `withRoutes`:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```ts title="app/app.config.server.ts" {2,6}
|
|
12
|
+
import { ApplicationConfig } from '@angular/core';
|
|
13
|
+
import { provideServerRendering, provideServerRouting } from '@angular/ssr';
|
|
14
|
+
import { serverRoutes } from './app.routes.server';
|
|
15
|
+
|
|
16
|
+
const serverConfig: ApplicationConfig = {
|
|
17
|
+
providers: [provideServerRendering(), provideServerRouting(serverRoutes)],
|
|
18
|
+
};
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
##### After
|
|
22
|
+
|
|
23
|
+
```ts title="app/app.config.server.ts" {2,6}
|
|
24
|
+
import { ApplicationConfig } from '@angular/core';
|
|
25
|
+
import { provideServerRendering, withRoutes } from '@angular/ssr';
|
|
26
|
+
import { serverRoutes } from './app.routes.server';
|
|
27
|
+
|
|
28
|
+
const serverConfig: ApplicationConfig = {
|
|
29
|
+
providers: [provideServerRendering(withRoutes(serverRoutes))],
|
|
30
|
+
};
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
If you have `provideServerRouting` with additional arguments, the migration will preserve them:
|
|
34
|
+
|
|
35
|
+
##### Before
|
|
36
|
+
|
|
37
|
+
```ts title="app/app.config.server.ts" {4,11,12}
|
|
38
|
+
import { ApplicationConfig } from '@angular/core';
|
|
39
|
+
import {
|
|
40
|
+
provideServerRendering,
|
|
41
|
+
provideServerRouting,
|
|
42
|
+
withAppShell,
|
|
43
|
+
} from '@angular/ssr';
|
|
44
|
+
import { serverRoutes } from './app.routes.server';
|
|
45
|
+
|
|
46
|
+
const serverConfig: ApplicationConfig = {
|
|
47
|
+
providers: [
|
|
48
|
+
provideServerRendering(),
|
|
49
|
+
provideServerRouting(serverRoutes, withAppShell(AppShellComponent)),
|
|
50
|
+
],
|
|
51
|
+
};
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
##### After
|
|
55
|
+
|
|
56
|
+
```ts title="app/app.config.server.ts" {2,7-10}
|
|
57
|
+
import { ApplicationConfig } from '@angular/core';
|
|
58
|
+
import { provideServerRendering, withAppShell, withRoutes } from '@angular/ssr';
|
|
59
|
+
import { serverRoutes } from './app.routes.server';
|
|
60
|
+
|
|
61
|
+
const serverConfig: ApplicationConfig = {
|
|
62
|
+
providers: [
|
|
63
|
+
provideServerRendering(
|
|
64
|
+
withRoutes(serverRoutes),
|
|
65
|
+
withAppShell(AppShellComponent)
|
|
66
|
+
),
|
|
67
|
+
],
|
|
68
|
+
};
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Remove `provideServerRoutesConfig` from your providers array and update the `provideServerRendering` call to use `withRoutes`:
|
|
72
|
+
|
|
73
|
+
##### Before
|
|
74
|
+
|
|
75
|
+
```ts title="app/app.config.server.ts" {4,11,12}
|
|
76
|
+
import { ApplicationConfig } from '@angular/core';
|
|
77
|
+
import {
|
|
78
|
+
provideServerRendering,
|
|
79
|
+
provideServerRoutesConfig,
|
|
80
|
+
withAppShell,
|
|
81
|
+
} from '@angular/ssr';
|
|
82
|
+
import { serverRoutes } from './app.routes.server';
|
|
83
|
+
|
|
84
|
+
const serverConfig: ApplicationConfig = {
|
|
85
|
+
providers: [
|
|
86
|
+
provideServerRendering(),
|
|
87
|
+
provideServerRoutesConfig(serverRoutes, withAppShell(AppShellComponent)),
|
|
88
|
+
],
|
|
89
|
+
};
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
##### After
|
|
93
|
+
|
|
94
|
+
```ts title="app/app.config.server.ts" {2,7-10}
|
|
95
|
+
import { ApplicationConfig } from '@angular/core';
|
|
96
|
+
import { provideServerRendering, withAppShell, withRoutes } from '@angular/ssr';
|
|
97
|
+
import { serverRoutes } from './app.routes.server';
|
|
98
|
+
|
|
99
|
+
const serverConfig: ApplicationConfig = {
|
|
100
|
+
providers: [
|
|
101
|
+
provideServerRendering(
|
|
102
|
+
withRoutes(serverRoutes),
|
|
103
|
+
withAppShell(AppShellComponent)
|
|
104
|
+
),
|
|
105
|
+
],
|
|
106
|
+
};
|
|
107
|
+
```
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
#### Set Generator Defaults for Previous Style Guide
|
|
2
|
+
|
|
3
|
+
Updates the generator defaults in the `nx.json` file to maintain the previous Angular Style Guide behavior. This ensures that newly generated code in existing workspaces follows the same conventions as the existing codebase.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
The migration will add default configurations for the relevant Angular generators in the workspace's `nx.json` file:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="nx.json"
|
|
12
|
+
{
|
|
13
|
+
"generators": {}
|
|
14
|
+
}
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
##### After
|
|
18
|
+
|
|
19
|
+
```json title="nx.json"
|
|
20
|
+
{
|
|
21
|
+
"generators": {
|
|
22
|
+
"@nx/angular:component": {
|
|
23
|
+
"type": "component"
|
|
24
|
+
},
|
|
25
|
+
"@nx/angular:directive": {
|
|
26
|
+
"type": "directive"
|
|
27
|
+
},
|
|
28
|
+
"@nx/angular:service": {
|
|
29
|
+
"type": "service"
|
|
30
|
+
},
|
|
31
|
+
"@nx/angular:scam": {
|
|
32
|
+
"type": "component"
|
|
33
|
+
},
|
|
34
|
+
"@nx/angular:scam-directive": {
|
|
35
|
+
"type": "directive"
|
|
36
|
+
},
|
|
37
|
+
"@nx/angular:guard": {
|
|
38
|
+
"typeSeparator": "."
|
|
39
|
+
},
|
|
40
|
+
"@nx/angular:interceptor": {
|
|
41
|
+
"typeSeparator": "."
|
|
42
|
+
},
|
|
43
|
+
"@nx/angular:module": {
|
|
44
|
+
"typeSeparator": "."
|
|
45
|
+
},
|
|
46
|
+
"@nx/angular:pipe": {
|
|
47
|
+
"typeSeparator": "."
|
|
48
|
+
},
|
|
49
|
+
"@nx/angular:resolver": {
|
|
50
|
+
"typeSeparator": "."
|
|
51
|
+
},
|
|
52
|
+
"@schematics/angular:component": {
|
|
53
|
+
"type": "component"
|
|
54
|
+
},
|
|
55
|
+
"@schematics/angular:directive": {
|
|
56
|
+
"type": "directive"
|
|
57
|
+
},
|
|
58
|
+
"@schematics/angular:service": {
|
|
59
|
+
"type": "service"
|
|
60
|
+
},
|
|
61
|
+
"@schematics/angular:guard": {
|
|
62
|
+
"typeSeparator": "."
|
|
63
|
+
},
|
|
64
|
+
"@schematics/angular:interceptor": {
|
|
65
|
+
"typeSeparator": "."
|
|
66
|
+
},
|
|
67
|
+
"@schematics/angular:module": {
|
|
68
|
+
"typeSeparator": "."
|
|
69
|
+
},
|
|
70
|
+
"@schematics/angular:pipe": {
|
|
71
|
+
"typeSeparator": "."
|
|
72
|
+
},
|
|
73
|
+
"@schematics/angular:resolver": {
|
|
74
|
+
"typeSeparator": "."
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
If some of the generator defaults are already set, the migration will not override them:
|
|
81
|
+
|
|
82
|
+
##### Before
|
|
83
|
+
|
|
84
|
+
```json title="nx.json" {3-14}
|
|
85
|
+
{
|
|
86
|
+
"generators": {
|
|
87
|
+
"@nx/angular:component": {
|
|
88
|
+
"type": "cmp"
|
|
89
|
+
},
|
|
90
|
+
"@schematics/angular:component": {
|
|
91
|
+
"type": "cmp"
|
|
92
|
+
},
|
|
93
|
+
"@nx/angular:interceptor": {
|
|
94
|
+
"typeSeparator": "-"
|
|
95
|
+
},
|
|
96
|
+
"@schematics/angular:interceptor": {
|
|
97
|
+
"typeSeparator": "-"
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
##### After
|
|
104
|
+
|
|
105
|
+
```json title="nx.json" {3-14}
|
|
106
|
+
{
|
|
107
|
+
"generators": {
|
|
108
|
+
"@nx/angular:component": {
|
|
109
|
+
"type": "cmp"
|
|
110
|
+
},
|
|
111
|
+
"@schematics/angular:component": {
|
|
112
|
+
"type": "cmp"
|
|
113
|
+
},
|
|
114
|
+
"@nx/angular:interceptor": {
|
|
115
|
+
"typeSeparator": "-"
|
|
116
|
+
},
|
|
117
|
+
"@schematics/angular:interceptor": {
|
|
118
|
+
"typeSeparator": "-"
|
|
119
|
+
},
|
|
120
|
+
"@nx/angular:directive": {
|
|
121
|
+
"type": "directive"
|
|
122
|
+
},
|
|
123
|
+
"@nx/angular:service": {
|
|
124
|
+
"type": "service"
|
|
125
|
+
},
|
|
126
|
+
"@nx/angular:scam": {
|
|
127
|
+
"type": "component"
|
|
128
|
+
},
|
|
129
|
+
"@nx/angular:scam-directive": {
|
|
130
|
+
"type": "directive"
|
|
131
|
+
},
|
|
132
|
+
"@nx/angular:guard": {
|
|
133
|
+
"typeSeparator": "."
|
|
134
|
+
},
|
|
135
|
+
"@nx/angular:module": {
|
|
136
|
+
"typeSeparator": "."
|
|
137
|
+
},
|
|
138
|
+
"@nx/angular:pipe": {
|
|
139
|
+
"typeSeparator": "."
|
|
140
|
+
},
|
|
141
|
+
"@nx/angular:resolver": {
|
|
142
|
+
"typeSeparator": "."
|
|
143
|
+
},
|
|
144
|
+
"@schematics/angular:directive": {
|
|
145
|
+
"type": "directive"
|
|
146
|
+
},
|
|
147
|
+
"@schematics/angular:service": {
|
|
148
|
+
"type": "service"
|
|
149
|
+
},
|
|
150
|
+
"@schematics/angular:guard": {
|
|
151
|
+
"typeSeparator": "."
|
|
152
|
+
},
|
|
153
|
+
"@schematics/angular:module": {
|
|
154
|
+
"typeSeparator": "."
|
|
155
|
+
},
|
|
156
|
+
"@schematics/angular:pipe": {
|
|
157
|
+
"typeSeparator": "."
|
|
158
|
+
},
|
|
159
|
+
"@schematics/angular:resolver": {
|
|
160
|
+
"typeSeparator": "."
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
```
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#### Sample Code Changes
|
|
2
|
+
|
|
3
|
+
Update the `@angular/cli` package version in the `package.json` file at the workspace root to **~20.0.0**.
|
|
4
|
+
|
|
5
|
+
##### Before
|
|
6
|
+
|
|
7
|
+
```json title="package.json"
|
|
8
|
+
{
|
|
9
|
+
"devDependencies": {
|
|
10
|
+
"@angular/cli": "~19.2.0"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
##### After
|
|
16
|
+
|
|
17
|
+
```json title="package.json" {3}
|
|
18
|
+
{
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@angular/cli": "~20.0.0"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#### Update `moduleResolution` to `bundler` in TypeScript configurations
|
|
2
|
+
|
|
3
|
+
Updates the TypeScript `moduleResolution` option to `'bundler'` for improved compatibility with modern package resolution algorithms used by bundlers like Webpack, Vite, and esbuild.
|
|
4
|
+
|
|
5
|
+
#### Examples
|
|
6
|
+
|
|
7
|
+
The migration will update TypeScript configuration files in your workspace to use the `'bundler'` module resolution strategy:
|
|
8
|
+
|
|
9
|
+
##### Before
|
|
10
|
+
|
|
11
|
+
```json title="apps/app1/tsconfig.app.json" {4}
|
|
12
|
+
{
|
|
13
|
+
"compilerOptions": {
|
|
14
|
+
"module": "es2020",
|
|
15
|
+
"moduleResolution": "node"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
##### After
|
|
21
|
+
|
|
22
|
+
```json title="apps/app1/tsconfig.app.json" {4}
|
|
23
|
+
{
|
|
24
|
+
"compilerOptions": {
|
|
25
|
+
"module": "es2020",
|
|
26
|
+
"moduleResolution": "bundler"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
If the `moduleResolution` is already set to `'bundler'` or the `module` is set to `'preserve'`, the migration will not modify the configuration:
|
|
32
|
+
|
|
33
|
+
##### Before
|
|
34
|
+
|
|
35
|
+
```json title="apps/app1/tsconfig.app.json" {3-4}
|
|
36
|
+
{
|
|
37
|
+
"compilerOptions": {
|
|
38
|
+
"module": "preserve",
|
|
39
|
+
"moduleResolution": "node"
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
##### After
|
|
45
|
+
|
|
46
|
+
```json title="apps/app1/tsconfig.app.json" {3-4}
|
|
47
|
+
{
|
|
48
|
+
"compilerOptions": {
|
|
49
|
+
"module": "preserve",
|
|
50
|
+
"moduleResolution": "node"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
```
|