@nx/angular 0.0.0-pr-29176-d3c6c29 → 0.0.0-pr-29314-bfd9d0c

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.
Files changed (31) hide show
  1. package/generators.json +4 -2
  2. package/migrations.json +72 -13
  3. package/package.json +8 -8
  4. package/src/builders/dev-server/lib/normalize-options.js +1 -1
  5. package/src/executors/application/utils/normalize-options.js +7 -6
  6. package/src/generators/component/lib/normalize-options.js +2 -0
  7. package/src/generators/component/schema.json +1 -1
  8. package/src/generators/directive/lib/normalize-options.js +2 -0
  9. package/src/generators/directive/schema.json +5 -1
  10. package/src/generators/federate-module/schema.json +18 -11
  11. package/src/generators/host/schema.json +13 -8
  12. package/src/generators/pipe/lib/normalize-options.js +2 -0
  13. package/src/generators/pipe/schema.json +5 -1
  14. package/src/generators/remote/schema.json +13 -8
  15. package/src/generators/scam/lib/normalize-options.js +2 -0
  16. package/src/generators/scam/schema.json +5 -1
  17. package/src/generators/scam-directive/lib/normalize-options.js +2 -0
  18. package/src/generators/scam-directive/schema.json +5 -1
  19. package/src/generators/scam-pipe/lib/normalize-options.js +2 -0
  20. package/src/generators/scam-pipe/schema.json +5 -1
  21. package/src/generators/setup-mf/schema.json +5 -3
  22. package/src/generators/utils/add-vitest.js +8 -42
  23. package/src/migrations/update-20-2-0/add-localize-polyfill-to-targets.js +8 -1
  24. package/src/migrations/update-20-2-0/remove-angular-eslint-rules.d.ts +3 -0
  25. package/src/migrations/update-20-2-0/remove-angular-eslint-rules.js +62 -0
  26. package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.d.ts +3 -0
  27. package/src/migrations/update-20-2-0/remove-tailwind-config-from-ng-packagr-executors.js +73 -0
  28. package/src/utils/backward-compatible-versions.d.ts +1 -1
  29. package/src/utils/backward-compatible-versions.js +0 -1
  30. package/src/utils/versions.d.ts +2 -3
  31. package/src/utils/versions.js +3 -4
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,60 @@
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
+ }
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
+ }
1400
+ },
1401
+ "20.2.3-ngrx": {
1402
+ "version": "20.3.0-beta.2",
1403
+ "requires": {
1404
+ "@angular/core": "^19.0.0"
1405
+ },
1406
+ "packages": {
1407
+ "@ngrx/store": {
1408
+ "version": "^19.0.0",
1409
+ "alwaysAddToPackageJson": false
1410
+ }
1411
+ }
1353
1412
  }
1354
1413
  }
1355
1414
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nx/angular",
3
- "version": "0.0.0-pr-29176-d3c6c29",
3
+ "version": "0.0.0-pr-29314-bfd9d0c",
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": "0.0.0-pr-29176-d3c6c29",
75
- "@nx/js": "0.0.0-pr-29176-d3c6c29",
76
- "@nx/eslint": "0.0.0-pr-29176-d3c6c29",
77
- "@nx/webpack": "0.0.0-pr-29176-d3c6c29",
78
- "@nx/module-federation": "0.0.0-pr-29176-d3c6c29",
79
- "@nx/web": "0.0.0-pr-29176-d3c6c29",
80
- "@nx/workspace": "0.0.0-pr-29176-d3c6c29",
74
+ "@nx/devkit": "0.0.0-pr-29314-bfd9d0c",
75
+ "@nx/js": "0.0.0-pr-29314-bfd9d0c",
76
+ "@nx/eslint": "0.0.0-pr-29314-bfd9d0c",
77
+ "@nx/webpack": "0.0.0-pr-29314-bfd9d0c",
78
+ "@nx/module-federation": "0.0.0-pr-29314-bfd9d0c",
79
+ "@nx/web": "0.0.0-pr-29314-bfd9d0c",
80
+ "@nx/workspace": "0.0.0-pr-29314-bfd9d0c",
81
81
  "piscina": "^4.4.0"
82
82
  },
83
83
  "peerDependencies": {
@@ -15,7 +15,7 @@ function normalizeOptions(schema) {
15
15
  host: schema.host ?? 'localhost',
16
16
  port: schema.port ?? 4200,
17
17
  liveReload: schema.liveReload ?? true,
18
- hmr: angularMajorVersion < 19 ? schema.hmr ?? false : undefined,
18
+ hmr: schema.hmr ?? (angularMajorVersion < 19 ? false : undefined),
19
19
  open: schema.open ?? false,
20
20
  ssl: schema.ssl ?? false,
21
21
  };
@@ -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
@@ -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"
@@ -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
@@ -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
  },
@@ -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
@@ -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": {
@@ -4,46 +4,12 @@ exports.addVitest = addVitest;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("../../utils/versions");
6
6
  async function addVitest(tree, options) {
7
- if (!options.skipPackageJson) {
8
- (0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
9
- '@analogjs/vitest-angular': versions_1.analogVitestAngular,
10
- '@analogjs/vite-plugin-angular': versions_1.analogVitestAngular,
11
- }, undefined, true);
12
- }
13
- const { createOrEditViteConfig, vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
14
- const relativeTestSetupPath = (0, devkit_1.joinPathFragments)('src', 'test-setup.ts');
15
- const setupFile = (0, devkit_1.joinPathFragments)(options.projectRoot, relativeTestSetupPath);
16
- if (!tree.exists(setupFile)) {
17
- tree.write(setupFile, `import '@analogjs/vitest-angular/setup-zone';
18
-
19
- import {
20
- BrowserDynamicTestingModule,
21
- platformBrowserDynamicTesting,
22
- } from '@angular/platform-browser-dynamic/testing';
23
- import { getTestBed } from '@angular/core/testing';
24
-
25
- getTestBed().initTestEnvironment(
26
- BrowserDynamicTestingModule,
27
- platformBrowserDynamicTesting()
28
- );
29
- `);
30
- await vitestGenerator(tree, {
31
- project: options.name,
32
- uiFramework: 'none',
33
- skipViteConfig: true,
34
- testEnvironment: 'jsdom',
35
- coverageProvider: 'v8',
36
- addPlugin: false,
37
- });
38
- createOrEditViteConfig(tree, {
39
- project: options.name,
40
- includeLib: false,
41
- includeVitest: true,
42
- inSourceTests: false,
43
- imports: [`import angular from '@analogjs/vite-plugin-angular'`],
44
- plugins: ['angular()'],
45
- setupFile: relativeTestSetupPath,
46
- useEsmExtension: true,
47
- }, true);
48
- }
7
+ const { vitestGenerator } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
8
+ await vitestGenerator(tree, {
9
+ project: options.name,
10
+ uiFramework: 'angular',
11
+ testEnvironment: 'jsdom',
12
+ coverageProvider: 'v8',
13
+ addPlugin: false,
14
+ });
49
15
  }
@@ -33,7 +33,14 @@ async function default_1(tree) {
33
33
  for (const [, options] of (0, targets_1.allTargetOptions)(target)) {
34
34
  if (options['localize']) {
35
35
  target.options ??= {};
36
- target.options['polyfills'] ??= [];
36
+ const polyfills = target.options['polyfills'];
37
+ // Ensure polyfills is an array before pushing
38
+ if (typeof polyfills === 'string') {
39
+ target.options['polyfills'] = [polyfills];
40
+ }
41
+ else if (!Array.isArray(polyfills)) {
42
+ target.options['polyfills'] = [];
43
+ }
37
44
  target.options['polyfills'].push('@angular/localize/init');
38
45
  isUpdated = true;
39
46
  break;
@@ -0,0 +1,3 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export declare const rulesToRemove: string[];
3
+ export default function (tree: Tree): Promise<void>;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.rulesToRemove = void 0;
4
+ exports.default = default_1;
5
+ const devkit_1 = require("@nx/devkit");
6
+ const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
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
+ ];
13
+ async function default_1(tree) {
14
+ const projects = await (0, projects_1.getProjectsFilteredByDependencies)(tree, [
15
+ 'npm:@angular/core',
16
+ ]);
17
+ let hasRootProject = false;
18
+ for (const { project: { root }, } of projects) {
19
+ if (!(0, eslint_file_1.isEslintConfigSupported)(tree, root)) {
20
+ // ESLint config is not supported, skip
21
+ continue;
22
+ }
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);
46
+ }
47
+ await (0, devkit_1.formatFiles)(tree);
48
+ }
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
+ });
61
+ }
62
+ }
@@ -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
+ }
@@ -4,7 +4,7 @@ type LatestPackageVersionNames = Exclude<keyof typeof latestVersions, 'nxVersion
4
4
  type CompatPackageVersionNames = LatestPackageVersionNames;
5
5
  export type PackageVersionNames = LatestPackageVersionNames | CompatPackageVersionNames;
6
6
  export type VersionMap = {
7
- angularV17: Record<Exclude<CompatPackageVersionNames, 'analogVitestAngular' | 'typescriptEslintVersion'>, string>;
7
+ angularV17: Record<Exclude<CompatPackageVersionNames, 'typescriptEslintVersion'>, string>;
8
8
  angularV18: Record<CompatPackageVersionNames, string>;
9
9
  };
10
10
  export type PackageLatestVersions = Record<LatestPackageVersionNames, string>;
@@ -55,7 +55,6 @@ exports.backwardCompatibleVersions = {
55
55
  jestPresetAngularVersion: '~14.1.0',
56
56
  typesNodeVersion: '18.16.9',
57
57
  jasmineMarblesVersion: '^0.9.2',
58
- analogVitestAngular: '~1.9.1',
59
58
  jsoncEslintParserVersion: '^2.1.0',
60
59
  },
61
60
  };
@@ -2,7 +2,7 @@ export declare const nxVersion: any;
2
2
  export declare const angularVersion = "~19.0.0";
3
3
  export declare const angularDevkitVersion = "~19.0.0";
4
4
  export declare const ngPackagrVersion = "~19.0.0";
5
- export declare const ngrxVersion = "^18.0.2";
5
+ export declare const ngrxVersion = "^19.0.0";
6
6
  export declare const rxjsVersion = "~7.8.0";
7
7
  export declare const zoneJsVersion = "~0.15.0";
8
8
  export declare const angularJsVersion = "1.7.9";
@@ -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";
@@ -24,5 +24,4 @@ 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";
28
27
  export declare const jsoncEslintParserVersion = "^2.1.0";
@@ -1,11 +1,11 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.jsoncEslintParserVersion = exports.analogVitestAngular = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
3
+ exports.jsoncEslintParserVersion = exports.jasmineMarblesVersion = exports.typesNodeVersion = exports.jestPresetAngularVersion = exports.tsNodeVersion = exports.autoprefixerVersion = exports.postcssUrlVersion = exports.postcssVersion = exports.tailwindVersion = exports.typescriptEslintVersion = exports.angularEslintVersion = exports.moduleFederationEnhancedVersion = exports.moduleFederationNodeVersion = exports.browserSyncVersion = exports.typesExpressVersion = exports.expressVersion = exports.typesCorsVersion = exports.corsVersion = exports.tsLibVersion = exports.angularJsVersion = exports.zoneJsVersion = exports.rxjsVersion = exports.ngrxVersion = exports.ngPackagrVersion = exports.angularDevkitVersion = exports.angularVersion = exports.nxVersion = void 0;
4
4
  exports.nxVersion = require('../../package.json').version;
5
5
  exports.angularVersion = '~19.0.0';
6
6
  exports.angularDevkitVersion = '~19.0.0';
7
7
  exports.ngPackagrVersion = '~19.0.0';
8
- exports.ngrxVersion = '^18.0.2';
8
+ exports.ngrxVersion = '^19.0.0';
9
9
  exports.rxjsVersion = '~7.8.0';
10
10
  exports.zoneJsVersion = '~0.15.0';
11
11
  exports.angularJsVersion = '1.7.9';
@@ -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';
@@ -27,5 +27,4 @@ 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';
31
30
  exports.jsoncEslintParserVersion = '^2.1.0';