@nx/angular 23.2.0-beta.7 → 23.2.0-beta.8

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.
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addE2e = addE2e;
4
+ const devkit_1 = require("@nx/devkit");
4
5
  const internal_1 = require("@nx/devkit/internal");
5
6
  const internal_2 = require("@nx/eslint/internal");
6
- const devkit_1 = require("@nx/devkit");
7
7
  const versions_1 = require("../../../utils/versions");
8
8
  async function addE2e(tree, options) {
9
9
  // since e2e are separate projects, default to adding plugins
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.convertToRspack = convertToRspack;
4
4
  const internal_1 = require("@nx/devkit/internal");
5
5
  const devkit_1 = require("@nx/devkit");
6
- const enquirer_1 = require("enquirer");
7
6
  const path_1 = require("path");
8
7
  const posix_1 = require("path/posix");
9
8
  const assert_supported_angular_version_1 = require("../../utils/assert-supported-angular-version");
@@ -226,13 +225,10 @@ async function getProjectToConvert(tree) {
226
225
  projects.add(project);
227
226
  });
228
227
  }
229
- const { project } = await (0, enquirer_1.prompt)({
230
- type: 'select',
231
- name: 'project',
228
+ return (0, internal_1.selectPrompt)({
232
229
  message: 'Which project would you like to convert to rspack?',
233
230
  choices: Array.from(projects),
234
231
  });
235
- return project;
236
232
  }
237
233
  async function convertToRspack(tree, schema) {
238
234
  (0, assert_supported_angular_version_1.assertSupportedAngularVersion)(tree);
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LibMigrator = void 0;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const devkit_2 = require("@nx/devkit");
6
5
  const utilities_1 = require("../../utilities");
7
6
  const builders_1 = require("../builders");
8
7
  const project_migrator_1 = require("./project.migrator");
@@ -46,7 +45,7 @@ class LibMigrator extends project_migrator_1.ProjectMigrator {
46
45
  !Object.keys(this.projectConfig.targets).length) {
47
46
  this.logger.warn('The project does not have any targets configured. This might not be an issue. Skipping updating targets.');
48
47
  }
49
- (0, devkit_2.updateProjectConfiguration)(this.tree, this.project.name, {
48
+ (0, devkit_1.updateProjectConfiguration)(this.tree, this.project.name, {
50
49
  ...this.projectConfig,
51
50
  });
52
51
  }
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = migrateMfImportsToNewPackage;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const devkit_2 = require("@nx/devkit");
6
5
  const tsquery_1 = require("@phenomnomnominal/tsquery");
7
6
  const MF_IMPORT_TO_UPDATE = 'ModuleFederationConfig';
8
7
  const MF_CONFIG_IMPORT_SELECTOR = `ImportDeclaration:has(StringLiteral[value=@nx/webpack]):has(Identifier[name=ModuleFederationConfig])`;
@@ -23,7 +22,7 @@ async function migrateMfImportsToNewPackage(tree) {
23
22
  }
24
23
  }
25
24
  for (const root of rootsToCheck) {
26
- (0, devkit_2.visitNotIgnoredFiles)(tree, root, (filePath) => {
25
+ (0, devkit_1.visitNotIgnoredFiles)(tree, root, (filePath) => {
27
26
  if (!filePath.endsWith('.ts') && !filePath.endsWith('.js')) {
28
27
  return;
29
28
  }
@@ -57,5 +56,5 @@ async function migrateMfImportsToNewPackage(tree) {
57
56
  tree.write(filePath, contents);
58
57
  });
59
58
  }
60
- await (0, devkit_2.formatFiles)(tree);
59
+ await (0, devkit_1.formatFiles)(tree);
61
60
  }
@@ -4,7 +4,6 @@ exports.default = default_1;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const internal_1 = require("@nx/js/internal");
6
6
  const internal_2 = require("@nx/devkit/internal");
7
- const internal_3 = require("@nx/devkit/internal");
8
7
  const version_utils_1 = require("../../generators/utils/version-utils");
9
8
  const file_change_recorder_1 = require("../../utils/file-change-recorder");
10
9
  const projects_1 = require("../utils/projects");
@@ -27,7 +26,7 @@ async function default_1(tree) {
27
26
  const tsqueryModule = require('@phenomnomnominal/tsquery');
28
27
  tsqueryAst = tsqueryModule.ast;
29
28
  tsqueryQuery = tsqueryModule.query;
30
- const cachedFileMap = (0, internal_3.readFileMapCache)().fileMap.projectFileMap;
29
+ const cachedFileMap = (0, internal_2.readFileMapCache)().fileMap.projectFileMap;
31
30
  const filesWithNxAngularImports = [];
32
31
  for (const graphNode of projects) {
33
32
  const files = filterFilesWithNxAngularDep(cachedFileMap[graphNode.name] || []);
@@ -4,6 +4,7 @@ exports.assertCypressComponentTestingSupport = assertCypressComponentTestingSupp
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const internal_1 = require("@nx/devkit/internal");
6
6
  const semver_1 = require("semver");
7
+ const minCypressVersion = '15.20.1';
7
8
  /**
8
9
  * Asserts the workspace's Cypress version can run Component Testing against its
9
10
  * Angular version. Must be called after `@nx/cypress` has been ensured.
@@ -16,12 +17,15 @@ function assertCypressComponentTestingSupport(tree) {
16
17
  const { cypressVersion, } = require('@nx/cypress/internal');
17
18
  // When Cypress is not installed, the generators install `cypressVersion`
18
19
  const declaredCypressVersion = (0, devkit_1.getDependencyVersionFromPackageJson)(tree, 'cypress') ?? cypressVersion;
19
- // A dist tag (`latest`, `next`) can't be compared, so it's not gated
20
- const installedCypressVersion = (0, semver_1.coerce)(declaredCypressVersion)?.version;
21
- if (installedCypressVersion && (0, semver_1.lt)(installedCypressVersion, '16.0.0')) {
22
- throw new Error(`Cypress Component Testing doesn't support Angular 22.1 and higher for Cypress version ${installedCypressVersion}. ` +
23
- `Angular 22.1 moved @angular-devkit/build-angular to Babel 8, which Cypress can't load. ` +
24
- `Cypress 16 should be the first release to support it. ` +
25
- `See https://github.com/cypress-io/cypress/issues/34461.`);
20
+ // Gate only ranges capped below the floor. `^15.17.0` installs 15.20.1+, so
21
+ // comparing its lower bound would reject workspaces that work. Dist tags
22
+ // (`latest`, `next`) aren't ranges and aren't gated.
23
+ if (!(0, semver_1.validRange)(declaredCypressVersion) ||
24
+ !(0, semver_1.subset)(declaredCypressVersion, `<${minCypressVersion}`)) {
25
+ return;
26
26
  }
27
+ throw new Error(`Cypress Component Testing with Angular 22.1 and higher requires Cypress ${minCypressVersion} or higher. ` +
28
+ `Found Cypress ${declaredCypressVersion}. Earlier Cypress versions can't load Angular's Babel 8 dependencies. ` +
29
+ `Please upgrade Cypress. ` +
30
+ `See https://github.com/cypress-io/cypress/issues/34461.`);
27
31
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "23.2.0-beta.7",
3
+ "version": "23.2.0-beta.8",
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.",
@@ -73,22 +73,21 @@
73
73
  "dependencies": {
74
74
  "@phenomnomnominal/tsquery": "~6.2.0",
75
75
  "@typescript-eslint/type-utils": "^8.0.0",
76
- "enquirer": "~2.3.6",
77
76
  "jsonc-parser": "^3.2.0",
78
77
  "magic-string": "~0.30.2",
79
78
  "picocolors": "^1.1.0",
80
79
  "picomatch": "4.0.4",
81
80
  "semver": "^7.6.3",
82
81
  "tslib": "^2.3.0",
83
- "@nx/js": "23.2.0-beta.7",
84
- "@nx/web": "23.2.0-beta.7",
85
- "@nx/eslint": "23.2.0-beta.7",
86
- "@nx/devkit": "23.2.0-beta.7"
82
+ "@nx/devkit": "23.2.0-beta.8",
83
+ "@nx/eslint": "23.2.0-beta.8",
84
+ "@nx/web": "23.2.0-beta.8",
85
+ "@nx/js": "23.2.0-beta.8"
87
86
  },
88
87
  "devDependencies": {
89
- "@nx/storybook": "23.2.0-beta.7",
90
- "@nx/vitest": "23.2.0-beta.7",
91
- "nx": "23.2.0-beta.7"
88
+ "@nx/storybook": "23.2.0-beta.8",
89
+ "@nx/vitest": "23.2.0-beta.8",
90
+ "nx": "23.2.0-beta.8"
92
91
  },
93
92
  "peerDependencies": {
94
93
  "@angular/build": ">= 20.0.0 < 23.0.0",
@@ -99,11 +98,11 @@
99
98
  "ng-packagr": ">= 20.0.0 < 23.0.0",
100
99
  "rxjs": "^6.5.3 || ^7.5.0",
101
100
  "webpack-merge": "^5.8.0",
102
- "@nx/cypress": "23.2.0-beta.7",
103
- "@nx/playwright": "23.2.0-beta.7",
104
- "@nx/module-federation": "23.2.0-beta.7",
105
- "@nx/webpack": "23.2.0-beta.7",
106
- "@nx/rspack": "23.2.0-beta.7"
101
+ "@nx/cypress": "23.2.0-beta.8",
102
+ "@nx/module-federation": "23.2.0-beta.8",
103
+ "@nx/rspack": "23.2.0-beta.8",
104
+ "@nx/webpack": "23.2.0-beta.8",
105
+ "@nx/playwright": "23.2.0-beta.8"
107
106
  },
108
107
  "peerDependenciesMeta": {
109
108
  "@angular/build": {