@nx/angular 23.3.0-beta.1 → 23.3.0-beta.3
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/src/generators/application/application.js +7 -0
- package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +9 -0
- package/dist/src/generators/library/library.js +2 -0
- package/dist/src/generators/utils/acknowledge-build-scripts.d.ts +2 -0
- package/dist/src/generators/utils/acknowledge-build-scripts.js +18 -0
- package/dist/src/generators/utils/add-vitest.js +3 -0
- package/dist/src/migrations/update-23-1-0/add-angular-build.js +2 -0
- package/dist/src/migrations/update-23-1-0/add-angular-build.md +3 -1
- package/dist/src/migrations/update-23-1-0/add-optional-webpack-packages.js +8 -0
- package/dist/src/migrations/update-23-1-0/add-optional-webpack-packages.md +2 -0
- package/package.json +13 -13
|
@@ -8,6 +8,7 @@ const assert_supported_angular_version_1 = require("../../utils/assert-supported
|
|
|
8
8
|
const convert_to_rspack_1 = require("../convert-to-rspack/convert-to-rspack");
|
|
9
9
|
const init_1 = require("../init/init");
|
|
10
10
|
const setup_ssr_1 = require("../setup-ssr/setup-ssr");
|
|
11
|
+
const acknowledge_build_scripts_1 = require("../utils/acknowledge-build-scripts");
|
|
11
12
|
const ensure_angular_dependencies_1 = require("../utils/ensure-angular-dependencies");
|
|
12
13
|
const validations_1 = require("../utils/validations");
|
|
13
14
|
const version_utils_1 = require("../utils/version-utils");
|
|
@@ -84,8 +85,14 @@ async function applicationGenerator(tree, schema) {
|
|
|
84
85
|
}
|
|
85
86
|
if (options.style === 'less') {
|
|
86
87
|
devDependencies['less'] = packageVersions.lessVersion;
|
|
88
|
+
// less's postinstall only installs Playwright browsers, which nothing
|
|
89
|
+
// that consumes less needs.
|
|
90
|
+
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
|
|
91
|
+
less: false,
|
|
92
|
+
});
|
|
87
93
|
}
|
|
88
94
|
if (Object.keys(devDependencies).length) {
|
|
95
|
+
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
89
96
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, true);
|
|
90
97
|
}
|
|
91
98
|
}
|
|
@@ -7,6 +7,7 @@ const path_1 = require("path");
|
|
|
7
7
|
const posix_1 = require("path/posix");
|
|
8
8
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
9
9
|
const versions_1 = require("../../utils/versions");
|
|
10
|
+
const acknowledge_build_scripts_1 = require("../utils/acknowledge-build-scripts");
|
|
10
11
|
const version_utils_1 = require("../utils/version-utils");
|
|
11
12
|
const create_config_1 = require("./lib/create-config");
|
|
12
13
|
const get_custom_webpack_config_1 = require("./lib/get-custom-webpack-config");
|
|
@@ -524,6 +525,14 @@ async function convertToRspack(tree, schema) {
|
|
|
524
525
|
}
|
|
525
526
|
if (!schema.skipInstall) {
|
|
526
527
|
const { webpackMergeVersion, tsNodeVersion } = (0, version_utils_1.versions)(tree);
|
|
528
|
+
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
529
|
+
// @nx/angular-rspack-compiler's install script patches `@angular/build`
|
|
530
|
+
// versions below 20.2.0, so it has to run. core-js only prints a funding
|
|
531
|
+
// message.
|
|
532
|
+
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
|
|
533
|
+
'@nx/angular-rspack-compiler': true,
|
|
534
|
+
'core-js': false,
|
|
535
|
+
});
|
|
527
536
|
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
528
537
|
'@nx/angular-rspack': versions_1.nxVersion,
|
|
529
538
|
'webpack-merge': webpackMergeVersion,
|
|
@@ -11,6 +11,7 @@ const init_1 = tslib_1.__importDefault(require("../../generators/init/init"));
|
|
|
11
11
|
const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
|
|
12
12
|
const test_runners_1 = require("../../utils/test-runners");
|
|
13
13
|
const add_linting_1 = tslib_1.__importDefault(require("../add-linting/add-linting"));
|
|
14
|
+
const acknowledge_build_scripts_1 = require("../utils/acknowledge-build-scripts");
|
|
14
15
|
const add_jest_1 = require("../utils/add-jest");
|
|
15
16
|
const add_vitest_1 = require("../utils/add-vitest");
|
|
16
17
|
const dependencies_1 = require("../utils/dependencies");
|
|
@@ -59,6 +60,7 @@ async function libraryGenerator(tree, schema) {
|
|
|
59
60
|
await addLinting(tree, libraryOptions);
|
|
60
61
|
if ((libraryOptions.buildable || libraryOptions.publishable) &&
|
|
61
62
|
!libraryOptions.skipPackageJson) {
|
|
63
|
+
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
62
64
|
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
63
65
|
'ng-packagr': pkgVersions.ngPackagrVersion,
|
|
64
66
|
}, undefined, true);
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.acknowledgeAngularBuildScripts = acknowledgeAngularBuildScripts;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const internal_1 = require("@nx/devkit/internal");
|
|
6
|
+
// The Angular build tooling (`@angular/build`, `@angular-devkit/build-angular`,
|
|
7
|
+
// `ng-packagr`) pulls in esbuild, lmdb (-> msgpackr-extract) and sass
|
|
8
|
+
// (-> @parcel/watcher). All of them ship prebuilt binaries as optional
|
|
9
|
+
// dependencies, so their install scripts have nothing to do.
|
|
10
|
+
const angularBuildAllowBuilds = {
|
|
11
|
+
esbuild: false,
|
|
12
|
+
lmdb: false,
|
|
13
|
+
'msgpackr-extract': false,
|
|
14
|
+
'@parcel/watcher': false,
|
|
15
|
+
};
|
|
16
|
+
function acknowledgeAngularBuildScripts(tree) {
|
|
17
|
+
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), angularBuildAllowBuilds);
|
|
18
|
+
}
|
|
@@ -6,6 +6,7 @@ const devkit_1 = require("@nx/devkit");
|
|
|
6
6
|
const internal_1 = require("@nx/devkit/internal");
|
|
7
7
|
const semver_1 = require("semver");
|
|
8
8
|
const versions_1 = require("../../utils/versions");
|
|
9
|
+
const acknowledge_build_scripts_1 = require("./acknowledge-build-scripts");
|
|
9
10
|
const version_utils_1 = require("./version-utils");
|
|
10
11
|
async function addVitestAngular(tree, options) {
|
|
11
12
|
validateVitestVersion(tree);
|
|
@@ -35,6 +36,7 @@ async function addVitestAngular(tree, options) {
|
|
|
35
36
|
}
|
|
36
37
|
const pkgVersions = (0, version_utils_1.versions)(tree, { minAngularMajorVersion: 21 });
|
|
37
38
|
const angularDevkitVersion = (0, version_utils_1.getInstalledAngularDevkitVersion)(tree) ?? pkgVersions.angularDevkitVersion;
|
|
39
|
+
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
38
40
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
39
41
|
'@angular/build': angularDevkitVersion,
|
|
40
42
|
jsdom: pkgVersions.jsdomVersion,
|
|
@@ -69,6 +71,7 @@ async function addVitestAnalog(tree, options) {
|
|
|
69
71
|
devDependencies['vitest'] = pkgVersions.vitestVersion;
|
|
70
72
|
devDependencies['jsdom'] = pkgVersions.jsdomVersion;
|
|
71
73
|
}
|
|
74
|
+
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
72
75
|
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, devDependencies, undefined, true));
|
|
73
76
|
}
|
|
74
77
|
(0, devkit_1.ensurePackage)('@nx/vitest', versions_1.nxVersion);
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.default = default_1;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const acknowledge_build_scripts_1 = require("../../generators/utils/acknowledge-build-scripts");
|
|
5
6
|
const versions_1 = require("../../utils/versions");
|
|
6
7
|
// The `@nx/angular:application` and `@nx/angular:unit-test` executors import
|
|
7
8
|
// `@angular/build` directly to run the Angular builders, and any
|
|
@@ -49,5 +50,6 @@ async function default_1(tree) {
|
|
|
49
50
|
if (!needsAngularBuild) {
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
53
|
+
(0, acknowledge_build_scripts_1.acknowledgeAngularBuildScripts)(tree);
|
|
52
54
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/build': versions_1.angularDevkitVersion }, undefined, true);
|
|
53
55
|
}
|
|
@@ -4,6 +4,8 @@ The `@nx/angular:application` and `@nx/angular:unit-test` executors load the Ang
|
|
|
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
|
|
|
7
|
+
On pnpm 11 and above, the migration also writes `pnpm-workspace.yaml`. `@angular/build` reaches four packages that run a build script on install (`esbuild`, `lmdb`, `msgpackr-extract` and `@parcel/watcher`), and pnpm 11 refuses to install a package whose script is neither allowed nor denied, so the migration records an `allowBuilds` decision for each. A decision already in the file is left untouched.
|
|
8
|
+
|
|
7
9
|
#### Examples
|
|
8
10
|
|
|
9
11
|
##### `project.json`
|
|
@@ -28,7 +30,7 @@ After (`package.json`):
|
|
|
28
30
|
// package.json
|
|
29
31
|
{
|
|
30
32
|
"devDependencies": {
|
|
31
|
-
"@angular/build": "~22.0
|
|
33
|
+
"@angular/build": "~22.1.0",
|
|
32
34
|
},
|
|
33
35
|
}
|
|
34
36
|
```
|
|
@@ -88,6 +88,14 @@ async function addOptionalWebpackPackages(tree) {
|
|
|
88
88
|
if (!needsWebpack && !needsModuleFederation && !needsRspack) {
|
|
89
89
|
return;
|
|
90
90
|
}
|
|
91
|
+
if (needsWebpack || needsRspack) {
|
|
92
|
+
// @nx/webpack and @nx/rspack depend on sass, which pulls in
|
|
93
|
+
// @parcel/watcher. Its install script only builds from source when
|
|
94
|
+
// npm_config_build_from_source is set, so skip it.
|
|
95
|
+
(0, internal_1.acknowledgeBuildScripts)(tree, (0, devkit_1.detectPackageManager)(tree.root), {
|
|
96
|
+
'@parcel/watcher': false,
|
|
97
|
+
});
|
|
98
|
+
}
|
|
91
99
|
return (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
92
100
|
...(needsWebpack
|
|
93
101
|
? {
|
|
@@ -12,6 +12,8 @@ A package is added only when a matching target exists:
|
|
|
12
12
|
|
|
13
13
|
Targets that inherit their executor from an `nx.json` `targetDefaults` entry are detected too.
|
|
14
14
|
|
|
15
|
+
On pnpm 11 and above, adding `@nx/webpack` or `@nx/rspack` also writes `pnpm-workspace.yaml`. Both reach `@parcel/watcher` through sass, and pnpm 11 refuses to install a package whose build script is neither allowed nor denied, so the migration records an `allowBuilds` decision for it. A decision already in the file is left untouched.
|
|
16
|
+
|
|
15
17
|
#### Examples
|
|
16
18
|
|
|
17
19
|
For a workspace with an `@nx/angular:webpack-browser` build target, the migration adds the webpack packages to `devDependencies`.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "23.3.0-beta.
|
|
3
|
+
"version": "23.3.0-beta.3",
|
|
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.",
|
|
@@ -79,15 +79,15 @@
|
|
|
79
79
|
"picomatch": "4.0.4",
|
|
80
80
|
"semver": "^7.6.3",
|
|
81
81
|
"tslib": "^2.3.0",
|
|
82
|
-
"@nx/devkit": "23.3.0-beta.
|
|
83
|
-
"@nx/
|
|
84
|
-
"@nx/
|
|
85
|
-
"@nx/
|
|
82
|
+
"@nx/devkit": "23.3.0-beta.3",
|
|
83
|
+
"@nx/web": "23.3.0-beta.3",
|
|
84
|
+
"@nx/js": "23.3.0-beta.3",
|
|
85
|
+
"@nx/eslint": "23.3.0-beta.3"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
|
-
"@nx/
|
|
89
|
-
"
|
|
90
|
-
"nx": "23.3.0-beta.
|
|
88
|
+
"@nx/vitest": "23.3.0-beta.3",
|
|
89
|
+
"nx": "23.3.0-beta.3",
|
|
90
|
+
"@nx/storybook": "23.3.0-beta.3"
|
|
91
91
|
},
|
|
92
92
|
"peerDependencies": {
|
|
93
93
|
"@angular/build": ">= 20.0.0 < 23.0.0",
|
|
@@ -98,11 +98,11 @@
|
|
|
98
98
|
"ng-packagr": ">= 20.0.0 < 23.0.0",
|
|
99
99
|
"rxjs": "^6.5.3 || ^7.5.0",
|
|
100
100
|
"webpack-merge": "^5.8.0",
|
|
101
|
-
"@nx/
|
|
102
|
-
"@nx/
|
|
103
|
-
"@nx/
|
|
104
|
-
"@nx/rspack": "23.3.0-beta.
|
|
105
|
-
"@nx/
|
|
101
|
+
"@nx/playwright": "23.3.0-beta.3",
|
|
102
|
+
"@nx/webpack": "23.3.0-beta.3",
|
|
103
|
+
"@nx/module-federation": "23.3.0-beta.3",
|
|
104
|
+
"@nx/rspack": "23.3.0-beta.3",
|
|
105
|
+
"@nx/cypress": "23.3.0-beta.3"
|
|
106
106
|
},
|
|
107
107
|
"peerDependenciesMeta": {
|
|
108
108
|
"@angular/build": {
|