@nx/angular 22.3.1 → 22.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/migrations.json +18 -8
- package/package.json +9 -9
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +47 -8
- package/src/utils/versions.d.ts +1 -1
- package/src/utils/versions.js +1 -1
- package/src/migrations/update-22-3-0/update-angular-cli.d.ts +0 -4
- package/src/migrations/update-22-3-0/update-angular-cli.d.ts.map +0 -1
- package/src/migrations/update-22-3-0/update-angular-cli.js +0 -14
package/migrations.json
CHANGED
|
@@ -342,14 +342,6 @@
|
|
|
342
342
|
"description": "Update the @angular/cli package version to ~20.3.0.",
|
|
343
343
|
"factory": "./src/migrations/update-21-6-1/update-angular-cli"
|
|
344
344
|
},
|
|
345
|
-
"update-angular-cli-version-21-0-0": {
|
|
346
|
-
"version": "22.3.0-beta.0",
|
|
347
|
-
"requires": {
|
|
348
|
-
"@angular/core": ">=21.0.0"
|
|
349
|
-
},
|
|
350
|
-
"description": "Update the @angular/cli package version to ~21.0.0.",
|
|
351
|
-
"factory": "./src/migrations/update-22-3-0/update-angular-cli"
|
|
352
|
-
},
|
|
353
345
|
"update-ssr-webpack-config-22-2-0": {
|
|
354
346
|
"version": "22.3.0-beta.0",
|
|
355
347
|
"requires": {
|
|
@@ -2012,6 +2004,12 @@
|
|
|
2012
2004
|
"@angular/core": ">=20.3.0 <21.0.0"
|
|
2013
2005
|
},
|
|
2014
2006
|
"packages": {
|
|
2007
|
+
"@angular/cli": {
|
|
2008
|
+
"version": "~21.0.0",
|
|
2009
|
+
"alwaysAddToPackageJson": false,
|
|
2010
|
+
"ignorePackageGroup": true,
|
|
2011
|
+
"ignoreMigrations": true
|
|
2012
|
+
},
|
|
2015
2013
|
"@angular-devkit/build-angular": {
|
|
2016
2014
|
"version": "~21.0.0",
|
|
2017
2015
|
"alwaysAddToPackageJson": false
|
|
@@ -2160,6 +2158,18 @@
|
|
|
2160
2158
|
"alwaysAddToPackageJson": false
|
|
2161
2159
|
}
|
|
2162
2160
|
}
|
|
2161
|
+
},
|
|
2162
|
+
"22.3.2-ngrx": {
|
|
2163
|
+
"version": "22.3.2-beta.0",
|
|
2164
|
+
"requires": {
|
|
2165
|
+
"@angular/core": "^21.0.0"
|
|
2166
|
+
},
|
|
2167
|
+
"packages": {
|
|
2168
|
+
"@ngrx/store": {
|
|
2169
|
+
"version": "^21.0.0",
|
|
2170
|
+
"alwaysAddToPackageJson": false
|
|
2171
|
+
}
|
|
2172
|
+
}
|
|
2163
2173
|
}
|
|
2164
2174
|
}
|
|
2165
2175
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/angular",
|
|
3
|
-
"version": "22.3.
|
|
3
|
+
"version": "22.3.2",
|
|
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": {
|
|
@@ -62,14 +62,14 @@
|
|
|
62
62
|
"migrations": "./migrations.json"
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@nx/devkit": "22.3.
|
|
66
|
-
"@nx/eslint": "22.3.
|
|
67
|
-
"@nx/js": "22.3.
|
|
68
|
-
"@nx/module-federation": "22.3.
|
|
69
|
-
"@nx/rspack": "22.3.
|
|
70
|
-
"@nx/web": "22.3.
|
|
71
|
-
"@nx/webpack": "22.3.
|
|
72
|
-
"@nx/workspace": "22.3.
|
|
65
|
+
"@nx/devkit": "22.3.2",
|
|
66
|
+
"@nx/eslint": "22.3.2",
|
|
67
|
+
"@nx/js": "22.3.2",
|
|
68
|
+
"@nx/module-federation": "22.3.2",
|
|
69
|
+
"@nx/rspack": "22.3.2",
|
|
70
|
+
"@nx/web": "22.3.2",
|
|
71
|
+
"@nx/webpack": "22.3.2",
|
|
72
|
+
"@nx/workspace": "22.3.2",
|
|
73
73
|
"@phenomnomnominal/tsquery": "~5.0.1",
|
|
74
74
|
"@typescript-eslint/type-utils": "^8.0.0",
|
|
75
75
|
"enquirer": "~2.3.6",
|
package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cypress-component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,iBAAiB,EAMjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"cypress-component-configuration.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":"AAEA,OAAO,EAGL,iBAAiB,EAMjB,IAAI,EAEL,MAAM,YAAY,CAAC;AAYpB,OAAO,EAAE,4BAA4B,EAAE,MAAM,UAAU,CAAC;AAiBxD;;;GAGG;AACH,wBAAsB,6BAA6B,CACjD,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,4BAA4B,GACpC,OAAO,CAAC,iBAAiB,CAAC,CAsD5B;AAoJD,eAAe,6BAA6B,CAAC"}
|
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
36
|
exports.cypressComponentConfiguration = cypressComponentConfiguration;
|
|
4
37
|
const devkit_1 = require("@nx/devkit");
|
|
@@ -10,6 +43,7 @@ const component_info_1 = require("../utils/storybook-ast/component-info");
|
|
|
10
43
|
const entry_point_1 = require("../utils/storybook-ast/entry-point");
|
|
11
44
|
const module_info_1 = require("../utils/storybook-ast/module-info");
|
|
12
45
|
const update_app_editor_tsconfig_excluded_files_1 = require("../utils/update-app-editor-tsconfig-excluded-files");
|
|
46
|
+
const semver_1 = require("semver");
|
|
13
47
|
const webpackExecutors = new Set([
|
|
14
48
|
'@nx/angular:webpack-browser',
|
|
15
49
|
'@nrwl/angular:webpack-browser',
|
|
@@ -27,8 +61,8 @@ const esbuildExecutors = new Set([
|
|
|
27
61
|
* storybook + cypress then use the componentCypressGenerator instead.
|
|
28
62
|
*/
|
|
29
63
|
async function cypressComponentConfiguration(tree, options) {
|
|
64
|
+
const { componentConfigurationGenerator: baseCyCTConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
30
65
|
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
31
|
-
// Cypress Component Testing requires Zone.js
|
|
32
66
|
let isZoneless;
|
|
33
67
|
if (projectConfig.projectType === 'application') {
|
|
34
68
|
// For applications, check the polyfills in the build target
|
|
@@ -39,11 +73,16 @@ async function cypressComponentConfiguration(tree, options) {
|
|
|
39
73
|
isZoneless = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'zone.js') === null;
|
|
40
74
|
}
|
|
41
75
|
if (isZoneless) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
76
|
+
const { getInstalledCypressVersion } = await Promise.resolve().then(() => __importStar(require('@nx/cypress/src/utils/versions')));
|
|
77
|
+
const installedCypressVersion = getInstalledCypressVersion(tree);
|
|
78
|
+
// Zoneless support was introduced in Cypress 15.8.0
|
|
79
|
+
// If Cypress is not yet installed, we'll install the latest version, which will have zoneless support
|
|
80
|
+
if (installedCypressVersion && (0, semver_1.lt)(installedCypressVersion, '15.8.0')) {
|
|
81
|
+
throw new Error(`Cypress Component Testing doesn't support Zoneless Angular projects for your installed Cypress version (${installedCypressVersion}). ` +
|
|
82
|
+
`The project "${options.project}" is configured without Zone.js. ` +
|
|
83
|
+
`Please upgrade Cypress to version 15.8.0 or higher.`);
|
|
84
|
+
}
|
|
45
85
|
}
|
|
46
|
-
const { componentConfigurationGenerator: baseCyCTConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
47
86
|
const tasks = [];
|
|
48
87
|
tasks.push(await baseCyCTConfig(tree, {
|
|
49
88
|
project: options.project,
|
|
@@ -53,7 +92,7 @@ async function cypressComponentConfiguration(tree, options) {
|
|
|
53
92
|
skipPackageJson: options.skipPackageJson,
|
|
54
93
|
}));
|
|
55
94
|
await configureCypressCT(tree, options);
|
|
56
|
-
tasks.push(await addFiles(tree, projectConfig, options));
|
|
95
|
+
tasks.push(await addFiles(tree, projectConfig, options, isZoneless));
|
|
57
96
|
if (projectConfig.projectType === 'application') {
|
|
58
97
|
(0, update_app_editor_tsconfig_excluded_files_1.updateAppEditorTsConfigExcludedFiles)(tree, projectConfig);
|
|
59
98
|
}
|
|
@@ -62,11 +101,11 @@ async function cypressComponentConfiguration(tree, options) {
|
|
|
62
101
|
}
|
|
63
102
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
64
103
|
}
|
|
65
|
-
async function addFiles(tree, projectConfig, options) {
|
|
104
|
+
async function addFiles(tree, projectConfig, options, isZoneless) {
|
|
66
105
|
const componentFile = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress', 'support', 'component.ts');
|
|
67
106
|
const { addMountDefinition } = require('@nx/cypress/src/utils/config');
|
|
68
107
|
const updatedCmpContents = await addMountDefinition(tree.read(componentFile, 'utf-8'));
|
|
69
|
-
tree.write(componentFile, `import { mount } from 'cypress/angular';\n${updatedCmpContents}`);
|
|
108
|
+
tree.write(componentFile, `import { mount } from '${isZoneless ? 'cypress/angular-zoneless' : 'cypress/angular'}';\n${updatedCmpContents}`);
|
|
70
109
|
if (!options.generateTests) {
|
|
71
110
|
return () => { };
|
|
72
111
|
}
|
package/src/utils/versions.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ export declare const nxVersion: any;
|
|
|
2
2
|
export declare const angularVersion = "~21.0.0";
|
|
3
3
|
export declare const angularDevkitVersion = "~21.0.0";
|
|
4
4
|
export declare const ngPackagrVersion = "~21.0.0";
|
|
5
|
-
export declare const ngrxVersion = "^
|
|
5
|
+
export declare const ngrxVersion = "^21.0.0";
|
|
6
6
|
export declare const rxjsVersion = "~7.8.0";
|
|
7
7
|
export declare const zoneJsVersion = "~0.15.0";
|
|
8
8
|
export declare const tsLibVersion = "^2.3.0";
|
package/src/utils/versions.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.nxVersion = require('../../package.json').version;
|
|
|
5
5
|
exports.angularVersion = '~21.0.0';
|
|
6
6
|
exports.angularDevkitVersion = '~21.0.0';
|
|
7
7
|
exports.ngPackagrVersion = '~21.0.0';
|
|
8
|
-
exports.ngrxVersion = '^
|
|
8
|
+
exports.ngrxVersion = '^21.0.0';
|
|
9
9
|
exports.rxjsVersion = '~7.8.0';
|
|
10
10
|
exports.zoneJsVersion = '~0.15.0';
|
|
11
11
|
exports.tsLibVersion = '^2.3.0';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-angular-cli.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/update-angular-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,eAAO,MAAM,iBAAiB,YAAY,CAAC;AAE3C,yBAA+B,IAAI,EAAE,IAAI,iBAaxC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
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 = '~21.0.0';
|
|
7
|
-
async function default_1(tree) {
|
|
8
|
-
const { devDependencies, dependencies } = (0, devkit_1.readJson)(tree, 'package.json');
|
|
9
|
-
const hasAngularCli = devDependencies?.['@angular/cli'] || dependencies?.['@angular/cli'];
|
|
10
|
-
if (hasAngularCli) {
|
|
11
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@angular/cli': exports.angularCliVersion });
|
|
12
|
-
await (0, devkit_1.formatFiles)(tree);
|
|
13
|
-
}
|
|
14
|
-
}
|