@nx/angular 20.2.1 → 20.2.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 CHANGED
@@ -1368,6 +1368,35 @@
1368
1368
  "alwaysAddToPackageJson": false
1369
1369
  }
1370
1370
  }
1371
+ },
1372
+ "20.2.2-angular-eslint": {
1373
+ "version": "20.2.2-beta.0",
1374
+ "requires": {
1375
+ "eslint": "^8.57.0 || ^9.0.0",
1376
+ "@angular/core": ">= 19.0.0 < 20.0.0"
1377
+ },
1378
+ "packages": {
1379
+ "angular-eslint": {
1380
+ "version": "^19.0.2",
1381
+ "alwaysAddToPackageJson": false
1382
+ },
1383
+ "@angular-eslint/eslint-plugin": {
1384
+ "version": "^19.0.2",
1385
+ "alwaysAddToPackageJson": false
1386
+ },
1387
+ "@angular-eslint/eslint-plugin-template": {
1388
+ "version": "^19.0.2",
1389
+ "alwaysAddToPackageJson": false
1390
+ },
1391
+ "@angular-eslint/template-parser": {
1392
+ "version": "^19.0.2",
1393
+ "alwaysAddToPackageJson": false
1394
+ },
1395
+ "@angular-eslint/utils": {
1396
+ "version": "^19.0.2",
1397
+ "alwaysAddToPackageJson": false
1398
+ }
1399
+ }
1371
1400
  }
1372
1401
  }
1373
1402
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "20.2.1",
3
+ "version": "20.2.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": {
@@ -71,13 +71,13 @@
71
71
  "semver": "^7.5.3",
72
72
  "tslib": "^2.3.0",
73
73
  "webpack-merge": "^5.8.0",
74
- "@nx/devkit": "20.2.1",
75
- "@nx/js": "20.2.1",
76
- "@nx/eslint": "20.2.1",
77
- "@nx/webpack": "20.2.1",
78
- "@nx/module-federation": "20.2.1",
79
- "@nx/web": "20.2.1",
80
- "@nx/workspace": "20.2.1",
74
+ "@nx/devkit": "20.2.2",
75
+ "@nx/js": "20.2.2",
76
+ "@nx/eslint": "20.2.2",
77
+ "@nx/webpack": "20.2.2",
78
+ "@nx/module-federation": "20.2.2",
79
+ "@nx/web": "20.2.2",
80
+ "@nx/workspace": "20.2.2",
81
81
  "piscina": "^4.4.0"
82
82
  },
83
83
  "peerDependencies": {
@@ -24,10 +24,11 @@ function normalizeOptions(options) {
24
24
  }
25
25
  }
26
26
  }
27
- return {
28
- ...options,
29
- appShell: angularMajorVersion < 19 ? options.appShell ?? false : undefined,
30
- prerender: angularMajorVersion < 19 ? options.prerender ?? false : undefined,
31
- security,
32
- };
27
+ let appShell = options.appShell;
28
+ let prerender = options.prerender;
29
+ if (angularMajorVersion < 19) {
30
+ appShell ??= false;
31
+ prerender ??= false;
32
+ }
33
+ return { ...options, appShell, prerender, security };
33
34
  }
@@ -11,6 +11,8 @@ async function normalizeOptions(tree, options) {
11
11
  name: options.name,
12
12
  path: options.path,
13
13
  suffix: options.type ?? 'component',
14
+ allowedFileExtensions: ['ts'],
15
+ fileExtension: 'ts',
14
16
  });
15
17
  const { className } = (0, devkit_1.names)(name);
16
18
  const { className: suffixClassName } = (0, devkit_1.names)(options.type);
@@ -9,7 +9,7 @@
9
9
  "properties": {
10
10
  "path": {
11
11
  "type": "string",
12
- "description": "The file path to the component without the file extension and suffix. Relative to the current working directory.",
12
+ "description": "The file path to the component. Relative to the current working directory.",
13
13
  "$default": {
14
14
  "$source": "argv",
15
15
  "index": 0
@@ -10,6 +10,8 @@ async function normalizeOptions(tree, options) {
10
10
  name: options.name,
11
11
  path: options.path,
12
12
  suffix: 'directive',
13
+ allowedFileExtensions: ['ts'],
14
+ fileExtension: 'ts',
13
15
  });
14
16
  const { className } = (0, devkit_1.names)(name);
15
17
  const { className: suffixClassName } = (0, devkit_1.names)('directive');
@@ -9,6 +9,10 @@
9
9
  "examples": [
10
10
  {
11
11
  "description": "Generate a directive with the exported symbol matching the file name. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
12
+ "command": "nx g @nx/angular:directive mylib/src/lib/foo.directive.ts"
13
+ },
14
+ {
15
+ "description": "Generate a directive without providing the file extension. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
12
16
  "command": "nx g @nx/angular:directive mylib/src/lib/foo"
13
17
  },
14
18
  {
@@ -19,7 +23,7 @@
19
23
  "properties": {
20
24
  "path": {
21
25
  "type": "string",
22
- "description": "The file path to the directive without the file extension and suffix. Relative to the current working directory.",
26
+ "description": "The file path to the directive. Relative to the current working directory.",
23
27
  "$default": {
24
28
  "$source": "argv",
25
29
  "index": 0
@@ -9,6 +9,8 @@ async function normalizeOptions(tree, options) {
9
9
  name: options.name,
10
10
  path: options.path,
11
11
  suffix: 'pipe',
12
+ allowedFileExtensions: ['ts'],
13
+ fileExtension: 'ts',
12
14
  });
13
15
  const { className } = (0, devkit_1.names)(name);
14
16
  const { className: suffixClassName } = (0, devkit_1.names)('pipe');
@@ -9,6 +9,10 @@
9
9
  "examples": [
10
10
  {
11
11
  "description": "Generate a pipe with the exported symbol matching the file name. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
12
+ "command": "nx g @nx/angular:pipe mylib/src/lib/foo.pipe.ts"
13
+ },
14
+ {
15
+ "description": "Generate a pipe without providing the file extension. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
12
16
  "command": "nx g @nx/angular:pipe mylib/src/lib/foo"
13
17
  },
14
18
  {
@@ -19,7 +23,7 @@
19
23
  "properties": {
20
24
  "path": {
21
25
  "type": "string",
22
- "description": "The file path to the pipe without the file extension and suffix. Relative to the current working directory.",
26
+ "description": "The file path to the pipe. Relative to the current working directory.",
23
27
  "$default": {
24
28
  "$source": "argv",
25
29
  "index": 0
@@ -10,6 +10,8 @@ async function normalizeOptions(tree, options) {
10
10
  name: options.name,
11
11
  path: options.path,
12
12
  suffix: options.type ?? 'component',
13
+ allowedFileExtensions: ['ts'],
14
+ fileExtension: 'ts',
13
15
  });
14
16
  const { className } = (0, devkit_1.names)(name);
15
17
  const { className: suffixClassName } = (0, devkit_1.names)(options.type);
@@ -7,6 +7,10 @@
7
7
  "examples": [
8
8
  {
9
9
  "description": "Generate a component with the exported symbol matching the file name. It results in the component `FooComponent` at `mylib/src/lib/foo.component.ts`",
10
+ "command": "nx g @nx/angular:scam mylib/src/lib/foo.component.ts"
11
+ },
12
+ {
13
+ "description": "Generate a component without providing the file extension. It results in the component `FooComponent` at `mylib/src/lib/foo.component.ts`",
10
14
  "command": "nx g @nx/angular:scam mylib/src/lib/foo"
11
15
  },
12
16
  {
@@ -19,7 +23,7 @@
19
23
  "properties": {
20
24
  "path": {
21
25
  "type": "string",
22
- "description": "The file path to the SCAM without the file extension and suffix. Relative to the current working directory.",
26
+ "description": "The file path to the SCAM. Relative to the current working directory.",
23
27
  "$default": {
24
28
  "$source": "argv",
25
29
  "index": 0
@@ -9,6 +9,8 @@ async function normalizeOptions(tree, options) {
9
9
  name: options.name,
10
10
  path: options.path,
11
11
  suffix: 'directive',
12
+ allowedFileExtensions: ['ts'],
13
+ fileExtension: 'ts',
12
14
  });
13
15
  const { className } = (0, devkit_1.names)(name);
14
16
  const { className: suffixClassName } = (0, devkit_1.names)('directive');
@@ -7,6 +7,10 @@
7
7
  "examples": [
8
8
  {
9
9
  "description": "Generate a directive with the exported symbol matching the file name. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
10
+ "command": "nx g @nx/angular:scam-directive mylib/src/lib/foo.directive.ts"
11
+ },
12
+ {
13
+ "description": "Generate a directive without providing the file extension. It results in the directive `FooDirective` at `mylib/src/lib/foo.directive.ts`",
10
14
  "command": "nx g @nx/angular:scam-directive mylib/src/lib/foo"
11
15
  },
12
16
  {
@@ -19,7 +23,7 @@
19
23
  "properties": {
20
24
  "path": {
21
25
  "type": "string",
22
- "description": "The file path to the SCAM directive without the file extension and suffix. Relative to the current working directory.",
26
+ "description": "The file path to the SCAM directive. Relative to the current working directory.",
23
27
  "$default": {
24
28
  "$source": "argv",
25
29
  "index": 0
@@ -9,6 +9,8 @@ async function normalizeOptions(tree, options) {
9
9
  name: options.name,
10
10
  path: options.path,
11
11
  suffix: 'pipe',
12
+ allowedFileExtensions: ['ts'],
13
+ fileExtension: 'ts',
12
14
  });
13
15
  const { className } = (0, devkit_1.names)(name);
14
16
  const { className: suffixClassName } = (0, devkit_1.names)('pipe');
@@ -7,6 +7,10 @@
7
7
  "examples": [
8
8
  {
9
9
  "description": "Generate a pipe with the exported symbol matching the file name. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
10
+ "command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo.pipe.ts"
11
+ },
12
+ {
13
+ "description": "Generate a pipe without providing the file extension. It results in the pipe `FooPipe` at `mylib/src/lib/foo.pipe.ts`",
10
14
  "command": "nx g @nx/angular:scam-pipe mylib/src/lib/foo"
11
15
  },
12
16
  {
@@ -19,7 +23,7 @@
19
23
  "properties": {
20
24
  "path": {
21
25
  "type": "string",
22
- "description": "The file path to the SCAM pipe without the file extension and suffix. Relative to the current working directory.",
26
+ "description": "The file path to the SCAM pipe. Relative to the current working directory.",
23
27
  "$default": {
24
28
  "$source": "argv",
25
29
  "index": 0
@@ -1,2 +1,3 @@
1
1
  import { type Tree } from '@nx/devkit';
2
+ export declare const rulesToRemove: string[];
2
3
  export default function (tree: Tree): Promise<void>;
@@ -1,33 +1,62 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rulesToRemove = void 0;
3
4
  exports.default = default_1;
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
6
7
  const projects_1 = require("../utils/projects");
8
+ exports.rulesToRemove = [
9
+ '@angular-eslint/no-host-metadata-property',
10
+ '@angular-eslint/sort-ngmodule-metadata-arrays',
11
+ '@angular-eslint/prefer-standalone-component',
12
+ ];
7
13
  async function default_1(tree) {
8
14
  const projects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, [
9
15
  'npm:@angular/core',
10
16
  ]);
17
+ let hasRootProject = false;
11
18
  for (const { project: { root }, } of projects) {
12
19
  if (!(0, eslint_file_1.isEslintConfigSupported)(tree, root)) {
13
20
  // ESLint config is not supported, skip
14
21
  continue;
15
22
  }
16
- removeRule(tree, root, '@angular-eslint/no-host-metadata-property');
17
- removeRule(tree, root, '@angular-eslint/sort-ngmodule-metadata-arrays');
18
- removeRule(tree, root, '@angular-eslint/prefer-standalone-component');
23
+ if (root === '.') {
24
+ hasRootProject = true;
25
+ }
26
+ removeRules(tree, root);
27
+ }
28
+ /**
29
+ * We need to handle both a root config file (e.g. eslint.config.js) and a
30
+ * potential base config file (e.g. eslint.base.config.js). We can't use
31
+ * `findEslintFile` because it would return only one or the other depending
32
+ * on whether a root is provided and the existence of the files. So, we
33
+ * handle each of them separately.
34
+ */
35
+ // check root config, provide a root so it doesn't try to lookup a base config
36
+ if (!hasRootProject) {
37
+ // if there is no root project the root eslint config has not been processed
38
+ if ((0, eslint_file_1.isEslintConfigSupported)(tree, '')) {
39
+ removeRules(tree, '');
40
+ }
41
+ }
42
+ // handle root base config, not providing a root will prioritize a base config
43
+ const baseEslintConfig = (0, eslint_file_1.findEslintFile)(tree);
44
+ if (baseEslintConfig && baseEslintConfig.includes('.base.')) {
45
+ removeRules(tree, baseEslintConfig);
19
46
  }
20
47
  await (0, devkit_1.formatFiles)(tree);
21
48
  }
22
- function removeRule(tree, root, rule) {
23
- const lookup = (o) => !!o.rules?.[rule];
24
- if (!(0, eslint_file_1.lintConfigHasOverride)(tree, root, lookup, true)) {
25
- // it's not using the rule, skip
26
- return;
49
+ function removeRules(tree, root) {
50
+ for (const rule of exports.rulesToRemove) {
51
+ const lookup = (o) => !!o.rules?.[rule];
52
+ if (!(0, eslint_file_1.lintConfigHasOverride)(tree, root, lookup)) {
53
+ // it's not using the rule, skip
54
+ continue;
55
+ }
56
+ // there is an override containing the rule, remove the rule
57
+ (0, eslint_file_1.updateOverrideInLintConfig)(tree, root, lookup, (o) => {
58
+ delete o.rules[rule];
59
+ return o;
60
+ });
27
61
  }
28
- // there is an override containing the rule, remove the rule
29
- (0, eslint_file_1.updateOverrideInLintConfig)(tree, root, lookup, (o) => {
30
- delete o.rules[rule];
31
- return o;
32
- });
33
62
  }
@@ -14,7 +14,7 @@ export declare const typesExpressVersion = "4.17.14";
14
14
  export declare const browserSyncVersion = "^3.0.0";
15
15
  export declare const moduleFederationNodeVersion = "~2.6.11";
16
16
  export declare const moduleFederationEnhancedVersion = "0.7.6";
17
- export declare const angularEslintVersion = "^19.0.0";
17
+ export declare const angularEslintVersion = "^19.0.2";
18
18
  export declare const typescriptEslintVersion = "^7.16.0";
19
19
  export declare const tailwindVersion = "^3.0.2";
20
20
  export declare const postcssVersion = "^8.4.5";
@@ -17,7 +17,7 @@ exports.typesExpressVersion = '4.17.14';
17
17
  exports.browserSyncVersion = '^3.0.0';
18
18
  exports.moduleFederationNodeVersion = '~2.6.11';
19
19
  exports.moduleFederationEnhancedVersion = '0.7.6';
20
- exports.angularEslintVersion = '^19.0.0';
20
+ exports.angularEslintVersion = '^19.0.2';
21
21
  exports.typescriptEslintVersion = '^7.16.0';
22
22
  exports.tailwindVersion = '^3.0.2';
23
23
  exports.postcssVersion = '^8.4.5';