@nx/react 23.0.0-beta.2 → 23.0.0-beta.21

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 (166) hide show
  1. package/generators.json +16 -3
  2. package/index.d.ts +0 -3
  3. package/index.d.ts.map +1 -1
  4. package/index.js +1 -4
  5. package/migrations.json +6 -0
  6. package/package.json +18 -18
  7. package/plugins/component-testing/index.js +7 -7
  8. package/plugins/component-testing/webpack-fallback.js +2 -2
  9. package/plugins/storybook/index.js +3 -3
  10. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts.map +1 -1
  11. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +6 -4
  12. package/src/executors/module-federation-dev-server/schema.json +1 -0
  13. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts.map +1 -1
  14. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +7 -5
  15. package/src/executors/module-federation-ssr-dev-server/schema.json +1 -0
  16. package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts.map +1 -1
  17. package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +6 -4
  18. package/src/executors/module-federation-static-server/schema.json +1 -0
  19. package/src/generators/_utils/mf-dependencies.d.ts +8 -0
  20. package/src/generators/_utils/mf-dependencies.d.ts.map +1 -0
  21. package/src/generators/_utils/mf-dependencies.js +84 -0
  22. package/src/generators/_utils/mf-versions.d.ts +12 -0
  23. package/src/generators/_utils/mf-versions.d.ts.map +1 -0
  24. package/src/generators/_utils/mf-versions.js +29 -0
  25. package/src/generators/_utils/normalize.d.ts +20 -0
  26. package/src/generators/_utils/normalize.d.ts.map +1 -0
  27. package/src/generators/_utils/normalize.js +48 -0
  28. package/src/generators/application/application.d.ts.map +1 -1
  29. package/src/generators/application/application.js +32 -18
  30. package/src/generators/application/lib/add-e2e.d.ts.map +1 -1
  31. package/src/generators/application/lib/add-linting.js +10 -11
  32. package/src/generators/application/lib/add-project.d.ts.map +1 -1
  33. package/src/generators/application/lib/add-project.js +10 -0
  34. package/src/generators/application/lib/add-routing.js +2 -2
  35. package/src/generators/application/lib/bundlers/add-vite.d.ts.map +1 -1
  36. package/src/generators/application/lib/bundlers/add-vite.js +10 -2
  37. package/src/generators/application/lib/create-application-files.d.ts +1 -1
  38. package/src/generators/application/lib/create-application-files.js +2 -2
  39. package/src/generators/application/lib/normalize-options.js +5 -5
  40. package/src/generators/component/component.js +2 -2
  41. package/src/generators/component/lib/normalize-options.d.ts.map +1 -1
  42. package/src/generators/component/lib/normalize-options.js +5 -6
  43. package/src/generators/component/schema.d.ts +2 -7
  44. package/src/generators/component/schema.json +0 -5
  45. package/src/generators/component-story/component-story.d.ts.map +1 -1
  46. package/src/generators/component-story/component-story.js +3 -4
  47. package/src/generators/component-test/component-test.d.ts.map +1 -1
  48. package/src/generators/component-test/component-test.js +3 -4
  49. package/src/generators/consumer/consumer.d.ts +5 -0
  50. package/src/generators/consumer/consumer.d.ts.map +1 -0
  51. package/src/generators/consumer/consumer.js +135 -0
  52. package/src/generators/consumer/files/_common/src/App.tsx__tmpl__ +53 -0
  53. package/src/generators/consumer/files/_common/src/bootstrap.tsx__tmpl__ +12 -0
  54. package/src/generators/consumer/files/_common/src/index.ts__tmpl__ +4 -0
  55. package/src/generators/consumer/files/_common/src/mf.ts__tmpl__ +35 -0
  56. package/src/generators/consumer/files/_common/tsconfig.json__tmpl__ +17 -0
  57. package/src/generators/consumer/files/rsbuild/index.html__tmpl__ +12 -0
  58. package/src/generators/consumer/files/rsbuild/package.json__tmpl__ +23 -0
  59. package/src/generators/consumer/files/rsbuild/rsbuild.config.ts__tmpl__ +25 -0
  60. package/src/generators/consumer/files/rspack/index.html__tmpl__ +12 -0
  61. package/src/generators/consumer/files/rspack/package.json__tmpl__ +23 -0
  62. package/src/generators/consumer/files/rspack/rspack.config.ts__tmpl__ +59 -0
  63. package/src/generators/consumer/files/vite/index.html__tmpl__ +12 -0
  64. package/src/generators/consumer/files/vite/package.json__tmpl__ +24 -0
  65. package/src/generators/consumer/files/vite/vite.config.ts__tmpl__ +27 -0
  66. package/src/generators/consumer/schema.d.ts +8 -0
  67. package/src/generators/consumer/schema.json +43 -0
  68. package/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -1
  69. package/src/generators/cypress-component-configuration/lib/add-files.d.ts.map +1 -1
  70. package/src/generators/cypress-component-configuration/lib/add-files.js +4 -4
  71. package/src/generators/federate-module/federate-module.d.ts.map +1 -1
  72. package/src/generators/federate-module/federate-module.js +4 -2
  73. package/src/generators/federate-module/lib/utils.js +2 -2
  74. package/src/generators/hook/hook.d.ts.map +1 -1
  75. package/src/generators/hook/hook.js +5 -6
  76. package/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
  77. package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +1 -1
  78. package/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
  79. package/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +2 -2
  80. package/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
  81. package/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
  82. package/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
  83. package/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
  84. package/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +2 -2
  85. package/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +2 -2
  86. package/src/generators/host/host.d.ts.map +1 -1
  87. package/src/generators/host/host.js +7 -5
  88. package/src/generators/host/lib/add-module-federation-files.d.ts.map +1 -1
  89. package/src/generators/host/lib/add-module-federation-files.js +3 -3
  90. package/src/generators/host/lib/normalize-host-name.js +2 -2
  91. package/src/generators/host/lib/update-module-federation-tsconfig.js +2 -2
  92. package/src/generators/init/init.d.ts.map +1 -1
  93. package/src/generators/init/init.js +2 -2
  94. package/src/generators/library/lib/add-linting.js +7 -8
  95. package/src/generators/library/lib/add-rollup-build-target.d.ts.map +1 -1
  96. package/src/generators/library/lib/add-rollup-build-target.js +6 -0
  97. package/src/generators/library/lib/install-common-dependencies.js +2 -2
  98. package/src/generators/library/lib/normalize-options.d.ts.map +1 -1
  99. package/src/generators/library/lib/normalize-options.js +7 -7
  100. package/src/generators/library/lib/update-app-routes.js +2 -2
  101. package/src/generators/library/library.d.ts.map +1 -1
  102. package/src/generators/library/library.js +14 -18
  103. package/src/generators/provider/files/_common/src/__componentName__.tsx__tmpl__ +11 -0
  104. package/src/generators/provider/files/_common/src/bootstrap.tsx__tmpl__ +12 -0
  105. package/src/generators/provider/files/_common/src/index.ts__tmpl__ +5 -0
  106. package/src/generators/provider/files/_common/tsconfig.json__tmpl__ +17 -0
  107. package/src/generators/provider/files/rsbuild/index.html__tmpl__ +12 -0
  108. package/src/generators/provider/files/rsbuild/package.json__tmpl__ +22 -0
  109. package/src/generators/provider/files/rsbuild/rsbuild.config.ts__tmpl__ +31 -0
  110. package/src/generators/provider/files/rspack/index.html__tmpl__ +12 -0
  111. package/src/generators/provider/files/rspack/package.json__tmpl__ +22 -0
  112. package/src/generators/provider/files/rspack/rspack.config.ts__tmpl__ +69 -0
  113. package/src/generators/provider/files/vite/index.html__tmpl__ +12 -0
  114. package/src/generators/provider/files/vite/package.json__tmpl__ +23 -0
  115. package/src/generators/provider/files/vite/vite.config.ts__tmpl__ +37 -0
  116. package/src/generators/provider/provider.d.ts +5 -0
  117. package/src/generators/provider/provider.d.ts.map +1 -0
  118. package/src/generators/provider/provider.js +92 -0
  119. package/src/generators/provider/schema.d.ts +9 -0
  120. package/src/generators/provider/schema.json +46 -0
  121. package/src/generators/redux/redux.d.ts.map +1 -1
  122. package/src/generators/redux/redux.js +7 -8
  123. package/src/generators/redux/schema.d.ts +1 -1
  124. package/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
  125. package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +1 -1
  126. package/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
  127. package/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +1 -1
  128. package/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +1 -1
  129. package/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +1 -1
  130. package/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +1 -1
  131. package/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +1 -1
  132. package/src/generators/remote/lib/setup-package-json-exports-for-remote.js +2 -2
  133. package/src/generators/remote/lib/update-host-with-remote.js +4 -5
  134. package/src/generators/remote/remote.d.ts.map +1 -1
  135. package/src/generators/remote/remote.js +9 -7
  136. package/src/generators/setup-ssr/setup-ssr.d.ts.map +1 -1
  137. package/src/generators/setup-ssr/setup-ssr.js +5 -7
  138. package/src/generators/stories/stories.js +5 -6
  139. package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts.map +1 -1
  140. package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +2 -2
  141. package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts.map +1 -1
  142. package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +2 -2
  143. package/src/migrations/update-22-0-0/add-svgr-to-webpack-config.d.ts.map +1 -1
  144. package/src/migrations/update-22-0-0/add-svgr-to-webpack-config.js +2 -2
  145. package/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.d.ts +3 -0
  146. package/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.d.ts.map +1 -0
  147. package/src/migrations/update-23-0-0/remove-nx-react-webpack-plugin-import.js +128 -0
  148. package/src/module-federation/ast-utils.js +2 -2
  149. package/src/plugins/router-plugin.d.ts.map +1 -1
  150. package/src/plugins/router-plugin.js +14 -23
  151. package/src/rules/update-module-federation-project.js +3 -3
  152. package/src/utils/add-mf-env-to-inputs.d.ts.map +1 -1
  153. package/src/utils/add-mf-env-to-inputs.js +15 -8
  154. package/src/utils/ast-utils.js +15 -15
  155. package/src/utils/component-props.js +3 -3
  156. package/src/utils/create-ts-config.js +3 -3
  157. package/src/utils/ct-utils.d.ts +1 -1
  158. package/src/utils/ct-utils.d.ts.map +1 -1
  159. package/src/utils/ct-utils.js +6 -6
  160. package/src/utils/module-federation-deprecation.d.ts +13 -0
  161. package/src/utils/module-federation-deprecation.d.ts.map +1 -0
  162. package/src/utils/module-federation-deprecation.js +46 -0
  163. package/src/utils/normalize-remote.js +2 -2
  164. package/src/utils/versions.d.ts +1 -1
  165. package/src/utils/versions.js +1 -1
  166. package/tailwind.js +2 -2
@@ -1,13 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hookGenerator = hookGenerator;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  // TODO(jack): Remove inline renderHook function when RTL releases with its own version
5
6
  const devkit_1 = require("@nx/devkit");
6
- const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
7
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  const path_1 = require("path");
9
9
  const ast_utils_1 = require("../../utils/ast-utils");
10
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
11
10
  async function hookGenerator(host, schema) {
12
11
  const options = await normalizeOptions(host, schema);
13
12
  createFiles(host, options);
@@ -29,7 +28,7 @@ function createFiles(host, options) {
29
28
  let tsModule;
30
29
  function addExportsToBarrel(host, options) {
31
30
  if (!tsModule) {
32
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
31
+ tsModule = (0, internal_2.ensureTypescript)();
33
32
  }
34
33
  const workspace = (0, devkit_1.getProjects)(host);
35
34
  const isApp = workspace.get(options.projectName).projectType === 'application';
@@ -45,7 +44,7 @@ function addExportsToBarrel(host, options) {
45
44
  }
46
45
  }
47
46
  async function normalizeOptions(host, options) {
48
- const { artifactName, directory, fileName: hookFilename, fileExtension, fileExtensionType, project: projectName, } = await (0, artifact_name_and_directory_utils_1.determineArtifactNameAndDirectoryOptions)(host, {
47
+ const { artifactName, directory, fileName: hookFilename, fileExtension, fileExtensionType, project: projectName, } = await (0, internal_1.determineArtifactNameAndDirectoryOptions)(host, {
49
48
  path: options.path,
50
49
  name: options.name,
51
50
  allowedFileExtensions: ['js', 'ts'],
@@ -64,7 +63,7 @@ async function normalizeOptions(host, options) {
64
63
  const project = (0, devkit_1.getProjects)(host).get(projectName);
65
64
  const { root, sourceRoot: projectSourceRoot, projectType } = project;
66
65
  if (options.export &&
67
- (0, ts_solution_setup_1.getProjectType)(host, root, projectType) === 'application') {
66
+ (0, internal_2.getProjectType)(host, root, projectType) === 'application') {
68
67
  devkit_1.logger.warn(`The "--export" option should not be used with applications and will do nothing.`);
69
68
  }
70
69
  return {
@@ -1,4 +1,4 @@
1
- import { ModuleFederationConfig } from '@nx/module-federation';
1
+ import type { ModuleFederationConfig } from '@nx/module-federation';
2
2
 
3
3
  const config: ModuleFederationConfig = {
4
4
  name: '<%= projectName %>',
@@ -1,6 +1,6 @@
1
1
  import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
2
2
  import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
3
- import { NxModuleFederationPlugin, NxModuleFederationSSRDevServerPlugin } from '@nx/module-federation/rspack.js';
3
+ import { NxModuleFederationPlugin, NxModuleFederationSSRDevServerPlugin } from '@nx/module-federation/rspack';
4
4
  import { join } from 'path';
5
5
 
6
6
  import browserMfConfig from './module-federation.config';
@@ -1,4 +1,4 @@
1
- import { ModuleFederationConfig } from '@nx/module-federation';
1
+ import type { ModuleFederationConfig } from '@nx/module-federation';
2
2
 
3
3
  const config: ModuleFederationConfig = {
4
4
  name: '<%= projectName %>',
@@ -1,7 +1,7 @@
1
1
  import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
2
2
  import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
3
- import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack.js';
4
- import { ModuleFederationConfig } from '@nx/module-federation';
3
+ import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack';
4
+ import type { ModuleFederationConfig } from '@nx/module-federation';
5
5
  import { join } from 'path';
6
6
 
7
7
  import baseConfig from './module-federation.config';
@@ -1,6 +1,6 @@
1
1
  import { NxAppRspackPlugin } from '@nx/rspack/app-plugin.js';
2
2
  import { NxReactRspackPlugin } from '@nx/rspack/react-plugin.js';
3
- import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack.js';
3
+ import { NxModuleFederationPlugin, NxModuleFederationDevServerPlugin } from '@nx/module-federation/rspack';
4
4
  import { join } from 'path';
5
5
 
6
6
  import config from './module-federation.config';
@@ -1,4 +1,4 @@
1
- import { ModuleFederationConfig } from '@nx/module-federation';
1
+ import type { ModuleFederationConfig } from '@nx/module-federation';
2
2
 
3
3
  const config: ModuleFederationConfig = {
4
4
  name: '<%= projectName %>',
@@ -1,6 +1,6 @@
1
1
  import {composePlugins, withNx} from '@nx/webpack';
2
2
  import {withReact} from '@nx/react';
3
- import {withModuleFederationForSSR} from '@nx/module-federation/webpack.js';
3
+ import {withModuleFederationForSSR} from '@nx/module-federation/webpack';
4
4
 
5
5
  import baseConfig from './module-federation.config';
6
6
 
@@ -1,4 +1,4 @@
1
- import { ModuleFederationConfig } from '@nx/module-federation';
1
+ import type { ModuleFederationConfig } from '@nx/module-federation';
2
2
 
3
3
  const config: ModuleFederationConfig = {
4
4
  name: '<%= projectName %>',
@@ -1,7 +1,7 @@
1
1
  import { composePlugins, withNx } from '@nx/webpack';
2
2
  import { withReact } from '@nx/react';
3
- import { withModuleFederation } from '@nx/module-federation/webpack.js';
4
- import { ModuleFederationConfig } from '@nx/module-federation';
3
+ import { withModuleFederation } from '@nx/module-federation/webpack';
4
+ import type { ModuleFederationConfig } from '@nx/module-federation';
5
5
 
6
6
  import baseConfig from './module-federation.config';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import {composePlugins, withNx} from '@nx/webpack';
2
2
  import {withReact} from '@nx/react';
3
- import {withModuleFederation} from '@nx/module-federation/webpack.js';
4
- import { ModuleFederationConfig } from '@nx/module-federation';
3
+ import {withModuleFederation} from '@nx/module-federation/webpack';
4
+ import type { ModuleFederationConfig } from '@nx/module-federation';
5
5
 
6
6
  import baseConfig from './module-federation.config';
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/host/host.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAKjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAapB,OAAO,EAAoB,MAAM,EAAE,MAAM,UAAU,CAAC;AAYpD,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAmJ5B;AAmCD,eAAe,aAAa,CAAC"}
1
+ {"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/host/host.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAKjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAapB,OAAO,EAAoB,MAAM,EAAE,MAAM,UAAU,CAAC;AAYpD,wBAAsB,aAAa,CACjC,IAAI,EAAE,IAAI,EACV,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,iBAAiB,CAAC,CAoJ5B;AAmCD,eAAe,aAAa,CAAC"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.hostGenerator = hostGenerator;
4
4
  const tslib_1 = require("tslib");
5
+ const internal_1 = require("@nx/devkit/internal");
5
6
  const devkit_1 = require("@nx/devkit");
6
7
  const update_module_federation_project_1 = require("../../rules/update-module-federation-project");
7
8
  const application_1 = tslib_1.__importDefault(require("../application/application"));
@@ -14,12 +15,13 @@ const setup_ssr_for_host_1 = require("./lib/setup-ssr-for-host");
14
15
  const update_module_federation_e2e_project_1 = require("./lib/update-module-federation-e2e-project");
15
16
  const add_mf_env_to_inputs_1 = require("../../utils/add-mf-env-to-inputs");
16
17
  const js_1 = require("@nx/js");
17
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
18
+ const internal_2 = require("@nx/js/internal");
18
19
  const versions_1 = require("../../utils/versions");
19
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
20
20
  const update_module_federation_tsconfig_1 = require("./lib/update-module-federation-tsconfig");
21
21
  const normalize_host_name_1 = require("./lib/normalize-host-name");
22
+ const module_federation_deprecation_1 = require("../../utils/module-federation-deprecation");
22
23
  async function hostGenerator(host, schema) {
24
+ (0, module_federation_deprecation_1.warnReactHostGeneratorDeprecation)();
23
25
  const tasks = [];
24
26
  const name = await (0, normalize_host_name_1.normalizeHostName)(host, schema.directory, schema.name);
25
27
  const options = {
@@ -46,7 +48,7 @@ async function hostGenerator(host, schema) {
46
48
  }
47
49
  });
48
50
  }
49
- await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'application');
51
+ await (0, internal_1.ensureRootProjectName)(options, 'application');
50
52
  const initTask = await (0, application_1.default)(host, {
51
53
  ...options,
52
54
  directory: options.appProjectRoot,
@@ -57,7 +59,7 @@ async function hostGenerator(host, schema) {
57
59
  });
58
60
  tasks.push(initTask);
59
61
  // In TS solution setup, update package.json to use simple name instead of scoped name
60
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
62
+ if ((0, internal_2.isUsingTsSolutionSetup)(host)) {
61
63
  const hostPackageJsonPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'package.json');
62
64
  if (host.exists(hostPackageJsonPath)) {
63
65
  (0, devkit_1.updateJson)(host, hostPackageJsonPath, (json) => {
@@ -98,7 +100,7 @@ async function hostGenerator(host, schema) {
98
100
  (0, update_module_federation_e2e_project_1.updateModuleFederationE2eProject)(host, options);
99
101
  (0, update_module_federation_tsconfig_1.updateModuleFederationTsconfig)(host, options);
100
102
  // Add remotes as devDependencies in TS solution setup
101
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host) && remotesWithPorts.length > 0) {
103
+ if ((0, internal_2.isUsingTsSolutionSetup)(host) && remotesWithPorts.length > 0) {
102
104
  addRemotesAsHostDependencies(host, options.projectName, remotesWithPorts);
103
105
  }
104
106
  if (options.ssr) {
@@ -1 +1 @@
1
- {"version":3,"file":"add-module-federation-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/host/lib/add-module-federation-files.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAML,MAAM,YAAY,CAAC;AAUpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,EACzB,qBAAqB,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,QAgJxD"}
1
+ {"version":3,"file":"add-module-federation-files.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/host/lib/add-module-federation-files.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EAML,MAAM,YAAY,CAAC;AAOpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAG7C,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,EACzB,qBAAqB,EAAE;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,EAAE,QAgJxD"}
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addModuleFederationFiles = addModuleFederationFiles;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/js/internal");
6
6
  const maybe_js_1 = require("../../../utils/maybe-js");
7
7
  const create_application_files_1 = require("../../application/lib/create-application-files");
8
8
  const path_1 = require("path");
@@ -35,7 +35,7 @@ function addModuleFederationFiles(host, options, defaultRemoteManifest) {
35
35
  }),
36
36
  };
37
37
  const projectConfig = (0, devkit_1.readProjectConfiguration)(host, options.projectName);
38
- const pathToMFManifest = (0, devkit_1.joinPathFragments)((0, ts_solution_setup_1.getProjectSourceRoot)(projectConfig, host), 'assets/module-federation.manifest.json');
38
+ const pathToMFManifest = (0, devkit_1.joinPathFragments)((0, internal_1.getProjectSourceRoot)(projectConfig, host), 'assets/module-federation.manifest.json');
39
39
  // Module federation requires bootstrap code to be dynamically imported.
40
40
  // Renaming original entry file so we can use `import(./bootstrap)` in
41
41
  // new entry file.
@@ -69,7 +69,7 @@ function addModuleFederationFiles(host, options, defaultRemoteManifest) {
69
69
  processBundlerConfigFile(options, host, 'webpack.config.prod.js');
70
70
  }
71
71
  // Delete TypeScript prod config in TS solution setup - not needed in Crystal
72
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
72
+ if ((0, internal_1.isUsingTsSolutionSetup)(host)) {
73
73
  const prodConfigFileName = options.bundler === 'rspack'
74
74
  ? 'rspack.config.prod.ts'
75
75
  : 'webpack.config.prod.ts';
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeHostName = normalizeHostName;
4
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
4
+ const internal_1 = require("@nx/devkit/internal");
5
5
  async function normalizeHostName(tree, directory, name) {
6
- const { projectName } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(tree, {
6
+ const { projectName } = await (0, internal_1.determineProjectNameAndRootOptions)(tree, {
7
7
  name,
8
8
  directory,
9
9
  projectType: 'application',
@@ -2,13 +2,13 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.updateModuleFederationTsconfig = updateModuleFederationTsconfig;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
5
+ const internal_1 = require("@nx/js/internal");
6
6
  function updateModuleFederationTsconfig(host, options) {
7
7
  const tsconfigPath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.json');
8
8
  const tsconfigRuntimePath = (0, devkit_1.joinPathFragments)(options.appProjectRoot, 'tsconfig.app.json');
9
9
  if (!host.exists(tsconfigPath) || !host.exists(tsconfigRuntimePath))
10
10
  return;
11
- if ((0, ts_solution_setup_1.isUsingTsSolutionSetup)(host)) {
11
+ if ((0, internal_1.isUsingTsSolutionSetup)(host)) {
12
12
  // Update references to match what `nx sync` does.
13
13
  if (options.remotes?.length) {
14
14
  (0, devkit_1.updateJson)(host, tsconfigPath, (json) => {
@@ -1 +1 @@
1
- {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/init/init.ts"],"names":[],"mappings":"AAAA,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAKtC,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,8BAyDtE;AAED,eAAe,kBAAkB,CAAC"}
1
+ {"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/init/init.ts"],"names":[],"mappings":"AACA,OAAO,EAOL,KAAK,iBAAiB,EACtB,KAAK,IAAI,EACV,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAItC,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,UAAU,8BAyDtE;AAED,eAAe,kBAAkB,CAAC"}
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.reactInitGenerator = reactInitGenerator;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
6
  const versions_1 = require("../../utils/versions");
6
7
  const version_utils_1 = require("../../utils/version-utils");
7
- const add_plugin_1 = require("@nx/devkit/src/utils/add-plugin");
8
8
  const router_plugin_1 = require("../../plugins/router-plugin");
9
9
  async function reactInitGenerator(tree, schema) {
10
10
  const tasks = [];
@@ -23,7 +23,7 @@ async function reactInitGenerator(tree, schema) {
23
23
  process.env.NX_ADD_PLUGINS !== 'false' &&
24
24
  nxJson.useInferencePlugins !== false;
25
25
  if (schema.useReactRouterPlugin && schema.addPlugin) {
26
- await (0, add_plugin_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/react/router-plugin', router_plugin_1.createNodesV2, {
26
+ await (0, internal_1.addPlugin)(tree, await (0, devkit_1.createProjectGraphAsync)(), '@nx/react/router-plugin', router_plugin_1.createNodesV2, {
27
27
  buildTargetName: ['build', 'react-router:build', 'react-router-build'],
28
28
  devTargetName: ['dev', 'react-router:dev', 'react-router-dev'],
29
29
  startTargetName: ['start', 'react-router-serve', 'react-router-start'],
@@ -5,8 +5,7 @@ const eslint_1 = require("@nx/eslint");
5
5
  const path_1 = require("nx/src/utils/path");
6
6
  const devkit_1 = require("@nx/devkit");
7
7
  const lint_1 = require("../../../utils/lint");
8
- const eslint_file_1 = require("@nx/eslint/src/generators/utils/eslint-file");
9
- const flat_config_1 = require("@nx/eslint/src/utils/flat-config");
8
+ const internal_1 = require("@nx/eslint/internal");
10
9
  async function addLinting(host, options) {
11
10
  if (options.linter === 'eslint') {
12
11
  const tasks = [];
@@ -23,17 +22,17 @@ async function addLinting(host, options) {
23
22
  addPlugin: options.addPlugin,
24
23
  });
25
24
  tasks.push(lintTask);
26
- if ((0, eslint_file_1.isEslintConfigSupported)(host)) {
27
- if ((0, flat_config_1.useFlatConfig)(host)) {
28
- (0, eslint_file_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
25
+ if ((0, internal_1.isEslintConfigSupported)(host)) {
26
+ if ((0, internal_1.useFlatConfig)(host)) {
27
+ (0, internal_1.addPredefinedConfigToFlatLintConfig)(host, options.projectRoot, 'flat/react', { checkBaseConfig: true });
29
28
  // Add an empty rules object to users know how to add/override rules
30
- (0, eslint_file_1.addOverrideToLintConfig)(host, options.projectRoot, {
29
+ (0, internal_1.addOverrideToLintConfig)(host, options.projectRoot, {
31
30
  files: ['*.ts', '*.tsx', '*.js', '*.jsx'],
32
31
  rules: {},
33
32
  });
34
33
  }
35
34
  else {
36
- const addExtendsTask = (0, eslint_file_1.addExtendsToLintConfig)(host, options.projectRoot, {
35
+ const addExtendsTask = (0, internal_1.addExtendsToLintConfig)(host, options.projectRoot, {
37
36
  name: 'plugin:@nx/react',
38
37
  needCompatFixup: true,
39
38
  });
@@ -41,7 +40,7 @@ async function addLinting(host, options) {
41
40
  }
42
41
  // Add out-tsc ignore pattern when using TS solution setup
43
42
  if (options.isUsingTsSolutionConfig) {
44
- (0, eslint_file_1.addIgnoresToLintConfig)(host, options.projectRoot, ['**/out-tsc']);
43
+ (0, internal_1.addIgnoresToLintConfig)(host, options.projectRoot, ['**/out-tsc']);
45
44
  }
46
45
  }
47
46
  let installTask = () => { };
@@ -1 +1 @@
1
- {"version":3,"file":"add-rollup-build-target.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/library/lib/add-rollup-build-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAGL,iBAAiB,EAOlB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;CAAE,EAC7D,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAmC,8BAiHxD"}
1
+ {"version":3,"file":"add-rollup-build-target.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/library/lib/add-rollup-build-target.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAGL,iBAAiB,EAQlB,MAAM,YAAY,CAAC;AAQpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAE7C,wBAAsB,oBAAoB,CACxC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,gBAAgB,GAAG;IAAE,MAAM,CAAC,EAAE,KAAK,CAAC,KAAK,GAAG,KAAK,CAAC,CAAA;CAAE,EAC7D,QAAQ,GAAE,GAAG,CAAC,MAAM,CAAmC,8BAyHxD"}
@@ -59,6 +59,12 @@ module.exports = withNx(
59
59
  }
60
60
  else {
61
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.');
62
68
  const { targets } = (0, devkit_1.readProjectConfiguration)(host, options.name);
63
69
  targets.build = {
64
70
  executor: '@nx/rollup:rollup',
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.installCommonDependencies = installCommonDependencies;
4
4
  const devkit_1 = require("@nx/devkit");
5
- const add_swc_dependencies_1 = require("@nx/js/src/utils/swc/add-swc-dependencies");
5
+ const internal_1 = require("@nx/js/internal");
6
6
  const version_utils_1 = require("../../../utils/version-utils");
7
7
  const versions_1 = require("../../../utils/versions");
8
8
  async function installCommonDependencies(host, options) {
@@ -32,7 +32,7 @@ async function installCommonDependencies(host, options) {
32
32
  const baseInstallTask = (0, devkit_1.addDependenciesToPackageJson)(host, dependencies, devDependencies);
33
33
  tasks.push(baseInstallTask);
34
34
  if (options.compiler === 'swc') {
35
- tasks.push((0, add_swc_dependencies_1.addSwcDependencies)(host));
35
+ tasks.push((0, internal_1.addSwcDependencies)(host));
36
36
  }
37
37
  else if (options.compiler === 'babel') {
38
38
  tasks.push((0, devkit_1.addDependenciesToPackageJson)(host, {}, {
@@ -1 +1 @@
1
- {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/library/lib/normalize-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOrD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAmG3B"}
1
+ {"version":3,"file":"normalize-options.d.ts","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/library/lib/normalize-options.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,IAAI,EACL,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAOrD,wBAAsB,gBAAgB,CACpC,IAAI,EAAE,IAAI,EACV,OAAO,EAAE,MAAM,GACd,OAAO,CAAC,gBAAgB,CAAC,CAmG3B"}
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.normalizeOptions = normalizeOptions;
4
+ const internal_1 = require("@nx/devkit/internal");
4
5
  const devkit_1 = require("@nx/devkit");
5
- const project_name_and_root_utils_1 = require("@nx/devkit/src/generators/project-name-and-root-utils");
6
6
  const assertion_1 = require("../../../utils/assertion");
7
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
7
+ const internal_2 = require("@nx/js/internal");
8
8
  async function normalizeOptions(host, options) {
9
- const isUsingTsSolutionConfig = (0, ts_solution_setup_1.isUsingTsSolutionSetup)(host);
10
- await (0, project_name_and_root_utils_1.ensureRootProjectName)(options, 'library');
11
- const { projectName, names: projectNames, projectRoot, importPath, } = await (0, project_name_and_root_utils_1.determineProjectNameAndRootOptions)(host, {
9
+ const isUsingTsSolutionConfig = (0, internal_2.isUsingTsSolutionSetup)(host);
10
+ await (0, internal_1.ensureRootProjectName)(options, 'library');
11
+ const { projectName, names: projectNames, projectRoot, importPath, } = await (0, internal_1.determineProjectNameAndRootOptions)(host, {
12
12
  name: options.name,
13
13
  projectType: 'library',
14
14
  directory: options.directory,
@@ -50,11 +50,11 @@ async function normalizeOptions(host, options) {
50
50
  normalized.inSourceTests === normalized.minimal || normalized.inSourceTests;
51
51
  if (options.appProject) {
52
52
  const appProjectConfig = (0, devkit_1.getProjects)(host).get(options.appProject);
53
- const appProjectType = (0, ts_solution_setup_1.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
53
+ const appProjectType = (0, internal_2.getProjectType)(host, appProjectConfig.root, appProjectConfig.projectType);
54
54
  if (appProjectType !== 'application') {
55
55
  throw new Error(`appProject expected type of "application" but got "${appProjectType}"`);
56
56
  }
57
- const appSourceRoot = (0, ts_solution_setup_1.getProjectSourceRoot)(appProjectConfig, host);
57
+ const appSourceRoot = (0, internal_2.getProjectSourceRoot)(appProjectConfig, host);
58
58
  normalized.appMain =
59
59
  appProjectConfig.targets.build?.options?.main ??
60
60
  findMainEntry(host, appProjectConfig.root);
@@ -6,7 +6,7 @@ const ast_utils_1 = require("../../../utils/ast-utils");
6
6
  const ast_utils_2 = require("../../../utils/ast-utils");
7
7
  const maybe_js_1 = require("../../../utils/maybe-js");
8
8
  const versions_1 = require("../../../utils/versions");
9
- const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
9
+ const internal_1 = require("@nx/js/internal");
10
10
  let tsModule;
11
11
  function updateAppRoutes(host, options) {
12
12
  if (!options.appMain || !options.appSourceRoot) {
@@ -53,7 +53,7 @@ function readComponent(host, path) {
53
53
  throw new Error(`Cannot find ${path}`);
54
54
  }
55
55
  if (!tsModule) {
56
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
56
+ tsModule = (0, internal_1.ensureTypescript)();
57
57
  }
58
58
  const content = host.read(path, 'utf-8');
59
59
  const source = tsModule.createSourceFile(path, content, tsModule.ScriptTarget.Latest, true);
@@ -1 +1 @@
1
- {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AAgCpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMhE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BA0RxE;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"library.d.ts","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,iBAAiB,EAOjB,IAAI,EAGL,MAAM,YAAY,CAAC;AA4BpB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAMhE;AAED,wBAAsB,wBAAwB,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,8BAyRxE;AAED,eAAe,gBAAgB,CAAC"}
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.libraryGenerator = libraryGenerator;
4
4
  exports.libraryGeneratorInternal = libraryGeneratorInternal;
5
5
  const tslib_1 = require("tslib");
6
+ const internal_1 = require("@nx/devkit/internal");
6
7
  const devkit_1 = require("@nx/devkit");
7
- const artifact_name_and_directory_utils_1 = require("@nx/devkit/src/generators/artifact-name-and-directory-utils");
8
- const log_show_project_command_1 = require("@nx/devkit/src/utils/log-show-project-command");
9
8
  const js_1 = require("@nx/js");
10
9
  const path_1 = require("path");
11
- const add_release_config_1 = require("@nx/js/src/generators/library/utils/add-release-config");
12
- const sort_fields_1 = require("@nx/js/src/utils/package-json/sort-fields");
13
- const ts_solution_setup_1 = require("@nx/js/src/utils/typescript/ts-solution-setup");
10
+ const internal_2 = require("@nx/js/internal");
14
11
  const create_ts_config_1 = require("../../utils/create-ts-config");
15
12
  const jest_utils_1 = require("../../utils/jest-utils");
16
13
  const maybe_js_1 = require("../../utils/maybe-js");
@@ -34,7 +31,7 @@ async function libraryGenerator(host, schema) {
34
31
  }
35
32
  async function libraryGeneratorInternal(host, schema) {
36
33
  const tasks = [];
37
- const addTsPlugin = (0, ts_solution_setup_1.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
34
+ const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(host, schema.addPlugin);
38
35
  const jsInitTask = await (0, js_1.initGenerator)(host, {
39
36
  ...schema,
40
37
  addTsPlugin,
@@ -85,7 +82,7 @@ async function libraryGeneratorInternal(host, schema) {
85
82
  }
86
83
  (0, create_files_1.createFiles)(host, options);
87
84
  if (options.isUsingTsSolutionConfig) {
88
- await (0, ts_solution_setup_1.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
85
+ await (0, internal_2.addProjectToTsSolutionWorkspace)(host, options.projectRoot);
89
86
  }
90
87
  const lintTask = await (0, add_linting_1.addLinting)(host, options);
91
88
  tasks.push(lintTask);
@@ -110,7 +107,7 @@ async function libraryGeneratorInternal(host, schema) {
110
107
  includeLib: true,
111
108
  includeVitest: options.unitTestRunner === 'vitest',
112
109
  inSourceTests: options.inSourceTests,
113
- rollupOptionsExternal: [
110
+ rolldownOptionsExternal: [
114
111
  "'react'",
115
112
  "'react-dom'",
116
113
  "'react/jsx-runtime'",
@@ -169,7 +166,7 @@ async function libraryGeneratorInternal(host, schema) {
169
166
  includeLib: true,
170
167
  includeVitest: true,
171
168
  inSourceTests: options.inSourceTests,
172
- rollupOptionsExternal: [
169
+ rolldownOptionsExternal: [
173
170
  "'react'",
174
171
  "'react-dom'",
175
172
  "'react/jsx-runtime'",
@@ -184,8 +181,8 @@ async function libraryGeneratorInternal(host, schema) {
184
181
  }, true);
185
182
  }
186
183
  if (options.component) {
187
- const relativeCwd = (0, artifact_name_and_directory_utils_1.getRelativeCwd)();
188
- const path = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/lib', options.fileName);
184
+ const relativeCwd = (0, internal_1.getRelativeCwd)();
185
+ const path = (0, devkit_1.joinPathFragments)(options.projectRoot, 'src/lib', options.js ? `${options.fileName}.js` : options.fileName);
189
186
  const componentTask = await (0, component_1.default)(host, {
190
187
  path: relativeCwd ? (0, path_1.relative)(relativeCwd, path) : path,
191
188
  style: options.style,
@@ -193,7 +190,6 @@ async function libraryGeneratorInternal(host, schema) {
193
190
  (options.unitTestRunner === 'vitest' && options.inSourceTests == true),
194
191
  export: true,
195
192
  routing: options.routing,
196
- js: options.js,
197
193
  name: options.name,
198
194
  inSourceTests: options.inSourceTests,
199
195
  skipFormat: true,
@@ -204,14 +200,14 @@ async function libraryGeneratorInternal(host, schema) {
204
200
  if (options.publishable) {
205
201
  const projectConfiguration = (0, devkit_1.readProjectConfiguration)(host, options.name);
206
202
  if (options.isUsingTsSolutionConfig) {
207
- await (0, add_release_config_1.addReleaseConfigForTsSolution)(host, options.name, projectConfiguration);
203
+ await (0, internal_2.addReleaseConfigForTsSolution)(host, options.name, projectConfiguration);
208
204
  }
209
205
  else {
210
206
  const nxJson = (0, devkit_1.readNxJson)(host);
211
- await (0, add_release_config_1.addReleaseConfigForNonTsSolution)(host, options.name, projectConfiguration);
207
+ await (0, internal_2.addReleaseConfigForNonTsSolution)(host, options.name, projectConfiguration);
212
208
  }
213
209
  (0, devkit_1.updateProjectConfiguration)(host, options.name, projectConfiguration);
214
- tasks.push(await (0, add_release_config_1.releaseTasks)(host));
210
+ tasks.push(await (0, internal_2.releaseTasks)(host));
215
211
  }
216
212
  if (!options.skipPackageJson) {
217
213
  const installReactTask = await (0, install_common_dependencies_1.installCommonDependencies)(host, options);
@@ -226,14 +222,14 @@ async function libraryGeneratorInternal(host, schema) {
226
222
  (0, maybe_js_1.maybeJs)(options, (0, devkit_1.joinPathFragments)(options.projectRoot, './src/index.ts')),
227
223
  ]);
228
224
  }
229
- (0, ts_solution_setup_1.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
225
+ (0, internal_2.updateTsconfigFiles)(host, options.projectRoot, 'tsconfig.lib.json', {
230
226
  jsx: 'react-jsx',
231
227
  module: 'esnext',
232
228
  moduleResolution: 'bundler',
233
229
  }, options.linter === 'eslint'
234
230
  ? ['eslint.config.js', 'eslint.config.cjs', 'eslint.config.mjs']
235
231
  : undefined);
236
- (0, sort_fields_1.sortPackageJsonFields)(host, options.projectRoot);
232
+ (0, internal_2.sortPackageJsonFields)(host, options.projectRoot);
237
233
  if (!options.skipFormat) {
238
234
  await (0, devkit_1.formatFiles)(host);
239
235
  }
@@ -242,7 +238,7 @@ async function libraryGeneratorInternal(host, schema) {
242
238
  tasks.push(() => (0, devkit_1.installPackagesTask)(host, true));
243
239
  }
244
240
  tasks.push(() => {
245
- (0, log_show_project_command_1.logShowProjectCommand)(options.name);
241
+ (0, internal_1.logShowProjectCommand)(options.name);
246
242
  });
247
243
  return (0, devkit_1.runTasksInSerial)(...tasks);
248
244
  }
@@ -0,0 +1,11 @@
1
+ // Exposed by the federation plugin as '<%= projectName %>/<%= exposeName %>'.
2
+ // Consumers render it lazily via `lazyProvider('<%= projectName %>', '<%= exposeName %>')`.
3
+ export function <%= componentName %>() {
4
+ return (
5
+ <section data-testid="<%= projectName %>">
6
+ <h1>Hello from <%= projectName %></h1>
7
+ </section>
8
+ );
9
+ }
10
+
11
+ export default <%= componentName %>;
@@ -0,0 +1,12 @@
1
+ import { StrictMode } from 'react';
2
+ import { createRoot } from 'react-dom/client';
3
+ import { <%= componentName %> } from './<%= componentName %>';
4
+
5
+ const container = document.getElementById('root');
6
+ if (!container) throw new Error('#root element not found');
7
+
8
+ createRoot(container).render(
9
+ <StrictMode>
10
+ <<%= componentName %> />
11
+ </StrictMode>
12
+ );
@@ -0,0 +1,5 @@
1
+ // Indirection required by Module Federation: the federation runtime must boot
2
+ // before any shared dependency (React, react-dom, etc.) is evaluated. Dynamic
3
+ // `import('./bootstrap')` defers the real entry until federation is ready.
4
+ import('./bootstrap');
5
+ export {};
@@ -0,0 +1,17 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
5
+ "module": "ESNext",
6
+ "moduleResolution": "Bundler",
7
+ "jsx": "react-jsx",
8
+ "strict": true,
9
+ "skipLibCheck": true,
10
+ "esModuleInterop": true,
11
+ "allowSyntheticDefaultImports": true,
12
+ "resolveJsonModule": true,
13
+ "isolatedModules": true,
14
+ "noEmit": true
15
+ },
16
+ "include": ["src"]
17
+ }
@@ -0,0 +1,12 @@
1
+ <!doctype html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta name="viewport" content="width=device-width,initial-scale=1" />
6
+ <title><%= projectName %> (standalone)</title>
7
+ </head>
8
+ <body>
9
+ <div id="root"></div>
10
+ <!-- Rsbuild's html plugin injects the entry script automatically. -->
11
+ </body>
12
+ </html>