Skip to content

Commit 7c95ea6

Browse files
committed
feat(angular): support angular 20.0.0-next.9 (#31000)
Update the Angular CLI version to v20.0.0-next.9. Fixes #
1 parent 16da6d9 commit 7c95ea6

File tree

25 files changed

+1253
-821
lines changed

25 files changed

+1253
-821
lines changed

docs/generated/manifests/nx-api.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -444,14 +444,14 @@
444444
}
445445
},
446446
"migrations": {
447-
"/nx-api/angular/migrations/update-angular-cli-version-20-0-0-next-5": {
448-
"description": "Update the @angular/cli package version to ~20.0.0-next.5.",
449-
"file": "generated/packages/angular/migrations/update-angular-cli-version-20-0-0-next-5.json",
447+
"/nx-api/angular/migrations/update-angular-cli-version-20-0-0-next-9": {
448+
"description": "Update the @angular/cli package version to 20.0.0-next.9.",
449+
"file": "generated/packages/angular/migrations/update-angular-cli-version-20-0-0-next-9.json",
450450
"hidden": false,
451-
"name": "update-angular-cli-version-20-0-0-next-5",
451+
"name": "update-angular-cli-version-20-0-0-next-9",
452452
"version": "21.2.0-beta.0",
453453
"originalFilePath": "/packages/angular",
454-
"path": "/nx-api/angular/migrations/update-angular-cli-version-20-0-0-next-5",
454+
"path": "/nx-api/angular/migrations/update-angular-cli-version-20-0-0-next-9",
455455
"type": "migration"
456456
},
457457
"/nx-api/angular/migrations/21.2.0-package-updates": {

docs/generated/packages-metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -440,13 +440,13 @@
440440
],
441441
"migrations": [
442442
{
443-
"description": "Update the @angular/cli package version to ~20.0.0-next.5.",
444-
"file": "generated/packages/angular/migrations/update-angular-cli-version-20-0-0-next-5.json",
443+
"description": "Update the @angular/cli package version to 20.0.0-next.9.",
444+
"file": "generated/packages/angular/migrations/update-angular-cli-version-20-0-0-next-9.json",
445445
"hidden": false,
446-
"name": "update-angular-cli-version-20-0-0-next-5",
446+
"name": "update-angular-cli-version-20-0-0-next-9",
447447
"version": "21.2.0-beta.0",
448448
"originalFilePath": "/packages/angular",
449-
"path": "angular/migrations/update-angular-cli-version-20-0-0-next-5",
449+
"path": "angular/migrations/update-angular-cli-version-20-0-0-next-9",
450450
"type": "migration"
451451
},
452452
{

docs/generated/packages/angular/migrations/21.2.0-package-updates.json

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,61 @@
22
"name": "21.2.0-package-updates",
33
"version": "21.2.0-beta.0",
44
"x-prompt": "Do you want to update the Angular version to v20?",
5-
"requires": { "@angular/core": ">=19.2.0 <20.0.0-next.6" },
5+
"requires": { "@angular/core": ">=19.2.0 <20.0.0-next.9" },
66
"packages": {
77
"@angular-devkit/build-angular": {
8-
"version": "~20.0.0-next.5",
8+
"version": "20.0.0-next.9",
99
"alwaysAddToPackageJson": false
1010
},
1111
"@angular-devkit/core": {
12-
"version": "~20.0.0-next.5",
12+
"version": "20.0.0-next.9",
1313
"alwaysAddToPackageJson": false
1414
},
1515
"@angular-devkit/schematics": {
16-
"version": "~20.0.0-next.5",
16+
"version": "20.0.0-next.9",
1717
"alwaysAddToPackageJson": false
1818
},
1919
"@angular/build": {
20-
"version": "~20.0.0-next.5",
20+
"version": "20.0.0-next.9",
2121
"alwaysAddToPackageJson": false
2222
},
2323
"@angular/pwa": {
24-
"version": "~20.0.0-next.5",
24+
"version": "20.0.0-next.9",
2525
"alwaysAddToPackageJson": false
2626
},
2727
"@angular/ssr": {
28-
"version": "~20.0.0-next.5",
28+
"version": "20.0.0-next.9",
2929
"alwaysAddToPackageJson": false
3030
},
3131
"@schematics/angular": {
32-
"version": "~20.0.0-next.5",
32+
"version": "20.0.0-next.9",
3333
"alwaysAddToPackageJson": false
3434
},
3535
"@angular-devkit/architect": {
36-
"version": "~0.2000.0-next.5",
36+
"version": "0.2000.0-next.9",
3737
"alwaysAddToPackageJson": false
3838
},
3939
"@angular-devkit/build-webpack": {
40-
"version": "~0.2000.0-next.5",
40+
"version": "0.2000.0-next.9",
4141
"alwaysAddToPackageJson": false
4242
},
4343
"@angular/core": {
44-
"version": "~20.0.0-next.6",
44+
"version": "20.0.0-next.9",
4545
"alwaysAddToPackageJson": true
4646
},
4747
"@angular/material": {
48-
"version": "~20.0.0-next.6",
48+
"version": "20.0.0-next.10",
4949
"alwaysAddToPackageJson": false
5050
},
5151
"@angular/cdk": {
52-
"version": "~20.0.0-next.6",
52+
"version": "20.0.0-next.10",
5353
"alwaysAddToPackageJson": false
5454
},
5555
"@angular/google-maps": {
56-
"version": "~20.0.0-next.6",
56+
"version": "20.0.0-next.10",
5757
"alwaysAddToPackageJson": false
5858
},
59-
"ng-packagr": {
60-
"version": "~20.0.0-next.6",
61-
"alwaysAddToPackageJson": false
62-
}
59+
"ng-packagr": { "version": "20.0.0-rc.0", "alwaysAddToPackageJson": false }
6360
},
6461
"aliases": [],
6562
"description": "",

docs/generated/packages/angular/migrations/update-angular-cli-version-20-0-0-next-5.json renamed to docs/generated/packages/angular/migrations/update-angular-cli-version-20-0-0-next-9.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
2-
"name": "update-angular-cli-version-20-0-0-next-5",
2+
"name": "update-angular-cli-version-20-0-0-next-9",
33
"cli": "nx",
44
"version": "21.2.0-beta.0",
5-
"requires": { "@angular/core": ">=20.0.0-next.6" },
6-
"description": "Update the @angular/cli package version to ~20.0.0-next.5.",
5+
"requires": { "@angular/core": ">=20.0.0-next.9" },
6+
"description": "Update the @angular/cli package version to 20.0.0-next.9.",
77
"factory": "./src/migrations/update-21-2-0/update-angular-cli",
88
"implementation": "/packages/angular/src/migrations/update-21-2-0/update-angular-cli.ts",
99
"aliases": [],

package.json

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,20 @@
2727
},
2828
"devDependencies": {
2929
"@actions/core": "^1.10.0",
30-
"@angular-devkit/architect": "0.2000.0-next.5",
31-
"@angular-devkit/build-angular": "20.0.0-next.5",
32-
"@angular-devkit/core": "20.0.0-next.5",
33-
"@angular-devkit/schematics": "20.0.0-next.5",
30+
"@angular-devkit/architect": "0.2000.0-next.9",
31+
"@angular-devkit/build-angular": "20.0.0-next.9",
32+
"@angular-devkit/core": "20.0.0-next.9",
33+
"@angular-devkit/schematics": "20.0.0-next.9",
3434
"@angular-eslint/eslint-plugin": "19.2.0",
3535
"@angular-eslint/eslint-plugin-template": "19.2.0",
3636
"@angular-eslint/template-parser": "19.2.0",
37-
"@angular/cli": "20.0.0-next.5",
38-
"@angular/common": "20.0.0-next.6",
39-
"@angular/compiler": "20.0.0-next.6",
40-
"@angular/compiler-cli": "20.0.0-next.6",
41-
"@angular/core": "20.0.0-next.6",
42-
"@angular/platform-browser": "20.0.0-next.6",
43-
"@angular/router": "20.0.0-next.6",
37+
"@angular/cli": "20.0.0-next.9",
38+
"@angular/common": "20.0.0-next.9",
39+
"@angular/compiler": "20.0.0-next.9",
40+
"@angular/compiler-cli": "20.0.0-next.9",
41+
"@angular/core": "20.0.0-next.9",
42+
"@angular/platform-browser": "20.0.0-next.9",
43+
"@angular/router": "20.0.0-next.9",
4444
"@astrojs/check": "^0.7.0",
4545
"@astrojs/react": "^3.6.2",
4646
"@babel/core": "^7.23.2",
@@ -114,7 +114,7 @@
114114
"@rspack/dev-server": "1.1.1",
115115
"@rspack/plugin-minify": "^0.7.5",
116116
"@rspack/plugin-react-refresh": "^1.0.0",
117-
"@schematics/angular": "20.0.0-next.5",
117+
"@schematics/angular": "20.0.0-next.9",
118118
"@storybook/addon-essentials": "8.4.6",
119119
"@storybook/addon-interactions": "8.4.6",
120120
"@storybook/core-server": "8.4.6",
@@ -264,7 +264,7 @@
264264
"mini-css-extract-plugin": "~2.4.7",
265265
"minimatch": "9.0.3",
266266
"next-sitemap": "^3.1.10",
267-
"ng-packagr": "20.0.0-next.6",
267+
"ng-packagr": "20.0.0-rc.0",
268268
"npm-package-arg": "11.0.1",
269269
"nuxt": "^3.10.0",
270270
"nx": "21.0.0-rc.4",
@@ -326,7 +326,7 @@
326326
"verdaccio": "6.0.5",
327327
"vite": "6.2.0",
328328
"vitest": "3.0.5",
329-
"webpack": "5.99.5",
329+
"webpack": "5.99.7",
330330
"webpack-dev-server": "5.2.1",
331331
"webpack-merge": "^5.8.0",
332332
"webpack-node-externals": "^3.0.0",

packages/angular/migrations.json

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -303,13 +303,13 @@
303303
"description": "Change the data persistence operator imports to '@ngrx/router-store/data-persistence'.",
304304
"factory": "./src/migrations/update-21-0-0/change-data-persistence-operators-imports-to-ngrx-router-store-data-persistence"
305305
},
306-
"update-angular-cli-version-20-0-0-next-5": {
306+
"update-angular-cli-version-20-0-0-next-9": {
307307
"cli": "nx",
308308
"version": "21.2.0-beta.0",
309309
"requires": {
310-
"@angular/core": ">=20.0.0-next.6"
310+
"@angular/core": ">=20.0.0-next.9"
311311
},
312-
"description": "Update the @angular/cli package version to ~20.0.0-next.5.",
312+
"description": "Update the @angular/cli package version to 20.0.0-next.9.",
313313
"factory": "./src/migrations/update-21-2-0/update-angular-cli"
314314
}
315315
},
@@ -1629,63 +1629,63 @@
16291629
"version": "21.2.0-beta.0",
16301630
"x-prompt": "Do you want to update the Angular version to v20?",
16311631
"requires": {
1632-
"@angular/core": ">=19.2.0 <20.0.0-next.6"
1632+
"@angular/core": ">=19.2.0 <20.0.0-next.9"
16331633
},
16341634
"packages": {
16351635
"@angular-devkit/build-angular": {
1636-
"version": "~20.0.0-next.5",
1636+
"version": "20.0.0-next.9",
16371637
"alwaysAddToPackageJson": false
16381638
},
16391639
"@angular-devkit/core": {
1640-
"version": "~20.0.0-next.5",
1640+
"version": "20.0.0-next.9",
16411641
"alwaysAddToPackageJson": false
16421642
},
16431643
"@angular-devkit/schematics": {
1644-
"version": "~20.0.0-next.5",
1644+
"version": "20.0.0-next.9",
16451645
"alwaysAddToPackageJson": false
16461646
},
16471647
"@angular/build": {
1648-
"version": "~20.0.0-next.5",
1648+
"version": "20.0.0-next.9",
16491649
"alwaysAddToPackageJson": false
16501650
},
16511651
"@angular/pwa": {
1652-
"version": "~20.0.0-next.5",
1652+
"version": "20.0.0-next.9",
16531653
"alwaysAddToPackageJson": false
16541654
},
16551655
"@angular/ssr": {
1656-
"version": "~20.0.0-next.5",
1656+
"version": "20.0.0-next.9",
16571657
"alwaysAddToPackageJson": false
16581658
},
16591659
"@schematics/angular": {
1660-
"version": "~20.0.0-next.5",
1660+
"version": "20.0.0-next.9",
16611661
"alwaysAddToPackageJson": false
16621662
},
16631663
"@angular-devkit/architect": {
1664-
"version": "~0.2000.0-next.5",
1664+
"version": "0.2000.0-next.9",
16651665
"alwaysAddToPackageJson": false
16661666
},
16671667
"@angular-devkit/build-webpack": {
1668-
"version": "~0.2000.0-next.5",
1668+
"version": "0.2000.0-next.9",
16691669
"alwaysAddToPackageJson": false
16701670
},
16711671
"@angular/core": {
1672-
"version": "~20.0.0-next.6",
1672+
"version": "20.0.0-next.9",
16731673
"alwaysAddToPackageJson": true
16741674
},
16751675
"@angular/material": {
1676-
"version": "~20.0.0-next.6",
1676+
"version": "20.0.0-next.10",
16771677
"alwaysAddToPackageJson": false
16781678
},
16791679
"@angular/cdk": {
1680-
"version": "~20.0.0-next.6",
1680+
"version": "20.0.0-next.10",
16811681
"alwaysAddToPackageJson": false
16821682
},
16831683
"@angular/google-maps": {
1684-
"version": "~20.0.0-next.6",
1684+
"version": "20.0.0-next.10",
16851685
"alwaysAddToPackageJson": false
16861686
},
16871687
"ng-packagr": {
1688-
"version": "~20.0.0-next.6",
1688+
"version": "20.0.0-rc.0",
16891689
"alwaysAddToPackageJson": false
16901690
}
16911691
}

packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/entry-point.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type {
22
DestinationFiles,
33
NgEntryPoint as NgEntryPointBase,
4-
} from 'ng-packagr/lib/ng-package/entry-point/entry-point';
5-
import type { NgPackageConfig } from 'ng-packagr/ng-package.schema';
4+
} from 'ng-packagr/src/lib/ng-package/entry-point/entry-point';
5+
import type { NgPackageConfig } from 'ng-packagr/src/ng-package.schema';
66
import { dirname } from 'node:path';
77
import { getNgPackagrVersionInfo } from '../../../../utilities/ng-packagr/ng-packagr-version';
88
import { importNgPackagrPath } from '../../../../utilities/ng-packagr/package-imports';
@@ -16,8 +16,11 @@ export function createNgEntryPoint(
1616
const { major: ngPackagrMajorVersion } = getNgPackagrVersionInfo();
1717

1818
const { NgEntryPoint: NgEntryPointBase } = importNgPackagrPath<
19-
typeof import('ng-packagr/lib/ng-package/entry-point/entry-point')
20-
>('ng-packagr/lib/ng-package/entry-point/entry-point', ngPackagrMajorVersion);
19+
typeof import('ng-packagr/src/lib/ng-package/entry-point/entry-point')
20+
>(
21+
'ng-packagr/src/lib/ng-package/entry-point/entry-point',
22+
ngPackagrMajorVersion
23+
);
2124

2225
class NgEntryPoint extends NgEntryPointBase {
2326
/**

packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.di.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { TransformProvider } from 'ng-packagr/lib/graph/transform.di';
1+
import type { TransformProvider } from 'ng-packagr/src/lib/graph/transform.di';
22
import { getNgPackagrVersionInfo } from '../../../../utilities/ng-packagr/ng-packagr-version';
33
import { importNgPackagrPath } from '../../../../utilities/ng-packagr/package-imports';
44
import { writeBundlesTransform } from './write-bundles.transform';
@@ -7,17 +7,17 @@ export function getWriteBundlesTransformProvider(): TransformProvider {
77
const { major: ngPackagrMajorVersion } = getNgPackagrVersionInfo();
88

99
const { provideTransform } = importNgPackagrPath<
10-
typeof import('ng-packagr/lib/graph/transform.di')
11-
>('ng-packagr/lib/graph/transform.di', ngPackagrMajorVersion);
10+
typeof import('ng-packagr/src/lib/graph/transform.di')
11+
>('ng-packagr/src/lib/graph/transform.di', ngPackagrMajorVersion);
1212
const { WRITE_BUNDLES_TRANSFORM_TOKEN } = importNgPackagrPath<
13-
typeof import('ng-packagr/lib/ng-package/entry-point/write-bundles.di')
13+
typeof import('ng-packagr/src/lib/ng-package/entry-point/write-bundles.di')
1414
>(
15-
'ng-packagr/lib/ng-package/entry-point/write-bundles.di',
15+
'ng-packagr/src/lib/ng-package/entry-point/write-bundles.di',
1616
ngPackagrMajorVersion
1717
);
1818
const { OPTIONS_TOKEN } = importNgPackagrPath<
19-
typeof import('ng-packagr/lib/ng-package/options.di')
20-
>('ng-packagr/lib/ng-package/options.di', ngPackagrMajorVersion);
19+
typeof import('ng-packagr/src/lib/ng-package/options.di')
20+
>('ng-packagr/src/lib/ng-package/options.di', ngPackagrMajorVersion);
2121

2222
return provideTransform({
2323
provide: WRITE_BUNDLES_TRANSFORM_TOKEN,

packages/angular/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
* - Fake the FESM2022 outputs pointing them to the ESM2022 outputs.
88
*/
99

10-
import type { NgEntryPoint } from 'ng-packagr/lib/ng-package/entry-point/entry-point';
11-
import type { NgPackagrOptions } from 'ng-packagr/lib/ng-package/options.di';
10+
import type { NgEntryPoint } from 'ng-packagr/src/lib/ng-package/entry-point/entry-point';
11+
import type { NgPackagrOptions } from 'ng-packagr/src/lib/ng-package/options.di';
1212
import { mkdir, writeFile } from 'node:fs/promises';
1313
import { dirname } from 'node:path';
1414
import { getNgPackagrVersionInfo } from '../../../../utilities/ng-packagr/ng-packagr-version';
@@ -19,17 +19,17 @@ export const writeBundlesTransform = (_options: NgPackagrOptions) => {
1919
const { major: ngPackagrMajorVersion } = getNgPackagrVersionInfo();
2020

2121
const { BuildGraph } = importNgPackagrPath<
22-
typeof import('ng-packagr/lib/graph/build-graph')
23-
>('ng-packagr/lib/graph/build-graph', ngPackagrMajorVersion);
22+
typeof import('ng-packagr/src/lib/graph/build-graph')
23+
>('ng-packagr/src/lib/graph/build-graph', ngPackagrMajorVersion);
2424
const { transformFromPromise } = importNgPackagrPath<
25-
typeof import('ng-packagr/lib/graph/transform')
26-
>('ng-packagr/lib/graph/transform', ngPackagrMajorVersion);
25+
typeof import('ng-packagr/src/lib/graph/transform')
26+
>('ng-packagr/src/lib/graph/transform', ngPackagrMajorVersion);
2727
const { isEntryPoint, isPackage } = importNgPackagrPath<
28-
typeof import('ng-packagr/lib/ng-package/nodes')
29-
>('ng-packagr/lib/ng-package/nodes', ngPackagrMajorVersion);
28+
typeof import('ng-packagr/src/lib/ng-package/nodes')
29+
>('ng-packagr/src/lib/ng-package/nodes', ngPackagrMajorVersion);
3030
const { NgPackage } = importNgPackagrPath<
31-
typeof import('ng-packagr/lib/ng-package/package')
32-
>('ng-packagr/lib/ng-package/package', ngPackagrMajorVersion);
31+
typeof import('ng-packagr/src/lib/ng-package/package')
32+
>('ng-packagr/src/lib/ng-package/package', ngPackagrMajorVersion);
3333

3434
return transformFromPromise(async (graph) => {
3535
const updatedGraph = new BuildGraph();

packages/angular/src/executors/utilities/ng-packagr/package-imports.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
1+
type NgPackagrImportPath = `ng-packagr/src/${string}`;
2+
13
export function importNgPackagrPath<T>(
2-
path: string,
4+
path: NgPackagrImportPath,
35
ngPackagrMajorVersion: number
46
): T {
5-
let finalPath = path;
7+
let finalPath: string = path;
68

7-
if (ngPackagrMajorVersion >= 20 && !path.startsWith('ng-packagr/src/')) {
8-
finalPath = path.replace(/^ng-packagr\//, 'ng-packagr/src/');
9+
if (ngPackagrMajorVersion < 20 && path.startsWith('ng-packagr/src/')) {
10+
finalPath = path.replace(/^ng-packagr\/src\//, 'ng-packagr/');
911
}
1012

1113
return require(finalPath);

0 commit comments

Comments
 (0)