@nx/angular 24.0.0-beta.1 → 24.0.0-beta.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.
@@ -96,8 +96,7 @@ function validateVitestVersion(tree) {
96
96
  installedVitestVersion = packageJson.version;
97
97
  }
98
98
  catch { }
99
- const pkgVersions = (0, version_utils_1.versions)(tree, { minAngularMajorVersion: 21 });
100
- const requiredRange = pkgVersions.vitestVersion;
99
+ const requiredRange = getVitestRangeAngularRequires(tree);
101
100
  if (installedVitestVersion) {
102
101
  if (!(0, semver_1.satisfies)(installedVitestVersion, requiredRange, {
103
102
  includePrerelease: true,
@@ -135,6 +134,27 @@ function validateVitestVersion(tree) {
135
134
  `The generation will continue, but you may encounter issues if the version is not compatible.`);
136
135
  }
137
136
  }
137
+ // @angular/build 22.2.0 widened its vitest peer to `^4.0.8 || ^5.0.0`.
138
+ function getVitestRangeAngularRequires(tree) {
139
+ const { vitestVersion } = (0, version_utils_1.versions)(tree, { minAngularMajorVersion: 21 });
140
+ const vitestV5Range = '^5.0.0';
141
+ let installedPeerRange;
142
+ try {
143
+ installedPeerRange =
144
+ (0, internal_1.readModulePackageJson)('@angular/build').packageJson.peerDependencies
145
+ ?.vitest;
146
+ }
147
+ catch { }
148
+ const declaredAngularBuildVersion = (0, internal_1.getDeclaredPackageVersion)(tree, '@angular/build');
149
+ const angularBuildPeersVitestV5 = (typeof installedPeerRange === 'string' &&
150
+ (0, semver_1.validRange)(installedPeerRange) &&
151
+ (0, semver_1.intersects)(installedPeerRange, vitestV5Range)) ||
152
+ (!!declaredAngularBuildVersion &&
153
+ (0, semver_1.gte)(declaredAngularBuildVersion, '22.2.0'));
154
+ return angularBuildPeersVitestV5
155
+ ? `${vitestVersion} || ${vitestV5Range}`
156
+ : vitestVersion;
157
+ }
138
158
  function configureTypeScriptForVitest(tree, projectRoot) {
139
159
  (0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.spec.json'), {
140
160
  extends: './tsconfig.json',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "24.0.0-beta.1",
3
+ "version": "24.0.0-beta.2",
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.",
@@ -71,10 +71,10 @@
71
71
  "supportsOptionalMigrations": true
72
72
  },
73
73
  "dependencies": {
74
- "@nx/devkit": "24.0.0-beta.1",
75
- "@nx/eslint": "24.0.0-beta.1",
76
- "@nx/js": "24.0.0-beta.1",
77
- "@nx/web": "24.0.0-beta.1",
74
+ "@nx/devkit": "24.0.0-beta.2",
75
+ "@nx/eslint": "24.0.0-beta.2",
76
+ "@nx/js": "24.0.0-beta.2",
77
+ "@nx/web": "24.0.0-beta.2",
78
78
  "@phenomnomnominal/tsquery": "~6.2.0",
79
79
  "@typescript-eslint/type-utils": "^8.0.0",
80
80
  "jsonc-parser": "^3.2.0",
@@ -85,21 +85,21 @@
85
85
  "tslib": "^2.3.0"
86
86
  },
87
87
  "devDependencies": {
88
- "@nx/storybook": "24.0.0-beta.1",
89
- "@nx/vitest": "24.0.0-beta.1",
90
- "nx": "24.0.0-beta.1"
88
+ "@nx/storybook": "24.0.0-beta.2",
89
+ "@nx/vitest": "24.0.0-beta.2",
90
+ "nx": "24.0.0-beta.2"
91
91
  },
92
92
  "peerDependencies": {
93
93
  "@angular/build": ">= 20.0.0 < 23.0.0",
94
94
  "@angular-devkit/build-angular": ">= 20.0.0 < 23.0.0",
95
95
  "@angular-devkit/core": ">= 20.0.0 < 23.0.0",
96
96
  "@angular-devkit/schematics": ">= 20.0.0 < 23.0.0",
97
- "@nx/cypress": "24.0.0-beta.1",
98
- "@nx/playwright": "24.0.0-beta.1",
97
+ "@nx/cypress": "24.0.0-beta.2",
98
+ "@nx/playwright": "24.0.0-beta.2",
99
99
  "@schematics/angular": ">= 20.0.0 < 23.0.0",
100
- "@nx/module-federation": "24.0.0-beta.1",
101
- "@nx/rspack": "24.0.0-beta.1",
102
- "@nx/webpack": "24.0.0-beta.1",
100
+ "@nx/module-federation": "24.0.0-beta.2",
101
+ "@nx/rspack": "24.0.0-beta.2",
102
+ "@nx/webpack": "24.0.0-beta.2",
103
103
  "ng-packagr": ">= 20.0.0 < 23.0.0",
104
104
  "rxjs": "^6.5.3 || ^7.5.0",
105
105
  "webpack-merge": "^5.8.0"