@nx/react 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.1

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 (232) hide show
  1. package/dist/index.d.ts +0 -2
  2. package/dist/index.js +1 -5
  3. package/dist/internal.d.ts +1 -0
  4. package/dist/internal.js +3 -1
  5. package/dist/module-federation.d.ts +6 -5
  6. package/dist/module-federation.js +29 -18
  7. package/dist/plugins/component-testing/index.js +92 -33
  8. package/dist/plugins/storybook/index.js +18 -18
  9. package/dist/plugins/with-react.d.ts +3 -7
  10. package/dist/plugins/with-react.js +5 -19
  11. package/dist/ready-check.d.ts +1 -0
  12. package/dist/ready-check.js +5 -0
  13. package/dist/src/generators/_utils/mf-dependencies.js +3 -0
  14. package/dist/src/generators/application/application.js +1 -36
  15. package/dist/src/generators/application/files/base-rspack/rspack.config.js__tmpl__ +1 -24
  16. package/dist/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +1 -26
  17. package/dist/src/generators/application/lib/add-e2e.js +11 -11
  18. package/dist/src/generators/application/lib/add-linting.js +1 -2
  19. package/dist/src/generators/application/lib/add-project.js +0 -167
  20. package/dist/src/generators/application/lib/bundlers/add-rsbuild.js +0 -1
  21. package/dist/src/generators/application/lib/bundlers/add-vite.js +0 -2
  22. package/dist/src/generators/application/lib/bundlers/add-webpack.js +0 -1
  23. package/dist/src/generators/application/lib/create-application-files.d.ts +0 -2
  24. package/dist/src/generators/application/lib/create-application-files.js +2 -11
  25. package/dist/src/generators/application/lib/normalize-options.js +0 -4
  26. package/dist/src/generators/application/schema.d.ts +0 -6
  27. package/dist/src/generators/application/schema.json +0 -6
  28. package/dist/src/generators/consumer/consumer.js +2 -0
  29. package/dist/src/generators/consumer/files/rsbuild/package.json__tmpl__ +1 -0
  30. package/dist/src/generators/consumer/files/rsbuild/rsbuild.config.ts__tmpl__ +2 -0
  31. package/dist/src/generators/consumer/files/rspack/package.json__tmpl__ +1 -0
  32. package/dist/src/generators/consumer/files/rspack/rspack.config.ts__tmpl__ +2 -0
  33. package/dist/src/generators/consumer/files/vite/package.json__tmpl__ +1 -0
  34. package/dist/src/generators/consumer/files/vite/vite.config.mts__tmpl__ +2 -0
  35. package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +4 -16
  36. package/dist/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -2
  37. package/dist/src/generators/cypress-component-configuration/lib/add-files.js +4 -2
  38. package/dist/src/generators/cypress-component-configuration/schema.d.ts +0 -1
  39. package/dist/src/generators/init/init.js +3 -5
  40. package/dist/src/generators/init/schema.d.ts +0 -1
  41. package/dist/src/generators/library/lib/add-linting.js +1 -2
  42. package/dist/src/generators/library/lib/add-rollup-build-target.js +3 -47
  43. package/dist/src/generators/library/lib/normalize-options.js +0 -4
  44. package/dist/src/generators/library/library.js +1 -4
  45. package/dist/src/generators/library/schema.d.ts +0 -5
  46. package/dist/src/generators/library/schema.json +0 -6
  47. package/dist/src/generators/provider/files/rsbuild/package.json__tmpl__ +1 -0
  48. package/dist/src/generators/provider/files/rsbuild/rsbuild.config.ts__tmpl__ +2 -0
  49. package/dist/src/generators/provider/files/rspack/package.json__tmpl__ +1 -0
  50. package/dist/src/generators/provider/files/rspack/rspack.config.ts__tmpl__ +2 -0
  51. package/dist/src/generators/provider/files/vite/package.json__tmpl__ +1 -0
  52. package/dist/src/generators/provider/files/vite/vite.config.mts__tmpl__ +2 -0
  53. package/dist/src/generators/provider/provider.js +2 -0
  54. package/dist/src/generators/stories/stories.js +0 -5
  55. package/dist/src/generators/storybook-configuration/configuration.js +1 -9
  56. package/dist/src/generators/storybook-configuration/schema.d.ts +0 -1
  57. package/dist/src/migrations/update-23-2-0/add-optional-module-federation-packages.js +2 -1
  58. package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.d.ts +4 -0
  59. package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.js +13 -0
  60. package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.md +40 -0
  61. package/dist/src/plugins/router-plugin-utils.d.ts +4 -0
  62. package/dist/src/plugins/router-plugin-utils.js +15 -0
  63. package/dist/src/plugins/router-plugin.d.ts +0 -1
  64. package/dist/src/plugins/router-plugin.js +35 -44
  65. package/dist/src/utils/ast-utils.d.ts +0 -1
  66. package/dist/src/utils/ast-utils.js +0 -23
  67. package/dist/src/utils/ct-utils.d.ts +0 -7
  68. package/dist/src/utils/ct-utils.js +71 -55
  69. package/dist/src/utils/deprecation.d.ts +1 -1
  70. package/dist/src/utils/deprecation.js +3 -5
  71. package/dist/src/utils/framework.js +1 -3
  72. package/dist/src/utils/react-router-serve-ready-check.d.ts +11 -0
  73. package/dist/src/utils/react-router-serve-ready-check.js +25 -0
  74. package/dist/src/utils/versions.d.ts +0 -7
  75. package/dist/src/utils/versions.js +2 -9
  76. package/executors.json +1 -17
  77. package/generators.json +0 -27
  78. package/migrations.json +6 -0
  79. package/package.json +25 -39
  80. package/dist/mf/dynamic-federation.d.ts +0 -69
  81. package/dist/mf/dynamic-federation.js +0 -141
  82. package/dist/mf/index.d.ts +0 -1
  83. package/dist/mf/index.js +0 -8
  84. package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
  85. package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
  86. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -4
  87. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -19
  88. package/dist/src/executors/module-federation-dev-server/lib/start-remotes.d.ts +0 -5
  89. package/dist/src/executors/module-federation-dev-server/lib/start-remotes.js +0 -33
  90. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -6
  91. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -80
  92. package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -19
  93. package/dist/src/executors/module-federation-dev-server/schema.json +0 -142
  94. package/dist/src/executors/module-federation-ssr-dev-server/lib/index.d.ts +0 -2
  95. package/dist/src/executors/module-federation-ssr-dev-server/lib/index.js +0 -5
  96. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -4
  97. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -23
  98. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +0 -5
  99. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.js +0 -34
  100. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -3
  101. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -83
  102. package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -29
  103. package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -81
  104. package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +0 -12
  105. package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.js +0 -244
  106. package/dist/src/executors/module-federation-static-server/schema.d.ts +0 -3
  107. package/dist/src/executors/module-federation-static-server/schema.json +0 -16
  108. package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
  109. package/dist/src/generators/federate-module/federate-module.js +0 -67
  110. package/dist/src/generators/federate-module/lib/utils.d.ts +0 -23
  111. package/dist/src/generators/federate-module/lib/utils.js +0 -99
  112. package/dist/src/generators/federate-module/schema.d.ts +0 -15
  113. package/dist/src/generators/federate-module/schema.json +0 -89
  114. package/dist/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +0 -40
  115. package/dist/src/generators/host/files/common/src/main.js__tmpl__ +0 -13
  116. package/dist/src/generators/host/files/common/tsconfig.lint.json__tmpl__ +0 -19
  117. package/dist/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +0 -41
  118. package/dist/src/generators/host/files/common-ts/src/main.ts__tmpl__ +0 -13
  119. package/dist/src/generators/host/files/rspack-common/src/app/__fileName__.jsx__tmpl__ +0 -42
  120. package/dist/src/generators/host/files/rspack-common/src/main.jsx__tmpl__ +0 -13
  121. package/dist/src/generators/host/files/rspack-common/tsconfig.lint.json__tmpl__ +0 -19
  122. package/dist/src/generators/host/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -24
  123. package/dist/src/generators/host/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -42
  124. package/dist/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -66
  125. package/dist/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -27
  126. package/dist/src/generators/host/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -68
  127. package/dist/src/generators/host/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -28
  128. package/dist/src/generators/host/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -49
  129. package/dist/src/generators/host/files/rspack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
  130. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -22
  131. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -68
  132. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
  133. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -49
  134. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
  135. package/dist/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
  136. package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -67
  137. package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -42
  138. package/dist/src/generators/host/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -24
  139. package/dist/src/generators/host/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
  140. package/dist/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -39
  141. package/dist/src/generators/host/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -19
  142. package/dist/src/generators/host/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -28
  143. package/dist/src/generators/host/files/webpack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
  144. package/dist/src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
  145. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -16
  146. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
  147. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
  148. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
  149. package/dist/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
  150. package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -40
  151. package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -18
  152. package/dist/src/generators/host/host.d.ts +0 -4
  153. package/dist/src/generators/host/host.js +0 -174
  154. package/dist/src/generators/host/lib/add-module-federation-files.d.ts +0 -6
  155. package/dist/src/generators/host/lib/add-module-federation-files.js +0 -92
  156. package/dist/src/generators/host/lib/normalize-host-name.d.ts +0 -2
  157. package/dist/src/generators/host/lib/normalize-host-name.js +0 -12
  158. package/dist/src/generators/host/lib/setup-ssr-for-host.d.ts +0 -6
  159. package/dist/src/generators/host/lib/setup-ssr-for-host.js +0 -59
  160. package/dist/src/generators/host/lib/update-module-federation-e2e-project.d.ts +0 -3
  161. package/dist/src/generators/host/lib/update-module-federation-e2e-project.js +0 -19
  162. package/dist/src/generators/host/lib/update-module-federation-tsconfig.d.ts +0 -3
  163. package/dist/src/generators/host/lib/update-module-federation-tsconfig.js +0 -34
  164. package/dist/src/generators/host/schema.d.ts +0 -44
  165. package/dist/src/generators/host/schema.json +0 -173
  166. package/dist/src/generators/remote/files/common/src/main.js__tmpl__ +0 -1
  167. package/dist/src/generators/remote/files/common/src/remote-entry.js__tmpl__ +0 -1
  168. package/dist/src/generators/remote/files/common-ts/src/main.ts__tmpl__ +0 -1
  169. package/dist/src/generators/remote/files/common-ts/src/remote-entry.ts__tmpl__ +0 -1
  170. package/dist/src/generators/remote/files/rspack-common/src/main.jsx__tmpl__ +0 -1
  171. package/dist/src/generators/remote/files/rspack-common/src/remote-entry.js__tmpl__ +0 -1
  172. package/dist/src/generators/remote/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -12
  173. package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -45
  174. package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -1
  175. package/dist/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -15
  176. package/dist/src/generators/remote/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -71
  177. package/dist/src/generators/remote/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -45
  178. package/dist/src/generators/remote/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -45
  179. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -19
  180. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -71
  181. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
  182. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -45
  183. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
  184. package/dist/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
  185. package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -1
  186. package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -45
  187. package/dist/src/generators/remote/files/rspack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
  188. package/dist/src/generators/remote/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -12
  189. package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
  190. package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -1
  191. package/dist/src/generators/remote/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -9
  192. package/dist/src/generators/remote/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -45
  193. package/dist/src/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
  194. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -13
  195. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
  196. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
  197. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
  198. package/dist/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
  199. package/dist/src/generators/remote/files/webpack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
  200. package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -1
  201. package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -17
  202. package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.d.ts +0 -2
  203. package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.js +0 -12
  204. package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.d.ts +0 -3
  205. package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.js +0 -30
  206. package/dist/src/generators/remote/lib/setup-ssr-for-remote.d.ts +0 -4
  207. package/dist/src/generators/remote/lib/setup-ssr-for-remote.js +0 -61
  208. package/dist/src/generators/remote/lib/setup-tspath-for-remote.d.ts +0 -3
  209. package/dist/src/generators/remote/lib/setup-tspath-for-remote.js +0 -14
  210. package/dist/src/generators/remote/lib/update-host-with-remote.d.ts +0 -2
  211. package/dist/src/generators/remote/lib/update-host-with-remote.js +0 -79
  212. package/dist/src/generators/remote/remote.d.ts +0 -6
  213. package/dist/src/generators/remote/remote.js +0 -201
  214. package/dist/src/generators/remote/schema.d.ts +0 -39
  215. package/dist/src/generators/remote/schema.json +0 -173
  216. package/dist/src/generators/setup-ssr/files/server.ts__tmpl__ +0 -28
  217. package/dist/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +0 -47
  218. package/dist/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +0 -17
  219. package/dist/src/generators/setup-ssr/schema.d.ts +0 -8
  220. package/dist/src/generators/setup-ssr/schema.json +0 -54
  221. package/dist/src/generators/setup-ssr/setup-ssr.d.ts +0 -4
  222. package/dist/src/generators/setup-ssr/setup-ssr.js +0 -198
  223. package/dist/src/module-federation/ast-utils.d.ts +0 -8
  224. package/dist/src/module-federation/ast-utils.js +0 -101
  225. package/dist/src/rules/update-module-federation-project.d.ts +0 -11
  226. package/dist/src/rules/update-module-federation-project.js +0 -72
  227. package/dist/src/utils/add-mf-env-to-inputs.d.ts +0 -2
  228. package/dist/src/utils/add-mf-env-to-inputs.js +0 -29
  229. package/dist/src/utils/module-federation-deprecation.d.ts +0 -12
  230. package/dist/src/utils/module-federation-deprecation.js +0 -46
  231. package/dist/src/utils/normalize-remote.d.ts +0 -8
  232. package/dist/src/utils/normalize-remote.js +0 -31
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addE2e = addE2e;
4
- const internal_1 = require("@nx/eslint/internal");
5
4
  const devkit_1 = require("@nx/devkit");
6
5
  const web_1 = require("@nx/web");
7
6
  const versions_1 = require("../../../utils/versions");
@@ -24,26 +23,26 @@ async function addE2e(tree, options) {
24
23
  };
25
24
  if (options.bundler === 'webpack') {
26
25
  const { getWebpackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_1.nxVersion);
27
- e2eWebServerInfo = await getWebpackE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `webpack.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.port);
26
+ e2eWebServerInfo = await getWebpackE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `webpack.config.${options.js ? 'js' : 'ts'}`), options.port);
28
27
  }
29
28
  else if (options.bundler === 'rspack') {
30
29
  const { getRspackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
31
- e2eWebServerInfo = await getRspackE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `rspack.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.port);
30
+ e2eWebServerInfo = await getRspackE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `rspack.config.${options.js ? 'js' : 'ts'}`), options.port);
32
31
  }
33
32
  else if (options.bundler === 'vite') {
34
33
  const { getViteE2EWebServerInfo, getReactRouterE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
35
34
  e2eWebServerInfo = options.useReactRouter
36
- ? await getReactRouterE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.port ?? 4200,
35
+ ? await getReactRouterE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`), options.port ?? 4200,
37
36
  // If the user manually sets the port, then use it for dev and preview
38
37
  options.port)
39
- : await getViteE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.port ?? 4200,
38
+ : await getViteE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`), options.port ?? 4200,
40
39
  // If the user manually sets the port, then use it for dev and preview
41
40
  options.port);
42
41
  }
43
42
  else if (options.bundler === 'rsbuild') {
44
43
  (0, devkit_1.ensurePackage)('@nx/rsbuild', versions_1.nxVersion);
45
44
  const { getRsbuildE2EWebServerInfo, } = require('@nx/rsbuild/config-utils');
46
- e2eWebServerInfo = await getRsbuildE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `rsbuild.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.port ?? 4200);
45
+ e2eWebServerInfo = await getRsbuildE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `rsbuild.config.${options.js ? 'js' : 'ts'}`), options.port ?? 4200);
47
46
  }
48
47
  if (!hasNxBuildPlugin) {
49
48
  await (0, web_1.webStaticServeGenerator)(tree, {
@@ -95,7 +94,7 @@ async function addE2e(tree, options) {
95
94
  baseUrl: e2eWebServerInfo.e2eWebServerAddress,
96
95
  jsx: true,
97
96
  rootProject: options.rootProject,
98
- enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
97
+ enableTypedLinting: options.enableTypedLinting,
99
98
  webServerCommands: {
100
99
  default: e2eWebServerInfo.e2eWebServerCommand,
101
100
  production: e2eWebServerInfo.e2eCiWebServerCommand,
@@ -137,11 +136,12 @@ async function addE2e(tree, options) {
137
136
  directory: 'src',
138
137
  js: false,
139
138
  linter: options.linter,
140
- enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
141
- webServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
142
- webServerAddress: e2eWebServerInfo.e2eCiBaseUrl,
139
+ enableTypedLinting: options.enableTypedLinting,
140
+ webServerCommand: e2eWebServerInfo.e2eWebServerCommand,
141
+ webServerAddress: e2eWebServerInfo.e2eWebServerAddress,
142
+ ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
143
+ ciWebServerAddress: e2eWebServerInfo.e2eCiBaseUrl,
143
144
  rootProject: options.rootProject,
144
- addPlugin: options.addPlugin,
145
145
  });
146
146
  return e2eTask;
147
147
  }
@@ -21,8 +21,7 @@ async function addLinting(host, options) {
21
21
  unitTestRunner: options.unitTestRunner,
22
22
  rootProject: options.rootProject,
23
23
  skipPackageJson: options.skipPackageJson,
24
- enableTypedLinting: (0, internal_1.isTypedLintingEnabled)(options),
25
- addPlugin: options.addPlugin,
24
+ enableTypedLinting: options.enableTypedLinting,
26
25
  }));
27
26
  // Predefined configs, `extends` and ignore entries are ESLint concepts with
28
27
  // no equivalent in other linters.
@@ -2,9 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addProject = addProject;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
6
- const maybe_js_1 = require("../../../utils/maybe-js");
7
- const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
8
5
  function addProject(host, options) {
9
6
  const project = {
10
7
  root: options.appProjectRoot,
@@ -13,31 +10,6 @@ function addProject(host, options) {
13
10
  targets: {},
14
11
  tags: options.parsedTags,
15
12
  };
16
- if (options.bundler === 'webpack') {
17
- if (!(0, has_webpack_plugin_1.hasWebpackPlugin)(host) || !options.addPlugin) {
18
- // Mirrors warnWebpackExecutorGenerating from @nx/webpack/src/utils/deprecation.
19
- // Inlined to avoid a cross-package deep import; @nx/webpack's package
20
- // exports field doesn't expose internal `src/...` paths, so the import
21
- // works at compile time (via tsconfig project refs) but fails at runtime
22
- // in published packages.
23
- devkit_1.logger.warn('Generating targets that use the deprecated `@nx/webpack:webpack` and `@nx/webpack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/webpack:convert-to-inferred` next to migrate these targets to the `@nx/webpack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
24
- project.targets = {
25
- build: createBuildTarget(options),
26
- serve: createServeTarget(options),
27
- };
28
- }
29
- }
30
- else if (options.bundler === 'rspack' &&
31
- (!(0, has_rspack_plugin_1.hasRspackPlugin)(host) || !options.addPlugin)) {
32
- // Mirrors warnRspackExecutorGenerating from @nx/rspack/src/utils/deprecation.
33
- // Inlined to avoid a cross-package import where react does not declare a
34
- // TypeScript project reference to rspack.
35
- devkit_1.logger.warn('Generating targets that use the deprecated `@nx/rspack:rspack` and `@nx/rspack:dev-server` executors. These executors will be removed in Nx v24. Run `nx g @nx/rspack:convert-to-inferred` next to migrate these targets to the `@nx/rspack/plugin` inferred plugin and prevent future generators from emitting executor targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
36
- project.targets = {
37
- build: createRspackBuildTarget(options),
38
- serve: createRspackServeTarget(options),
39
- };
40
- }
41
13
  const packageJson = {
42
14
  name: options.importPath,
43
15
  version: '0.0.1',
@@ -77,142 +49,3 @@ function addProject(host, options) {
77
49
  }
78
50
  }
79
51
  }
80
- function createRspackBuildTarget(options) {
81
- return {
82
- executor: '@nx/rspack:rspack',
83
- outputs: ['{options.outputPath}'],
84
- defaultConfiguration: 'production',
85
- options: {
86
- outputPath: options.isUsingTsSolutionConfig
87
- ? (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'dist')
88
- : (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot !== '.'
89
- ? options.appProjectRoot
90
- : options.projectName),
91
- index: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/index.html'),
92
- baseHref: '/',
93
- main: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/main.tsx`)),
94
- tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
95
- assets: [
96
- (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/favicon.ico'),
97
- (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
98
- ],
99
- rspackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'rspack.config.js'),
100
- styles: !options.hasStyles
101
- ? []
102
- : [
103
- (0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
104
- ],
105
- scripts: [],
106
- configurations: {
107
- development: {
108
- mode: 'development',
109
- },
110
- production: {
111
- mode: 'production',
112
- optimization: true,
113
- sourceMap: false,
114
- outputHashing: 'all',
115
- namedChunks: false,
116
- extractLicenses: true,
117
- vendorChunk: false,
118
- },
119
- },
120
- },
121
- };
122
- }
123
- function createRspackServeTarget(options) {
124
- return {
125
- executor: '@nx/rspack:dev-server',
126
- defaultConfiguration: 'development',
127
- options: {
128
- buildTarget: `${options.projectName}:build`,
129
- // @nx/rspack:dev-server defaults to 4200 at runtime, not in its schema, so
130
- // omitting this is safe but the generated executor docs show no default.
131
- ...(options.port != null ? { port: options.port } : {}),
132
- hmr: true,
133
- },
134
- configurations: {
135
- development: {
136
- buildTarget: `${options.projectName}:build:development`,
137
- },
138
- production: {
139
- buildTarget: `${options.projectName}:build:production`,
140
- hmr: false,
141
- },
142
- },
143
- };
144
- }
145
- function createBuildTarget(options) {
146
- return {
147
- executor: '@nx/webpack:webpack',
148
- outputs: ['{options.outputPath}'],
149
- defaultConfiguration: 'production',
150
- options: {
151
- compiler: options.compiler ?? 'babel',
152
- outputPath: options.isUsingTsSolutionConfig
153
- ? (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'dist')
154
- : (0, devkit_1.joinPathFragments)('dist', options.appProjectRoot !== '.'
155
- ? options.appProjectRoot
156
- : options.projectName),
157
- index: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/index.html'),
158
- baseHref: '/',
159
- main: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/main.tsx`)),
160
- tsConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json'),
161
- assets: [
162
- (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/favicon.ico'),
163
- (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'src/assets'),
164
- ],
165
- styles: !options.hasStyles
166
- ? []
167
- : [
168
- (0, devkit_1.joinPathFragments)(options.appProjectRoot, `src/styles.${options.style}`),
169
- ],
170
- scripts: [],
171
- webpackConfig: (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'webpack.config.js'),
172
- },
173
- configurations: {
174
- development: {
175
- extractLicenses: false,
176
- optimization: false,
177
- sourceMap: true,
178
- vendorChunk: true,
179
- },
180
- production: {
181
- fileReplacements: [
182
- {
183
- replace: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/environments/environment.ts`)),
184
- with: (0, devkit_1.joinPathFragments)(options.appProjectRoot, (0, maybe_js_1.maybeJs)(options, `src/environments/environment.prod.ts`)),
185
- },
186
- ],
187
- optimization: true,
188
- outputHashing: 'all',
189
- sourceMap: false,
190
- namedChunks: false,
191
- extractLicenses: true,
192
- vendorChunk: false,
193
- },
194
- },
195
- };
196
- }
197
- function createServeTarget(options) {
198
- return {
199
- executor: '@nx/webpack:dev-server',
200
- defaultConfiguration: 'development',
201
- options: {
202
- buildTarget: `${options.projectName}:build`,
203
- // Only when asked: @nx/webpack:dev-server already defaults to 4200, so writing
204
- // it unrequested would just restate the executor's own default.
205
- ...(options.port != null ? { port: options.port } : {}),
206
- hmr: true,
207
- },
208
- configurations: {
209
- development: {
210
- buildTarget: `${options.projectName}:build:development`,
211
- },
212
- production: {
213
- buildTarget: `${options.projectName}:build:production`,
214
- hmr: false,
215
- },
216
- },
217
- };
218
- }
@@ -10,7 +10,6 @@ async function initRsbuild(tree, options, tasks) {
10
10
  const { initGenerator, } = require('@nx/rsbuild/generators');
11
11
  const initTask = await initGenerator(tree, {
12
12
  skipPackageJson: options.skipPackageJson,
13
- addPlugin: true,
14
13
  skipFormat: true,
15
14
  });
16
15
  tasks.push(initTask);
@@ -35,7 +35,6 @@ async function setupViteConfiguration(tree, options, tasks) {
35
35
  inSourceTests: options.inSourceTests,
36
36
  compiler: options.compiler,
37
37
  skipFormat: true,
38
- addPlugin: options.addPlugin,
39
38
  projectType: 'application',
40
39
  port: options.port,
41
40
  ...(forceViteV7 ? { useViteV7: true } : {}),
@@ -69,7 +68,6 @@ async function setupVitestConfiguration(tree, options, tasks) {
69
68
  project: options.projectName,
70
69
  inSourceTests: options.inSourceTests,
71
70
  skipFormat: true,
72
- addPlugin: options.addPlugin,
73
71
  });
74
72
  tasks.push(vitestTask);
75
73
  createOrEditViteConfig(tree, {
@@ -8,7 +8,6 @@ async function initWebpack(tree, options, tasks) {
8
8
  const webpackInitTask = await webpackInitGenerator(tree, {
9
9
  skipPackageJson: options.skipPackageJson,
10
10
  skipFormat: true,
11
- addPlugin: options.addPlugin,
12
11
  });
13
12
  tasks.push(webpackInitTask);
14
13
  if (!options.skipPackageJson) {
@@ -19,7 +19,6 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
19
19
  globalCss?: boolean;
20
20
  strict?: boolean;
21
21
  enableTypedLinting?: boolean;
22
- setParserOptionsProject?: boolean;
23
22
  compiler?: 'babel' | 'swc';
24
23
  remotes?: string[];
25
24
  devServerPort?: number;
@@ -41,7 +40,6 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
41
40
  fileName: string;
42
41
  hasStyles: boolean;
43
42
  unitTestRunner: 'jest' | 'vitest' | 'none';
44
- addPlugin?: boolean;
45
43
  names: ReturnType<typeof import("@nx/devkit").names>;
46
44
  isUsingTsSolutionConfig?: boolean;
47
45
  typesNodeVersion: string;
@@ -9,9 +9,7 @@ const path_1 = require("path");
9
9
  const create_ts_config_1 = require("../../../utils/create-ts-config");
10
10
  const get_in_source_vitest_tests_template_1 = require("../../../utils/get-in-source-vitest-tests-template");
11
11
  const maybe_js_1 = require("../../../utils/maybe-js");
12
- const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
13
12
  const get_app_tests_1 = require("./get-app-tests");
14
- const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
15
13
  const internal_1 = require("@nx/js/internal");
16
14
  const versions_1 = require("../../../utils/versions");
17
15
  const internal_2 = require("@nx/devkit/internal");
@@ -83,12 +81,7 @@ async function createApplicationFiles(host, options) {
83
81
  else if (options.bundler === 'webpack') {
84
82
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/base-webpack'), options.appProjectRoot, {
85
83
  ...templateVariables,
86
- // Must match addProject's gate. An app that opts out gets executor targets,
87
- // so it needs the executor-shaped config too — otherwise the plugin config's
88
- // devServer.port and the serve target's port both describe the same server.
89
- webpackPluginOptions: (0, has_webpack_plugin_1.hasWebpackPlugin)(host) && options.addPlugin
90
- ? createNxWebpackPluginOptions(options, templateVariables.offsetFromRoot)
91
- : null,
84
+ webpackPluginOptions: createNxWebpackPluginOptions(options, templateVariables.offsetFromRoot),
92
85
  });
93
86
  if (options.compiler === 'babel') {
94
87
  (0, devkit_1.writeJson)(host, `${options.appProjectRoot}/.babelrc`, {
@@ -114,9 +107,7 @@ async function createApplicationFiles(host, options) {
114
107
  else if (options.bundler === 'rspack') {
115
108
  (0, devkit_1.generateFiles)(host, (0, path_1.join)(__dirname, '../files/base-rspack'), options.appProjectRoot, {
116
109
  ...templateVariables,
117
- rspackPluginOptions: (0, has_rspack_plugin_1.hasRspackPlugin)(host) && options.addPlugin
118
- ? createNxRspackPluginOptions(options, templateVariables.offsetFromRoot)
119
- : null,
110
+ rspackPluginOptions: createNxRspackPluginOptions(options, templateVariables.offsetFromRoot),
120
111
  });
121
112
  }
122
113
  else if (options.bundler === 'rsbuild') {
@@ -13,10 +13,6 @@ async function normalizeOptions(host, options) {
13
13
  directory: options.directory,
14
14
  rootProject: options.rootProject,
15
15
  });
16
- const nxJson = (0, devkit_1.readNxJson)(host);
17
- const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
18
- nxJson.useInferencePlugins !== false;
19
- options.addPlugin ??= addPlugin;
20
16
  options.rootProject = appProjectRoot === '.';
21
17
  const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
22
18
  const appProjectName = !isUsingTsSolutionConfig || options.name ? projectName : importPath;
@@ -20,10 +20,6 @@ export interface Schema {
20
20
  globalCss?: boolean;
21
21
  strict?: boolean;
22
22
  enableTypedLinting?: boolean;
23
- /**
24
- * @deprecated Use `enableTypedLinting` instead. This option will be removed in Nx v24.
25
- */
26
- setParserOptionsProject?: boolean;
27
23
  compiler?: 'babel' | 'swc';
28
24
  remotes?: string[];
29
25
  /** @deprecated Use {@link Schema.port} instead. This option will be removed in Nx v25. */
@@ -33,7 +29,6 @@ export interface Schema {
33
29
  bundler?: 'webpack' | 'vite' | 'rspack' | 'rsbuild';
34
30
  minimal?: boolean;
35
31
  // Internal options
36
- addPlugin?: boolean;
37
32
  nxCloudToken?: string;
38
33
  useTsSolution?: boolean;
39
34
  formatter?: 'prettier' | 'oxfmt' | 'none';
@@ -53,7 +48,6 @@ export interface NormalizedSchema<T extends Schema = Schema> extends T {
53
48
  fileName: string;
54
49
  hasStyles: boolean;
55
50
  unitTestRunner: 'jest' | 'vitest' | 'none';
56
- addPlugin?: boolean;
57
51
  names: ReturnType<typeof names>;
58
52
  isUsingTsSolutionConfig?: boolean;
59
53
  }
@@ -158,12 +158,6 @@
158
158
  "description": "Whether to enable typed linting. For flat configs, this configures the recommended `parserOptions.projectService` and `tsconfigRootDir`. For legacy `.eslintrc` configs, this configures `parserOptions.project`. We do not enable this by default for lint performance reasons.",
159
159
  "default": false
160
160
  },
161
- "setParserOptionsProject": {
162
- "type": "boolean",
163
- "description": "Deprecated alias for `enableTypedLinting`.",
164
- "default": false,
165
- "x-deprecated": "Use `enableTypedLinting` instead. This option will be removed in Nx v24."
166
- },
167
161
  "compiler": {
168
162
  "type": "string",
169
163
  "description": "The compiler to use.",
@@ -66,6 +66,7 @@ async function consumerGenerator(tree, schema) {
66
66
  command: BUNDLER_DEV_COMMAND[opts.bundler],
67
67
  cwd: opts.projectRoot,
68
68
  },
69
+ readyWhen: { signal: true },
69
70
  },
70
71
  build: {
71
72
  executor: 'nx:run-commands',
@@ -118,6 +119,7 @@ async function consumerGenerator(tree, schema) {
118
119
  remoteType,
119
120
  versions: {
120
121
  ...mfVersions,
122
+ nxVersion: versions_2.nxVersion,
121
123
  reactVersion: versions_2.reactVersion,
122
124
  reactDomVersion: versions_2.reactDomVersion,
123
125
  typesReactVersion: versions_2.typesReactVersion,
@@ -14,6 +14,7 @@
14
14
  },
15
15
  "devDependencies": {
16
16
  "@module-federation/rsbuild-plugin": "<%= versions.moduleFederationRsbuildPluginVersion %>",
17
+ "@nx/rsbuild": "<%= versions.nxVersion %>",
17
18
  "@rsbuild/core": "<%= versions.rsbuildCoreVersion %>",
18
19
  "@rsbuild/plugin-react": "<%= versions.rsbuildPluginReactVersion %>",
19
20
  "@types/react": "<%= versions.typesReactVersion %>",
@@ -1,6 +1,7 @@
1
1
  import { defineConfig } from '@rsbuild/core';
2
2
  import { pluginReact } from '@rsbuild/plugin-react';
3
3
  import { pluginModuleFederation } from '@module-federation/rsbuild-plugin';
4
+ import { pluginNxReadySignal } from '@nx/rsbuild/ready-signal';
4
5
 
5
6
  const PORT = <%= port %>;
6
7
  const NAME = '<%= federationName %>';
@@ -21,5 +22,6 @@ export default defineConfig({
21
22
  // at module load time.
22
23
  shared: ['react', 'react-dom'],
23
24
  }),
25
+ pluginNxReadySignal(),
24
26
  ],
25
27
  });
@@ -13,6 +13,7 @@
13
13
  "react-dom": "<%= versions.reactDomVersion %>"
14
14
  },
15
15
  "devDependencies": {
16
+ "@nx/rspack": "<%= versions.nxVersion %>",
16
17
  "@rspack/cli": "<%= versions.rspackCliVersion %>",
17
18
  "@rspack/core": "<%= versions.rspackCoreVersion %>",
18
19
  "@rspack/dev-server": "<%= versions.rspackDevServerVersion %>",
@@ -1,6 +1,7 @@
1
1
  import { defineConfig } from '@rspack/cli';
2
2
  import { rspack } from '@rspack/core';
3
3
  import { ModuleFederationPlugin } from '@module-federation/enhanced/rspack';
4
+ import { NxReadySignalPlugin } from '@nx/rspack/ready-signal';
4
5
  import { ReactRefreshRspackPlugin } from '@rspack/plugin-react-refresh';
5
6
  import * as path from 'node:path';
6
7
  import { fileURLToPath } from 'node:url';
@@ -58,6 +59,7 @@ export default defineConfig((_env, argv) => {
58
59
  // src/mf.ts at module load time.
59
60
  shared: ['react', 'react-dom'],
60
61
  }),
62
+ new NxReadySignalPlugin(),
61
63
  ].filter(Boolean),
62
64
  };
63
65
  });
@@ -15,6 +15,7 @@
15
15
  },
16
16
  "devDependencies": {
17
17
  "@module-federation/vite": "<%= versions.moduleFederationVitePluginVersion %>",
18
+ "@nx/vite": "<%= versions.nxVersion %>",
18
19
  "@types/react": "<%= versions.typesReactVersion %>",
19
20
  "@types/react-dom": "<%= versions.typesReactDomVersion %>",
20
21
  "@vitejs/plugin-react": "<%= versions.vitejsPluginReactVersion %>",
@@ -1,6 +1,7 @@
1
1
  import { defineConfig } from 'vite';
2
2
  import react from '@vitejs/plugin-react';
3
3
  import { federation } from '@module-federation/vite';
4
+ import { nxReadySignal } from '@nx/vite/plugins/nx-ready-signal.plugin';
4
5
 
5
6
  const PORT = <%= port %>;
6
7
 
@@ -23,5 +24,6 @@ export default defineConfig({
23
24
  },
24
25
  }),
25
26
  react(),
27
+ nxReadySignal(),
26
28
  ],
27
29
  });
@@ -8,10 +8,7 @@ const versions_1 = require("../../utils/versions");
8
8
  const add_files_1 = require("./lib/add-files");
9
9
  const ct_utils_1 = require("../../utils/ct-utils");
10
10
  function cypressComponentConfigGenerator(tree, options) {
11
- return cypressComponentConfigGeneratorInternal(tree, {
12
- addPlugin: false,
13
- ...options,
14
- });
11
+ return cypressComponentConfigGeneratorInternal(tree, options);
15
12
  }
16
13
  /**
17
14
  * This is for using cypresses own Component testing, if you want to use test
@@ -21,29 +18,20 @@ function cypressComponentConfigGenerator(tree, options) {
21
18
  async function cypressComponentConfigGeneratorInternal(tree, options) {
22
19
  (0, assert_supported_react_version_1.assertSupportedReactVersion)(tree);
23
20
  const { componentConfigurationGenerator: baseCyCtConfig } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
24
- const nxJson = (0, devkit_1.readNxJson)(tree);
25
- const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
26
- nxJson.useInferencePlugins !== false;
27
- options.addPlugin ??= addPlugin;
28
21
  const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
29
- const { found, bundler } = await (0, ct_utils_1.resolveCypressCTTarget)(tree, {
22
+ const { found, bundler: buildBundler } = await (0, ct_utils_1.resolveCypressCTTarget)(tree, {
30
23
  project: options.project,
31
24
  buildTarget: options.buildTarget,
32
- bundler: options.bundler,
33
- validExecutorNames: new Set([
34
- '@nx/webpack:webpack',
35
- '@nx/vite:build',
36
- ]),
37
25
  });
26
+ const bundler = options.bundler ?? buildBundler;
38
27
  const installTask = await baseCyCtConfig(tree, {
39
28
  project: options.project,
40
29
  skipFormat: true,
41
30
  jsx: true,
42
- addPlugin: options.addPlugin,
43
31
  bundler,
44
32
  });
45
33
  await (0, ct_utils_1.configureCypressCT)(tree, { project: options.project, found, bundler });
46
- await (0, add_files_1.addFiles)(tree, projectConfig, options, found);
34
+ await (0, add_files_1.addFiles)(tree, projectConfig, options, buildBundler);
47
35
  if (!options.skipFormat) {
48
36
  await (0, devkit_1.formatFiles)(tree);
49
37
  }
@@ -1,4 +1,3 @@
1
- import type { FoundTarget } from '@nx/cypress/internal';
2
1
  import { ProjectConfiguration, Tree } from '@nx/devkit';
3
2
  import type { CypressComponentConfigurationSchema } from '../schema';
4
- export declare function addFiles(tree: Tree, projectConfig: ProjectConfiguration, options: CypressComponentConfigurationSchema, found: FoundTarget): Promise<void>;
3
+ export declare function addFiles(tree: Tree, projectConfig: ProjectConfiguration, options: CypressComponentConfigurationSchema, buildBundler: 'vite' | 'webpack'): Promise<void>;
@@ -6,12 +6,14 @@ const internal_1 = require("@nx/js/internal");
6
6
  const ct_utils_1 = require("../../../utils/ct-utils");
7
7
  const component_test_1 = require("../../component-test/component-test");
8
8
  const internal_2 = require("@nx/devkit/internal");
9
- async function addFiles(tree, projectConfig, options, found) {
9
+ async function addFiles(tree, projectConfig, options, buildBundler) {
10
10
  // must dynamicaly import to prevent packages not using cypress from erroring out
11
11
  // when importing react
12
12
  const { addMountDefinition, getInstalledCypressMajorVersion, } = require('@nx/cypress/internal');
13
13
  const installedCypressMajorVersion = getInstalledCypressMajorVersion(tree);
14
- const actualBundler = await (0, ct_utils_1.getActualBundler)(tree, options, found);
14
+ const actualBundler = options.buildTarget !== undefined && options.bundler
15
+ ? options.bundler
16
+ : buildBundler;
15
17
  if (options.bundler && options.bundler !== actualBundler) {
16
18
  devkit_1.logger.warn(`You have specified ${options.bundler} as the bundler but this project is configured to use ${actualBundler}.
17
19
  This may cause errors. If you are seeing errors, try removing the --bundler option.`);
@@ -4,5 +4,4 @@ export interface CypressComponentConfigurationSchema {
4
4
  skipFormat?: boolean;
5
5
  buildTarget?: string;
6
6
  bundler?: 'webpack' | 'vite';
7
- addPlugin?: boolean;
8
7
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.reactInitGenerator = reactInitGenerator;
4
4
  const internal_1 = require("@nx/devkit/internal");
5
5
  const devkit_1 = require("@nx/devkit");
6
+ const internal_2 = require("@nx/js/internal");
6
7
  const versions_1 = require("../../utils/versions");
7
8
  const version_utils_1 = require("../../utils/version-utils");
8
9
  const assert_supported_react_version_1 = require("../../utils/assert-supported-react-version");
@@ -20,11 +21,7 @@ async function reactInitGenerator(tree, schema) {
20
21
  '@nx/react': versions_1.nxVersion,
21
22
  }, undefined, schema.keepExistingVersions ?? true));
22
23
  }
23
- const nxJson = (0, devkit_1.readNxJson)(tree);
24
- schema.addPlugin ??=
25
- process.env.NX_ADD_PLUGINS !== 'false' &&
26
- nxJson.useInferencePlugins !== false;
27
- if (schema.useReactRouterPlugin && schema.addPlugin) {
24
+ if (schema.useReactRouterPlugin) {
28
25
  await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/react/router-plugin', router_plugin_1.createNodes, {
29
26
  buildTargetName: ['build', 'react-router:build', 'react-router-build'],
30
27
  devTargetName: ['dev', 'react-router:dev', 'react-router-dev'],
@@ -40,6 +37,7 @@ async function reactInitGenerator(tree, schema) {
40
37
  'react-router-build-deps',
41
38
  ],
42
39
  }, schema.updatePackageScripts);
40
+ await (0, internal_2.ensureTypescriptPlugin)(tree, schema.updatePackageScripts);
43
41
  }
44
42
  if (!schema.skipFormat) {
45
43
  await (0, devkit_1.formatFiles)(tree);
@@ -3,6 +3,5 @@ export interface InitSchema {
3
3
  skipPackageJson?: boolean;
4
4
  keepExistingVersions?: boolean;
5
5
  updatePackageScripts?: boolean;
6
- addPlugin?: boolean;
7
6
  useReactRouterPlugin?: boolean;
8
7
  }
@@ -19,8 +19,7 @@ async function addLinting(host, options) {
19
19
  ],
20
20
  unitTestRunner: options.unitTestRunner,
21
21
  skipPackageJson: options.skipPackageJson,
22
- enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
23
- addPlugin: options.addPlugin,
22
+ enableTypedLinting: options.enableTypedLinting,
24
23
  }));
25
24
  // Predefined configs, `extends` and ignore entries are ESLint concepts with
26
25
  // no equivalent in other linters.