@nx/angular 24.0.0-beta.3 → 24.0.0-beta.4
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/dist/fesm2022/nx-angular.mjs +0 -4
- package/dist/src/executors/application/schema.json +1 -2
- package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +9 -1
- package/dist/src/executors/unit-test/schema.json +6 -1
- package/dist/src/executors/unit-test/unit-test.impl.js +5 -0
- package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.js +35 -10
- package/dist/src/migrations/update-23-1-0/add-angular-build.js +7 -3
- package/dist/src/migrations/update-23-1-0/add-angular-build.md +1 -1
- package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.js +9 -2
- package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.d.ts +5 -0
- package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.js +332 -0
- package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.md +46 -0
- package/dist/src/utils/assert-cypress-component-testing-support.js +10 -0
- package/dist/src/utils/versions.d.ts +4 -4
- package/dist/src/utils/versions.js +4 -4
- package/dist/types/nx-angular.d.ts +1 -3
- package/migrations.json +97 -0
- package/package.json +11 -11
- package/dist/fesm2022/nx-angular.mjs.map +0 -1
- package/dist/types/nx-angular.d.ts.map +0 -1
|
@@ -522,8 +522,7 @@
|
|
|
522
522
|
},
|
|
523
523
|
"preloadInitial": {
|
|
524
524
|
"type": "boolean",
|
|
525
|
-
"
|
|
526
|
-
"description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources."
|
|
525
|
+
"description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources. Defaults to false when a service worker is enabled; otherwise true. _Note: defaulting to false when a service worker is enabled only applies in Angular versions >= 22.2.0. Earlier versions default to true._"
|
|
527
526
|
}
|
|
528
527
|
},
|
|
529
528
|
"required": ["input"]
|
|
@@ -12,8 +12,10 @@ exports.writeBundlesTransform = void 0;
|
|
|
12
12
|
exports.removeSourceMappingUrl = removeSourceMappingUrl;
|
|
13
13
|
exports.remapDeclarationMapSources = remapDeclarationMapSources;
|
|
14
14
|
exports.normalizeEsm2022Path = normalizeEsm2022Path;
|
|
15
|
+
const tslib_1 = require("tslib");
|
|
15
16
|
const transform_1 = require("ng-packagr/src/lib/graph/transform");
|
|
16
17
|
const nodes_1 = require("ng-packagr/src/lib/ng-package/nodes");
|
|
18
|
+
const ngPackagrNodes = tslib_1.__importStar(require("ng-packagr/src/lib/ng-package/nodes"));
|
|
17
19
|
const package_1 = require("ng-packagr/src/lib/ng-package/package");
|
|
18
20
|
const path_1 = require("ng-packagr/src/lib/utils/path");
|
|
19
21
|
const promises_1 = require("node:fs/promises");
|
|
@@ -29,9 +31,15 @@ async function shouldWriteFile(filePath, newContent) {
|
|
|
29
31
|
return true;
|
|
30
32
|
}
|
|
31
33
|
}
|
|
34
|
+
// ng-packagr 22.2.0 to 22.2.3 build entry points in parallel and export this
|
|
35
|
+
// to find the one a graph is scoped to. 22.2.4 reverted that:
|
|
36
|
+
// https://github.com/ng-packagr/ng-packagr/issues/3451
|
|
37
|
+
const { getActiveEntryPoint } = ngPackagrNodes;
|
|
32
38
|
const writeBundlesTransform = (_options) => {
|
|
33
39
|
return (0, transform_1.transformFromPromise)(async (graph) => {
|
|
34
|
-
const entryPointNode =
|
|
40
|
+
const entryPointNode = getActiveEntryPoint
|
|
41
|
+
? getActiveEntryPoint(graph)
|
|
42
|
+
: graph.find((0, nodes_1.isEntryPointInProgress)());
|
|
35
43
|
if (!entryPointNode) {
|
|
36
44
|
return;
|
|
37
45
|
}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
},
|
|
23
23
|
"runnerConfig": {
|
|
24
24
|
"type": ["string", "boolean"],
|
|
25
|
-
"description": "Specifies the configuration file for the selected test runner. If a string is provided, it will be used as the path to the configuration file. If `true`, the builder will search for a default configuration file (e.g., `vitest.config.
|
|
25
|
+
"description": "Specifies the configuration file for the selected test runner. If a string is provided, it will be used as the path to the configuration file. If `true`, the builder will search for a default configuration file (e.g., `vitest-base.config.mts` or `karma.conf.js`). If `false`, no external configuration file will be used.\\nFor Vitest, this enables advanced options and the use of custom plugins. Please note that while the file is loaded, the Angular team does not provide direct support for its specific contents or any third-party plugins used within it.",
|
|
26
26
|
"default": false
|
|
27
27
|
},
|
|
28
28
|
"browsers": {
|
|
@@ -46,6 +46,11 @@
|
|
|
46
46
|
"type": "boolean",
|
|
47
47
|
"description": "Enables isolation for test execution. When true, Vitest runs tests in separate threads or processes. This option is only available for the Vitest runner. Defaults to false to align with the Karma/Jasmine experience. _Note: this is only supported in Angular versions >= 22.0.0_."
|
|
48
48
|
},
|
|
49
|
+
"splitting": {
|
|
50
|
+
"type": "boolean",
|
|
51
|
+
"description": "Enables code splitting for test execution. When enabled, shared code between test files is split into separate chunks. Issues with live ESM bindings in Node.js environments (such as uninitialized exports or mocking failures) can be resolved by disabling splitting. This option is only available for the Vitest runner. Defaults to `true`. _Note: this is only supported in Angular versions >= 22.2.0_.",
|
|
52
|
+
"x-deprecated": "No longer needed with Vitest 5."
|
|
53
|
+
},
|
|
49
54
|
"quiet": {
|
|
50
55
|
"type": "boolean",
|
|
51
56
|
"description": "Suppresses the verbose build summary and stats table on each rebuild. Defaults to `true` locally and `false` in CI environments. _Note: this is only supported in Angular versions >= 22.0.0_."
|
|
@@ -47,6 +47,11 @@ function validateOptions(options) {
|
|
|
47
47
|
throw new Error(`The "quiet" option requires Angular version 22.0.0 or greater. You are currently using version ${angularVersion}.`);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
+
if ((0, semver_1.lt)(angularVersion, '22.2.0')) {
|
|
51
|
+
if (options.splitting !== undefined) {
|
|
52
|
+
throw new Error(`The "splitting" option requires Angular version 22.2.0 or greater. You are currently using version ${angularVersion}.`);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
50
55
|
}
|
|
51
56
|
/**
|
|
52
57
|
* The Angular CLI unit-test builder only accepts the `@angular/build:application`
|
|
@@ -13,6 +13,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
13
13
|
const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
|
|
14
14
|
const component_stylesheets_1 = require("ng-packagr/src/lib/styles/component-stylesheets");
|
|
15
15
|
const postcss_configuration_1 = require("ng-packagr/src/lib/styles/postcss-configuration");
|
|
16
|
+
const semver_1 = require("semver");
|
|
16
17
|
const ng_packagr_version_1 = require("./ng-packagr-version");
|
|
17
18
|
var CssUrl;
|
|
18
19
|
(function (CssUrl) {
|
|
@@ -20,7 +21,13 @@ var CssUrl;
|
|
|
20
21
|
CssUrl["none"] = "none";
|
|
21
22
|
})(CssUrl || (exports.CssUrl = CssUrl = {}));
|
|
22
23
|
function getStylesheetProcessor() {
|
|
23
|
-
const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
|
24
|
+
const { major: ngPackagrMajorVersion, version: ngPackagrVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
|
|
25
|
+
// ng-packagr >= 22.2 resolves the style config once per package, older
|
|
26
|
+
// versions resolve it for each entry point
|
|
27
|
+
const resolvePerPackage = !(0, semver_1.lt)(ngPackagrVersion, '22.2.0');
|
|
28
|
+
// ng-packagr calls this factory once per build, so a later build in the
|
|
29
|
+
// same process reads config changes
|
|
30
|
+
const styleConfigCache = new Map();
|
|
24
31
|
class StylesheetProcessor extends component_stylesheets_1.ComponentStylesheetBundler {
|
|
25
32
|
constructor(projectBasePath, basePath, cssUrl, includePaths, sass, cacheDirectory, watch) {
|
|
26
33
|
if (ngPackagrMajorVersion === 22) {
|
|
@@ -34,21 +41,17 @@ function getStylesheetProcessor() {
|
|
|
34
41
|
path: require.resolve('ng-packagr/.browserslistrc'),
|
|
35
42
|
});
|
|
36
43
|
}
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
// (nx-specific): we support loading the TailwindCSS config from the root of the workspace
|
|
41
|
-
searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath, devkit_1.workspaceRoot]);
|
|
44
|
+
const { postcssConfiguration, tailwindConfiguration, target } = resolvePerPackage
|
|
45
|
+
? getPackageStyleConfig(styleConfigCache, projectBasePath)
|
|
46
|
+
: resolveStyleConfig(projectBasePath, basePath);
|
|
42
47
|
super({
|
|
43
48
|
cacheDirectory: cacheDirectory,
|
|
44
49
|
postcssConfiguration: postcssConfiguration,
|
|
45
|
-
tailwindConfiguration:
|
|
46
|
-
? undefined
|
|
47
|
-
: (0, postcss_configuration_1.getTailwindConfig)(searchDirs, projectBasePath),
|
|
50
|
+
tailwindConfiguration: tailwindConfiguration,
|
|
48
51
|
sass: sass,
|
|
49
52
|
workspaceRoot: projectBasePath,
|
|
50
53
|
cssUrl: cssUrl,
|
|
51
|
-
target:
|
|
54
|
+
target: target,
|
|
52
55
|
includePaths: includePaths,
|
|
53
56
|
}, 'css', watch);
|
|
54
57
|
this.projectBasePath = projectBasePath;
|
|
@@ -65,6 +68,28 @@ function getStylesheetProcessor() {
|
|
|
65
68
|
}
|
|
66
69
|
return StylesheetProcessor;
|
|
67
70
|
}
|
|
71
|
+
function getPackageStyleConfig(styleConfigCache, projectBasePath) {
|
|
72
|
+
let config = styleConfigCache.get(projectBasePath);
|
|
73
|
+
if (!config) {
|
|
74
|
+
config = resolveStyleConfig(projectBasePath, projectBasePath);
|
|
75
|
+
styleConfigCache.set(projectBasePath, config);
|
|
76
|
+
}
|
|
77
|
+
return config;
|
|
78
|
+
}
|
|
79
|
+
function resolveStyleConfig(projectBasePath, browserslistPath) {
|
|
80
|
+
const browserslistData = (0, browserslist_1.default)(undefined, { path: browserslistPath });
|
|
81
|
+
let searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath]);
|
|
82
|
+
const postcssConfiguration = (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirs);
|
|
83
|
+
// (nx-specific): we support loading the TailwindCSS config from the root of the workspace
|
|
84
|
+
searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath, devkit_1.workspaceRoot]);
|
|
85
|
+
return {
|
|
86
|
+
postcssConfiguration,
|
|
87
|
+
tailwindConfiguration: postcssConfiguration
|
|
88
|
+
? undefined
|
|
89
|
+
: (0, postcss_configuration_1.getTailwindConfig)(searchDirs, projectBasePath),
|
|
90
|
+
target: transformSupportedBrowsersToTargets(browserslistData),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
68
93
|
function transformSupportedBrowsersToTargets(supportedBrowsers) {
|
|
69
94
|
const transformed = [];
|
|
70
95
|
// https://esbuild.github.io/api/#target
|
|
@@ -2,8 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
5
6
|
const acknowledge_build_scripts_1 = require("../../generators/utils/acknowledge-build-scripts");
|
|
6
|
-
const
|
|
7
|
+
const version_utils_1 = require("../../generators/utils/version-utils");
|
|
7
8
|
// The `@nx/angular:application` and `@nx/angular:unit-test` executors import
|
|
8
9
|
// `@angular/build` directly to run the Angular builders, and any
|
|
9
10
|
// `@angular/build:*` executor is provided by that package; it is a required
|
|
@@ -12,7 +13,8 @@ const versions_1 = require("../../utils/versions");
|
|
|
12
13
|
// `@angular-devkit/build-angular`, which isn't reliable (it can be absent from
|
|
13
14
|
// node_modules, e.g. under Yarn Berry), so `require.resolve('@angular/build')`
|
|
14
15
|
// fails and the build breaks. Add it as a direct dependency when an executor
|
|
15
|
-
// needs it
|
|
16
|
+
// needs it. Match the version `@angular-devkit/build-angular` pins it to,
|
|
17
|
+
// because a newer `@angular/build` breaks peers such as `@angular/ssr`.
|
|
16
18
|
const angularBuildExecutors = [
|
|
17
19
|
'@nx/angular:application',
|
|
18
20
|
'@nx/angular:unit-test',
|
|
@@ -51,5 +53,7 @@ async function default_1(tree) {
|
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
55
|
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
54
|
-
|
|
56
|
+
const version = (0, internal_1.getInstalledPackageVersionFromTree)(tree, '@angular-devkit/build-angular') ??
|
|
57
|
+
(0, version_utils_1.getInstalledAngularVersion)(tree);
|
|
58
|
+
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/build': `~${version}` }, undefined, true);
|
|
55
59
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#### Add `@angular/build` When Used by an Executor
|
|
2
2
|
|
|
3
|
-
The `@nx/angular:application` and `@nx/angular:unit-test` executors load the Angular builders by importing `@angular/build` directly, and any `@angular/build:*` executor is provided by that package, so `@angular/build` is a required runtime dependency for workspaces using those targets. Nothing declares it as a direct dependency, though: it has only ever been available transitively as a dependency of `@angular-devkit/build-angular`. That is not reliable (for example, under Yarn Berry it can be missing from `node_modules` even when `@angular-devkit/build-angular` is installed), and when `@angular/build` cannot be resolved the build fails with an error like `The "@angular/build" package is required by "@nx/angular:application" but is not installed`. This migration adds `@angular/build` to `devDependencies` when a project uses one of those executors and it is not already installed,
|
|
3
|
+
The `@nx/angular:application` and `@nx/angular:unit-test` executors load the Angular builders by importing `@angular/build` directly, and any `@angular/build:*` executor is provided by that package, so `@angular/build` is a required runtime dependency for workspaces using those targets. Nothing declares it as a direct dependency, though: it has only ever been available transitively as a dependency of `@angular-devkit/build-angular`. That is not reliable (for example, under Yarn Berry it can be missing from `node_modules` even when `@angular-devkit/build-angular` is installed), and when `@angular/build` cannot be resolved the build fails with an error like `The "@angular/build" package is required by "@nx/angular:application" but is not installed`. This migration adds `@angular/build` to `devDependencies` when a project uses one of those executors and it is not already installed. It uses the installed `@angular-devkit/build-angular` version, which pins `@angular/build` to the same version. When `@angular-devkit/build-angular` isn't installed, it uses the `@angular/core` version declared in `package.json`, limited to that minor (`^22.1.0` becomes `~22.1.0`). An existing version is preserved.
|
|
4
4
|
|
|
5
5
|
Executor usage is detected on any target using `@nx/angular:application`, `@nx/angular:unit-test`, or an `@angular/build:*` executor. Targets that inherit their executor from an `nx.json` `targetDefaults` entry are detected too.
|
|
6
6
|
|
|
@@ -32,14 +32,21 @@ async function default_1(tree) {
|
|
|
32
32
|
ts.isIdentifier(node.expression) &&
|
|
33
33
|
(node.expression.text === 'AngularNodeAppEngine' ||
|
|
34
34
|
node.expression.text === 'AngularAppEngine')) {
|
|
35
|
-
if (!node.arguments
|
|
35
|
+
if (!node.arguments) {
|
|
36
|
+
// `new AngularAppEngine` without parentheses has no argument list.
|
|
37
|
+
recorder ??= new file_change_recorder_1.FileChangeRecorder(tree, path);
|
|
38
|
+
recorder.insertRight(node.end, `({\n ${TODO_COMMENT}\n ${TRUST_PROXY_HEADERS}\n})`);
|
|
39
|
+
}
|
|
40
|
+
else if (node.arguments.length === 0) {
|
|
36
41
|
// No options object: insert one before the closing parenthesis.
|
|
37
42
|
recorder ??= new file_change_recorder_1.FileChangeRecorder(tree, path);
|
|
38
43
|
recorder.insertRight(node.end - 1, `{\n ${TODO_COMMENT}\n ${TRUST_PROXY_HEADERS}\n}`);
|
|
39
44
|
}
|
|
40
45
|
else if (ts.isObjectLiteralExpression(node.arguments[0])) {
|
|
41
46
|
const optionsArg = node.arguments[0];
|
|
42
|
-
|
|
47
|
+
// Any member kind counts (shorthand, method, accessor): adding the
|
|
48
|
+
// property next to one would duplicate the key.
|
|
49
|
+
const hasTrustProxyHeaders = optionsArg.properties.some((prop) => prop.name &&
|
|
43
50
|
(ts.isIdentifier(prop.name) || ts.isStringLiteral(prop.name)) &&
|
|
44
51
|
prop.name.text === 'trustProxyHeaders');
|
|
45
52
|
if (!hasTrustProxyHeaders) {
|
|
@@ -0,0 +1,332 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.default = upgradeToAngular222;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
const internal_2 = require("@nx/js/internal");
|
|
7
|
+
const path_1 = require("path");
|
|
8
|
+
// Keep these versions pinned; versions.ts advances to later Angular versions.
|
|
9
|
+
const ANGULAR_22_2_VERSIONS = {
|
|
10
|
+
'@angular/core': '~22.2.0',
|
|
11
|
+
'@angular/animations': '~22.2.0',
|
|
12
|
+
'@angular/common': '~22.2.0',
|
|
13
|
+
'@angular/compiler': '~22.2.0',
|
|
14
|
+
'@angular/compiler-cli': '~22.2.0',
|
|
15
|
+
'@angular/elements': '~22.2.0',
|
|
16
|
+
'@angular/forms': '~22.2.0',
|
|
17
|
+
'@angular/language-service': '~22.2.0',
|
|
18
|
+
'@angular/localize': '~22.2.0',
|
|
19
|
+
'@angular/platform-browser': '~22.2.0',
|
|
20
|
+
'@angular/platform-browser-dynamic': '~22.2.0',
|
|
21
|
+
'@angular/platform-server': '~22.2.0',
|
|
22
|
+
'@angular/router': '~22.2.0',
|
|
23
|
+
'@angular/service-worker': '~22.2.0',
|
|
24
|
+
'@angular/upgrade': '~22.2.0',
|
|
25
|
+
'@angular/cli': '~22.2.0',
|
|
26
|
+
'@angular/build': '~22.2.0',
|
|
27
|
+
'@angular/pwa': '~22.2.0',
|
|
28
|
+
'@angular/ssr': '~22.2.0',
|
|
29
|
+
'@angular-devkit/build-angular': '~22.2.0',
|
|
30
|
+
'@angular-devkit/core': '~22.2.0',
|
|
31
|
+
'@angular-devkit/schematics': '~22.2.0',
|
|
32
|
+
'@angular-devkit/architect': '~0.2202.0',
|
|
33
|
+
'@angular-devkit/build-webpack': '~0.2202.0',
|
|
34
|
+
'@schematics/angular': '~22.2.0',
|
|
35
|
+
'@angular/aria': '~22.2.0',
|
|
36
|
+
'@angular/cdk': '~22.2.0',
|
|
37
|
+
'@angular/cdk-experimental': '~22.2.0',
|
|
38
|
+
'@angular/google-maps': '~22.2.0',
|
|
39
|
+
'@angular/material': '~22.2.0',
|
|
40
|
+
'@angular/material-date-fns-adapter': '~22.2.0',
|
|
41
|
+
'@angular/material-experimental': '~22.2.0',
|
|
42
|
+
'@angular/material-luxon-adapter': '~22.2.0',
|
|
43
|
+
'@angular/material-moment-adapter': '~22.2.0',
|
|
44
|
+
'ng-packagr': '~22.2.0',
|
|
45
|
+
'zone.js': '~0.16.2',
|
|
46
|
+
};
|
|
47
|
+
const COMPONENT_TESTING_SPECIFIER = /^(@?cypress\/angular|@nx\/angular\/plugins\/component-testing$)/;
|
|
48
|
+
const MODULE_FEDERATION_SPECIFIER = /^(@module-federation\/(enhanced|node)|@nx\/module-federation|@nx\/angular\/(mf|module-federation))(\/|$)/;
|
|
49
|
+
const MARKER_TEXT = /cypress\/angular|module-federation|@nx\/angular\/(mf|plugins\/component-testing)/;
|
|
50
|
+
const NX_WEBPACK_EXECUTORS = new Set([
|
|
51
|
+
'@nx/angular:webpack-browser',
|
|
52
|
+
'@nx/angular:webpack-server',
|
|
53
|
+
'@nx/angular:module-federation-dev-server',
|
|
54
|
+
'@nx/angular:module-federation-dev-ssr',
|
|
55
|
+
]);
|
|
56
|
+
const WEBPACK_CONFIG_FILE = /^(webpack[\w.-]*|module-federation\.config)\.[cm]?[jt]s$/;
|
|
57
|
+
const RESOLVE_EXTENSIONS = ['.ts', '.js', '.mjs', '.cjs', '.mts', '.cts'];
|
|
58
|
+
const DEPENDENCY_FIELDS = [
|
|
59
|
+
'dependencies',
|
|
60
|
+
'devDependencies',
|
|
61
|
+
'optionalDependencies',
|
|
62
|
+
'peerDependencies',
|
|
63
|
+
];
|
|
64
|
+
let ts;
|
|
65
|
+
async function upgradeToAngular222(tree) {
|
|
66
|
+
const scan = scanWorkspace(tree);
|
|
67
|
+
const unresolved = [];
|
|
68
|
+
const moduleFederationConfigs = findModuleFederationConfigs(tree, scan, unresolved);
|
|
69
|
+
const reasons = [];
|
|
70
|
+
if (scan.componentTestingFiles.length > 0) {
|
|
71
|
+
reasons.push(`Cypress component testing (${scan.componentTestingFiles.join(', ')}) fails with the webpack-dev-server 6 that Angular 22.2 installs (https://github.com/cypress-io/cypress/issues/34259)`);
|
|
72
|
+
}
|
|
73
|
+
if (moduleFederationConfigs.length > 0) {
|
|
74
|
+
reasons.push(`Module Federation builds (${moduleFederationConfigs.join(', ')}) fail with the webpack 5.111 that Angular 22.2 installs (https://github.com/module-federation/core/issues/5077)`);
|
|
75
|
+
}
|
|
76
|
+
else if (unresolved.length > 0 && scan.moduleFederationFiles.length > 0) {
|
|
77
|
+
reasons.push(`Module Federation fails with the webpack 5.111 that Angular 22.2 installs (https://github.com/module-federation/core/issues/5077). ${scan.moduleFederationFiles.join(', ')} import it, and the migration could not tell whether an Angular webpack build does: ${unresolved.join('; ')}`);
|
|
78
|
+
}
|
|
79
|
+
if (reasons.length > 0) {
|
|
80
|
+
const nextSteps = [
|
|
81
|
+
`Kept Angular 22.1. ${reasons.join('. ')}. A later Nx migration updates Angular once these issues are fixed. To update before then, move the Angular packages to 22.2 by hand and work around the issues.`,
|
|
82
|
+
];
|
|
83
|
+
return { nextSteps, agentContext: nextSteps };
|
|
84
|
+
}
|
|
85
|
+
const declared = (0, devkit_1.readJson)(tree, 'package.json');
|
|
86
|
+
const { '@angular/core': core, ...others } = ANGULAR_22_2_VERSIONS;
|
|
87
|
+
// `@angular/core` goes to `dependencies` when the root does not declare it.
|
|
88
|
+
(0, devkit_1.addDependenciesToPackageJson)(tree, { '@angular/core': core }, Object.fromEntries(Object.entries(others).filter(([name]) => declared.dependencies?.[name] || declared.devDependencies?.[name])));
|
|
89
|
+
}
|
|
90
|
+
function scanWorkspace(tree) {
|
|
91
|
+
const scan = {
|
|
92
|
+
angularJsonPaths: [],
|
|
93
|
+
workspacePackages: new Set(),
|
|
94
|
+
declaredDependencies: new Map(),
|
|
95
|
+
componentTestingFiles: [],
|
|
96
|
+
moduleFederationFiles: [],
|
|
97
|
+
};
|
|
98
|
+
// Shared support libraries and config helpers can hold the imports, so the
|
|
99
|
+
// whole workspace is scanned.
|
|
100
|
+
(0, devkit_1.visitNotIgnoredFiles)(tree, '.', (filePath) => {
|
|
101
|
+
const fileName = (0, path_1.basename)(filePath);
|
|
102
|
+
if (fileName === 'angular.json') {
|
|
103
|
+
scan.angularJsonPaths.push(filePath);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
if (fileName === 'package.json') {
|
|
107
|
+
// Installs fail on a workspace package.json that doesn't parse, so
|
|
108
|
+
// skipping one loses no installed or linked package.
|
|
109
|
+
try {
|
|
110
|
+
const packageJson = (0, devkit_1.readJson)(tree, filePath);
|
|
111
|
+
if (typeof packageJson.name === 'string') {
|
|
112
|
+
scan.workspacePackages.add(packageJson.name);
|
|
113
|
+
}
|
|
114
|
+
scan.declaredDependencies.set((0, path_1.dirname)(filePath), new Set(DEPENDENCY_FIELDS.flatMap((field) => Object.keys(packageJson[field] ?? {}))));
|
|
115
|
+
}
|
|
116
|
+
catch { }
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
if (!/\.[cm]?[jt]sx?$/.test(filePath)) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const content = tree.read(filePath, 'utf-8');
|
|
123
|
+
if (!MARKER_TEXT.test(content)) {
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
const { specifiers } = readModuleSpecifiers(filePath, content);
|
|
127
|
+
if (specifiers.some((s) => COMPONENT_TESTING_SPECIFIER.test(s))) {
|
|
128
|
+
scan.componentTestingFiles.push(filePath);
|
|
129
|
+
}
|
|
130
|
+
if (specifiers.some((s) => MODULE_FEDERATION_SPECIFIER.test(s))) {
|
|
131
|
+
scan.moduleFederationFiles.push(filePath);
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
return scan;
|
|
135
|
+
}
|
|
136
|
+
// The webpack config files of Angular webpack targets that import Module
|
|
137
|
+
// Federation, following relative imports. An import or config the migration
|
|
138
|
+
// cannot read is recorded in `unresolved`.
|
|
139
|
+
function findModuleFederationConfigs(tree, scan, unresolved) {
|
|
140
|
+
const configs = new Set();
|
|
141
|
+
const visited = new Set();
|
|
142
|
+
const visit = (fromDir, specifier, importer) => {
|
|
143
|
+
if (MODULE_FEDERATION_SPECIFIER.test(specifier)) {
|
|
144
|
+
configs.add(importer);
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (specifier.startsWith('.')) {
|
|
148
|
+
const filePath = resolveFile(tree, (0, devkit_1.joinPathFragments)(fromDir, specifier));
|
|
149
|
+
if (!filePath) {
|
|
150
|
+
unresolved.push(`${importer} loads "${specifier}", which is missing`);
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
if (visited.has(filePath)) {
|
|
154
|
+
return;
|
|
155
|
+
}
|
|
156
|
+
visited.add(filePath);
|
|
157
|
+
const { specifiers, computed } = readModuleSpecifiers(filePath, tree.read(filePath, 'utf-8'));
|
|
158
|
+
if (computed) {
|
|
159
|
+
unresolved.push(`${filePath} has a computed require or import`);
|
|
160
|
+
}
|
|
161
|
+
for (const s of specifiers) {
|
|
162
|
+
visit((0, path_1.dirname)(filePath), s, filePath);
|
|
163
|
+
}
|
|
164
|
+
return;
|
|
165
|
+
}
|
|
166
|
+
if (!(0, internal_1.isBuiltinModuleImport)(specifier) &&
|
|
167
|
+
!isInstalledPackage(tree, fromDir, specifier, scan)) {
|
|
168
|
+
unresolved.push(`${importer} loads "${specifier}", which is not an installed package`);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
const projectRoots = new Set();
|
|
172
|
+
const visitTarget = (executor, target, workspaceRoot, projectRoot, label) => {
|
|
173
|
+
if (!isAngularWebpackExecutor(executor)) {
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
projectRoots.add(projectRoot);
|
|
177
|
+
for (const options of [
|
|
178
|
+
target.options,
|
|
179
|
+
...Object.values(target.configurations ?? {}),
|
|
180
|
+
]) {
|
|
181
|
+
for (const specifier of getWebpackConfigSpecifiers(executor, options ?? {}, projectRoot)) {
|
|
182
|
+
visit(workspaceRoot, specifier, label);
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
const targetDefaults = (0, devkit_1.readNxJson)(tree)?.targetDefaults;
|
|
187
|
+
for (const [projectName, project] of (0, devkit_1.getProjects)(tree)) {
|
|
188
|
+
for (const [targetName, target] of Object.entries(project.targets ?? {})) {
|
|
189
|
+
const defaults = (0, internal_1.readTargetDefaultsForTarget)(targetName, targetDefaults, target.executor, {
|
|
190
|
+
projectName,
|
|
191
|
+
projectNode: {
|
|
192
|
+
name: projectName,
|
|
193
|
+
type: project.projectType === 'application' ? 'app' : 'lib',
|
|
194
|
+
data: project,
|
|
195
|
+
},
|
|
196
|
+
});
|
|
197
|
+
const merged = defaults
|
|
198
|
+
? (0, internal_1.mergeTargetConfigurations)(target, defaults)
|
|
199
|
+
: target;
|
|
200
|
+
visitTarget(merged.executor, merged, '.', project.root, `${projectName}:${targetName}`);
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
for (const angularJsonPath of scan.angularJsonPaths) {
|
|
204
|
+
let angularJson;
|
|
205
|
+
try {
|
|
206
|
+
angularJson = (0, devkit_1.readJson)(tree, angularJsonPath);
|
|
207
|
+
}
|
|
208
|
+
catch {
|
|
209
|
+
unresolved.push(`${angularJsonPath} could not be parsed`);
|
|
210
|
+
continue;
|
|
211
|
+
}
|
|
212
|
+
const workspaceRoot = (0, path_1.dirname)(angularJsonPath);
|
|
213
|
+
for (const [projectName, project] of Object.entries(angularJson.projects ?? {})) {
|
|
214
|
+
const projectRoot = (0, devkit_1.joinPathFragments)(workspaceRoot, project.root ?? '');
|
|
215
|
+
for (const [targetName, target] of Object.entries(project.architect ?? project.targets ?? {})) {
|
|
216
|
+
visitTarget(target.builder, target, workspaceRoot, projectRoot, `${angularJsonPath} ${projectName}:${targetName}`);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
// Configs a target does not reference directly, such as a remote's
|
|
221
|
+
// module-federation.config, are found by name.
|
|
222
|
+
for (const projectRoot of projectRoots) {
|
|
223
|
+
for (const child of tree.children(projectRoot)) {
|
|
224
|
+
if (WEBPACK_CONFIG_FILE.test(child)) {
|
|
225
|
+
visit(projectRoot, `./${child}`, projectRoot);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
return [...configs];
|
|
230
|
+
}
|
|
231
|
+
function isAngularWebpackExecutor(executor) {
|
|
232
|
+
return (!!executor &&
|
|
233
|
+
(NX_WEBPACK_EXECUTORS.has(executor) ||
|
|
234
|
+
executor.startsWith('@angular-builders/custom-webpack:') ||
|
|
235
|
+
executor.startsWith('ngx-build-plus:')));
|
|
236
|
+
}
|
|
237
|
+
// The webpack config modules a target loads, as specifiers relative to the
|
|
238
|
+
// workspace root.
|
|
239
|
+
function getWebpackConfigSpecifiers(executor, options, projectRoot) {
|
|
240
|
+
const toSpecifier = (path) => `./${path
|
|
241
|
+
.replace(/^\{workspaceRoot\}\/?/, '')
|
|
242
|
+
.replace(/\{projectRoot\}/g, projectRoot)}`;
|
|
243
|
+
const { customWebpackConfig, extraWebpackConfig, plugin } = options;
|
|
244
|
+
const specifiers = [];
|
|
245
|
+
if (typeof customWebpackConfig?.path === 'string') {
|
|
246
|
+
specifiers.push(toSpecifier(customWebpackConfig.path));
|
|
247
|
+
}
|
|
248
|
+
else if (customWebpackConfig &&
|
|
249
|
+
executor.startsWith('@angular-builders/custom-webpack:')) {
|
|
250
|
+
specifiers.push('./webpack.config.js');
|
|
251
|
+
}
|
|
252
|
+
if (typeof extraWebpackConfig === 'string') {
|
|
253
|
+
specifiers.push(toSpecifier(extraWebpackConfig));
|
|
254
|
+
}
|
|
255
|
+
// ngx-build-plus loads a `~` plugin path from the workspace root and
|
|
256
|
+
// anything else as a module.
|
|
257
|
+
if (typeof plugin === 'string' && plugin) {
|
|
258
|
+
specifiers.push(plugin.startsWith('~') ? toSpecifier(plugin.slice(1)) : plugin);
|
|
259
|
+
}
|
|
260
|
+
return specifiers;
|
|
261
|
+
}
|
|
262
|
+
function resolveFile(tree, path) {
|
|
263
|
+
return [
|
|
264
|
+
path,
|
|
265
|
+
...RESOLVE_EXTENSIONS.map((extension) => `${path}${extension}`),
|
|
266
|
+
...RESOLVE_EXTENSIONS.map((extension) => (0, devkit_1.joinPathFragments)(path, `index${extension}`)),
|
|
267
|
+
].find((candidate) => tree.isFile(candidate));
|
|
268
|
+
}
|
|
269
|
+
// A package installed in a node_modules folder the importer resolves from, or
|
|
270
|
+
// declared by the importer's nearest package.json for Yarn PnP installs, which
|
|
271
|
+
// have no node_modules. A workspace package or path alias points back into the
|
|
272
|
+
// workspace, so it is not one.
|
|
273
|
+
function isInstalledPackage(tree, fromDir, specifier, scan) {
|
|
274
|
+
const segments = specifier.split('/');
|
|
275
|
+
const packageName = segments
|
|
276
|
+
.slice(0, specifier.startsWith('@') ? 2 : 1)
|
|
277
|
+
.join('/');
|
|
278
|
+
if (scan.workspacePackages.has(packageName)) {
|
|
279
|
+
return false;
|
|
280
|
+
}
|
|
281
|
+
let nearestPackageJsonChecked = false;
|
|
282
|
+
for (let dir = fromDir;; dir = (0, path_1.dirname)(dir)) {
|
|
283
|
+
if (tree.exists((0, devkit_1.joinPathFragments)(dir, 'node_modules', packageName, 'package.json'))) {
|
|
284
|
+
return true;
|
|
285
|
+
}
|
|
286
|
+
const declared = scan.declaredDependencies.get(dir);
|
|
287
|
+
if (declared && !nearestPackageJsonChecked) {
|
|
288
|
+
nearestPackageJsonChecked = true;
|
|
289
|
+
if (declared.has(packageName)) {
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (dir === '.') {
|
|
294
|
+
return false;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
// Specifiers of `import`/`export ... from`, `import x = require()`,
|
|
299
|
+
// `import()` and `require()`. `computed` is set when an `import()` or
|
|
300
|
+
// `require()` takes a value other than a string literal.
|
|
301
|
+
function readModuleSpecifiers(filePath, content) {
|
|
302
|
+
ts ??= (0, internal_2.ensureTypescript)();
|
|
303
|
+
const sourceFile = ts.createSourceFile(filePath, content, ts.ScriptTarget.Latest, true);
|
|
304
|
+
const specifiers = [];
|
|
305
|
+
let computed = false;
|
|
306
|
+
const visit = (node) => {
|
|
307
|
+
if ((ts.isImportDeclaration(node) || ts.isExportDeclaration(node)) &&
|
|
308
|
+
node.moduleSpecifier &&
|
|
309
|
+
ts.isStringLiteral(node.moduleSpecifier)) {
|
|
310
|
+
specifiers.push(node.moduleSpecifier.text);
|
|
311
|
+
}
|
|
312
|
+
else if (ts.isExternalModuleReference(node) &&
|
|
313
|
+
ts.isStringLiteral(node.expression)) {
|
|
314
|
+
specifiers.push(node.expression.text);
|
|
315
|
+
}
|
|
316
|
+
else if (ts.isCallExpression(node) &&
|
|
317
|
+
(node.expression.kind === ts.SyntaxKind.ImportKeyword ||
|
|
318
|
+
(ts.isIdentifier(node.expression) &&
|
|
319
|
+
node.expression.text === 'require'))) {
|
|
320
|
+
const [argument] = node.arguments;
|
|
321
|
+
if (argument && ts.isStringLiteralLike(argument)) {
|
|
322
|
+
specifiers.push(argument.text);
|
|
323
|
+
}
|
|
324
|
+
else {
|
|
325
|
+
computed = true;
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
ts.forEachChild(node, visit);
|
|
329
|
+
};
|
|
330
|
+
visit(sourceFile);
|
|
331
|
+
return { specifiers, computed };
|
|
332
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#### Upgrade Angular to 22.2
|
|
2
|
+
|
|
3
|
+
Updates the Angular packages of an Angular 22.1 workspace to 22.2, unless the workspace uses Cypress component testing or webpack Module Federation in an Angular project.
|
|
4
|
+
|
|
5
|
+
Angular 22.2 installs webpack 5.111 and webpack-dev-server 6 through `@angular-devkit/build-angular`. Cypress rejects that webpack-dev-server when it starts Angular component tests ([cypress-io/cypress#34259](https://github.com/cypress-io/cypress/issues/34259)). Module Federation builds fail on that webpack ([module-federation/core#5077](https://github.com/module-federation/core/issues/5077)). The migration keeps the workspace on Angular 22.1 and reports why when it finds either of these:
|
|
6
|
+
|
|
7
|
+
- An import from `cypress/angular`, `@cypress/angular` or one of their variants, or from `@nx/angular/plugins/component-testing`, in any file of the workspace.
|
|
8
|
+
- An import from `@module-federation/enhanced`, `@module-federation/node`, `@nx/module-federation`, `@nx/angular/mf` or `@nx/angular/module-federation` in the webpack config of an Angular project.
|
|
9
|
+
|
|
10
|
+
An Angular project is one with an `@nx/angular` webpack or Module Federation executor, an `@angular-builders/custom-webpack` builder or an `ngx-build-plus` builder. Targets are read from `project.json`, including executors inherited from `targetDefaults`, and from every `angular.json`. The migration reads the webpack configs these targets reference, the `webpack*` and `module-federation.config` files in the project root, and every file they import through a relative path. When a config imports something the migration cannot follow, such as a path alias or a workspace package, a Module Federation import anywhere in the workspace also keeps Angular 22.1.
|
|
11
|
+
|
|
12
|
+
Rspack builds, Native Federation and `@angular-architects/module-federation` don't hold the update. The last one uses the container plugin built into webpack, which works with webpack 5.111.
|
|
13
|
+
|
|
14
|
+
The migration updates only the packages that the root `package.json` declares, and a catalog reference is updated in the catalog. `@angular/core` is added to `dependencies` when the root doesn't declare it. A later Nx migration updates a workspace kept on Angular 22.1 once the upstream issues are fixed.
|
|
15
|
+
|
|
16
|
+
#### Examples
|
|
17
|
+
|
|
18
|
+
##### Before
|
|
19
|
+
|
|
20
|
+
```jsonc title="package.json"
|
|
21
|
+
{
|
|
22
|
+
"dependencies": {
|
|
23
|
+
"@angular/common": "~22.1.0",
|
|
24
|
+
"@angular/core": "~22.1.0",
|
|
25
|
+
},
|
|
26
|
+
"devDependencies": {
|
|
27
|
+
"@angular/cli": "~22.1.0",
|
|
28
|
+
"@angular-devkit/build-angular": "~22.1.0",
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
##### After
|
|
34
|
+
|
|
35
|
+
```jsonc title="package.json"
|
|
36
|
+
{
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@angular/common": "~22.2.0",
|
|
39
|
+
"@angular/core": "~22.2.0",
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@angular/cli": "~22.2.0",
|
|
43
|
+
"@angular-devkit/build-angular": "~22.2.0",
|
|
44
|
+
},
|
|
45
|
+
}
|
|
46
|
+
```
|
|
@@ -12,6 +12,16 @@ const minCypressVersion = '15.20.1';
|
|
|
12
12
|
*/
|
|
13
13
|
function assertCypressComponentTestingSupport(tree) {
|
|
14
14
|
const angularVersion = (0, internal_1.getResolvedPackageVersion)(tree, '@angular/core');
|
|
15
|
+
// Cypress loads webpack-dev-server from build-angular, so its version decides
|
|
16
|
+
// this check. Angular core stands in when build-angular isn't declared.
|
|
17
|
+
const buildAngularVersion = (0, internal_1.getResolvedPackageVersion)(tree, '@angular-devkit/build-angular') ??
|
|
18
|
+
angularVersion;
|
|
19
|
+
if (buildAngularVersion &&
|
|
20
|
+
(0, semver_1.gte)((0, semver_1.coerce)(buildAngularVersion)?.version ?? buildAngularVersion, '22.2.0')) {
|
|
21
|
+
throw new Error(`Cypress Component Testing doesn't support Angular 22.2 and higher yet. ` +
|
|
22
|
+
`Cypress rejects the webpack-dev-server 6 that @angular-devkit/build-angular 22.2 and higher installs. ` +
|
|
23
|
+
`See https://github.com/cypress-io/cypress/issues/34259.`);
|
|
24
|
+
}
|
|
15
25
|
if (!angularVersion) {
|
|
16
26
|
return;
|
|
17
27
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const nxVersion: any;
|
|
2
|
-
export declare const angularVersion = "~22.
|
|
3
|
-
export declare const angularDevkitVersion = "~22.
|
|
4
|
-
export declare const ngPackagrVersion = "~22.
|
|
2
|
+
export declare const angularVersion = "~22.2.0";
|
|
3
|
+
export declare const angularDevkitVersion = "~22.2.0";
|
|
4
|
+
export declare const ngPackagrVersion = "~22.2.0";
|
|
5
5
|
export declare const ngrxVersion = "^22.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
7
|
export declare const zoneJsVersion = "~0.16.2";
|
|
@@ -10,7 +10,7 @@ export declare const expressVersion = "^4.21.2";
|
|
|
10
10
|
export declare const typesExpressVersion = "^4.17.21";
|
|
11
11
|
export declare const browserSyncVersion = "^3.0.0";
|
|
12
12
|
export declare const webpackMergeVersion = "^5.8.0";
|
|
13
|
-
export declare const angularEslintVersion = "^22.
|
|
13
|
+
export declare const angularEslintVersion = "^22.5.0";
|
|
14
14
|
export declare const typescriptEslintVersion = "^8.40.0";
|
|
15
15
|
export declare const postcssVersion = "^8.4.5";
|
|
16
16
|
export declare const postcssUrlVersion = "~10.1.3";
|
|
@@ -3,9 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.jsoncEslintParserVersion = exports.oxcProjectRuntimeVersion = exports.jsdomVersion = exports.vitestVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.lessVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.webpackMergeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.tsLibVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
|
|
4
4
|
const path_1 = require("path");
|
|
5
5
|
exports.nxVersion = require((0, path_1.join)('@nx/angular', 'package.json')).version;
|
|
6
|
-
exports.angularVersion = '~22.
|
|
7
|
-
exports.angularDevkitVersion = '~22.
|
|
8
|
-
exports.ngPackagrVersion = '~22.
|
|
6
|
+
exports.angularVersion = '~22.2.0';
|
|
7
|
+
exports.angularDevkitVersion = '~22.2.0';
|
|
8
|
+
exports.ngPackagrVersion = '~22.2.0';
|
|
9
9
|
exports.ngrxVersion = '^22.0.0';
|
|
10
10
|
exports.rxjsVersion = '~7.8.0';
|
|
11
11
|
exports.zoneJsVersion = '~0.16.2';
|
|
@@ -14,7 +14,7 @@ exports.expressVersion = '^4.21.2';
|
|
|
14
14
|
exports.typesExpressVersion = '^4.17.21';
|
|
15
15
|
exports.browserSyncVersion = '^3.0.0';
|
|
16
16
|
exports.webpackMergeVersion = '^5.8.0';
|
|
17
|
-
exports.angularEslintVersion = '^22.
|
|
17
|
+
exports.angularEslintVersion = '^22.5.0';
|
|
18
18
|
exports.typescriptEslintVersion = '^8.40.0';
|
|
19
19
|
exports.postcssVersion = '^8.4.5';
|
|
20
20
|
exports.postcssUrlVersion = '~10.1.3';
|
package/migrations.json
CHANGED
|
@@ -372,6 +372,16 @@
|
|
|
372
372
|
"description": "Add optional webpack, Module Federation, and Rspack packages when existing targets require them.",
|
|
373
373
|
"factory": "./dist/src/migrations/update-23-1-0/add-optional-webpack-packages",
|
|
374
374
|
"documentation": "./dist/src/migrations/update-23-1-0/add-optional-webpack-packages.md"
|
|
375
|
+
},
|
|
376
|
+
"update-24-0-0-upgrade-to-angular-22-2": {
|
|
377
|
+
"version": "24.0.0-beta.4",
|
|
378
|
+
"requires": {
|
|
379
|
+
"@angular/core": ">=22.1.0 <22.2.0"
|
|
380
|
+
},
|
|
381
|
+
"optionalUpdate": true,
|
|
382
|
+
"description": "Update the Angular packages to 22.2 unless the workspace uses Cypress component testing or webpack Module Federation in an Angular project, which break with the webpack-dev-server and webpack versions Angular 22.2 installs.",
|
|
383
|
+
"factory": "./dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2",
|
|
384
|
+
"documentation": "./dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.md"
|
|
375
385
|
}
|
|
376
386
|
},
|
|
377
387
|
"packageJsonUpdates": {
|
|
@@ -2323,6 +2333,93 @@
|
|
|
2323
2333
|
"alwaysAddToPackageJson": false
|
|
2324
2334
|
}
|
|
2325
2335
|
}
|
|
2336
|
+
},
|
|
2337
|
+
"24.0.0-angular-eslint": {
|
|
2338
|
+
"version": "24.0.0-beta.4",
|
|
2339
|
+
"requires": {
|
|
2340
|
+
"@angular/core": ">= 22.0.0 < 23.0.0",
|
|
2341
|
+
"typescript-eslint": "^8.0.0",
|
|
2342
|
+
"eslint": "^9.0.0 || ^10.0.0"
|
|
2343
|
+
},
|
|
2344
|
+
"packages": {
|
|
2345
|
+
"angular-eslint": {
|
|
2346
|
+
"version": "^22.5.0",
|
|
2347
|
+
"alwaysAddToPackageJson": false
|
|
2348
|
+
},
|
|
2349
|
+
"@angular-eslint/eslint-plugin": {
|
|
2350
|
+
"version": "^22.5.0",
|
|
2351
|
+
"alwaysAddToPackageJson": false
|
|
2352
|
+
},
|
|
2353
|
+
"@angular-eslint/eslint-plugin-template": {
|
|
2354
|
+
"version": "^22.5.0",
|
|
2355
|
+
"alwaysAddToPackageJson": false
|
|
2356
|
+
},
|
|
2357
|
+
"@angular-eslint/template-parser": {
|
|
2358
|
+
"version": "^22.5.0",
|
|
2359
|
+
"alwaysAddToPackageJson": false
|
|
2360
|
+
},
|
|
2361
|
+
"@angular-eslint/utils": {
|
|
2362
|
+
"version": "^22.5.0",
|
|
2363
|
+
"alwaysAddToPackageJson": false
|
|
2364
|
+
},
|
|
2365
|
+
"@angular-eslint/schematics": {
|
|
2366
|
+
"version": "^22.5.0",
|
|
2367
|
+
"alwaysAddToPackageJson": false
|
|
2368
|
+
},
|
|
2369
|
+
"@angular-eslint/test-utils": {
|
|
2370
|
+
"version": "^22.5.0",
|
|
2371
|
+
"alwaysAddToPackageJson": false
|
|
2372
|
+
},
|
|
2373
|
+
"@angular-eslint/builder": {
|
|
2374
|
+
"version": "^22.5.0",
|
|
2375
|
+
"alwaysAddToPackageJson": false
|
|
2376
|
+
},
|
|
2377
|
+
"@angular-eslint/bundled-angular-compiler": {
|
|
2378
|
+
"version": "^22.5.0",
|
|
2379
|
+
"alwaysAddToPackageJson": false
|
|
2380
|
+
}
|
|
2381
|
+
}
|
|
2382
|
+
},
|
|
2383
|
+
"24.0.0-@angular-eslint": {
|
|
2384
|
+
"version": "24.0.0-beta.4",
|
|
2385
|
+
"requires": {
|
|
2386
|
+
"@angular/core": ">= 22.0.0 < 23.0.0",
|
|
2387
|
+
"eslint": "^9.0.0 || ^10.0.0"
|
|
2388
|
+
},
|
|
2389
|
+
"packages": {
|
|
2390
|
+
"@angular-eslint/eslint-plugin": {
|
|
2391
|
+
"version": "^22.5.0",
|
|
2392
|
+
"alwaysAddToPackageJson": false
|
|
2393
|
+
},
|
|
2394
|
+
"@angular-eslint/eslint-plugin-template": {
|
|
2395
|
+
"version": "^22.5.0",
|
|
2396
|
+
"alwaysAddToPackageJson": false
|
|
2397
|
+
},
|
|
2398
|
+
"@angular-eslint/template-parser": {
|
|
2399
|
+
"version": "^22.5.0",
|
|
2400
|
+
"alwaysAddToPackageJson": false
|
|
2401
|
+
},
|
|
2402
|
+
"@angular-eslint/utils": {
|
|
2403
|
+
"version": "^22.5.0",
|
|
2404
|
+
"alwaysAddToPackageJson": false
|
|
2405
|
+
},
|
|
2406
|
+
"@angular-eslint/schematics": {
|
|
2407
|
+
"version": "^22.5.0",
|
|
2408
|
+
"alwaysAddToPackageJson": false
|
|
2409
|
+
},
|
|
2410
|
+
"@angular-eslint/test-utils": {
|
|
2411
|
+
"version": "^22.5.0",
|
|
2412
|
+
"alwaysAddToPackageJson": false
|
|
2413
|
+
},
|
|
2414
|
+
"@angular-eslint/builder": {
|
|
2415
|
+
"version": "^22.5.0",
|
|
2416
|
+
"alwaysAddToPackageJson": false
|
|
2417
|
+
},
|
|
2418
|
+
"@angular-eslint/bundled-angular-compiler": {
|
|
2419
|
+
"version": "^22.5.0",
|
|
2420
|
+
"alwaysAddToPackageJson": false
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2326
2423
|
}
|
|
2327
2424
|
}
|
|
2328
2425
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "24.0.0-beta.
|
|
3
|
+
"version": "24.0.0-beta.4",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"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, 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.",
|
|
@@ -67,9 +67,9 @@
|
|
|
67
67
|
"supportsOptionalMigrations": true
|
|
68
68
|
},
|
|
69
69
|
"dependencies": {
|
|
70
|
-
"@nx/devkit": "24.0.0-beta.
|
|
71
|
-
"@nx/eslint": "24.0.0-beta.
|
|
72
|
-
"@nx/js": "24.0.0-beta.
|
|
70
|
+
"@nx/devkit": "24.0.0-beta.4",
|
|
71
|
+
"@nx/eslint": "24.0.0-beta.4",
|
|
72
|
+
"@nx/js": "24.0.0-beta.4",
|
|
73
73
|
"@phenomnomnominal/tsquery": "~6.2.0",
|
|
74
74
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
75
75
|
"jsonc-parser": "^3.2.0",
|
|
@@ -80,20 +80,20 @@
|
|
|
80
80
|
"tslib": "^2.3.0"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@nx/storybook": "24.0.0-beta.
|
|
84
|
-
"@nx/vitest": "24.0.0-beta.
|
|
85
|
-
"nx": "24.0.0-beta.
|
|
83
|
+
"@nx/storybook": "24.0.0-beta.4",
|
|
84
|
+
"@nx/vitest": "24.0.0-beta.4",
|
|
85
|
+
"nx": "24.0.0-beta.4"
|
|
86
86
|
},
|
|
87
87
|
"peerDependencies": {
|
|
88
88
|
"@angular/build": ">= 20.0.0 < 23.0.0",
|
|
89
89
|
"@angular-devkit/build-angular": ">= 20.0.0 < 23.0.0",
|
|
90
90
|
"@angular-devkit/core": ">= 20.0.0 < 23.0.0",
|
|
91
91
|
"@angular-devkit/schematics": ">= 20.0.0 < 23.0.0",
|
|
92
|
-
"@nx/cypress": "24.0.0-beta.
|
|
93
|
-
"@nx/playwright": "24.0.0-beta.
|
|
92
|
+
"@nx/cypress": "24.0.0-beta.4",
|
|
93
|
+
"@nx/playwright": "24.0.0-beta.4",
|
|
94
94
|
"@schematics/angular": ">= 20.0.0 < 23.0.0",
|
|
95
|
-
"@nx/rspack": "24.0.0-beta.
|
|
96
|
-
"@nx/webpack": "24.0.0-beta.
|
|
95
|
+
"@nx/rspack": "24.0.0-beta.4",
|
|
96
|
+
"@nx/webpack": "24.0.0-beta.4",
|
|
97
97
|
"ng-packagr": ">= 20.0.0 < 23.0.0",
|
|
98
98
|
"rxjs": "^6.5.3 || ^7.5.0",
|
|
99
99
|
"webpack-merge": "^5.8.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nx-angular.mjs","sources":["../../nx-angular.ts"],"sourcesContent":["/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":"AAAA;;AAEG"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nx-angular.d.ts","sources":[],"mappings":"","names":[]}
|