@nx/angular 20.2.0-canary.20241205-15060e3 → 20.2.0

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
@@ -314,6 +314,24 @@
314
314
  },
315
315
  "description": "Disable the Angular ESLint prefer-standalone rule if not set.",
316
316
  "factory": "./src/migrations/update-20-2-0/disable-angular-eslint-prefer-standalone"
317
+ },
318
+ "remove-angular-eslint-rules": {
319
+ "cli": "nx",
320
+ "version": "20.2.0-beta.8",
321
+ "requires": {
322
+ "@angular/core": ">=19.0.0"
323
+ },
324
+ "description": "Remove Angular ESLint rules that were removed in v19.0.0.",
325
+ "factory": "./src/migrations/update-20-2-0/remove-angular-eslint-rules"
326
+ },
327
+ "remove-tailwind-config-from-ng-packagr-executors": {
328
+ "cli": "nx",
329
+ "version": "20.2.0-beta.8",
330
+ "requires": {
331
+ "@angular/core": ">=19.0.0"
332
+ },
333
+ "description": "Remove the deprecated 'tailwindConfig' option from ng-packagr executors. Tailwind CSS configurations located at the project or workspace root will be picked up automatically.",
334
+ "factory": "./src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors"
317
335
  }
318
336
  },
319
337
  "packageJsonUpdates": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "20.2.0-canary.20241205-15060e3",
3
+ "version": "20.2.0",
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.0-canary.20241205-15060e3",
75
- "@nx/js": "20.2.0-canary.20241205-15060e3",
76
- "@nx/eslint": "20.2.0-canary.20241205-15060e3",
77
- "@nx/webpack": "20.2.0-canary.20241205-15060e3",
78
- "@nx/module-federation": "20.2.0-canary.20241205-15060e3",
79
- "@nx/web": "20.2.0-canary.20241205-15060e3",
80
- "@nx/workspace": "20.2.0-canary.20241205-15060e3",
74
+ "@nx/devkit": "20.2.0",
75
+ "@nx/js": "20.2.0",
76
+ "@nx/eslint": "20.2.0",
77
+ "@nx/webpack": "20.2.0",
78
+ "@nx/module-federation": "20.2.0",
79
+ "@nx/web": "20.2.0",
80
+ "@nx/workspace": "20.2.0",
81
81
  "piscina": "^4.4.0"
82
82
  },
83
83
  "peerDependencies": {
@@ -0,0 +1,2 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export default function (tree: Tree): Promise<void>;
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = default_1;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
6
+ const projects_1 = require("../utils/projects");
7
+ async function default_1(tree) {
8
+ const projects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, [
9
+ 'npm:@angular/core',
10
+ ]);
11
+ for (const { project: { root }, } of projects) {
12
+ if (!(0, eslint_file_1.isEslintConfigSupported)(tree, root)) {
13
+ // ESLint config is not supported, skip
14
+ continue;
15
+ }
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');
19
+ }
20
+ await (0, devkit_1.formatFiles)(tree);
21
+ }
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;
27
+ }
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
+ }
@@ -0,0 +1,3 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export declare const executors: string[];
3
+ export default function (tree: Tree): Promise<void>;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executors = void 0;
4
+ exports.default = default_1;
5
+ const devkit_1 = require("@nx/devkit");
6
+ const executor_options_utils_1 = require("@nx/devkit/src/generators/executor-options-utils");
7
+ exports.executors = ['@nx/angular:ng-packagr-lite', '@nx/angular:package'];
8
+ async function default_1(tree) {
9
+ // update options from project configs
10
+ exports.executors.forEach((executor) => {
11
+ (0, executor_options_utils_1.forEachExecutorOptions)(tree, executor, (options, project, target, configuration) => {
12
+ if (options.tailwindConfig === undefined) {
13
+ return;
14
+ }
15
+ const projectConfiguration = (0, devkit_1.readProjectConfiguration)(tree, project);
16
+ if (configuration) {
17
+ const config = projectConfiguration.targets[target].configurations[configuration];
18
+ delete config.tailwindConfig;
19
+ if (!Object.keys(config).length) {
20
+ delete projectConfiguration.targets[target].configurations[configuration];
21
+ }
22
+ if (!Object.keys(projectConfiguration.targets[target].configurations)
23
+ .length) {
24
+ delete projectConfiguration.targets[target].configurations;
25
+ }
26
+ }
27
+ else {
28
+ const config = projectConfiguration.targets[target].options;
29
+ delete config.tailwindConfig;
30
+ if (!Object.keys(config).length) {
31
+ delete projectConfiguration.targets[target].options;
32
+ }
33
+ }
34
+ (0, devkit_1.updateProjectConfiguration)(tree, project, projectConfiguration);
35
+ });
36
+ });
37
+ // update options from nx.json target defaults
38
+ const nxJson = (0, devkit_1.readNxJson)(tree);
39
+ if (!nxJson.targetDefaults) {
40
+ return;
41
+ }
42
+ for (const [targetOrExecutor, targetConfig] of Object.entries(nxJson.targetDefaults)) {
43
+ if (!exports.executors.includes(targetOrExecutor) &&
44
+ !exports.executors.includes(targetConfig.executor)) {
45
+ continue;
46
+ }
47
+ if (targetConfig.options) {
48
+ delete targetConfig.options.tailwindConfig;
49
+ if (!Object.keys(targetConfig.options).length) {
50
+ delete targetConfig.options;
51
+ }
52
+ }
53
+ Object.entries(targetConfig.configurations ?? {}).forEach(([name, config]) => {
54
+ delete config.tailwindConfig;
55
+ if (!Object.keys(config).length) {
56
+ delete targetConfig.configurations[name];
57
+ }
58
+ });
59
+ if (!Object.keys(targetConfig.configurations ?? {}).length) {
60
+ delete targetConfig.configurations;
61
+ }
62
+ if (!Object.keys(targetConfig).length ||
63
+ (Object.keys(targetConfig).length === 1 &&
64
+ Object.keys(targetConfig)[0] === 'executor')) {
65
+ delete nxJson.targetDefaults[targetOrExecutor];
66
+ }
67
+ if (!Object.keys(nxJson.targetDefaults).length) {
68
+ delete nxJson.targetDefaults;
69
+ }
70
+ }
71
+ (0, devkit_1.updateNxJson)(tree, nxJson);
72
+ await (0, devkit_1.formatFiles)(tree);
73
+ }