@nx/angular 20.2.0-canary.20241204-75b2080 → 20.2.0-rc.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/generators.json CHANGED
@@ -73,7 +73,8 @@
73
73
  "factory": "./src/generators/remote/remote",
74
74
  "schema": "./src/generators/remote/schema.json",
75
75
  "x-type": "application",
76
- "description": "Generate a Remote Angular Module Federation Application."
76
+ "description": "Generate a Remote Angular Module Federation Application.",
77
+ "aliases": ["producer"]
77
78
  },
78
79
  "move": {
79
80
  "factory": "./src/generators/move/move#angularMoveGenerator",
@@ -91,7 +92,8 @@
91
92
  "factory": "./src/generators/host/host",
92
93
  "schema": "./src/generators/host/schema.json",
93
94
  "x-type": "application",
94
- "description": "Generate a Host Angular Module Federation Application."
95
+ "description": "Generate a Host Angular Module Federation Application.",
96
+ "aliases": ["consumer"]
95
97
  },
96
98
  "ng-add": {
97
99
  "factory": "./src/generators/ng-add/ng-add",
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": {
@@ -1293,19 +1311,6 @@
1293
1311
  }
1294
1312
  }
1295
1313
  },
1296
- "20.2.0-analog": {
1297
- "version": "20.2.0-beta.5",
1298
- "packages": {
1299
- "@analogjs/vitest-angular": {
1300
- "version": "~1.10.0-beta.6",
1301
- "alwaysAddToPackageJson": false
1302
- },
1303
- "@analogjs/vite-plugin-angular": {
1304
- "version": "~1.10.0-beta.6",
1305
- "alwaysAddToPackageJson": false
1306
- }
1307
- }
1308
- },
1309
1314
  "20.2.0-jest": {
1310
1315
  "version": "20.2.0-beta.5",
1311
1316
  "requires": {
@@ -1350,6 +1355,19 @@
1350
1355
  "alwaysAddToPackageJson": false
1351
1356
  }
1352
1357
  }
1358
+ },
1359
+ "20.2.0-analog": {
1360
+ "version": "20.2.0-beta.7",
1361
+ "packages": {
1362
+ "@analogjs/vitest-angular": {
1363
+ "version": "~1.10.0",
1364
+ "alwaysAddToPackageJson": false
1365
+ },
1366
+ "@analogjs/vite-plugin-angular": {
1367
+ "version": "~1.10.0",
1368
+ "alwaysAddToPackageJson": false
1369
+ }
1370
+ }
1353
1371
  }
1354
1372
  }
1355
1373
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "20.2.0-canary.20241204-75b2080",
3
+ "version": "20.2.0-rc.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.20241204-75b2080",
75
- "@nx/js": "20.2.0-canary.20241204-75b2080",
76
- "@nx/eslint": "20.2.0-canary.20241204-75b2080",
77
- "@nx/webpack": "20.2.0-canary.20241204-75b2080",
78
- "@nx/module-federation": "20.2.0-canary.20241204-75b2080",
79
- "@nx/web": "20.2.0-canary.20241204-75b2080",
80
- "@nx/workspace": "20.2.0-canary.20241204-75b2080",
74
+ "@nx/devkit": "20.2.0-rc.0",
75
+ "@nx/js": "20.2.0-rc.0",
76
+ "@nx/eslint": "20.2.0-rc.0",
77
+ "@nx/webpack": "20.2.0-rc.0",
78
+ "@nx/module-federation": "20.2.0-rc.0",
79
+ "@nx/web": "20.2.0-rc.0",
80
+ "@nx/workspace": "20.2.0-rc.0",
81
81
  "piscina": "^4.4.0"
82
82
  },
83
83
  "peerDependencies": {
@@ -3,11 +3,15 @@
3
3
  "cli": "nx",
4
4
  "$id": "NxReactFederateModule",
5
5
  "title": "Federate Module",
6
- "description": "Create a federated module, which is exposed by a remote and can be subsequently loaded by a host.",
6
+ "description": "Create a federated module, which is exposed by a Producer (remote) and can be subsequently loaded by a Consumer (host).",
7
7
  "examples": [
8
8
  {
9
- "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=my-remote-app --remoteDirectory=apps/my-remote-app",
9
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --remote=myRemoteApp --remoteDirectory=apps/myRemoteApp",
10
10
  "description": "Create a federated module from my-remote-app, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
11
+ },
12
+ {
13
+ "command": "nx g federate-module MyModule --path=./src/component/my-cmp.ts --producer=myProducer --producerDirectory=apps/myProducer",
14
+ "description": "Create a federated module from myProducer, that exposes my-cmp from ./src/component/my-cmp.ts as MyModule."
11
15
  }
12
16
  ],
13
17
  "type": "object",
@@ -30,15 +34,17 @@
30
34
  },
31
35
  "remote": {
32
36
  "type": "string",
33
- "description": "The name of the remote.",
34
- "x-prompt": "What is/should the remote be named?"
37
+ "description": "The name of the Producer (remote).",
38
+ "x-prompt": "What is/should the Producer (remote) be named?",
39
+ "alias": "producer"
35
40
  },
36
41
  "remoteDirectory": {
37
- "description": "The directory of the new remote application if one needs to be created.",
38
- "type": "string"
42
+ "description": "The directory of the new Producer (remote) application if one needs to be created.",
43
+ "type": "string",
44
+ "alias": "producerDirectory"
39
45
  },
40
46
  "style": {
41
- "description": "The file extension to be used for style files for the remote if one needs to be created.",
47
+ "description": "The file extension to be used for style files for the Producer (remote) if one needs to be created.",
42
48
  "type": "string",
43
49
  "default": "css",
44
50
  "enum": ["css", "scss", "sass", "less"]
@@ -52,24 +58,25 @@
52
58
  "unitTestRunner": {
53
59
  "type": "string",
54
60
  "enum": ["jest", "vitest", "none"],
55
- "description": "Test runner to use for unit tests of the remote if it needs to be created.",
61
+ "description": "Test runner to use for unit tests of the Producer (remote) if it needs to be created.",
56
62
  "x-prompt": "Which unit test runner would you like to use?",
57
63
  "default": "jest"
58
64
  },
59
65
  "e2eTestRunner": {
60
66
  "type": "string",
61
67
  "enum": ["cypress", "none"],
62
- "description": "Test runner to use for end to end (e2e) tests of the remote if it needs to be created.",
68
+ "description": "Test runner to use for end to end (e2e) tests of the Producer (remote) if it needs to be created.",
63
69
  "default": "cypress"
64
70
  },
65
71
  "standalone": {
66
- "description": "Whether to generate the remote application with standalone components if it needs to be created.",
72
+ "description": "Whether to generate the Producer (remote) application with standalone components if it needs to be created.",
67
73
  "type": "boolean",
68
74
  "default": true
69
75
  },
70
76
  "host": {
71
77
  "type": "string",
72
- "description": "The host / shell application for this remote."
78
+ "description": "The Consumer (host) application for this Producer (remote).",
79
+ "alias": "consumer"
73
80
  }
74
81
  },
75
82
  "required": ["name", "path", "remote"],
@@ -2,13 +2,17 @@
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxMFHost",
4
4
  "cli": "nx",
5
- "title": "Nx Module Federation Host Application",
6
- "description": "Create an Angular Host Module Federation Application.",
5
+ "title": "Nx Module Federation Consumer (Host) Application",
6
+ "description": "Create an Angular Consumer (Host) Module Federation Application.",
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
10
  "command": "nx g @nx/angular:host appName --remotes=remote1",
11
- "description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the remote application to this application's configuration"
11
+ "description": "Create an Angular application with configuration in place for Module Federation. If the `remotes` option is provided, attach the Producer (remote) application to this application's configuration"
12
+ },
13
+ {
14
+ "command": "nx g @nx/angular:consumer appName --producers=remote1",
15
+ "description": "Create an Angular application with configuration in place for Module Federation. If the `producers` option is provided, attach the Producer (remote) application to this application's configuration"
12
16
  }
13
17
  ],
14
18
  "properties": {
@@ -23,14 +27,15 @@
23
27
  },
24
28
  "name": {
25
29
  "type": "string",
26
- "description": "The name to give to the host Angular application.",
30
+ "description": "The name to give to the Consumer (host) Angular application.",
27
31
  "pattern": "^[a-zA-Z][^:]*$",
28
32
  "x-priority": "important"
29
33
  },
30
34
  "remotes": {
31
35
  "type": "array",
32
- "description": "The names of the remote applications to add to the host.",
33
- "x-priority": "important"
36
+ "description": "The names of the Producers (remote) applications to add to the Consumer (host).",
37
+ "x-priority": "important",
38
+ "alias": "producers"
34
39
  },
35
40
  "dynamic": {
36
41
  "type": "boolean",
@@ -163,11 +168,11 @@
163
168
  },
164
169
  "standalone": {
165
170
  "type": "boolean",
166
- "description": "Whether to generate a host application that uses standalone components.",
171
+ "description": "Whether to generate a Consumer (host) application that uses standalone components.",
167
172
  "default": true
168
173
  },
169
174
  "ssr": {
170
- "description": "Whether to configure SSR for the host application",
175
+ "description": "Whether to configure SSR for the Consumer (host) application",
171
176
  "type": "boolean",
172
177
  "default": false,
173
178
  "x-priority": "important"
@@ -2,13 +2,17 @@
2
2
  "$schema": "https://json-schema.org/schema",
3
3
  "$id": "NxMFRemote",
4
4
  "cli": "nx",
5
- "title": "Nx Module Federation Remote App",
6
- "description": "Create an Angular Remote Module Federation Application.",
5
+ "title": "Nx Module Federation Producer (Remote) App",
6
+ "description": "Create an Angular Producer (Remote) Module Federation Application.",
7
7
  "type": "object",
8
8
  "examples": [
9
9
  {
10
10
  "command": "nx g @nx/angular:remote appName --host=host --port=4201",
11
- "description": "Create an Angular app with configuration in place for Module Federation. If host is provided, attach this remote app to host app's configuration."
11
+ "description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
12
+ },
13
+ {
14
+ "command": "nx g @nx/angular:producer appName --consumer=host --port=4201",
15
+ "description": "Create an Angular app with configuration in place for Module Federation. If Consumer (host) is provided, attach this Producer (remote) app to Consumer (host) app's configuration."
12
16
  }
13
17
  ],
14
18
  "properties": {
@@ -23,15 +27,16 @@
23
27
  },
24
28
  "name": {
25
29
  "type": "string",
26
- "description": "The name to give to the remote Angular app.",
30
+ "description": "The name to give to the Producer (remote) Angular app.",
27
31
  "pattern": "^[a-zA-Z_$][a-zA-Z_$0-9]*$",
28
32
  "x-priority": "important"
29
33
  },
30
34
  "host": {
31
35
  "type": "string",
32
- "description": "The name of the host app to attach this remote app to.",
36
+ "description": "The name of the Consumer (host) app to attach this Producer (remote) app to.",
33
37
  "x-dropdown": "projects",
34
- "x-priority": "important"
38
+ "x-priority": "important",
39
+ "alias": "consumer"
35
40
  },
36
41
  "port": {
37
42
  "type": "number",
@@ -156,12 +161,12 @@
156
161
  "x-priority": "internal"
157
162
  },
158
163
  "standalone": {
159
- "description": "Whether to generate a remote application with standalone components.",
164
+ "description": "Whether to generate a Producer (remote) application with standalone components.",
160
165
  "type": "boolean",
161
166
  "default": true
162
167
  },
163
168
  "ssr": {
164
- "description": "Whether to configure SSR for the remote application to be consumed by a host application using SSR.",
169
+ "description": "Whether to configure SSR for the Producer (remote) application to be consumed by a Consumer (host) application using SSR.",
165
170
  "type": "boolean",
166
171
  "default": false
167
172
  },
@@ -34,15 +34,17 @@
34
34
  },
35
35
  "remotes": {
36
36
  "type": "array",
37
- "description": "A list of remote application names that the host application should consume."
37
+ "description": "A list of remote application names that the Consumer (host) application should consume.",
38
+ "alias": "producers"
38
39
  },
39
40
  "host": {
40
41
  "type": "string",
41
- "description": "The name of the host application that the remote application will be consumed by."
42
+ "description": "The name of the host application that the remote application will be consumed by.",
43
+ "alias": "consumer"
42
44
  },
43
45
  "routing": {
44
46
  "type": "boolean",
45
- "description": "Generate a routing setup to allow a host application to route to the remote application.",
47
+ "description": "Generate a routing setup to allow a Consumer (host) application to route to the Producer (remote) application.",
46
48
  "x-priority": "important"
47
49
  },
48
50
  "skipFormat": {
@@ -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
+ }
@@ -24,5 +24,5 @@ export declare const tsNodeVersion = "10.9.1";
24
24
  export declare const jestPresetAngularVersion = "~14.4.0";
25
25
  export declare const typesNodeVersion = "18.16.9";
26
26
  export declare const jasmineMarblesVersion = "^0.9.2";
27
- export declare const analogVitestAngular = "~1.10.0-beta.6";
27
+ export declare const analogVitestAngular = "~1.10.0";
28
28
  export declare const jsoncEslintParserVersion = "^2.1.0";
@@ -27,5 +27,5 @@ exports.tsNodeVersion = '10.9.1';
27
27
  exports.jestPresetAngularVersion = '~14.4.0';
28
28
  exports.typesNodeVersion = '18.16.9';
29
29
  exports.jasmineMarblesVersion = '^0.9.2';
30
- exports.analogVitestAngular = '~1.10.0-beta.6';
30
+ exports.analogVitestAngular = '~1.10.0';
31
31
  exports.jsoncEslintParserVersion = '^2.1.0';