@nx/react 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 (209) 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/plugins/component-testing/index.js +92 -33
  6. package/dist/plugins/storybook/index.js +18 -18
  7. package/dist/plugins/with-react.d.ts +3 -7
  8. package/dist/plugins/with-react.js +5 -19
  9. package/dist/src/generators/application/application.js +1 -36
  10. package/dist/src/generators/application/files/base-rspack/rspack.config.js__tmpl__ +1 -24
  11. package/dist/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +1 -26
  12. package/dist/src/generators/application/lib/add-e2e.js +5 -6
  13. package/dist/src/generators/application/lib/add-linting.js +0 -1
  14. package/dist/src/generators/application/lib/add-project.js +0 -167
  15. package/dist/src/generators/application/lib/bundlers/add-rsbuild.js +0 -1
  16. package/dist/src/generators/application/lib/bundlers/add-vite.js +0 -2
  17. package/dist/src/generators/application/lib/bundlers/add-webpack.js +0 -1
  18. package/dist/src/generators/application/lib/create-application-files.d.ts +0 -1
  19. package/dist/src/generators/application/lib/create-application-files.js +2 -11
  20. package/dist/src/generators/application/lib/normalize-options.js +0 -4
  21. package/dist/src/generators/application/schema.d.ts +0 -2
  22. package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +4 -16
  23. package/dist/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -2
  24. package/dist/src/generators/cypress-component-configuration/lib/add-files.js +4 -2
  25. package/dist/src/generators/cypress-component-configuration/schema.d.ts +0 -1
  26. package/dist/src/generators/init/init.js +3 -5
  27. package/dist/src/generators/init/schema.d.ts +0 -1
  28. package/dist/src/generators/library/lib/add-linting.js +0 -1
  29. package/dist/src/generators/library/lib/add-rollup-build-target.js +3 -47
  30. package/dist/src/generators/library/lib/normalize-options.js +0 -4
  31. package/dist/src/generators/library/library.js +1 -4
  32. package/dist/src/generators/library/schema.d.ts +0 -1
  33. package/dist/src/generators/stories/stories.js +0 -5
  34. package/dist/src/generators/storybook-configuration/configuration.js +1 -9
  35. package/dist/src/generators/storybook-configuration/schema.d.ts +0 -1
  36. package/dist/src/migrations/update-23-2-0/add-optional-module-federation-packages.js +2 -1
  37. package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.d.ts +4 -0
  38. package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.js +13 -0
  39. package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.md +40 -0
  40. package/dist/src/plugins/router-plugin.d.ts +0 -1
  41. package/dist/src/plugins/router-plugin.js +5 -42
  42. package/dist/src/utils/ast-utils.d.ts +0 -1
  43. package/dist/src/utils/ast-utils.js +0 -23
  44. package/dist/src/utils/ct-utils.d.ts +0 -7
  45. package/dist/src/utils/ct-utils.js +71 -55
  46. package/dist/src/utils/deprecation.d.ts +1 -1
  47. package/dist/src/utils/deprecation.js +3 -5
  48. package/dist/src/utils/framework.js +1 -3
  49. package/dist/src/utils/versions.d.ts +0 -7
  50. package/dist/src/utils/versions.js +2 -9
  51. package/executors.json +1 -17
  52. package/generators.json +0 -27
  53. package/migrations.json +6 -0
  54. package/package.json +17 -47
  55. package/dist/mf/dynamic-federation.d.ts +0 -69
  56. package/dist/mf/dynamic-federation.js +0 -141
  57. package/dist/mf/index.d.ts +0 -1
  58. package/dist/mf/index.js +0 -8
  59. package/dist/module-federation.d.ts +0 -5
  60. package/dist/module-federation.js +0 -20
  61. package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
  62. package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
  63. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -4
  64. package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -19
  65. package/dist/src/executors/module-federation-dev-server/lib/start-remotes.d.ts +0 -5
  66. package/dist/src/executors/module-federation-dev-server/lib/start-remotes.js +0 -33
  67. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -6
  68. package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -80
  69. package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -19
  70. package/dist/src/executors/module-federation-dev-server/schema.json +0 -142
  71. package/dist/src/executors/module-federation-ssr-dev-server/lib/index.d.ts +0 -2
  72. package/dist/src/executors/module-federation-ssr-dev-server/lib/index.js +0 -5
  73. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -4
  74. package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -23
  75. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +0 -5
  76. package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.js +0 -34
  77. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -3
  78. package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -83
  79. package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -29
  80. package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -81
  81. package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +0 -12
  82. package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.js +0 -244
  83. package/dist/src/executors/module-federation-static-server/schema.d.ts +0 -3
  84. package/dist/src/executors/module-federation-static-server/schema.json +0 -16
  85. package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
  86. package/dist/src/generators/federate-module/federate-module.js +0 -67
  87. package/dist/src/generators/federate-module/lib/utils.d.ts +0 -23
  88. package/dist/src/generators/federate-module/lib/utils.js +0 -99
  89. package/dist/src/generators/federate-module/schema.d.ts +0 -15
  90. package/dist/src/generators/federate-module/schema.json +0 -89
  91. package/dist/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +0 -40
  92. package/dist/src/generators/host/files/common/src/main.js__tmpl__ +0 -13
  93. package/dist/src/generators/host/files/common/tsconfig.lint.json__tmpl__ +0 -19
  94. package/dist/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +0 -41
  95. package/dist/src/generators/host/files/common-ts/src/main.ts__tmpl__ +0 -13
  96. package/dist/src/generators/host/files/rspack-common/src/app/__fileName__.jsx__tmpl__ +0 -42
  97. package/dist/src/generators/host/files/rspack-common/src/main.jsx__tmpl__ +0 -13
  98. package/dist/src/generators/host/files/rspack-common/tsconfig.lint.json__tmpl__ +0 -19
  99. package/dist/src/generators/host/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -24
  100. package/dist/src/generators/host/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -42
  101. package/dist/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -66
  102. package/dist/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -27
  103. package/dist/src/generators/host/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -68
  104. package/dist/src/generators/host/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -28
  105. package/dist/src/generators/host/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -49
  106. package/dist/src/generators/host/files/rspack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
  107. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -22
  108. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -68
  109. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
  110. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -49
  111. package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
  112. package/dist/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
  113. package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -67
  114. package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -42
  115. package/dist/src/generators/host/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -24
  116. package/dist/src/generators/host/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
  117. package/dist/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -39
  118. package/dist/src/generators/host/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -19
  119. package/dist/src/generators/host/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -28
  120. package/dist/src/generators/host/files/webpack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
  121. package/dist/src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
  122. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -16
  123. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
  124. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
  125. package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
  126. package/dist/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
  127. package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -40
  128. package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -18
  129. package/dist/src/generators/host/host.d.ts +0 -4
  130. package/dist/src/generators/host/host.js +0 -174
  131. package/dist/src/generators/host/lib/add-module-federation-files.d.ts +0 -6
  132. package/dist/src/generators/host/lib/add-module-federation-files.js +0 -92
  133. package/dist/src/generators/host/lib/normalize-host-name.d.ts +0 -2
  134. package/dist/src/generators/host/lib/normalize-host-name.js +0 -12
  135. package/dist/src/generators/host/lib/setup-ssr-for-host.d.ts +0 -6
  136. package/dist/src/generators/host/lib/setup-ssr-for-host.js +0 -59
  137. package/dist/src/generators/host/lib/update-module-federation-e2e-project.d.ts +0 -3
  138. package/dist/src/generators/host/lib/update-module-federation-e2e-project.js +0 -19
  139. package/dist/src/generators/host/lib/update-module-federation-tsconfig.d.ts +0 -3
  140. package/dist/src/generators/host/lib/update-module-federation-tsconfig.js +0 -34
  141. package/dist/src/generators/host/schema.d.ts +0 -44
  142. package/dist/src/generators/host/schema.json +0 -173
  143. package/dist/src/generators/remote/files/common/src/main.js__tmpl__ +0 -1
  144. package/dist/src/generators/remote/files/common/src/remote-entry.js__tmpl__ +0 -1
  145. package/dist/src/generators/remote/files/common-ts/src/main.ts__tmpl__ +0 -1
  146. package/dist/src/generators/remote/files/common-ts/src/remote-entry.ts__tmpl__ +0 -1
  147. package/dist/src/generators/remote/files/rspack-common/src/main.jsx__tmpl__ +0 -1
  148. package/dist/src/generators/remote/files/rspack-common/src/remote-entry.js__tmpl__ +0 -1
  149. package/dist/src/generators/remote/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -12
  150. package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -45
  151. package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -1
  152. package/dist/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -15
  153. package/dist/src/generators/remote/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -71
  154. package/dist/src/generators/remote/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -45
  155. package/dist/src/generators/remote/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -45
  156. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -19
  157. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -71
  158. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
  159. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -45
  160. package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
  161. package/dist/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
  162. package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -1
  163. package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -45
  164. package/dist/src/generators/remote/files/rspack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
  165. package/dist/src/generators/remote/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -12
  166. package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
  167. package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -1
  168. package/dist/src/generators/remote/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -9
  169. package/dist/src/generators/remote/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -45
  170. package/dist/src/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
  171. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -13
  172. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
  173. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
  174. package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
  175. package/dist/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
  176. package/dist/src/generators/remote/files/webpack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
  177. package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -1
  178. package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -17
  179. package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.d.ts +0 -2
  180. package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.js +0 -12
  181. package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.d.ts +0 -3
  182. package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.js +0 -30
  183. package/dist/src/generators/remote/lib/setup-ssr-for-remote.d.ts +0 -4
  184. package/dist/src/generators/remote/lib/setup-ssr-for-remote.js +0 -61
  185. package/dist/src/generators/remote/lib/setup-tspath-for-remote.d.ts +0 -3
  186. package/dist/src/generators/remote/lib/setup-tspath-for-remote.js +0 -14
  187. package/dist/src/generators/remote/lib/update-host-with-remote.d.ts +0 -2
  188. package/dist/src/generators/remote/lib/update-host-with-remote.js +0 -79
  189. package/dist/src/generators/remote/remote.d.ts +0 -6
  190. package/dist/src/generators/remote/remote.js +0 -201
  191. package/dist/src/generators/remote/schema.d.ts +0 -39
  192. package/dist/src/generators/remote/schema.json +0 -173
  193. package/dist/src/generators/setup-ssr/files/server.ts__tmpl__ +0 -28
  194. package/dist/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +0 -47
  195. package/dist/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +0 -17
  196. package/dist/src/generators/setup-ssr/schema.d.ts +0 -8
  197. package/dist/src/generators/setup-ssr/schema.json +0 -54
  198. package/dist/src/generators/setup-ssr/setup-ssr.d.ts +0 -4
  199. package/dist/src/generators/setup-ssr/setup-ssr.js +0 -198
  200. package/dist/src/module-federation/ast-utils.d.ts +0 -8
  201. package/dist/src/module-federation/ast-utils.js +0 -101
  202. package/dist/src/rules/update-module-federation-project.d.ts +0 -11
  203. package/dist/src/rules/update-module-federation-project.js +0 -72
  204. package/dist/src/utils/add-mf-env-to-inputs.d.ts +0 -2
  205. package/dist/src/utils/add-mf-env-to-inputs.js +0 -29
  206. package/dist/src/utils/module-federation-deprecation.d.ts +0 -12
  207. package/dist/src/utils/module-federation-deprecation.js +0 -46
  208. package/dist/src/utils/normalize-remote.d.ts +0 -8
  209. package/dist/src/utils/normalize-remote.js +0 -31
@@ -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) {
@@ -41,7 +41,6 @@ export declare function getDefaultTemplateVariables(host: Tree, options: Normali
41
41
  fileName: string;
42
42
  hasStyles: boolean;
43
43
  unitTestRunner: 'jest' | 'vitest' | 'none';
44
- addPlugin?: boolean;
45
44
  names: ReturnType<typeof import("@nx/devkit").names>;
46
45
  isUsingTsSolutionConfig?: boolean;
47
46
  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;
@@ -33,7 +33,6 @@ export interface Schema {
33
33
  bundler?: 'webpack' | 'vite' | 'rspack' | 'rsbuild';
34
34
  minimal?: boolean;
35
35
  // Internal options
36
- addPlugin?: boolean;
37
36
  nxCloudToken?: string;
38
37
  useTsSolution?: boolean;
39
38
  formatter?: 'prettier' | 'oxfmt' | 'none';
@@ -53,7 +52,6 @@ export interface NormalizedSchema<T extends Schema = Schema> extends T {
53
52
  fileName: string;
54
53
  hasStyles: boolean;
55
54
  unitTestRunner: 'jest' | 'vitest' | 'none';
56
- addPlugin?: boolean;
57
55
  names: ReturnType<typeof names>;
58
56
  isUsingTsSolutionConfig?: boolean;
59
57
  }
@@ -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
  }
@@ -20,7 +20,6 @@ async function addLinting(host, options) {
20
20
  unitTestRunner: options.unitTestRunner,
21
21
  skipPackageJson: options.skipPackageJson,
22
22
  enableTypedLinting: (0, internal_2.isTypedLintingEnabled)(options),
23
- addPlugin: options.addPlugin,
24
23
  }));
25
24
  // Predefined configs, `extends` and ignore entries are ESLint concepts with
26
25
  // no equivalent in other linters.
@@ -20,13 +20,7 @@ async function addRollupBuildTarget(host, options, external = new Set(['react',
20
20
  }, undefined, true));
21
21
  }
22
22
  external.add('react/jsx-runtime');
23
- const nxJson = (0, devkit_1.readNxJson)(host);
24
- const hasRollupPlugin = !!nxJson.plugins?.some((p) => typeof p === 'string'
25
- ? p === '@nx/rollup/plugin'
26
- : p.plugin === '@nx/rollup/plugin');
27
- if (hasRollupPlugin) {
28
- // New behavior, using rollup config file and inferred target.
29
- host.write((0, devkit_1.joinPathFragments)(options.projectRoot, 'rollup.config.cjs'), `const { withNx } = require('@nx/rollup/with-nx');
23
+ host.write((0, devkit_1.joinPathFragments)(options.projectRoot, 'rollup.config.cjs'), `const { withNx } = require('@nx/rollup/with-nx');
30
24
  const url = require('@rollup/plugin-url');
31
25
  const svg = require('@svgr/rollup');
32
26
 
@@ -34,8 +28,8 @@ module.exports = withNx(
34
28
  {
35
29
  main: '${(0, maybe_js_1.maybeJs)(options, './src/index.ts')}',
36
30
  outputPath: '${options.isUsingTsSolutionConfig
37
- ? './dist'
38
- : (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), 'dist', options.projectRoot)}',
31
+ ? './dist'
32
+ : (0, devkit_1.joinPathFragments)((0, devkit_1.offsetFromRoot)(options.projectRoot), 'dist', options.projectRoot)}',
39
33
  tsConfig: './tsconfig.lib.json',
40
34
  compiler: '${options.compiler ?? 'babel'}',
41
35
  external: ${JSON.stringify(Array.from(external))},
@@ -56,43 +50,5 @@ module.exports = withNx(
56
50
  }
57
51
  );
58
52
  `);
59
- }
60
- else {
61
- // Legacy behavior, there is a target in project.json using rollup executor.
62
- // Mirrors warnRollupExecutorGenerating from @nx/rollup/src/utils/deprecation.
63
- // Inlined to avoid a cross-package deep import; @nx/rollup's package
64
- // exports field doesn't expose internal `src/...` paths, so the import
65
- // works at compile time (via tsconfig project refs) but fails at runtime
66
- // in published packages.
67
- devkit_1.logger.warn('The `@nx/rollup:rollup` executor is deprecated and will be removed in Nx v24. Run `nx g @nx/rollup:convert-to-inferred` to migrate to the `@nx/rollup/plugin` inferred targets. See https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.');
68
- const { targets } = (0, devkit_1.readProjectConfiguration)(host, options.name);
69
- targets.build = {
70
- executor: '@nx/rollup:rollup',
71
- outputs: ['{options.outputPath}'],
72
- options: {
73
- outputPath: (0, devkit_1.joinPathFragments)('dist', options.projectRoot),
74
- tsConfig: `${options.projectRoot}/tsconfig.lib.json`,
75
- project: `${options.projectRoot}/package.json`,
76
- entryFile: (0, maybe_js_1.maybeJs)(options, `${options.projectRoot}/src/index.ts`),
77
- external: Array.from(external),
78
- rollupConfig: `@nx/react/plugins/bundle-rollup`,
79
- compiler: options.compiler ?? 'babel',
80
- assets: [
81
- {
82
- glob: `${options.projectRoot}/README.md`,
83
- input: '.',
84
- output: '.',
85
- },
86
- ],
87
- },
88
- };
89
- (0, devkit_1.updateProjectConfiguration)(host, options.name, {
90
- root: options.projectRoot,
91
- sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
92
- projectType: 'library',
93
- tags: options.parsedTags,
94
- targets,
95
- });
96
- }
97
53
  return (0, devkit_1.runTasksInSerial)(...tasks);
98
54
  }
@@ -14,10 +14,6 @@ async function normalizeOptions(host, options) {
14
14
  directory: options.directory,
15
15
  importPath: options.importPath,
16
16
  });
17
- const nxJson = (0, devkit_1.readNxJson)(host);
18
- const addPlugin = process.env.NX_ADD_PLUGINS !== 'false' &&
19
- nxJson.useInferencePlugins !== false;
20
- options.addPlugin ??= addPlugin;
21
17
  const fileName = projectNames.projectFileName;
22
18
  const parsedTags = options.tags
23
19
  ? options.tags.split(',').map((s) => s.trim())
@@ -25,7 +25,6 @@ const set_defaults_1 = require("./lib/set-defaults");
25
25
  const update_app_routes_1 = require("./lib/update-app-routes");
26
26
  async function libraryGenerator(host, schema) {
27
27
  return await libraryGeneratorInternal(host, {
28
- addPlugin: false,
29
28
  useProjectJson: true,
30
29
  ...schema,
31
30
  });
@@ -33,7 +32,7 @@ async function libraryGenerator(host, schema) {
33
32
  async function libraryGeneratorInternal(host, schema) {
34
33
  (0, assert_supported_react_version_1.assertSupportedReactVersion)(host);
35
34
  const tasks = [];
36
- const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
35
+ const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host);
37
36
  const jsInitTask = await (0, js_1.initGenerator)(host, {
38
37
  ...schema,
39
38
  addTsPlugin,
@@ -101,7 +100,6 @@ async function libraryGeneratorInternal(host, schema) {
101
100
  compiler: options.compiler,
102
101
  skipFormat: true,
103
102
  testEnvironment: 'jsdom',
104
- addPlugin: options.addPlugin,
105
103
  });
106
104
  tasks.push(viteTask);
107
105
  createOrEditViteConfig(host, {
@@ -159,7 +157,6 @@ async function libraryGeneratorInternal(host, schema) {
159
157
  inSourceTests: options.inSourceTests,
160
158
  skipFormat: true,
161
159
  testEnvironment: 'jsdom',
162
- addPlugin: options.addPlugin,
163
160
  compiler: options.compiler,
164
161
  });
165
162
  tasks.push(vitestTask);
@@ -29,7 +29,6 @@ export interface Schema {
29
29
  tags?: string;
30
30
  unitTestRunner?: 'jest' | 'vitest' | 'none';
31
31
  minimal?: boolean;
32
- addPlugin?: boolean;
33
32
  useProjectJson?: boolean;
34
33
  }
35
34
 
@@ -100,11 +100,6 @@ async function storiesGenerator(host, schema) {
100
100
  }
101
101
  }
102
102
  async function isNextJsProject(tree, config) {
103
- const { findStorybookAndBuildTargetsAndCompiler, } = require('@nx/storybook/src/utils/utilities');
104
- const { nextBuildTarget } = findStorybookAndBuildTargetsAndCompiler(config.targets);
105
- if (nextBuildTarget) {
106
- return true;
107
- }
108
103
  for (const configFile of ['next.config.js', 'next.config.ts']) {
109
104
  if (tree.exists((0, path_1.join)(config.root, configFile))) {
110
105
  return true;
@@ -8,18 +8,11 @@ const framework_1 = require("../../utils/framework");
8
8
  const versions_1 = require("../../utils/versions");
9
9
  const stories_1 = require("../stories/stories");
10
10
  function storybookConfigurationGenerator(host, schema) {
11
- return storybookConfigurationGeneratorInternal(host, {
12
- addPlugin: false,
13
- ...schema,
14
- });
11
+ return storybookConfigurationGeneratorInternal(host, schema);
15
12
  }
16
13
  async function storybookConfigurationGeneratorInternal(host, schema) {
17
14
  (0, assert_supported_react_version_1.assertSupportedReactVersion)(host);
18
15
  const tasks = [];
19
- const nxJson = (0, devkit_1.readNxJson)(host);
20
- const addPluginDefault = process.env.NX_ADD_PLUGINS !== 'false' &&
21
- nxJson.useInferencePlugins !== false;
22
- schema.addPlugin ??= addPluginDefault;
23
16
  const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/storybook', versions_1.nxVersion);
24
17
  const uiFramework = (0, framework_1.getUiFramework)(host, schema.project);
25
18
  if (uiFramework === '@storybook/react-vite') {
@@ -34,7 +27,6 @@ async function storybookConfigurationGeneratorInternal(host, schema) {
34
27
  configureStaticServe: schema.configureStaticServe,
35
28
  uiFramework: uiFramework, // cannot import UiFramework type dynamically
36
29
  skipFormat: true,
37
- addPlugin: schema.addPlugin,
38
30
  });
39
31
  tasks.push(installTask);
40
32
  if (schema.generateStories) {
@@ -9,5 +9,4 @@ export interface StorybookConfigureSchema {
9
9
  linter?: LinterType;
10
10
  ignorePaths?: string[];
11
11
  configureStaticServe?: boolean;
12
- addPlugin?: boolean;
13
12
  }
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.default = addOptionalModuleFederationPackages;
4
4
  const devkit_1 = require("@nx/devkit");
5
5
  const versions_1 = require("../../utils/versions");
6
+ const httpProxyMiddlewareVersion = '^3.0.5';
6
7
  const moduleFederationExecutors = new Set([
7
8
  '@nx/react:module-federation-dev-server',
8
9
  '@nx/react:module-federation-ssr-dev-server',
@@ -54,7 +55,7 @@ async function addOptionalModuleFederationPackages(tree) {
54
55
  ...(needsStaticServer
55
56
  ? {
56
57
  express: versions_1.expressVersion,
57
- 'http-proxy-middleware': versions_1.httpProxyMiddlewareVersion,
58
+ 'http-proxy-middleware': httpProxyMiddlewareVersion,
58
59
  }
59
60
  : {}),
60
61
  }, undefined, true);
@@ -0,0 +1,4 @@
1
+ import { type Tree } from '@nx/devkit';
2
+ export default function update(tree: Tree): Promise<{
3
+ skipAgentic: boolean;
4
+ }>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.default = update;
4
+ const devkit_1 = require("@nx/devkit");
5
+ const internal_1 = require("@nx/js/internal");
6
+ async function update(tree) {
7
+ if (!(0, internal_1.registerTypescriptPluginForTypecheck)(tree, '@nx/react/router-plugin', {
8
+ removeTypecheckTargetName: true,
9
+ })) {
10
+ return { skipAgentic: true };
11
+ }
12
+ await (0, devkit_1.formatFiles)(tree);
13
+ }