@nx/angular 21.2.0-canary.20250528-2572455 → 21.2.0-canary.20250530-b51676a

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "21.2.0-canary.20250528-2572455",
3
+ "version": "21.2.0-canary.20250530-b51676a",
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": {
@@ -58,14 +58,14 @@
58
58
  "migrations": "./migrations.json"
59
59
  },
60
60
  "dependencies": {
61
- "@nx/devkit": "21.2.0-canary.20250528-2572455",
62
- "@nx/eslint": "21.2.0-canary.20250528-2572455",
63
- "@nx/js": "21.2.0-canary.20250528-2572455",
64
- "@nx/module-federation": "21.2.0-canary.20250528-2572455",
65
- "@nx/rspack": "21.2.0-canary.20250528-2572455",
66
- "@nx/web": "21.2.0-canary.20250528-2572455",
67
- "@nx/webpack": "21.2.0-canary.20250528-2572455",
68
- "@nx/workspace": "21.2.0-canary.20250528-2572455",
61
+ "@nx/devkit": "21.2.0-canary.20250530-b51676a",
62
+ "@nx/eslint": "21.2.0-canary.20250530-b51676a",
63
+ "@nx/js": "21.2.0-canary.20250530-b51676a",
64
+ "@nx/module-federation": "21.2.0-canary.20250530-b51676a",
65
+ "@nx/rspack": "21.2.0-canary.20250530-b51676a",
66
+ "@nx/web": "21.2.0-canary.20250530-b51676a",
67
+ "@nx/webpack": "21.2.0-canary.20250530-b51676a",
68
+ "@nx/workspace": "21.2.0-canary.20250530-b51676a",
69
69
  "@phenomnomnominal/tsquery": "~5.0.1",
70
70
  "@typescript-eslint/type-utils": "^8.0.0",
71
71
  "enquirer": "~2.3.6",
@@ -6,10 +6,10 @@
6
6
  },
7
7
  "files": [],
8
8
  "include": [],
9
- "references": [
9
+ "references": [<% if (angularMajorVersion < 20) { %>
10
10
  {
11
11
  "path": "./tsconfig.editor.json"
12
- },
12
+ },<% } %>
13
13
  {
14
14
  "path": "./tsconfig.app.json"
15
15
  }
@@ -4,8 +4,8 @@ exports.updateTsconfigFiles = updateTsconfigFiles;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const js_1 = require("@nx/js");
6
6
  const configuration_1 = require("@nx/js/src/utils/typescript/configuration");
7
- const semver_1 = require("semver");
8
7
  const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
8
+ const semver_1 = require("semver");
9
9
  const update_app_editor_tsconfig_excluded_files_1 = require("../../utils/update-app-editor-tsconfig-excluded-files");
10
10
  const version_utils_1 = require("../../utils/version-utils");
11
11
  const enable_strict_type_checking_1 = require("./enable-strict-type-checking");
@@ -43,7 +43,8 @@ function updateTsconfigFiles(tree, options) {
43
43
  compilerOptions.esModuleInterop = true;
44
44
  }
45
45
  }
46
- (0, devkit_1.updateJson)(tree, `${options.appProjectRoot}/tsconfig.json`, (json) => {
46
+ const tsconfigPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json');
47
+ (0, devkit_1.updateJson)(tree, tsconfigPath, (json) => {
47
48
  json.compilerOptions = {
48
49
  ...json.compilerOptions,
49
50
  ...compilerOptions,
@@ -51,8 +52,24 @@ function updateTsconfigFiles(tree, options) {
51
52
  json.compilerOptions = (0, configuration_1.getNeededCompilerOptionOverrides)(tree, json.compilerOptions, rootTsConfigPath);
52
53
  return json;
53
54
  });
55
+ if (options.unitTestRunner === 'jest') {
56
+ const tsconfigSpecPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.spec.json');
57
+ (0, devkit_1.updateJson)(tree, tsconfigSpecPath, (json) => {
58
+ json.compilerOptions = {
59
+ ...json.compilerOptions,
60
+ module: 'commonjs',
61
+ moduleResolution: 'node10',
62
+ };
63
+ json.compilerOptions = (0, configuration_1.getNeededCompilerOptionOverrides)(tree, json.compilerOptions, tsconfigPath);
64
+ return json;
65
+ });
66
+ }
54
67
  }
55
68
  function updateEditorTsConfig(tree, options) {
69
+ const tsconfigEditorPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.editor.json');
70
+ if (!tree.exists(tsconfigEditorPath)) {
71
+ return;
72
+ }
56
73
  const appTsConfig = (0, devkit_1.readJson)(tree, (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'));
57
74
  const types = appTsConfig?.compilerOptions?.types ?? [];
58
75
  if (types?.length) {
@@ -19,6 +19,7 @@ function updateTsConfigFiles(tree, options) {
19
19
  experimentalDecorators: true,
20
20
  importHelpers: true,
21
21
  target: 'es2022',
22
+ moduleResolution: 'bundler',
22
23
  ...(options.strict
23
24
  ? {
24
25
  strict: true,
@@ -37,10 +38,10 @@ function updateTsConfigFiles(tree, options) {
37
38
  compilerOptions.module = 'preserve';
38
39
  }
39
40
  else {
40
- compilerOptions.moduleResolution = 'bundler';
41
41
  compilerOptions.module = 'es2022';
42
42
  }
43
- (0, devkit_1.updateJson)(tree, `${options.projectRoot}/tsconfig.json`, (json) => {
43
+ const tsconfigPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.json');
44
+ (0, devkit_1.updateJson)(tree, tsconfigPath, (json) => {
44
45
  json.compilerOptions = {
45
46
  ...json.compilerOptions,
46
47
  ...compilerOptions,
@@ -57,6 +58,18 @@ function updateTsConfigFiles(tree, options) {
57
58
  }
58
59
  return json;
59
60
  });
61
+ if (options.unitTestRunner === 'jest') {
62
+ const tsconfigSpecPath = (0, devkit_1.joinPathFragments)(options.projectRoot, 'tsconfig.spec.json');
63
+ (0, devkit_1.updateJson)(tree, tsconfigSpecPath, (json) => {
64
+ json.compilerOptions = {
65
+ ...json.compilerOptions,
66
+ module: 'commonjs',
67
+ moduleResolution: 'node10',
68
+ };
69
+ json.compilerOptions = (0, configuration_1.getNeededCompilerOptionOverrides)(tree, json.compilerOptions, tsconfigPath);
70
+ return json;
71
+ });
72
+ }
60
73
  }
61
74
  function updateProjectConfig(host, options) {
62
75
  (0, devkit_1.updateJson)(host, `${options.projectRoot}/tsconfig.lib.json`, (json) => {
@@ -50,8 +50,8 @@ async function libraryGenerator(tree, schema) {
50
50
  }
51
51
  const project = await (0, add_project_1.addProject)(tree, libraryOptions);
52
52
  (0, create_files_1.createFiles)(tree, options, project);
53
- (0, update_tsconfig_files_1.updateTsConfigFiles)(tree, libraryOptions);
54
53
  await addUnitTestRunner(tree, libraryOptions);
54
+ (0, update_tsconfig_files_1.updateTsConfigFiles)(tree, libraryOptions);
55
55
  updateNpmScopeIfBuildableOrPublishable(tree, libraryOptions);
56
56
  (0, set_generator_defaults_1.setGeneratorDefaults)(tree, options);
57
57
  if (!libraryOptions.standalone) {