@nx/angular 24.0.0-beta.2 → 24.0.0-beta.4

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 (204) hide show
  1. package/dist/executors.d.ts +0 -2
  2. package/dist/executors.js +0 -2
  3. package/dist/fesm2022/nx-angular.mjs +0 -4
  4. package/dist/generators.d.ts +0 -4
  5. package/dist/generators.js +0 -4
  6. package/dist/src/executors/application/schema.json +1 -2
  7. package/dist/src/executors/ng-packagr-lite/ng-packagr-adjustments/ng-package/entry-point/write-bundles.transform.js +9 -1
  8. package/dist/src/executors/unit-test/schema.json +6 -1
  9. package/dist/src/executors/unit-test/unit-test.impl.js +5 -0
  10. package/dist/src/executors/utilities/ng-packagr/stylesheet-processor.js +35 -10
  11. package/dist/src/generators/add-linting/add-linting.js +0 -2
  12. package/dist/src/generators/add-linting/schema.d.ts +0 -1
  13. package/dist/src/generators/application/application.js +1 -2
  14. package/dist/src/generators/application/lib/add-e2e.js +0 -6
  15. package/dist/src/generators/application/lib/add-linting.js +0 -1
  16. package/dist/src/generators/application/lib/add-unit-test-runner.js +0 -2
  17. package/dist/src/generators/application/lib/normalize-options.d.ts +1 -1
  18. package/dist/src/generators/application/lib/normalize-options.js +1 -8
  19. package/dist/src/generators/application/schema.d.ts +0 -1
  20. package/dist/src/generators/application/schema.json +1 -1
  21. package/dist/src/generators/convert-to-rspack/convert-to-rspack.js +3 -4
  22. package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.d.ts +1 -2
  23. package/dist/src/generators/convert-to-rspack/lib/get-custom-webpack-config.js +0 -63
  24. package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.d.ts +2 -0
  25. package/dist/src/generators/convert-to-rspack/lib/validate-no-module-federation.js +32 -0
  26. package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +3 -15
  27. package/dist/src/generators/init/init.js +1 -2
  28. package/dist/src/generators/init/schema.d.ts +0 -2
  29. package/dist/src/generators/library/schema.d.ts +0 -1
  30. package/dist/src/generators/ng-add/migrators/builders/angular-eslint-lint.migrator.js +12 -1
  31. package/dist/src/generators/ng-add/migrators/projects/e2e.migrator.js +12 -16
  32. package/dist/src/generators/ng-add/utilities/workspace.js +1 -3
  33. package/dist/src/generators/storybook-configuration/lib/generate-storybook-configuration.js +0 -2
  34. package/dist/src/generators/utils/add-jest.d.ts +0 -1
  35. package/dist/src/generators/utils/add-jest.js +0 -2
  36. package/dist/src/generators/utils/add-vitest.d.ts +0 -1
  37. package/dist/src/generators/utils/add-vitest.js +0 -1
  38. package/dist/src/generators/utils/testing.d.ts +0 -4
  39. package/dist/src/generators/utils/testing.js +0 -12
  40. package/dist/src/migrations/update-23-1-0/add-angular-build.js +7 -3
  41. package/dist/src/migrations/update-23-1-0/add-angular-build.md +1 -1
  42. package/dist/src/migrations/update-23-1-0/add-trust-proxy-headers.js +9 -2
  43. package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.d.ts +5 -0
  44. package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.js +332 -0
  45. package/dist/src/migrations/update-24-0-0/upgrade-to-angular-22-2.md +46 -0
  46. package/dist/src/utils/assert-cypress-component-testing-support.js +10 -0
  47. package/dist/src/utils/backward-compatible-versions.js +0 -8
  48. package/dist/src/utils/versions.d.ts +4 -8
  49. package/dist/src/utils/versions.js +5 -9
  50. package/dist/types/nx-angular.d.ts +1 -3
  51. package/executors.json +0 -10
  52. package/generators.json +0 -35
  53. package/migrations.json +97 -0
  54. package/package.json +11 -20
  55. package/dist/.npmignore +0 -2
  56. package/dist/fesm2022/nx-angular-mf.mjs +0 -193
  57. package/dist/fesm2022/nx-angular-mf.mjs.map +0 -1
  58. package/dist/fesm2022/nx-angular.mjs.map +0 -1
  59. package/dist/mf/package.json +0 -4
  60. package/dist/src/builders/utilities/module-federation.d.ts +0 -11
  61. package/dist/src/builders/utilities/module-federation.js +0 -109
  62. package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
  63. package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
  64. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -2
  65. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -22
  66. package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.d.ts +0 -5
  67. package/dist/src/executors/module-federation-dev-server/lib/start-dev-remotes.js +0 -29
  68. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -4
  69. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -111
  70. package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -38
  71. package/dist/src/executors/module-federation-dev-server/schema.json +0 -171
  72. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -2
  73. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -20
  74. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.d.ts +0 -5
  75. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-dev-remotes.js +0 -30
  76. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -4
  77. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -110
  78. package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -17
  79. package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -124
  80. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.d.ts +0 -4
  81. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.js +0 -36
  82. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.d.ts +0 -5
  83. package/dist/src/generators/convert-to-with-mf/convert-to-with-mf.test-data.js +0 -448
  84. package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.d.ts +0 -2
  85. package/dist/src/generators/convert-to-with-mf/lib/check-name-matches.js +0 -22
  86. package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.d.ts +0 -2
  87. package/dist/src/generators/convert-to-with-mf/lib/check-shared-npm-packages.js +0 -45
  88. package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.d.ts +0 -2
  89. package/dist/src/generators/convert-to-with-mf/lib/get-webpack-config-path.js +0 -18
  90. package/dist/src/generators/convert-to-with-mf/lib/index.d.ts +0 -6
  91. package/dist/src/generators/convert-to-with-mf/lib/index.js +0 -9
  92. package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.d.ts +0 -5
  93. package/dist/src/generators/convert-to-with-mf/lib/is-host-remote-config.js +0 -57
  94. package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.d.ts +0 -2
  95. package/dist/src/generators/convert-to-with-mf/lib/parse-ast-webpack-config.js +0 -13
  96. package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +0 -3
  97. package/dist/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +0 -50
  98. package/dist/src/generators/convert-to-with-mf/schema.d.ts +0 -4
  99. package/dist/src/generators/convert-to-with-mf/schema.json +0 -33
  100. package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
  101. package/dist/src/generators/federate-module/federate-module.js +0 -49
  102. package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.d.ts +0 -2
  103. package/dist/src/generators/federate-module/lib/add-file-to-remote-tsconfig.js +0 -14
  104. package/dist/src/generators/federate-module/lib/add-path-to-exposes.d.ts +0 -8
  105. package/dist/src/generators/federate-module/lib/add-path-to-exposes.js +0 -77
  106. package/dist/src/generators/federate-module/lib/add-path-to-ts-config.d.ts +0 -8
  107. package/dist/src/generators/federate-module/lib/add-path-to-ts-config.js +0 -11
  108. package/dist/src/generators/federate-module/lib/add-remote.d.ts +0 -7
  109. package/dist/src/generators/federate-module/lib/add-remote.js +0 -42
  110. package/dist/src/generators/federate-module/lib/check-remote-exists.d.ts +0 -2
  111. package/dist/src/generators/federate-module/lib/check-remote-exists.js +0 -21
  112. package/dist/src/generators/federate-module/lib/index.d.ts +0 -4
  113. package/dist/src/generators/federate-module/lib/index.js +0 -7
  114. package/dist/src/generators/federate-module/schema.d.ts +0 -13
  115. package/dist/src/generators/federate-module/schema.json +0 -83
  116. package/dist/src/generators/host/files/common/src/main.server.ts__tmpl__ +0 -78
  117. package/dist/src/generators/host/files/js/webpack.server.config.js__tmpl__ +0 -8
  118. package/dist/src/generators/host/files/ts/webpack.server.config.ts__tmpl__ +0 -9
  119. package/dist/src/generators/host/host.d.ts +0 -4
  120. package/dist/src/generators/host/host.js +0 -133
  121. package/dist/src/generators/host/lib/index.d.ts +0 -2
  122. package/dist/src/generators/host/lib/index.js +0 -5
  123. package/dist/src/generators/host/lib/update-ssr-setup.d.ts +0 -3
  124. package/dist/src/generators/host/lib/update-ssr-setup.js +0 -54
  125. package/dist/src/generators/host/lib/validate-options.d.ts +0 -3
  126. package/dist/src/generators/host/lib/validate-options.js +0 -12
  127. package/dist/src/generators/host/schema.d.ts +0 -36
  128. package/dist/src/generators/host/schema.json +0 -195
  129. package/dist/src/generators/remote/files/base/webpack.server.config.js__tmpl__ +0 -9
  130. package/dist/src/generators/remote/files/base-ts/webpack.server.config.ts__tmpl__ +0 -9
  131. package/dist/src/generators/remote/files/common/src/main.server.ts__tmpl__ +0 -84
  132. package/dist/src/generators/remote/files/standalone/src/bootstrap.server.ts__tmpl__ +0 -12
  133. package/dist/src/generators/remote/lib/find-next-available-port.d.ts +0 -2
  134. package/dist/src/generators/remote/lib/find-next-available-port.js +0 -16
  135. package/dist/src/generators/remote/lib/index.d.ts +0 -3
  136. package/dist/src/generators/remote/lib/index.js +0 -6
  137. package/dist/src/generators/remote/lib/update-ssr-setup.d.ts +0 -9
  138. package/dist/src/generators/remote/lib/update-ssr-setup.js +0 -82
  139. package/dist/src/generators/remote/lib/validate-options.d.ts +0 -3
  140. package/dist/src/generators/remote/lib/validate-options.js +0 -12
  141. package/dist/src/generators/remote/remote.d.ts +0 -4
  142. package/dist/src/generators/remote/remote.js +0 -114
  143. package/dist/src/generators/remote/schema.d.ts +0 -34
  144. package/dist/src/generators/remote/schema.json +0 -184
  145. package/dist/src/generators/setup-mf/files/entry-module-files/__entryModuleFileName__.ts__tmpl__ +0 -18
  146. package/dist/src/generators/setup-mf/files/entry-module-files/entry.routes.ts__tmpl__ +0 -4
  147. package/dist/src/generators/setup-mf/files/entry-module-files/entry__componentFileSuffix__.ts__tmpl__ +0 -10
  148. package/dist/src/generators/setup-mf/files/host-files/__appFileName__.spec.ts__tmpl__ +0 -42
  149. package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry.routes.ts__tmpl__ +0 -4
  150. package/dist/src/generators/setup-mf/files/standalone-entry-component-files/entry__componentFileSuffix__.ts__tmpl__ +0 -11
  151. package/dist/src/generators/setup-mf/files/ts-webpack/module-federation.config.ts__tmpl__ +0 -27
  152. package/dist/src/generators/setup-mf/files/ts-webpack/tsconfig.lint.json__tmpl__ +0 -12
  153. package/dist/src/generators/setup-mf/files/ts-webpack/webpack.config.ts__tmpl__ +0 -9
  154. package/dist/src/generators/setup-mf/files/ts-webpack/webpack.prod.config.ts__tmpl__ +0 -21
  155. package/dist/src/generators/setup-mf/files/webpack/module-federation.config.js__tmpl__ +0 -23
  156. package/dist/src/generators/setup-mf/files/webpack/webpack.config.js__tmpl__ +0 -9
  157. package/dist/src/generators/setup-mf/files/webpack/webpack.prod.config.js__tmpl__ +0 -21
  158. package/dist/src/generators/setup-mf/lib/add-cypress-workaround.d.ts +0 -3
  159. package/dist/src/generators/setup-mf/lib/add-cypress-workaround.js +0 -52
  160. package/dist/src/generators/setup-mf/lib/add-remote-entry.d.ts +0 -3
  161. package/dist/src/generators/setup-mf/lib/add-remote-entry.js +0 -27
  162. package/dist/src/generators/setup-mf/lib/add-remote-to-host.d.ts +0 -9
  163. package/dist/src/generators/setup-mf/lib/add-remote-to-host.js +0 -127
  164. package/dist/src/generators/setup-mf/lib/change-build-target.d.ts +0 -3
  165. package/dist/src/generators/setup-mf/lib/change-build-target.js +0 -24
  166. package/dist/src/generators/setup-mf/lib/fix-bootstrap.d.ts +0 -3
  167. package/dist/src/generators/setup-mf/lib/fix-bootstrap.js +0 -40
  168. package/dist/src/generators/setup-mf/lib/generate-config.d.ts +0 -6
  169. package/dist/src/generators/setup-mf/lib/generate-config.js +0 -32
  170. package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.d.ts +0 -6
  171. package/dist/src/generators/setup-mf/lib/get-remotes-with-ports.js +0 -20
  172. package/dist/src/generators/setup-mf/lib/index.d.ts +0 -15
  173. package/dist/src/generators/setup-mf/lib/index.js +0 -18
  174. package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.d.ts +0 -2
  175. package/dist/src/generators/setup-mf/lib/move-angular-plugin-to-dependencies.js +0 -15
  176. package/dist/src/generators/setup-mf/lib/normalize-options.d.ts +0 -3
  177. package/dist/src/generators/setup-mf/lib/normalize-options.js +0 -26
  178. package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.d.ts +0 -3
  179. package/dist/src/generators/setup-mf/lib/remove-dead-code-from-remote.js +0 -61
  180. package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.d.ts +0 -3
  181. package/dist/src/generators/setup-mf/lib/setup-host-if-dynamic.js +0 -20
  182. package/dist/src/generators/setup-mf/lib/setup-serve-target.d.ts +0 -3
  183. package/dist/src/generators/setup-mf/lib/setup-serve-target.js +0 -39
  184. package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.d.ts +0 -3
  185. package/dist/src/generators/setup-mf/lib/setup-tspath-for-remote.js +0 -15
  186. package/dist/src/generators/setup-mf/lib/update-host-app-routes.d.ts +0 -3
  187. package/dist/src/generators/setup-mf/lib/update-host-app-routes.js +0 -39
  188. package/dist/src/generators/setup-mf/lib/update-tsconfig.d.ts +0 -3
  189. package/dist/src/generators/setup-mf/lib/update-tsconfig.js +0 -18
  190. package/dist/src/generators/setup-mf/schema.d.ts +0 -35
  191. package/dist/src/generators/setup-mf/schema.json +0 -99
  192. package/dist/src/generators/setup-mf/setup-mf.d.ts +0 -4
  193. package/dist/src/generators/setup-mf/setup-mf.js +0 -90
  194. package/dist/src/generators/utils/add-mf-env-to-inputs.d.ts +0 -2
  195. package/dist/src/generators/utils/add-mf-env-to-inputs.js +0 -36
  196. package/dist/src/generators/utils/assert-mf-utils.d.ts +0 -1
  197. package/dist/src/generators/utils/assert-mf-utils.js +0 -8
  198. package/dist/src/utils/get-mf-projects.d.ts +0 -4
  199. package/dist/src/utils/get-mf-projects.js +0 -31
  200. package/dist/src/utils/module-federation-deprecation.d.ts +0 -4
  201. package/dist/src/utils/module-federation-deprecation.js +0 -29
  202. package/dist/types/nx-angular-mf.d.ts +0 -72
  203. package/dist/types/nx-angular-mf.d.ts.map +0 -1
  204. package/dist/types/nx-angular.d.ts.map +0 -1
@@ -1,11 +1,9 @@
1
1
  export * from './src/builders/webpack-browser/webpack-browser.impl';
2
2
  export * from './src/builders/webpack-server/webpack-server.impl';
3
- export * from './src/executors/module-federation-dev-server/module-federation-dev-server.impl';
4
3
  export * from './src/executors/delegate-build/delegate-build.impl';
5
4
  export * from './src/executors/ng-packagr-lite/ng-packagr-lite.impl';
6
5
  export * from './src/executors/package/package.impl';
7
6
  export * from './src/executors/browser-esbuild/browser-esbuild.impl';
8
7
  export * from './src/executors/application/application.impl';
9
8
  export * from './src/executors/extract-i18n/extract-i18n.impl';
10
- export * from './src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl';
11
9
  export { executeDevServerBuilder } from './src/builders/dev-server/dev-server.impl';
package/dist/executors.js CHANGED
@@ -4,13 +4,11 @@ exports.executeDevServerBuilder = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  tslib_1.__exportStar(require("./src/builders/webpack-browser/webpack-browser.impl"), exports);
6
6
  tslib_1.__exportStar(require("./src/builders/webpack-server/webpack-server.impl"), exports);
7
- tslib_1.__exportStar(require("./src/executors/module-federation-dev-server/module-federation-dev-server.impl"), exports);
8
7
  tslib_1.__exportStar(require("./src/executors/delegate-build/delegate-build.impl"), exports);
9
8
  tslib_1.__exportStar(require("./src/executors/ng-packagr-lite/ng-packagr-lite.impl"), exports);
10
9
  tslib_1.__exportStar(require("./src/executors/package/package.impl"), exports);
11
10
  tslib_1.__exportStar(require("./src/executors/browser-esbuild/browser-esbuild.impl"), exports);
12
11
  tslib_1.__exportStar(require("./src/executors/application/application.impl"), exports);
13
12
  tslib_1.__exportStar(require("./src/executors/extract-i18n/extract-i18n.impl"), exports);
14
- tslib_1.__exportStar(require("./src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl"), exports);
15
13
  var dev_server_impl_1 = require("./src/builders/dev-server/dev-server.impl");
16
14
  Object.defineProperty(exports, "executeDevServerBuilder", { enumerable: true, get: function () { return dev_server_impl_1.executeDevServerBuilder; } });
@@ -1,4 +0,0 @@
1
- /**
2
- * Generated bundle index. Do not edit.
3
- */
4
- //# sourceMappingURL=nx-angular.mjs.map
@@ -3,20 +3,16 @@ export * from './src/generators/application/application';
3
3
  export * from './src/generators/component-story/component-story';
4
4
  export * from './src/generators/component/component';
5
5
  export * from './src/generators/directive/directive';
6
- export * from './src/generators/federate-module/federate-module';
7
- export * from './src/generators/host/host';
8
6
  export * from './src/generators/init/init';
9
7
  export * from './src/generators/library-secondary-entry-point/library-secondary-entry-point';
10
8
  export * from './src/generators/library/library';
11
9
  export * from './src/generators/ngrx-feature-store/ngrx-feature-store';
12
10
  export * from './src/generators/ngrx-root-store/ngrx-root-store';
13
11
  export * from './src/generators/pipe/pipe';
14
- export * from './src/generators/remote/remote';
15
12
  export * from './src/generators/scam-directive/scam-directive';
16
13
  export * from './src/generators/scam-pipe/scam-pipe';
17
14
  export * from './src/generators/scam-to-standalone/scam-to-standalone';
18
15
  export * from './src/generators/scam/scam';
19
- export * from './src/generators/setup-mf/setup-mf';
20
16
  export * from './src/generators/setup-ssr/setup-ssr';
21
17
  export * from './src/generators/stories/stories';
22
18
  export * from './src/generators/storybook-configuration/storybook-configuration';
@@ -7,20 +7,16 @@ tslib_1.__exportStar(require("./src/generators/application/application"), export
7
7
  tslib_1.__exportStar(require("./src/generators/component-story/component-story"), exports);
8
8
  tslib_1.__exportStar(require("./src/generators/component/component"), exports);
9
9
  tslib_1.__exportStar(require("./src/generators/directive/directive"), exports);
10
- tslib_1.__exportStar(require("./src/generators/federate-module/federate-module"), exports);
11
- tslib_1.__exportStar(require("./src/generators/host/host"), exports);
12
10
  tslib_1.__exportStar(require("./src/generators/init/init"), exports);
13
11
  tslib_1.__exportStar(require("./src/generators/library-secondary-entry-point/library-secondary-entry-point"), exports);
14
12
  tslib_1.__exportStar(require("./src/generators/library/library"), exports);
15
13
  tslib_1.__exportStar(require("./src/generators/ngrx-feature-store/ngrx-feature-store"), exports);
16
14
  tslib_1.__exportStar(require("./src/generators/ngrx-root-store/ngrx-root-store"), exports);
17
15
  tslib_1.__exportStar(require("./src/generators/pipe/pipe"), exports);
18
- tslib_1.__exportStar(require("./src/generators/remote/remote"), exports);
19
16
  tslib_1.__exportStar(require("./src/generators/scam-directive/scam-directive"), exports);
20
17
  tslib_1.__exportStar(require("./src/generators/scam-pipe/scam-pipe"), exports);
21
18
  tslib_1.__exportStar(require("./src/generators/scam-to-standalone/scam-to-standalone"), exports);
22
19
  tslib_1.__exportStar(require("./src/generators/scam/scam"), exports);
23
- tslib_1.__exportStar(require("./src/generators/setup-mf/setup-mf"), exports);
24
20
  tslib_1.__exportStar(require("./src/generators/setup-ssr/setup-ssr"), exports);
25
21
  tslib_1.__exportStar(require("./src/generators/stories/stories"), exports);
26
22
  tslib_1.__exportStar(require("./src/generators/storybook-configuration/storybook-configuration"), exports);
@@ -522,8 +522,7 @@
522
522
  },
523
523
  "preloadInitial": {
524
524
  "type": "boolean",
525
- "default": true,
526
- "description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources."
525
+ "description": "Generates 'preload', 'modulepreload', and 'preconnect' link elements for initial application files and resources. Defaults to false when a service worker is enabled; otherwise true. _Note: defaulting to false when a service worker is enabled only applies in Angular versions >= 22.2.0. Earlier versions default to true._"
527
526
  }
528
527
  },
529
528
  "required": ["input"]
@@ -12,8 +12,10 @@ exports.writeBundlesTransform = void 0;
12
12
  exports.removeSourceMappingUrl = removeSourceMappingUrl;
13
13
  exports.remapDeclarationMapSources = remapDeclarationMapSources;
14
14
  exports.normalizeEsm2022Path = normalizeEsm2022Path;
15
+ const tslib_1 = require("tslib");
15
16
  const transform_1 = require("ng-packagr/src/lib/graph/transform");
16
17
  const nodes_1 = require("ng-packagr/src/lib/ng-package/nodes");
18
+ const ngPackagrNodes = tslib_1.__importStar(require("ng-packagr/src/lib/ng-package/nodes"));
17
19
  const package_1 = require("ng-packagr/src/lib/ng-package/package");
18
20
  const path_1 = require("ng-packagr/src/lib/utils/path");
19
21
  const promises_1 = require("node:fs/promises");
@@ -29,9 +31,15 @@ async function shouldWriteFile(filePath, newContent) {
29
31
  return true;
30
32
  }
31
33
  }
34
+ // ng-packagr 22.2.0 to 22.2.3 build entry points in parallel and export this
35
+ // to find the one a graph is scoped to. 22.2.4 reverted that:
36
+ // https://github.com/ng-packagr/ng-packagr/issues/3451
37
+ const { getActiveEntryPoint } = ngPackagrNodes;
32
38
  const writeBundlesTransform = (_options) => {
33
39
  return (0, transform_1.transformFromPromise)(async (graph) => {
34
- const entryPointNode = graph.find((0, nodes_1.isEntryPointInProgress)());
40
+ const entryPointNode = getActiveEntryPoint
41
+ ? getActiveEntryPoint(graph)
42
+ : graph.find((0, nodes_1.isEntryPointInProgress)());
35
43
  if (!entryPointNode) {
36
44
  return;
37
45
  }
@@ -22,7 +22,7 @@
22
22
  },
23
23
  "runnerConfig": {
24
24
  "type": ["string", "boolean"],
25
- "description": "Specifies the configuration file for the selected test runner. If a string is provided, it will be used as the path to the configuration file. If `true`, the builder will search for a default configuration file (e.g., `vitest.config.ts` or `karma.conf.js`). If `false`, no external configuration file will be used.\\nFor Vitest, this enables advanced options and the use of custom plugins. Please note that while the file is loaded, the Angular team does not provide direct support for its specific contents or any third-party plugins used within it.",
25
+ "description": "Specifies the configuration file for the selected test runner. If a string is provided, it will be used as the path to the configuration file. If `true`, the builder will search for a default configuration file (e.g., `vitest-base.config.mts` or `karma.conf.js`). If `false`, no external configuration file will be used.\\nFor Vitest, this enables advanced options and the use of custom plugins. Please note that while the file is loaded, the Angular team does not provide direct support for its specific contents or any third-party plugins used within it.",
26
26
  "default": false
27
27
  },
28
28
  "browsers": {
@@ -46,6 +46,11 @@
46
46
  "type": "boolean",
47
47
  "description": "Enables isolation for test execution. When true, Vitest runs tests in separate threads or processes. This option is only available for the Vitest runner. Defaults to false to align with the Karma/Jasmine experience. _Note: this is only supported in Angular versions >= 22.0.0_."
48
48
  },
49
+ "splitting": {
50
+ "type": "boolean",
51
+ "description": "Enables code splitting for test execution. When enabled, shared code between test files is split into separate chunks. Issues with live ESM bindings in Node.js environments (such as uninitialized exports or mocking failures) can be resolved by disabling splitting. This option is only available for the Vitest runner. Defaults to `true`. _Note: this is only supported in Angular versions >= 22.2.0_.",
52
+ "x-deprecated": "No longer needed with Vitest 5."
53
+ },
49
54
  "quiet": {
50
55
  "type": "boolean",
51
56
  "description": "Suppresses the verbose build summary and stats table on each rebuild. Defaults to `true` locally and `false` in CI environments. _Note: this is only supported in Angular versions >= 22.0.0_."
@@ -47,6 +47,11 @@ function validateOptions(options) {
47
47
  throw new Error(`The "quiet" option requires Angular version 22.0.0 or greater. You are currently using version ${angularVersion}.`);
48
48
  }
49
49
  }
50
+ if ((0, semver_1.lt)(angularVersion, '22.2.0')) {
51
+ if (options.splitting !== undefined) {
52
+ throw new Error(`The "splitting" option requires Angular version 22.2.0 or greater. You are currently using version ${angularVersion}.`);
53
+ }
54
+ }
50
55
  }
51
56
  /**
52
57
  * The Angular CLI unit-test builder only accepts the `@angular/build:application`
@@ -13,6 +13,7 @@ const devkit_1 = require("@nx/devkit");
13
13
  const browserslist_1 = tslib_1.__importDefault(require("browserslist"));
14
14
  const component_stylesheets_1 = require("ng-packagr/src/lib/styles/component-stylesheets");
15
15
  const postcss_configuration_1 = require("ng-packagr/src/lib/styles/postcss-configuration");
16
+ const semver_1 = require("semver");
16
17
  const ng_packagr_version_1 = require("./ng-packagr-version");
17
18
  var CssUrl;
18
19
  (function (CssUrl) {
@@ -20,7 +21,13 @@ var CssUrl;
20
21
  CssUrl["none"] = "none";
21
22
  })(CssUrl || (exports.CssUrl = CssUrl = {}));
22
23
  function getStylesheetProcessor() {
23
- const { major: ngPackagrMajorVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
24
+ const { major: ngPackagrMajorVersion, version: ngPackagrVersion } = (0, ng_packagr_version_1.getNgPackagrVersionInfo)();
25
+ // ng-packagr >= 22.2 resolves the style config once per package, older
26
+ // versions resolve it for each entry point
27
+ const resolvePerPackage = !(0, semver_1.lt)(ngPackagrVersion, '22.2.0');
28
+ // ng-packagr calls this factory once per build, so a later build in the
29
+ // same process reads config changes
30
+ const styleConfigCache = new Map();
24
31
  class StylesheetProcessor extends component_stylesheets_1.ComponentStylesheetBundler {
25
32
  constructor(projectBasePath, basePath, cssUrl, includePaths, sass, cacheDirectory, watch) {
26
33
  if (ngPackagrMajorVersion === 22) {
@@ -34,21 +41,17 @@ function getStylesheetProcessor() {
34
41
  path: require.resolve('ng-packagr/.browserslistrc'),
35
42
  });
36
43
  }
37
- const browserslistData = (0, browserslist_1.default)(undefined, { path: basePath });
38
- let searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath]);
39
- const postcssConfiguration = (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirs);
40
- // (nx-specific): we support loading the TailwindCSS config from the root of the workspace
41
- searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath, devkit_1.workspaceRoot]);
44
+ const { postcssConfiguration, tailwindConfiguration, target } = resolvePerPackage
45
+ ? getPackageStyleConfig(styleConfigCache, projectBasePath)
46
+ : resolveStyleConfig(projectBasePath, basePath);
42
47
  super({
43
48
  cacheDirectory: cacheDirectory,
44
49
  postcssConfiguration: postcssConfiguration,
45
- tailwindConfiguration: postcssConfiguration
46
- ? undefined
47
- : (0, postcss_configuration_1.getTailwindConfig)(searchDirs, projectBasePath),
50
+ tailwindConfiguration: tailwindConfiguration,
48
51
  sass: sass,
49
52
  workspaceRoot: projectBasePath,
50
53
  cssUrl: cssUrl,
51
- target: transformSupportedBrowsersToTargets(browserslistData),
54
+ target: target,
52
55
  includePaths: includePaths,
53
56
  }, 'css', watch);
54
57
  this.projectBasePath = projectBasePath;
@@ -65,6 +68,28 @@ function getStylesheetProcessor() {
65
68
  }
66
69
  return StylesheetProcessor;
67
70
  }
71
+ function getPackageStyleConfig(styleConfigCache, projectBasePath) {
72
+ let config = styleConfigCache.get(projectBasePath);
73
+ if (!config) {
74
+ config = resolveStyleConfig(projectBasePath, projectBasePath);
75
+ styleConfigCache.set(projectBasePath, config);
76
+ }
77
+ return config;
78
+ }
79
+ function resolveStyleConfig(projectBasePath, browserslistPath) {
80
+ const browserslistData = (0, browserslist_1.default)(undefined, { path: browserslistPath });
81
+ let searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath]);
82
+ const postcssConfiguration = (0, postcss_configuration_1.loadPostcssConfiguration)(searchDirs);
83
+ // (nx-specific): we support loading the TailwindCSS config from the root of the workspace
84
+ searchDirs = (0, postcss_configuration_1.generateSearchDirectories)([projectBasePath, devkit_1.workspaceRoot]);
85
+ return {
86
+ postcssConfiguration,
87
+ tailwindConfiguration: postcssConfiguration
88
+ ? undefined
89
+ : (0, postcss_configuration_1.getTailwindConfig)(searchDirs, projectBasePath),
90
+ target: transformSupportedBrowsersToTargets(browserslistData),
91
+ };
92
+ }
68
93
  function transformSupportedBrowsersToTargets(supportedBrowsers) {
69
94
  const transformed = [];
70
95
  // https://esbuild.github.io/api/#target
@@ -26,8 +26,6 @@ async function addLintingGenerator(tree, options) {
26
26
  unitTestRunner: options.unitTestRunner,
27
27
  enableTypedLinting: (0, internal_3.isTypedLintingEnabled)(options),
28
28
  rootProject: rootProject,
29
- addPlugin: options.addPlugin ?? false,
30
- addExplicitTargets: true,
31
29
  skipPackageJson: options.skipPackageJson,
32
30
  }));
33
31
  // The angular-eslint presets, selector rules and dependency install below have
@@ -13,5 +13,4 @@ export interface AddLintingGeneratorSchema {
13
13
  skipFormat?: boolean;
14
14
  skipPackageJson?: boolean;
15
15
  unitTestRunner?: string;
16
- addPlugin?: boolean;
17
16
  }
@@ -21,7 +21,7 @@ async function applicationGenerator(tree, schema) {
21
21
  if (isRspack) {
22
22
  schema.bundler = 'webpack';
23
23
  }
24
- const options = await (0, lib_1.normalizeOptions)(tree, schema, isRspack);
24
+ const options = await (0, lib_1.normalizeOptions)(tree, schema);
25
25
  const rootOffset = (0, devkit_1.offsetFromRoot)(options.appProjectRoot);
26
26
  await (0, js_1.initGenerator)(tree, {
27
27
  ...options,
@@ -32,7 +32,6 @@ async function applicationGenerator(tree, schema) {
32
32
  await (0, init_1.angularInitGenerator)(tree, {
33
33
  ...options,
34
34
  skipFormat: true,
35
- addPlugin: options.addPlugin,
36
35
  });
37
36
  if (!options.skipPackageJson) {
38
37
  (0, ensure_angular_dependencies_1.ensureAngularDependencies)(tree, options.zoneless);
@@ -6,10 +6,6 @@ const internal_1 = require("@nx/devkit/internal");
6
6
  const internal_2 = require("@nx/eslint/internal");
7
7
  const versions_1 = require("../../../utils/versions");
8
8
  async function addE2e(tree, options) {
9
- // since e2e are separate projects, default to adding plugins
10
- const nxJson = (0, devkit_1.readNxJson)(tree);
11
- const addPlugin = nxJson['useInferencePlugins'] !== false &&
12
- process.env.NX_ADD_PLUGINS !== 'false';
13
9
  const e2eWebServerInfo = getAngularE2EWebServerInfo(tree, options.name, options.port);
14
10
  if (options.e2eTestRunner === 'cypress') {
15
11
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
@@ -36,7 +32,6 @@ async function addE2e(tree, options) {
36
32
  ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
37
33
  ciBaseUrl: e2eWebServerInfo.e2eCiBaseUrl,
38
34
  rootProject: options.rootProject,
39
- addPlugin,
40
35
  });
41
36
  }
42
37
  else if (options.e2eTestRunner === 'playwright') {
@@ -59,7 +54,6 @@ async function addE2e(tree, options) {
59
54
  webServerCommand: e2eWebServerInfo.e2eWebServerCommand,
60
55
  webServerAddress: e2eWebServerInfo.e2eWebServerAddress,
61
56
  rootProject: options.rootProject,
62
- addPlugin,
63
57
  });
64
58
  }
65
59
  return e2eWebServerInfo.e2ePort;
@@ -17,6 +17,5 @@ async function addLinting(host, options) {
17
17
  skipPackageJson: options.skipPackageJson,
18
18
  unitTestRunner: options.unitTestRunner,
19
19
  skipFormat: true,
20
- addPlugin: options.addPlugin,
21
20
  });
22
21
  }
@@ -12,7 +12,6 @@ async function addUnitTestRunner(host, options) {
12
12
  projectRoot: options.appProjectRoot,
13
13
  skipPackageJson: options.skipPackageJson,
14
14
  strict: options.strict,
15
- addPlugin: options.addPlugin,
16
15
  runtimeTsconfigFileName: 'tsconfig.app.json',
17
16
  zoneless: options.zoneless,
18
17
  });
@@ -30,7 +29,6 @@ async function addUnitTestRunner(host, options) {
30
29
  skipFormat: options.skipFormat,
31
30
  skipPackageJson: options.skipPackageJson,
32
31
  strict: options.strict,
33
- addPlugin: options.addPlugin,
34
32
  zoneless: options.zoneless,
35
33
  });
36
34
  default:
@@ -1,4 +1,4 @@
1
1
  import { type Tree } from '@nx/devkit';
2
2
  import type { Schema } from '../schema';
3
3
  import type { NormalizedSchema } from './normalized-schema';
4
- export declare function normalizeOptions(host: Tree, options: Partial<Schema>, isRspack?: boolean): Promise<NormalizedSchema>;
4
+ export declare function normalizeOptions(host: Tree, options: Partial<Schema>): Promise<NormalizedSchema>;
@@ -6,18 +6,13 @@ const internal_1 = require("@nx/devkit/internal");
6
6
  const internal_2 = require("@nx/js/internal");
7
7
  const test_runners_1 = require("../../../utils/test-runners");
8
8
  const version_utils_1 = require("../../utils/version-utils");
9
- function arePluginsExplicitlyDisabled(host) {
10
- const { useInferencePlugins } = (0, devkit_1.readNxJson)(host);
11
- const addPluginEnvVar = process.env.NX_ADD_PLUGINS;
12
- return useInferencePlugins === false || addPluginEnvVar === 'false';
13
- }
14
9
  function validateBundler(bundler) {
15
10
  if (['esbuild', 'webpack', 'rspack'].includes(bundler)) {
16
11
  return bundler;
17
12
  }
18
13
  throw new Error(`Invalid bundler: ${bundler}. Please use one of the following: 'esbuild', 'webpack', 'rspack'.`);
19
14
  }
20
- async function normalizeOptions(host, options, isRspack) {
15
+ async function normalizeOptions(host, options) {
21
16
  await (0, internal_1.ensureRootProjectName)(options, 'application');
22
17
  const { projectName: appProjectName, projectRoot: appProjectRoot } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
23
18
  name: options.name,
@@ -32,7 +27,6 @@ async function normalizeOptions(host, options, isRspack) {
32
27
  ? options.tags.split(',').map((s) => s.trim())
33
28
  : [];
34
29
  const bundler = validateBundler(options.bundler ?? 'esbuild');
35
- const addPlugin = options.addPlugin ?? (!arePluginsExplicitlyDisabled(host) && isRspack);
36
30
  const { major: angularMajorVersion } = (0, version_utils_1.getInstalledAngularVersionInfo)(host);
37
31
  const zonelessDefaultValue = angularMajorVersion >= 21 ? true : false;
38
32
  const unitTestRunner = options.unitTestRunner ??
@@ -43,7 +37,6 @@ async function normalizeOptions(host, options, isRspack) {
43
37
  : test_runners_1.UnitTestRunner.Jest);
44
38
  // Set defaults and then overwrite with user options
45
39
  return {
46
- addPlugin,
47
40
  style: 'css',
48
41
  routing: true,
49
42
  inlineStyle: false,
@@ -32,7 +32,6 @@ export interface Schema {
32
32
  bundler?: 'webpack' | 'esbuild' | 'rspack';
33
33
  ssr?: boolean;
34
34
  nxCloudToken?: string;
35
- addPlugin?: boolean;
36
35
  zoneless?: boolean;
37
36
  formatter?: 'prettier' | 'oxfmt' | 'none';
38
37
  }
@@ -130,7 +130,7 @@
130
130
  },
131
131
  "port": {
132
132
  "type": "number",
133
- "description": "The port at which the remote application should be served."
133
+ "description": "The port at which the application should be served."
134
134
  },
135
135
  "enableTypedLinting": {
136
136
  "type": "boolean",
@@ -13,6 +13,7 @@ const create_config_1 = require("./lib/create-config");
13
13
  const get_custom_webpack_config_1 = require("./lib/get-custom-webpack-config");
14
14
  const merge_server_tsconfig_1 = require("./lib/merge-server-tsconfig");
15
15
  const update_tsconfig_1 = require("./lib/update-tsconfig");
16
+ const validate_no_module_federation_1 = require("./lib/validate-no-module-federation");
16
17
  const validate_supported_executor_1 = require("./lib/validate-supported-executor");
17
18
  const SUPPORTED_EXECUTORS = [
18
19
  '@angular-devkit/build-angular:browser',
@@ -23,7 +24,6 @@ const SUPPORTED_EXECUTORS = [
23
24
  '@nx/angular:webpack-browser',
24
25
  '@nx/angular:webpack-server',
25
26
  '@nx/angular:dev-server',
26
- '@nx/angular:module-federation-dev-server',
27
27
  ];
28
28
  const RENAMED_OPTIONS = {
29
29
  main: 'browser',
@@ -251,6 +251,7 @@ async function convertToRspack(tree, schema) {
251
251
  const targetsToRemove = [];
252
252
  let customWebpackConfigPath;
253
253
  (0, validate_supported_executor_1.validateSupportedBuildExecutor)(Object.values(project.targets));
254
+ (0, validate_no_module_federation_1.validateNoModuleFederation)(tree, project);
254
255
  let projectServePort = DEFAULT_PORT;
255
256
  const projectServeConfigurationOptions = {};
256
257
  for (const [targetName, target] of Object.entries(project.targets)) {
@@ -284,8 +285,7 @@ async function convertToRspack(tree, schema) {
284
285
  targetsToRemove.push(targetName);
285
286
  }
286
287
  else if (target.executor === '@angular-devkit/build-angular:dev-server' ||
287
- target.executor === '@nx/angular:dev-server' ||
288
- target.executor === '@nx/angular:module-federation-dev-server') {
288
+ target.executor === '@nx/angular:dev-server') {
289
289
  createConfigOptions.devServer = {};
290
290
  if (target.options) {
291
291
  handleDevServerTargetOptions(tree, target.options, createConfigOptions.devServer, project.root);
@@ -356,7 +356,6 @@ async function convertToRspack(tree, schema) {
356
356
  // ensure plugin is registered
357
357
  const { rspackInitGenerator } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
358
358
  await rspackInitGenerator(tree, {
359
- addPlugin: true,
360
359
  framework: 'angular',
361
360
  });
362
361
  // find the inferred target names
@@ -1,6 +1,5 @@
1
- import { Tree } from '@nx/devkit';
1
+ import type { Tree } from '@nx/devkit';
2
2
  export declare function getCustomWebpackConfig(tree: Tree, projectRoot: string, pathToCustomWebpackConfig: string): Promise<{
3
3
  isWebpackConfigFunction: boolean;
4
4
  normalizedPathToCustomWebpackConfig: string;
5
5
  }>;
6
- export declare function convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents: string): string;
@@ -1,22 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getCustomWebpackConfig = getCustomWebpackConfig;
4
- exports.convertWebpackConfigToUseNxModuleFederationPlugin = convertWebpackConfigToUseNxModuleFederationPlugin;
5
- const devkit_1 = require("@nx/devkit");
6
4
  const internal_1 = require("@nx/devkit/internal");
7
5
  const path_1 = require("path");
8
- const tsquery_1 = require("@phenomnomnominal/tsquery");
9
6
  const FILE_EXTENSION_REGEX = /\.[^.]+$/;
10
7
  async function getCustomWebpackConfig(tree, projectRoot, pathToCustomWebpackConfig) {
11
- const webpackConfigContents = tree.read(pathToCustomWebpackConfig, 'utf-8');
12
- if (webpackConfigContents.includes('@nx/module-federation/angular') &&
13
- webpackConfigContents.includes('withModuleFederation')) {
14
- tree.write(pathToCustomWebpackConfig, convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents));
15
- return {
16
- isWebpackConfigFunction: false,
17
- normalizedPathToCustomWebpackConfig: `./${(0, path_1.relative)(projectRoot, pathToCustomWebpackConfig).replace(FILE_EXTENSION_REGEX, '')}`,
18
- };
19
- }
20
8
  const configFile = await (0, internal_1.loadConfigFile)((0, path_1.join)(tree.root, pathToCustomWebpackConfig));
21
9
  const webpackConfig = 'default' in configFile ? configFile.default : configFile;
22
10
  return {
@@ -24,54 +12,3 @@ async function getCustomWebpackConfig(tree, projectRoot, pathToCustomWebpackConf
24
12
  normalizedPathToCustomWebpackConfig: `./${(0, path_1.relative)(projectRoot, pathToCustomWebpackConfig).replace(FILE_EXTENSION_REGEX, '')}`,
25
13
  };
26
14
  }
27
- function convertWebpackConfigToUseNxModuleFederationPlugin(webpackConfigContents) {
28
- let newWebpackConfigContents = webpackConfigContents;
29
- let sourceFile = (0, tsquery_1.ast)(webpackConfigContents);
30
- const withModuleFederationImportNodes = (0, tsquery_1.query)(sourceFile, 'ImportDeclaration:has(StringLiteral[value=@nx/module-federation/angular])');
31
- if (withModuleFederationImportNodes.length > 0) {
32
- const withModuleFederationImportNode = withModuleFederationImportNodes[0];
33
- newWebpackConfigContents = `${webpackConfigContents.slice(0, withModuleFederationImportNode.getStart())}import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/angular';${webpackConfigContents.slice(withModuleFederationImportNode.getEnd())}`;
34
- sourceFile = (0, tsquery_1.ast)(newWebpackConfigContents);
35
- const exportedWithModuleFederationNodes = (0, tsquery_1.query)(sourceFile, 'ExportAssignment:has(CallExpression > Identifier[name=withModuleFederation])');
36
- if (exportedWithModuleFederationNodes.length > 0) {
37
- const exportedWithModuleFederationNode = exportedWithModuleFederationNodes[0];
38
- newWebpackConfigContents = `${newWebpackConfigContents.slice(0, exportedWithModuleFederationNode.getStart())}${newWebpackConfigContents.slice(exportedWithModuleFederationNode.getEnd())}
39
- export default {
40
- plugins: [
41
- new NxModuleFederationPlugin({ config }, {
42
- dts: false,
43
- }),
44
- new NxModuleFederationDevServerPlugin({ config }),
45
- ]
46
- }
47
- `;
48
- }
49
- else {
50
- devkit_1.logger.warn("Could not find 'export default withModuleFederation' in the webpack config file. Skipping conversion.");
51
- }
52
- }
53
- const withModuleFederationRequireNodes = (0, tsquery_1.query)(sourceFile, 'VariableStatement:has(CallExpression > Identifier[name=withModuleFederation], StringLiteral[value=@nx/module-federation/angular])');
54
- if (withModuleFederationRequireNodes.length > 0) {
55
- const withModuleFederationRequireNode = withModuleFederationRequireNodes[0];
56
- newWebpackConfigContents = `${webpackConfigContents.slice(0, withModuleFederationRequireNode.getStart())}const { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } = require('@nx/module-federation/rspack');${webpackConfigContents.slice(withModuleFederationRequireNode.getEnd())}`;
57
- sourceFile = (0, tsquery_1.ast)(newWebpackConfigContents);
58
- const exportedWithModuleFederationNodes = (0, tsquery_1.query)(sourceFile, 'ExpressionStatement:has(BinaryExpression > PropertyAccessExpression:has(Identifier[name=module], Identifier[name=exports]), CallExpression:has(Identifier[name=withModuleFederation]))');
59
- if (exportedWithModuleFederationNodes.length > 0) {
60
- const exportedWithModuleFederationNode = exportedWithModuleFederationNodes[0];
61
- newWebpackConfigContents = `${newWebpackConfigContents.slice(0, exportedWithModuleFederationNode.getStart())}${newWebpackConfigContents.slice(exportedWithModuleFederationNode.getEnd())}
62
- module.exports = {
63
- plugins: [
64
- new NxModuleFederationPlugin({ config }, {
65
- dts: false,
66
- }),
67
- new NxModuleFederationDevServerPlugin({ config }),
68
- ]
69
- }
70
- `;
71
- }
72
- else {
73
- devkit_1.logger.warn("Could not find 'module.exports = withModuleFederation' in the webpack config file. Skipping conversion.");
74
- }
75
- }
76
- return newWebpackConfigContents;
77
- }
@@ -0,0 +1,2 @@
1
+ import type { ProjectConfiguration, Tree } from '@nx/devkit';
2
+ export declare function validateNoModuleFederation(tree: Tree, project: ProjectConfiguration): void;
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.validateNoModuleFederation = validateNoModuleFederation;
4
+ const MODULE_FEDERATION_EXECUTORS = [
5
+ '@nx/angular:module-federation-dev-server',
6
+ '@nx/angular:module-federation-dev-ssr',
7
+ ];
8
+ function validateNoModuleFederation(tree, project) {
9
+ if (usesModuleFederation(tree, project)) {
10
+ throw new Error(`The project ${project.name} is using Module Federation. At the moment, we don't support migrating projects that use Module Federation. See https://nx.dev/docs/kb/migrate-angular-module-federation.`);
11
+ }
12
+ }
13
+ function usesModuleFederation(tree, project) {
14
+ for (const target of Object.values(project.targets ?? {})) {
15
+ if (MODULE_FEDERATION_EXECUTORS.includes(target.executor)) {
16
+ return true;
17
+ }
18
+ const allOptions = [
19
+ target.options,
20
+ ...Object.values(target.configurations ?? {}),
21
+ ];
22
+ for (const options of allOptions) {
23
+ const configPath = options?.customWebpackConfig?.path;
24
+ if (configPath &&
25
+ tree.exists(configPath) &&
26
+ tree.read(configPath, 'utf-8').includes('@nx/module-federation')) {
27
+ return true;
28
+ }
29
+ }
30
+ }
31
+ return false;
32
+ }
@@ -64,8 +64,6 @@ async function cypressComponentConfiguration(tree, options) {
64
64
  tasks.push(await baseCyCTConfig(tree, {
65
65
  project: options.project,
66
66
  skipFormat: true,
67
- addPlugin: false,
68
- addExplicitTargets: true,
69
67
  skipPackageJson: options.skipPackageJson,
70
68
  }));
71
69
  await configureCypressCT(tree, options);
@@ -142,20 +140,10 @@ async function configureCypressCT(tree, options) {
142
140
  throw new Error('Unable to find a valid build configuration. Try passing in a target for an Angular app (e.g. --build-target=<project>:<target>[:<configuration>]).');
143
141
  }
144
142
  }
145
- const ctConfigOptions = {};
143
+ const ctConfigOptions = {
144
+ buildTarget: found.target,
145
+ };
146
146
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
147
- if (projectConfig.targets?.['component-test']?.executor ===
148
- '@nx/cypress:cypress') {
149
- projectConfig.targets['component-test'].options = {
150
- ...projectConfig.targets['component-test'].options,
151
- skipServe: true,
152
- devServerTarget: found.target,
153
- };
154
- (0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
155
- }
156
- else {
157
- ctConfigOptions.buildTarget = found.target;
158
- }
159
147
  const { addDefaultCTConfig, getProjectCypressConfigPath, getInstalledCypressMajorVersion, } = require('@nx/cypress/internal');
160
148
  const cypressConfigPath = getProjectCypressConfigPath(tree, projectConfig.root);
161
149
  const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigPath, 'utf-8'), ctConfigOptions, '@nx/angular/plugins/component-testing', getInstalledCypressMajorVersion(tree));
@@ -16,8 +16,7 @@ async function angularInitGenerator(tree, options) {
16
16
  // generators do not use `angular.json`, and `nx init` should split
17
17
  // `angular.json` into multiple `project.json` files -- as this is preferred
18
18
  // by most folks we've talked to.
19
- options.addPlugin ??= process.env.NX_RUNNING_NX_IMPORT === 'true';
20
- if (options.addPlugin) {
19
+ if (process.env.NX_RUNNING_NX_IMPORT === 'true') {
21
20
  await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/angular/plugin', plugin_1.createNodes, {
22
21
  targetNamePrefix: ['', 'angular:', 'angular-'],
23
22
  }, options.updatePackageScripts);
@@ -3,7 +3,5 @@ export interface Schema {
3
3
  skipInstall?: boolean;
4
4
  skipPackageJson?: boolean;
5
5
  keepExistingVersions?: boolean;
6
- /* internal */
7
- addPlugin?: boolean;
8
6
  updatePackageScripts?: boolean;
9
7
  }
@@ -39,6 +39,5 @@ export interface Schema {
39
39
  skipTests?: boolean;
40
40
  selector?: string;
41
41
  skipSelector?: boolean;
42
- addPlugin?: boolean;
43
42
  skipTsConfig?: boolean;
44
43
  }