@nx/angular 20.3.2 → 20.4.0-beta.1
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/executors.json +1 -1
- package/migrations.json +70 -0
- package/package.json +8 -8
- package/src/executors/package/schema.json +1 -1
- package/src/generators/move/lib/update-secondary-entry-points.js +1 -0
- package/src/generators/ng-add/migrators/builders/angular-devkit-karma.migrator.js +1 -1
- package/src/generators/ng-add/migrators/builders/angular-devkit-ng-packagr.migrator.js +4 -3
- package/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +1 -1
- package/src/generators/ng-add/migrators/builders/builder.migrator.d.ts +2 -2
- package/src/generators/ng-add/migrators/builders/builder.migrator.js +4 -4
- package/src/generators/ng-add/migrators/projects/project.migrator.js +1 -1
- package/src/generators/setup-ssr/lib/normalize-options.js +4 -0
- package/src/generators/setup-tailwind/lib/validate-build-target.js +1 -0
- package/src/migrations/update-20-4-0/update-angular-cli.d.ts +3 -0
- package/src/migrations/update-20-4-0/update-angular-cli.js +23 -0
- package/src/plugins/plugin.js +5 -2
- package/src/utils/versions.d.ts +3 -3
- package/src/utils/versions.js +3 -3
package/executors.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"package": {
|
|
14
14
|
"implementation": "./src/executors/package/package.impl",
|
|
15
15
|
"schema": "./src/executors/package/schema.json",
|
|
16
|
-
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds."
|
|
16
|
+
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds."
|
|
17
17
|
},
|
|
18
18
|
"browser-esbuild": {
|
|
19
19
|
"implementation": "./src/executors/browser-esbuild/browser-esbuild.impl",
|
package/migrations.json
CHANGED
|
@@ -338,6 +338,15 @@
|
|
|
338
338
|
"version": "20.3.0-beta.2",
|
|
339
339
|
"description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
|
|
340
340
|
"factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package"
|
|
341
|
+
},
|
|
342
|
+
"update-angular-cli-version-19-1-0": {
|
|
343
|
+
"cli": "nx",
|
|
344
|
+
"version": "20.4.0-beta.1",
|
|
345
|
+
"requires": {
|
|
346
|
+
"@angular/core": ">=19.1.0"
|
|
347
|
+
},
|
|
348
|
+
"description": "Update the @angular/cli package version to ~19.1.0.",
|
|
349
|
+
"factory": "./src/migrations/update-20-4-0/update-angular-cli"
|
|
341
350
|
}
|
|
342
351
|
},
|
|
343
352
|
"packageJsonUpdates": {
|
|
@@ -1415,6 +1424,67 @@
|
|
|
1415
1424
|
"alwaysAddToPackageJson": false
|
|
1416
1425
|
}
|
|
1417
1426
|
}
|
|
1427
|
+
},
|
|
1428
|
+
"20.4.0": {
|
|
1429
|
+
"version": "20.4.0-beta.1",
|
|
1430
|
+
"x-prompt": "Do you want to update the Angular version to v19.1?",
|
|
1431
|
+
"requires": {
|
|
1432
|
+
"@angular/core": ">=19.0.0 <19.1.0"
|
|
1433
|
+
},
|
|
1434
|
+
"packages": {
|
|
1435
|
+
"@angular-devkit/build-angular": {
|
|
1436
|
+
"version": "~19.1.0",
|
|
1437
|
+
"alwaysAddToPackageJson": false
|
|
1438
|
+
},
|
|
1439
|
+
"@angular-devkit/core": {
|
|
1440
|
+
"version": "~19.1.0",
|
|
1441
|
+
"alwaysAddToPackageJson": false
|
|
1442
|
+
},
|
|
1443
|
+
"@angular-devkit/schematics": {
|
|
1444
|
+
"version": "~19.1.0",
|
|
1445
|
+
"alwaysAddToPackageJson": false
|
|
1446
|
+
},
|
|
1447
|
+
"@angular/build": {
|
|
1448
|
+
"version": "~19.1.0",
|
|
1449
|
+
"alwaysAddToPackageJson": false
|
|
1450
|
+
},
|
|
1451
|
+
"@angular/pwa": {
|
|
1452
|
+
"version": "~19.1.0",
|
|
1453
|
+
"alwaysAddToPackageJson": false
|
|
1454
|
+
},
|
|
1455
|
+
"@angular/ssr": {
|
|
1456
|
+
"version": "~19.1.0",
|
|
1457
|
+
"alwaysAddToPackageJson": false
|
|
1458
|
+
},
|
|
1459
|
+
"@schematics/angular": {
|
|
1460
|
+
"version": "~19.1.0",
|
|
1461
|
+
"alwaysAddToPackageJson": false
|
|
1462
|
+
},
|
|
1463
|
+
"@angular-devkit/architect": {
|
|
1464
|
+
"version": "~0.1901.0",
|
|
1465
|
+
"alwaysAddToPackageJson": false
|
|
1466
|
+
},
|
|
1467
|
+
"@angular-devkit/build-webpack": {
|
|
1468
|
+
"version": "~0.1901.0",
|
|
1469
|
+
"alwaysAddToPackageJson": false
|
|
1470
|
+
},
|
|
1471
|
+
"@angular/core": {
|
|
1472
|
+
"version": "~19.1.0",
|
|
1473
|
+
"alwaysAddToPackageJson": true
|
|
1474
|
+
},
|
|
1475
|
+
"@angular/material": {
|
|
1476
|
+
"version": "~19.1.0",
|
|
1477
|
+
"alwaysAddToPackageJson": false
|
|
1478
|
+
},
|
|
1479
|
+
"@angular/cdk": {
|
|
1480
|
+
"version": "~19.1.0",
|
|
1481
|
+
"alwaysAddToPackageJson": false
|
|
1482
|
+
},
|
|
1483
|
+
"ng-packagr": {
|
|
1484
|
+
"version": "~19.1.0",
|
|
1485
|
+
"alwaysAddToPackageJson": false
|
|
1486
|
+
}
|
|
1487
|
+
}
|
|
1418
1488
|
}
|
|
1419
1489
|
}
|
|
1420
1490
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "20.
|
|
3
|
+
"version": "20.4.0-beta.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The Nx Plugin for Angular contains executors, generators, and utilities for managing Angular applications and libraries within an Nx workspace. It provides: \n\n- Integration with libraries such as Storybook, Jest, ESLint, Tailwind CSS, Playwright and Cypress. \n\n- Generators to help scaffold code quickly (like: Micro Frontends, Libraries, both internal to your codebase and publishable to npm) \n\n- Single Component Application Modules (SCAMs) \n\n- NgRx helpers. \n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -71,13 +71,13 @@
|
|
|
71
71
|
"semver": "^7.5.3",
|
|
72
72
|
"tslib": "^2.3.0",
|
|
73
73
|
"webpack-merge": "^5.8.0",
|
|
74
|
-
"@nx/devkit": "20.
|
|
75
|
-
"@nx/js": "20.
|
|
76
|
-
"@nx/eslint": "20.
|
|
77
|
-
"@nx/webpack": "20.
|
|
78
|
-
"@nx/module-federation": "20.
|
|
79
|
-
"@nx/web": "20.
|
|
80
|
-
"@nx/workspace": "20.
|
|
74
|
+
"@nx/devkit": "20.4.0-beta.1",
|
|
75
|
+
"@nx/js": "20.4.0-beta.1",
|
|
76
|
+
"@nx/eslint": "20.4.0-beta.1",
|
|
77
|
+
"@nx/webpack": "20.4.0-beta.1",
|
|
78
|
+
"@nx/module-federation": "20.4.0-beta.1",
|
|
79
|
+
"@nx/web": "20.4.0-beta.1",
|
|
80
|
+
"@nx/workspace": "20.4.0-beta.1",
|
|
81
81
|
"piscina": "^4.4.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependencies": {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"outputCapture": "direct-nodejs",
|
|
4
4
|
"$schema": "https://json-schema.org/schema",
|
|
5
5
|
"title": "ng-packagr Target",
|
|
6
|
-
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` with additional support for incremental builds.",
|
|
6
|
+
"description": "Builds and packages an Angular library producing an output following the Angular Package Format (APF) to be distributed as an NPM package.\n\nThis executor is a drop-in replacement for the `@angular-devkit/build-angular:ng-packagr` and `@angular/build:ng-packagr` builders, with additional support for incremental builds.",
|
|
7
7
|
"cli": "nx",
|
|
8
8
|
"type": "object",
|
|
9
9
|
"presets": [
|
|
@@ -5,6 +5,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const libraryExecutors = [
|
|
7
7
|
'@angular-devkit/build-angular:ng-packagr',
|
|
8
|
+
'@angular/build:ng-packagr',
|
|
8
9
|
'@nx/angular:ng-packagr-lite',
|
|
9
10
|
'@nx/angular:package',
|
|
10
11
|
// TODO(v17): remove when @nrwl/* scope is removed
|
|
@@ -7,7 +7,7 @@ const path_1 = require("path");
|
|
|
7
7
|
const builder_migrator_1 = require("./builder.migrator");
|
|
8
8
|
class AngularDevkitKarmaMigrator extends builder_migrator_1.BuilderMigrator {
|
|
9
9
|
constructor(tree, project, projectConfig, logger) {
|
|
10
|
-
super(tree, '@angular-devkit/build-angular:karma', 'karma', project, projectConfig, logger);
|
|
10
|
+
super(tree, ['@angular-devkit/build-angular:karma'], 'karma', project, projectConfig, logger);
|
|
11
11
|
}
|
|
12
12
|
migrate() {
|
|
13
13
|
if (this.skipMigration) {
|
|
@@ -8,15 +8,16 @@ const dependencies_1 = require("../../../utils/dependencies");
|
|
|
8
8
|
const builder_migrator_1 = require("./builder.migrator");
|
|
9
9
|
class AngularDevkitNgPackagrMigrator extends builder_migrator_1.BuilderMigrator {
|
|
10
10
|
constructor(tree, project, projectConfig, logger) {
|
|
11
|
-
super(tree, '@angular-devkit/build-angular:ng-packagr', undefined, project, projectConfig, logger);
|
|
11
|
+
super(tree, ['@angular-devkit/build-angular:ng-packagr', '@angular/build:ng-packagr'], undefined, project, projectConfig, logger);
|
|
12
12
|
}
|
|
13
13
|
migrate() {
|
|
14
14
|
if (this.skipMigration) {
|
|
15
15
|
return;
|
|
16
16
|
}
|
|
17
17
|
if (!this.targets.size) {
|
|
18
|
-
this.logger.warn(`There is no target in the project configuration using the ${this.
|
|
19
|
-
|
|
18
|
+
this.logger.warn(`There is no target in the project configuration using the ${this.possibleBuilderNames
|
|
19
|
+
.map((b) => `"${b}"`)
|
|
20
|
+
.join(', ')} builder${this.possibleBuilderNames.length > 1 ? 's' : ''}. This might not be an issue. Skipping updating the build configuration.`);
|
|
20
21
|
return;
|
|
21
22
|
}
|
|
22
23
|
for (const [name, target] of this.targets) {
|
|
@@ -7,7 +7,7 @@ const path_1 = require("path");
|
|
|
7
7
|
const builder_migrator_1 = require("./builder.migrator");
|
|
8
8
|
class AngularEslintLintMigrator extends builder_migrator_1.BuilderMigrator {
|
|
9
9
|
constructor(tree, project, projectConfig, logger) {
|
|
10
|
-
super(tree, '@angular-eslint/builder:lint', 'eslint', project, projectConfig, logger);
|
|
10
|
+
super(tree, ['@angular-eslint/builder:lint'], 'eslint', project, projectConfig, logger);
|
|
11
11
|
}
|
|
12
12
|
migrate() {
|
|
13
13
|
if (this.skipMigration) {
|
|
@@ -2,11 +2,11 @@ import type { ProjectConfiguration, TargetConfiguration, Tree } from '@nx/devkit
|
|
|
2
2
|
import type { Logger, ProjectMigrationInfo, ValidationResult, WorkspaceRootFileType } from '../../utilities';
|
|
3
3
|
import { Migrator } from '../migrator';
|
|
4
4
|
export declare abstract class BuilderMigrator extends Migrator {
|
|
5
|
-
readonly
|
|
5
|
+
readonly possibleBuilderNames: string[];
|
|
6
6
|
readonly rootFileType: WorkspaceRootFileType | undefined;
|
|
7
7
|
targets: Map<string, TargetConfiguration>;
|
|
8
8
|
protected skipMigration: boolean;
|
|
9
|
-
constructor(tree: Tree,
|
|
9
|
+
constructor(tree: Tree, possibleBuilderNames: string[], rootFileType: WorkspaceRootFileType | undefined, project: ProjectMigrationInfo, projectConfig: ProjectConfiguration, logger: Logger);
|
|
10
10
|
validate(): ValidationResult;
|
|
11
11
|
isBuilderUsed(): boolean;
|
|
12
12
|
protected collectBuilderTargets(): void;
|
|
@@ -4,9 +4,9 @@ exports.BuilderMigrator = void 0;
|
|
|
4
4
|
const utilities_1 = require("../../utilities");
|
|
5
5
|
const migrator_1 = require("../migrator");
|
|
6
6
|
class BuilderMigrator extends migrator_1.Migrator {
|
|
7
|
-
constructor(tree,
|
|
7
|
+
constructor(tree, possibleBuilderNames, rootFileType, project, projectConfig, logger) {
|
|
8
8
|
super(tree, projectConfig, logger);
|
|
9
|
-
this.
|
|
9
|
+
this.possibleBuilderNames = possibleBuilderNames;
|
|
10
10
|
this.rootFileType = rootFileType;
|
|
11
11
|
this.targets = new Map();
|
|
12
12
|
this.skipMigration = false;
|
|
@@ -20,7 +20,7 @@ class BuilderMigrator extends migrator_1.Migrator {
|
|
|
20
20
|
// expanding what's supported.
|
|
21
21
|
if (this.targets.size > 1) {
|
|
22
22
|
errors.push({
|
|
23
|
-
message: `There is more than one target using the builder
|
|
23
|
+
message: `There is more than one target using the builder${this.possibleBuilderNames.length > 1 ? 's' : ''} ${(0, utilities_1.arrayToString)(this.possibleBuilderNames)}: ${(0, utilities_1.arrayToString)([
|
|
24
24
|
...this.targets.keys(),
|
|
25
25
|
])}. This is not currently supported by the automated migration. These targets will be skipped.`,
|
|
26
26
|
hint: 'Make sure to manually migrate their configuration and any possible associated files.',
|
|
@@ -34,7 +34,7 @@ class BuilderMigrator extends migrator_1.Migrator {
|
|
|
34
34
|
}
|
|
35
35
|
collectBuilderTargets() {
|
|
36
36
|
for (const [name, target] of Object.entries(this.projectConfig.targets ?? {})) {
|
|
37
|
-
if (target.executor
|
|
37
|
+
if (this.possibleBuilderNames.includes(target.executor)) {
|
|
38
38
|
this.targets.set(name, target);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -88,7 +88,7 @@ class ProjectMigrator extends migrator_1.Migrator {
|
|
|
88
88
|
.map((x) => x.builders)
|
|
89
89
|
.flat(),
|
|
90
90
|
];
|
|
91
|
-
allSupportedBuilders.push(...this.builderMigrators.
|
|
91
|
+
allSupportedBuilders.push(...this.builderMigrators.flatMap((migrator) => migrator.possibleBuilderNames));
|
|
92
92
|
const unsupportedBuilders = [];
|
|
93
93
|
Object.entries(this.projectConfig.targets ?? {}).forEach(([targetName, target]) => {
|
|
94
94
|
if (!allSupportedBuilders.includes(target.executor)) {
|
|
@@ -24,6 +24,10 @@ async function normalizeOptions(tree, options) {
|
|
|
24
24
|
options.serverRouting = false;
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
else if (options.serverRouting !== undefined &&
|
|
28
|
+
!isUsingApplicationBuilder) {
|
|
29
|
+
throw new Error('Server routing APIs can only be added to a project using `application` builder.');
|
|
30
|
+
}
|
|
27
31
|
const isStandaloneApp = (0, ast_utils_1.isNgStandaloneApp)(tree, options.project);
|
|
28
32
|
return {
|
|
29
33
|
project: options.project,
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.angularCliVersion = void 0;
|
|
4
|
+
exports.default = default_1;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
exports.angularCliVersion = '~19.1.0';
|
|
7
|
+
async function default_1(tree) {
|
|
8
|
+
let shouldFormat = false;
|
|
9
|
+
(0, devkit_1.updateJson)(tree, 'package.json', (json) => {
|
|
10
|
+
if (json.devDependencies?.['@angular/cli']) {
|
|
11
|
+
json.devDependencies['@angular/cli'] = exports.angularCliVersion;
|
|
12
|
+
shouldFormat = true;
|
|
13
|
+
}
|
|
14
|
+
else if (json.dependencies?.['@angular/cli']) {
|
|
15
|
+
json.dependencies['@angular/cli'] = exports.angularCliVersion;
|
|
16
|
+
shouldFormat = true;
|
|
17
|
+
}
|
|
18
|
+
return json;
|
|
19
|
+
});
|
|
20
|
+
if (shouldFormat) {
|
|
21
|
+
await (0, devkit_1.formatFiles)(tree);
|
|
22
|
+
}
|
|
23
|
+
}
|
package/src/plugins/plugin.js
CHANGED
|
@@ -19,6 +19,7 @@ const knownExecutors = {
|
|
|
19
19
|
'@angular-devkit/build-angular:browser-esbuild',
|
|
20
20
|
'@angular-devkit/build-angular:browser',
|
|
21
21
|
'@angular-devkit/build-angular:ng-packagr',
|
|
22
|
+
'@angular/build:ng-packagr',
|
|
22
23
|
]),
|
|
23
24
|
devServer: new Set(['@angular-devkit/build-angular:dev-server']),
|
|
24
25
|
extractI18n: new Set(['@angular-devkit/build-angular:extract-i18n']),
|
|
@@ -201,7 +202,8 @@ async function updateBuildTarget(targetName, target, angularTarget, context, ang
|
|
|
201
202
|
getOutput(fullOutputPath, context.workspaceRoot, angularWorkspaceRoot, projectRoot),
|
|
202
203
|
];
|
|
203
204
|
}
|
|
204
|
-
else if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr'
|
|
205
|
+
else if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
|
|
206
|
+
angularTarget.builder === '@angular/build:ng-packagr') {
|
|
205
207
|
const outputs = await getNgPackagrOutputs(angularTarget, angularWorkspaceRoot, projectRoot, context);
|
|
206
208
|
if (outputs.length) {
|
|
207
209
|
target.outputs = outputs;
|
|
@@ -215,7 +217,8 @@ async function updateBuildTarget(targetName, target, angularTarget, context, ang
|
|
|
215
217
|
? ['production', '^production']
|
|
216
218
|
: ['default', '^default'];
|
|
217
219
|
}
|
|
218
|
-
if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr'
|
|
220
|
+
if (angularTarget.builder === '@angular-devkit/build-angular:ng-packagr' ||
|
|
221
|
+
angularTarget.builder === '@angular/build:ng-packagr') {
|
|
219
222
|
target.metadata.help.example.options = { watch: true };
|
|
220
223
|
}
|
|
221
224
|
else {
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const angularVersion = "~19.
|
|
3
|
-
export declare const angularDevkitVersion = "~19.
|
|
4
|
-
export declare const ngPackagrVersion = "~19.
|
|
2
|
+
export declare const angularVersion = "~19.1.0";
|
|
3
|
+
export declare const angularDevkitVersion = "~19.1.0";
|
|
4
|
+
export declare const ngPackagrVersion = "~19.1.0";
|
|
5
5
|
export declare const ngrxVersion = "^19.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
7
|
export declare const zoneJsVersion = "~0.15.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
exports.nxVersion = require('../../package.json').version;
|
|
5
|
-
exports.angularVersion = '~19.
|
|
6
|
-
exports.angularDevkitVersion = '~19.
|
|
7
|
-
exports.ngPackagrVersion = '~19.
|
|
5
|
+
exports.angularVersion = '~19.1.0';
|
|
6
|
+
exports.angularDevkitVersion = '~19.1.0';
|
|
7
|
+
exports.ngPackagrVersion = '~19.1.0';
|
|
8
8
|
exports.ngrxVersion = '^19.0.0';
|
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
|
10
10
|
exports.zoneJsVersion = '~0.15.0';
|