@nx/angular 22.3.0-canary.20251215-e864b6a → 22.3.0-canary.20251216-71bfc21

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 CHANGED
@@ -381,6 +381,14 @@
381
381
  },
382
382
  "description": "Update 'vitest' unit test runner option to 'vitest-analog' in generator defaults.",
383
383
  "factory": "./src/migrations/update-22-3-0/update-unit-test-runner-option"
384
+ },
385
+ "set-isolated-modules-22-3-0": {
386
+ "version": "22.3.0-beta.3",
387
+ "requires": {
388
+ "@angular/core": ">=21.0.0"
389
+ },
390
+ "description": "Set 'isolatedModules' to 'true' in TypeScript test configurations for Angular projects.",
391
+ "factory": "./src/migrations/update-22-3-0/set-isolated-modules"
384
392
  }
385
393
  },
386
394
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "22.3.0-canary.20251215-e864b6a",
3
+ "version": "22.3.0-canary.20251216-71bfc21",
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.0-canary.20251215-e864b6a",
66
- "@nx/eslint": "22.3.0-canary.20251215-e864b6a",
67
- "@nx/js": "22.3.0-canary.20251215-e864b6a",
68
- "@nx/module-federation": "22.3.0-canary.20251215-e864b6a",
69
- "@nx/rspack": "22.3.0-canary.20251215-e864b6a",
70
- "@nx/web": "22.3.0-canary.20251215-e864b6a",
71
- "@nx/webpack": "22.3.0-canary.20251215-e864b6a",
72
- "@nx/workspace": "22.3.0-canary.20251215-e864b6a",
65
+ "@nx/devkit": "22.3.0-canary.20251216-71bfc21",
66
+ "@nx/eslint": "22.3.0-canary.20251216-71bfc21",
67
+ "@nx/js": "22.3.0-canary.20251216-71bfc21",
68
+ "@nx/module-federation": "22.3.0-canary.20251216-71bfc21",
69
+ "@nx/rspack": "22.3.0-canary.20251216-71bfc21",
70
+ "@nx/web": "22.3.0-canary.20251216-71bfc21",
71
+ "@nx/webpack": "22.3.0-canary.20251216-71bfc21",
72
+ "@nx/workspace": "22.3.0-canary.20251216-71bfc21",
73
73
  "@phenomnomnominal/tsquery": "~5.0.1",
74
74
  "@typescript-eslint/type-utils": "^8.0.0",
75
75
  "enquirer": "~2.3.6",
@@ -0,0 +1,3 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export default function (tree: Tree): Promise<void>;
3
+ //# sourceMappingURL=set-isolated-modules.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"set-isolated-modules.d.ts","sourceRoot":"","sources":["../../../../../../packages/angular/src/migrations/update-22-3-0/set-isolated-modules.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,IAAI,EAEV,MAAM,YAAY,CAAC;AAWpB,yBAA+B,IAAI,EAAE,IAAI,iBA6CxC"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const tsconfig_utils_1 = require("../../generators/utils/tsconfig-utils");
6
+ const targets_1 = require("../../utils/targets");
7
+ const projects_1 = require("../utils/projects");
8
+ async function default_1(tree) {
9
+ const uniqueSpecTsConfigs = new Set();
10
+ const projects = await (0, projects_1.getProjectsFilteredByDependencies)([
11
+ 'npm:@angular/core',
12
+ 'npm:jest-preset-angular',
13
+ ]);
14
+ for (const graphNode of projects) {
15
+ const projectRoot = graphNode.data.root;
16
+ // add tsconfig.spec.json if it exists
17
+ const specTsConfigPath = (0, devkit_1.joinPathFragments)(projectRoot, 'tsconfig.spec.json');
18
+ if (tree.exists(specTsConfigPath)) {
19
+ uniqueSpecTsConfigs.add(specTsConfigPath);
20
+ }
21
+ // look for tsConfig in @nx/jest:jest tasks in case there are any
22
+ // custom test tsconfig files
23
+ for (const [, target] of (0, targets_1.allProjectTargets)(graphNode.data)) {
24
+ if (target.executor !== '@nx/jest:jest') {
25
+ continue;
26
+ }
27
+ for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
28
+ if (typeof options?.tsConfig === 'string' &&
29
+ tree.exists(options.tsConfig)) {
30
+ uniqueSpecTsConfigs.add(options.tsConfig);
31
+ }
32
+ }
33
+ }
34
+ }
35
+ for (const tsConfig of uniqueSpecTsConfigs) {
36
+ setIsolatedModules(tree, tsConfig);
37
+ }
38
+ await (0, devkit_1.formatFiles)(tree);
39
+ }
40
+ function setIsolatedModules(tree, tsConfigPath) {
41
+ const compilerOptions = (0, tsconfig_utils_1.readCompilerOptionsFromTsConfig)(tree, tsConfigPath);
42
+ if (compilerOptions.isolatedModules === true) {
43
+ // already set to true
44
+ return;
45
+ }
46
+ // set isolatedModules to true
47
+ (0, devkit_1.updateJson)(tree, tsConfigPath, (json) => {
48
+ json.compilerOptions ??= {};
49
+ json.compilerOptions.isolatedModules = true;
50
+ return json;
51
+ });
52
+ }