@nx/react 24.0.0-pr.37405.acdaf31 → 24.0.0-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +0 -2
- package/dist/index.js +1 -5
- package/dist/internal.d.ts +1 -0
- package/dist/internal.js +3 -1
- package/dist/module-federation.d.ts +6 -5
- package/dist/module-federation.js +29 -18
- package/dist/plugins/component-testing/index.js +92 -33
- package/dist/plugins/storybook/index.js +18 -18
- package/dist/plugins/with-react.d.ts +3 -7
- package/dist/plugins/with-react.js +5 -19
- package/dist/ready-check.d.ts +1 -0
- package/dist/ready-check.js +5 -0
- package/dist/src/generators/_utils/mf-dependencies.js +3 -0
- package/dist/src/generators/application/application.js +1 -36
- package/dist/src/generators/application/files/base-rspack/rspack.config.js__tmpl__ +1 -24
- package/dist/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +1 -26
- package/dist/src/generators/application/lib/add-e2e.js +11 -11
- package/dist/src/generators/application/lib/add-linting.js +1 -2
- package/dist/src/generators/application/lib/add-project.js +0 -167
- package/dist/src/generators/application/lib/bundlers/add-rsbuild.js +0 -1
- package/dist/src/generators/application/lib/bundlers/add-vite.js +0 -2
- package/dist/src/generators/application/lib/bundlers/add-webpack.js +0 -1
- package/dist/src/generators/application/lib/create-application-files.d.ts +0 -2
- package/dist/src/generators/application/lib/create-application-files.js +2 -11
- package/dist/src/generators/application/lib/normalize-options.js +0 -4
- package/dist/src/generators/application/schema.d.ts +0 -6
- package/dist/src/generators/application/schema.json +0 -6
- package/dist/src/generators/consumer/consumer.js +2 -0
- package/dist/src/generators/consumer/files/rsbuild/package.json__tmpl__ +1 -0
- package/dist/src/generators/consumer/files/rsbuild/rsbuild.config.ts__tmpl__ +2 -0
- package/dist/src/generators/consumer/files/rspack/package.json__tmpl__ +1 -0
- package/dist/src/generators/consumer/files/rspack/rspack.config.ts__tmpl__ +2 -0
- package/dist/src/generators/consumer/files/vite/package.json__tmpl__ +1 -0
- package/dist/src/generators/consumer/files/vite/vite.config.mts__tmpl__ +2 -0
- package/dist/src/generators/cypress-component-configuration/cypress-component-configuration.js +4 -16
- package/dist/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -2
- package/dist/src/generators/cypress-component-configuration/lib/add-files.js +4 -2
- package/dist/src/generators/cypress-component-configuration/schema.d.ts +0 -1
- package/dist/src/generators/init/init.js +3 -5
- package/dist/src/generators/init/schema.d.ts +0 -1
- package/dist/src/generators/library/lib/add-linting.js +1 -2
- package/dist/src/generators/library/lib/add-rollup-build-target.js +3 -47
- package/dist/src/generators/library/lib/normalize-options.js +0 -4
- package/dist/src/generators/library/library.js +1 -4
- package/dist/src/generators/library/schema.d.ts +0 -5
- package/dist/src/generators/library/schema.json +0 -6
- package/dist/src/generators/provider/files/rsbuild/package.json__tmpl__ +1 -0
- package/dist/src/generators/provider/files/rsbuild/rsbuild.config.ts__tmpl__ +2 -0
- package/dist/src/generators/provider/files/rspack/package.json__tmpl__ +1 -0
- package/dist/src/generators/provider/files/rspack/rspack.config.ts__tmpl__ +2 -0
- package/dist/src/generators/provider/files/vite/package.json__tmpl__ +1 -0
- package/dist/src/generators/provider/files/vite/vite.config.mts__tmpl__ +2 -0
- package/dist/src/generators/provider/provider.js +2 -0
- package/dist/src/generators/stories/stories.js +0 -5
- package/dist/src/generators/storybook-configuration/configuration.js +1 -9
- package/dist/src/generators/storybook-configuration/schema.d.ts +0 -1
- package/dist/src/migrations/update-23-2-0/add-optional-module-federation-packages.js +2 -1
- package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.d.ts +4 -0
- package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.js +13 -0
- package/dist/src/migrations/update-24-0-0/register-typescript-plugin-for-typecheck.md +40 -0
- package/dist/src/plugins/router-plugin-utils.d.ts +4 -0
- package/dist/src/plugins/router-plugin-utils.js +15 -0
- package/dist/src/plugins/router-plugin.d.ts +0 -1
- package/dist/src/plugins/router-plugin.js +35 -44
- package/dist/src/utils/ast-utils.d.ts +0 -1
- package/dist/src/utils/ast-utils.js +0 -23
- package/dist/src/utils/ct-utils.d.ts +0 -7
- package/dist/src/utils/ct-utils.js +71 -55
- package/dist/src/utils/deprecation.d.ts +1 -1
- package/dist/src/utils/deprecation.js +3 -5
- package/dist/src/utils/framework.js +1 -3
- package/dist/src/utils/react-router-serve-ready-check.d.ts +11 -0
- package/dist/src/utils/react-router-serve-ready-check.js +25 -0
- package/dist/src/utils/versions.d.ts +0 -7
- package/dist/src/utils/versions.js +2 -9
- package/executors.json +1 -17
- package/generators.json +0 -27
- package/migrations.json +6 -0
- package/package.json +25 -39
- package/dist/mf/dynamic-federation.d.ts +0 -69
- package/dist/mf/dynamic-federation.js +0 -141
- package/dist/mf/index.d.ts +0 -1
- package/dist/mf/index.js +0 -8
- package/dist/src/executors/module-federation-dev-server/lib/index.d.ts +0 -2
- package/dist/src/executors/module-federation-dev-server/lib/index.js +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +0 -4
- package/dist/src/executors/module-federation-dev-server/lib/normalize-options.js +0 -19
- package/dist/src/executors/module-federation-dev-server/lib/start-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-dev-server/lib/start-remotes.js +0 -33
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -6
- package/dist/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -80
- package/dist/src/executors/module-federation-dev-server/schema.d.ts +0 -19
- package/dist/src/executors/module-federation-dev-server/schema.json +0 -142
- package/dist/src/executors/module-federation-ssr-dev-server/lib/index.d.ts +0 -2
- package/dist/src/executors/module-federation-ssr-dev-server/lib/index.js +0 -5
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +0 -4
- package/dist/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +0 -23
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +0 -5
- package/dist/src/executors/module-federation-ssr-dev-server/lib/start-remotes.js +0 -34
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -3
- package/dist/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -83
- package/dist/src/executors/module-federation-ssr-dev-server/schema.d.ts +0 -29
- package/dist/src/executors/module-federation-ssr-dev-server/schema.json +0 -81
- package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +0 -12
- package/dist/src/executors/module-federation-static-server/module-federation-static-server.impl.js +0 -244
- package/dist/src/executors/module-federation-static-server/schema.d.ts +0 -3
- package/dist/src/executors/module-federation-static-server/schema.json +0 -16
- package/dist/src/generators/federate-module/federate-module.d.ts +0 -4
- package/dist/src/generators/federate-module/federate-module.js +0 -67
- package/dist/src/generators/federate-module/lib/utils.d.ts +0 -23
- package/dist/src/generators/federate-module/lib/utils.js +0 -99
- package/dist/src/generators/federate-module/schema.d.ts +0 -15
- package/dist/src/generators/federate-module/schema.json +0 -89
- package/dist/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +0 -40
- package/dist/src/generators/host/files/common/src/main.js__tmpl__ +0 -13
- package/dist/src/generators/host/files/common/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +0 -41
- package/dist/src/generators/host/files/common-ts/src/main.ts__tmpl__ +0 -13
- package/dist/src/generators/host/files/rspack-common/src/app/__fileName__.jsx__tmpl__ +0 -42
- package/dist/src/generators/host/files/rspack-common/src/main.jsx__tmpl__ +0 -13
- package/dist/src/generators/host/files/rspack-common/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/host/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -24
- package/dist/src/generators/host/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -42
- package/dist/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -66
- package/dist/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -27
- package/dist/src/generators/host/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -68
- package/dist/src/generators/host/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -49
- package/dist/src/generators/host/files/rspack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -22
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -68
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -49
- package/dist/src/generators/host/files/rspack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -67
- package/dist/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -42
- package/dist/src/generators/host/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -24
- package/dist/src/generators/host/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -39
- package/dist/src/generators/host/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -19
- package/dist/src/generators/host/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/webpack-module-federation-ssr/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -16
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
- package/dist/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -28
- package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -40
- package/dist/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -18
- package/dist/src/generators/host/host.d.ts +0 -4
- package/dist/src/generators/host/host.js +0 -174
- package/dist/src/generators/host/lib/add-module-federation-files.d.ts +0 -6
- package/dist/src/generators/host/lib/add-module-federation-files.js +0 -92
- package/dist/src/generators/host/lib/normalize-host-name.d.ts +0 -2
- package/dist/src/generators/host/lib/normalize-host-name.js +0 -12
- package/dist/src/generators/host/lib/setup-ssr-for-host.d.ts +0 -6
- package/dist/src/generators/host/lib/setup-ssr-for-host.js +0 -59
- package/dist/src/generators/host/lib/update-module-federation-e2e-project.d.ts +0 -3
- package/dist/src/generators/host/lib/update-module-federation-e2e-project.js +0 -19
- package/dist/src/generators/host/lib/update-module-federation-tsconfig.d.ts +0 -3
- package/dist/src/generators/host/lib/update-module-federation-tsconfig.js +0 -34
- package/dist/src/generators/host/schema.d.ts +0 -44
- package/dist/src/generators/host/schema.json +0 -173
- package/dist/src/generators/remote/files/common/src/main.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/common/src/remote-entry.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/common-ts/src/main.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/common-ts/src/remote-entry.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-common/src/main.jsx__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-common/src/remote-entry.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-module-federation/module-federation.config.js__tmpl__ +0 -12
- package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.js__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -15
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +0 -71
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -19
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +0 -71
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
- package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/rspack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/webpack-module-federation/module-federation.config.js__tmpl__ +0 -12
- package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.js__tmpl__ +0 -17
- package/dist/src/generators/remote/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +0 -1
- package/dist/src/generators/remote/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -9
- package/dist/src/generators/remote/files/webpack-module-federation-ssr/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +0 -17
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +0 -13
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/server.ts__tmpl__ +0 -45
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +0 -17
- package/dist/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +0 -16
- package/dist/src/generators/remote/files/webpack-module-federation-ts/tsconfig.lint.json__tmpl__ +0 -19
- package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +0 -1
- package/dist/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +0 -17
- package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.d.ts +0 -2
- package/dist/src/generators/remote/lib/add-remote-to-dynamic-host.js +0 -12
- package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.d.ts +0 -3
- package/dist/src/generators/remote/lib/setup-package-json-exports-for-remote.js +0 -30
- package/dist/src/generators/remote/lib/setup-ssr-for-remote.d.ts +0 -4
- package/dist/src/generators/remote/lib/setup-ssr-for-remote.js +0 -61
- package/dist/src/generators/remote/lib/setup-tspath-for-remote.d.ts +0 -3
- package/dist/src/generators/remote/lib/setup-tspath-for-remote.js +0 -14
- package/dist/src/generators/remote/lib/update-host-with-remote.d.ts +0 -2
- package/dist/src/generators/remote/lib/update-host-with-remote.js +0 -79
- package/dist/src/generators/remote/remote.d.ts +0 -6
- package/dist/src/generators/remote/remote.js +0 -201
- package/dist/src/generators/remote/schema.d.ts +0 -39
- package/dist/src/generators/remote/schema.json +0 -173
- package/dist/src/generators/setup-ssr/files/server.ts__tmpl__ +0 -28
- package/dist/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +0 -47
- package/dist/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +0 -17
- package/dist/src/generators/setup-ssr/schema.d.ts +0 -8
- package/dist/src/generators/setup-ssr/schema.json +0 -54
- package/dist/src/generators/setup-ssr/setup-ssr.d.ts +0 -4
- package/dist/src/generators/setup-ssr/setup-ssr.js +0 -198
- package/dist/src/module-federation/ast-utils.d.ts +0 -8
- package/dist/src/module-federation/ast-utils.js +0 -101
- package/dist/src/rules/update-module-federation-project.d.ts +0 -11
- package/dist/src/rules/update-module-federation-project.js +0 -72
- package/dist/src/utils/add-mf-env-to-inputs.d.ts +0 -2
- package/dist/src/utils/add-mf-env-to-inputs.js +0 -29
- package/dist/src/utils/module-federation-deprecation.d.ts +0 -12
- package/dist/src/utils/module-federation-deprecation.js +0 -46
- package/dist/src/utils/normalize-remote.d.ts +0 -8
- package/dist/src/utils/normalize-remote.js +0 -31
package/dist/index.d.ts
CHANGED
|
@@ -10,8 +10,6 @@ export { reactInitGenerator } from './src/generators/init/init';
|
|
|
10
10
|
export { reduxGenerator } from './src/generators/redux/redux';
|
|
11
11
|
export { storiesGenerator } from './src/generators/stories/stories';
|
|
12
12
|
export { storybookConfigurationGenerator } from './src/generators/storybook-configuration/configuration';
|
|
13
|
-
export { hostGenerator } from './src/generators/host/host';
|
|
14
|
-
export { remoteGenerator } from './src/generators/remote/remote';
|
|
15
13
|
export { cypressComponentConfigGenerator } from './src/generators/cypress-component-configuration/cypress-component-configuration';
|
|
16
14
|
export { componentTestGenerator } from './src/generators/component-test/component-test';
|
|
17
15
|
export type { SupportedStyles } from './typings/style';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.componentTestGenerator = exports.cypressComponentConfigGenerator = exports.
|
|
3
|
+
exports.componentTestGenerator = exports.cypressComponentConfigGenerator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.hookGenerator = exports.componentGenerator = exports.applicationGenerator = exports.reactVersion = exports.reactDomVersion = exports.assertValidStyle = exports.extendReactEslintJson = exports.extraEslintDependencies = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
var lint_1 = require("./src/utils/lint");
|
|
6
6
|
Object.defineProperty(exports, "extraEslintDependencies", { enumerable: true, get: function () { return lint_1.extraEslintDependencies; } });
|
|
@@ -28,10 +28,6 @@ var stories_1 = require("./src/generators/stories/stories");
|
|
|
28
28
|
Object.defineProperty(exports, "storiesGenerator", { enumerable: true, get: function () { return stories_1.storiesGenerator; } });
|
|
29
29
|
var configuration_1 = require("./src/generators/storybook-configuration/configuration");
|
|
30
30
|
Object.defineProperty(exports, "storybookConfigurationGenerator", { enumerable: true, get: function () { return configuration_1.storybookConfigurationGenerator; } });
|
|
31
|
-
var host_1 = require("./src/generators/host/host");
|
|
32
|
-
Object.defineProperty(exports, "hostGenerator", { enumerable: true, get: function () { return host_1.hostGenerator; } });
|
|
33
|
-
var remote_1 = require("./src/generators/remote/remote");
|
|
34
|
-
Object.defineProperty(exports, "remoteGenerator", { enumerable: true, get: function () { return remote_1.remoteGenerator; } });
|
|
35
31
|
var cypress_component_configuration_1 = require("./src/generators/cypress-component-configuration/cypress-component-configuration");
|
|
36
32
|
Object.defineProperty(exports, "cypressComponentConfigGenerator", { enumerable: true, get: function () { return cypress_component_configuration_1.cypressComponentConfigGenerator; } });
|
|
37
33
|
var component_test_1 = require("./src/generators/component-test/component-test");
|
package/dist/internal.d.ts
CHANGED
|
@@ -6,3 +6,4 @@ export { suppressReactComposeHelperWarnings } from './src/utils/deprecation';
|
|
|
6
6
|
export { hasWebpackPlugin } from './src/utils/has-webpack-plugin';
|
|
7
7
|
export { getReactDependenciesVersionsToInstall, isReact18, } from './src/utils/version-utils';
|
|
8
8
|
export { testingLibraryDomVersion, testingLibraryReactVersion, babelCoreVersion, babelPresetReactVersion, } from './src/utils/versions';
|
|
9
|
+
export { applyReactConfig } from './plugins/nx-react-webpack-plugin/lib/apply-react-config';
|
package/dist/internal.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// internal consumers and may change without semver protection. Mirrors
|
|
6
6
|
// `@nx/devkit/internal`.
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.babelPresetReactVersion = exports.babelCoreVersion = exports.testingLibraryReactVersion = exports.testingLibraryDomVersion = exports.isReact18 = exports.getReactDependenciesVersionsToInstall = exports.hasWebpackPlugin = exports.suppressReactComposeHelperWarnings = exports.isComponent = exports.assertPackageIsInstalled = exports.addRollupBuildTarget = exports.addE2e = void 0;
|
|
8
|
+
exports.applyReactConfig = exports.babelPresetReactVersion = exports.babelCoreVersion = exports.testingLibraryReactVersion = exports.testingLibraryDomVersion = exports.isReact18 = exports.getReactDependenciesVersionsToInstall = exports.hasWebpackPlugin = exports.suppressReactComposeHelperWarnings = exports.isComponent = exports.assertPackageIsInstalled = exports.addRollupBuildTarget = exports.addE2e = void 0;
|
|
9
9
|
var add_e2e_1 = require("./src/generators/application/lib/add-e2e");
|
|
10
10
|
Object.defineProperty(exports, "addE2e", { enumerable: true, get: function () { return add_e2e_1.addE2e; } });
|
|
11
11
|
var add_rollup_build_target_1 = require("./src/generators/library/lib/add-rollup-build-target");
|
|
@@ -26,3 +26,5 @@ Object.defineProperty(exports, "testingLibraryDomVersion", { enumerable: true, g
|
|
|
26
26
|
Object.defineProperty(exports, "testingLibraryReactVersion", { enumerable: true, get: function () { return versions_1.testingLibraryReactVersion; } });
|
|
27
27
|
Object.defineProperty(exports, "babelCoreVersion", { enumerable: true, get: function () { return versions_1.babelCoreVersion; } });
|
|
28
28
|
Object.defineProperty(exports, "babelPresetReactVersion", { enumerable: true, get: function () { return versions_1.babelPresetReactVersion; } });
|
|
29
|
+
var apply_react_config_1 = require("./plugins/nx-react-webpack-plugin/lib/apply-react-config");
|
|
30
|
+
Object.defineProperty(exports, "applyReactConfig", { enumerable: true, get: function () { return apply_react_config_1.applyReactConfig; } });
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export
|
|
1
|
+
type IdentityConfigFn = <T>(config: T, ...rest: unknown[]) => T;
|
|
2
|
+
/** @deprecated Removed in Nx v24. Use `ModuleFederationPlugin` from `@module-federation/enhanced`. This stub will be removed in Nx v25. */
|
|
3
|
+
export declare function withModuleFederation(..._args: unknown[]): Promise<IdentityConfigFn>;
|
|
4
|
+
/** @deprecated Removed in Nx v24. Use `ModuleFederationPlugin` from `@module-federation/enhanced`. This stub will be removed in Nx v25. */
|
|
5
|
+
export declare function withModuleFederationForSSR(..._args: unknown[]): Promise<IdentityConfigFn>;
|
|
6
|
+
export {};
|
|
@@ -1,20 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
3
|
+
exports.withModuleFederation = withModuleFederation;
|
|
4
|
+
exports.withModuleFederationForSSR = withModuleFederationForSSR;
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
// TODO(v25): Delete this subpath. It keeps 23.x configs loading during graph creation so `nx migrate` can run.
|
|
7
|
+
const REMOVED_MESSAGE = 'Nx Module Federation was removed in Nx v24. `@nx/react/module-federation` is a stub that keeps old configs loadable during project graph creation; it does not configure Module Federation. Follow https://nx.dev/docs/kb/migrate-from-nx-module-federation to move to the official Module Federation plugin.';
|
|
8
|
+
let warned = false;
|
|
9
|
+
// Graph creation only reads the config, so it keeps working; a build would silently drop federation.
|
|
10
|
+
function failOutsideGraphCreation() {
|
|
11
|
+
if (!global.NX_GRAPH_CREATION)
|
|
12
|
+
throw new Error(REMOVED_MESSAGE);
|
|
13
|
+
if (warned)
|
|
14
|
+
return;
|
|
15
|
+
warned = true;
|
|
16
|
+
devkit_1.logger.warn(REMOVED_MESSAGE);
|
|
17
|
+
}
|
|
18
|
+
/** @deprecated Removed in Nx v24. Use `ModuleFederationPlugin` from `@module-federation/enhanced`. This stub will be removed in Nx v25. */
|
|
19
|
+
async function withModuleFederation(..._args) {
|
|
20
|
+
failOutsideGraphCreation();
|
|
21
|
+
return (config) => config;
|
|
22
|
+
}
|
|
23
|
+
/** @deprecated Removed in Nx v24. Use `ModuleFederationPlugin` from `@module-federation/enhanced`. This stub will be removed in Nx v25. */
|
|
24
|
+
async function withModuleFederationForSSR(..._args) {
|
|
25
|
+
failOutsideGraphCreation();
|
|
26
|
+
return (config) => config;
|
|
27
|
+
}
|
|
28
|
+
// Older generated configs use `const withModuleFederation = require('@nx/react/module-federation')`.
|
|
29
|
+
module.exports = withModuleFederation;
|
|
30
|
+
module.exports.withModuleFederation = withModuleFederation;
|
|
31
|
+
module.exports.withModuleFederationForSSR = withModuleFederationForSSR;
|
|
@@ -4,9 +4,11 @@ exports.nxComponentTestingPreset = nxComponentTestingPreset;
|
|
|
4
4
|
const cypress_preset_1 = require("@nx/cypress/plugins/cypress-preset");
|
|
5
5
|
const internal_1 = require("@nx/cypress/internal");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
|
-
const internal_2 = require("@nx/
|
|
7
|
+
const internal_2 = require("@nx/devkit/internal");
|
|
8
|
+
const internal_3 = require("@nx/js/internal");
|
|
8
9
|
const fs_1 = require("fs");
|
|
9
10
|
const path_1 = require("path");
|
|
11
|
+
const url_1 = require("url");
|
|
10
12
|
/**
|
|
11
13
|
* React nx preset for Cypress Component Testing
|
|
12
14
|
*
|
|
@@ -34,7 +36,10 @@ function nxComponentTestingPreset(pathToConfig, options) {
|
|
|
34
36
|
// options, cast to any to avoid type errors
|
|
35
37
|
return basePresetSettings;
|
|
36
38
|
}
|
|
37
|
-
|
|
39
|
+
pathToConfig = pathToConfig.startsWith('file://')
|
|
40
|
+
? (0, url_1.fileURLToPath)(pathToConfig)
|
|
41
|
+
: pathToConfig;
|
|
42
|
+
const normalizedProjectRootPath = (0, fs_1.statSync)(pathToConfig).isDirectory()
|
|
38
43
|
? pathToConfig
|
|
39
44
|
: (0, path_1.dirname)(pathToConfig);
|
|
40
45
|
if (options?.bundler === 'vite') {
|
|
@@ -154,51 +159,105 @@ function buildTargetWebpack(ctx, buildTarget, componentTestingProjectName) {
|
|
|
154
159
|
Has component config? ${!!ctProjectConfig}
|
|
155
160
|
`);
|
|
156
161
|
}
|
|
162
|
+
const buildConfig = buildableProjectConfig.targets[parsed.target];
|
|
163
|
+
if (buildConfig.metadata?.technologies?.includes('webpack')) {
|
|
164
|
+
return async () => {
|
|
165
|
+
const configPath = ['js', 'cjs', 'mjs', 'ts', 'cts', 'mts']
|
|
166
|
+
.map((ext) => (0, path_1.join)(devkit_1.workspaceRoot, buildableProjectConfig.root, `webpack.config.${ext}`))
|
|
167
|
+
.find((path) => (0, fs_1.existsSync)(path));
|
|
168
|
+
if (!configPath)
|
|
169
|
+
throw new Error(`Cannot find webpack config for ${buildTarget}`);
|
|
170
|
+
const previousBuildTarget = process.env.NX_BUILD_TARGET;
|
|
171
|
+
process.env.NX_BUILD_TARGET = buildTarget;
|
|
172
|
+
try {
|
|
173
|
+
const exported = await (0, internal_2.loadConfigFile)(configPath);
|
|
174
|
+
const config = typeof exported === 'function'
|
|
175
|
+
? await exported({}, { mode: 'development' })
|
|
176
|
+
: exported;
|
|
177
|
+
// Cypress runs its own dev server; the app's port and history
|
|
178
|
+
// fallback would collide with it and replace its spec page.
|
|
179
|
+
const { devServer: _devServer, ...ctConfig } = config;
|
|
180
|
+
return ctConfig;
|
|
181
|
+
}
|
|
182
|
+
finally {
|
|
183
|
+
if (previousBuildTarget === undefined)
|
|
184
|
+
delete process.env.NX_BUILD_TARGET;
|
|
185
|
+
else
|
|
186
|
+
process.env.NX_BUILD_TARGET = previousBuildTarget;
|
|
187
|
+
}
|
|
188
|
+
};
|
|
189
|
+
}
|
|
157
190
|
if (buildableProjectConfig.targets[parsed.target].executor !==
|
|
158
191
|
'@nx/webpack:webpack' &&
|
|
159
192
|
buildableProjectConfig.targets[parsed.target].executor !==
|
|
160
193
|
'@nx/rspack:rspack') {
|
|
161
|
-
throw new InvalidExecutorError(`The '${parsed.target}' target of the '${parsed.project}' project is not
|
|
162
|
-
`
|
|
194
|
+
throw new InvalidExecutorError(`The '${parsed.target}' target of the '${parsed.project}' project is not a Webpack build target. ` +
|
|
195
|
+
`Cypress Component Testing needs a build target inferred by '@nx/webpack/plugin'.`);
|
|
196
|
+
}
|
|
197
|
+
const context = (0, internal_1.createExecutorContext)(graph, buildableProjectConfig.targets, parsed.project, parsed.target, parsed.configuration);
|
|
198
|
+
const { resolveUserDefinedWebpackConfig, webpackExecutorContext, } = require('@nx/webpack/internal');
|
|
199
|
+
const { normalizeOptions } = require('@nx/webpack');
|
|
200
|
+
const options = normalizeOptions(withSchemaDefaults(parsed, context), devkit_1.workspaceRoot, buildableProjectConfig.root, (0, internal_3.getProjectSourceRoot)(buildableProjectConfig));
|
|
201
|
+
if (!options.webpackConfig) {
|
|
202
|
+
return null;
|
|
163
203
|
}
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
204
|
+
return () => webpackExecutorContext.run({
|
|
205
|
+
target: parsed,
|
|
206
|
+
options: {
|
|
207
|
+
...options,
|
|
208
|
+
// Cypress supplies component-index.html and builds library sources.
|
|
209
|
+
generateIndexHtml: false,
|
|
210
|
+
extractLicenses: false,
|
|
211
|
+
},
|
|
212
|
+
}, async () => {
|
|
213
|
+
const customWebpack = await resolveUserDefinedWebpackConfig(options.webpackConfig, options.tsConfig.startsWith(context.root)
|
|
171
214
|
? options.tsConfig
|
|
172
215
|
: (0, path_1.join)(context.root, options.tsConfig));
|
|
173
|
-
|
|
174
|
-
return async () => {
|
|
175
|
-
customWebpack = await customWebpack;
|
|
176
|
-
// For legacy `composePlugins(...)` setup, we need change some options to make Cypress CT work properly.
|
|
216
|
+
// Unmigrated `composePlugins(...)` configs are inert, so CT uses its fallback config.
|
|
177
217
|
if (customWebpack &&
|
|
178
218
|
require('@nx/webpack').isNxWebpackComposablePlugin(customWebpack) // using inline since @nx/webpack may not be installed when using vite so top-level import would error
|
|
179
219
|
) {
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
generateIndexHtml: false,
|
|
185
|
-
// causes issues with buildable libraries with ENOENT: no such file or directory, scandir error
|
|
186
|
-
extractLicenses: false,
|
|
187
|
-
root: devkit_1.workspaceRoot,
|
|
188
|
-
projectRoot: ctProjectConfig.root,
|
|
189
|
-
sourceRoot: (0, internal_2.getProjectSourceRoot)(ctProjectConfig),
|
|
190
|
-
},
|
|
191
|
-
context,
|
|
192
|
-
configuration: parsed.configuration,
|
|
220
|
+
const { buildBaseWebpackConfig } = require('./webpack-fallback');
|
|
221
|
+
return buildBaseWebpackConfig({
|
|
222
|
+
tsConfigPath: findTsConfig((0, path_1.join)(devkit_1.workspaceRoot, ctProjectConfig.root)),
|
|
223
|
+
compiler: options.compiler || 'babel',
|
|
193
224
|
});
|
|
194
225
|
}
|
|
195
226
|
else if (typeof customWebpack === 'object' ||
|
|
196
227
|
typeof customWebpack === 'function') {
|
|
197
|
-
|
|
198
|
-
|
|
228
|
+
const config = typeof customWebpack === 'function'
|
|
229
|
+
? await customWebpack({}, { mode: 'development' })
|
|
230
|
+
: customWebpack;
|
|
231
|
+
const { NxAppWebpackPlugin, } = require('@nx/webpack/app-plugin');
|
|
232
|
+
config.plugins = config.plugins?.map((plugin) => plugin instanceof NxAppWebpackPlugin
|
|
233
|
+
? {
|
|
234
|
+
apply(compiler) {
|
|
235
|
+
// Cypress installs its harness after this config is returned.
|
|
236
|
+
const entry = { ...compiler.options.entry };
|
|
237
|
+
const output = { ...compiler.options.output };
|
|
238
|
+
const devtool = compiler.options.devtool;
|
|
239
|
+
const optimization = {
|
|
240
|
+
...compiler.options.optimization,
|
|
241
|
+
};
|
|
242
|
+
const mode = compiler.options.mode;
|
|
243
|
+
const watchOptions = compiler.options.watchOptions;
|
|
244
|
+
const context = compiler.options.context;
|
|
245
|
+
plugin.apply(compiler);
|
|
246
|
+
compiler.options.entry = entry;
|
|
247
|
+
compiler.options.output = output;
|
|
248
|
+
compiler.options.devtool = devtool;
|
|
249
|
+
compiler.options.optimization = optimization;
|
|
250
|
+
compiler.options.mode = mode;
|
|
251
|
+
compiler.options.watchOptions = watchOptions;
|
|
252
|
+
compiler.options.context = context;
|
|
253
|
+
compiler.context = context;
|
|
254
|
+
},
|
|
255
|
+
}
|
|
256
|
+
: plugin);
|
|
257
|
+
return config;
|
|
199
258
|
}
|
|
200
|
-
return null;
|
|
201
|
-
};
|
|
259
|
+
return null;
|
|
260
|
+
});
|
|
202
261
|
}
|
|
203
262
|
function findViteConfig(projectRootFullPath) {
|
|
204
263
|
const allowsExt = ['js', 'mjs', 'ts', 'cjs', 'mts', 'cts'];
|
|
@@ -216,7 +275,7 @@ function findTsConfig(projectRoot) {
|
|
|
216
275
|
];
|
|
217
276
|
for (const config of potentialConfigs) {
|
|
218
277
|
if ((0, fs_1.existsSync)((0, path_1.join)(projectRoot, config))) {
|
|
219
|
-
return config;
|
|
278
|
+
return (0, path_1.join)(projectRoot, config);
|
|
220
279
|
}
|
|
221
280
|
}
|
|
222
281
|
}
|
|
@@ -3,13 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.webpack = exports.core = void 0;
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const internal_1 = require("@nx/js/internal");
|
|
6
|
-
const webpack_1 = require("@nx/webpack");
|
|
7
6
|
const internal_2 = require("@nx/webpack/internal");
|
|
8
7
|
const fs_1 = require("fs");
|
|
9
8
|
const path_1 = require("path");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const deprecation_1 = require("../../src/utils/deprecation");
|
|
9
|
+
const webpack_1 = require("webpack");
|
|
10
|
+
const apply_react_config_1 = require("../nx-react-webpack-plugin/lib/apply-react-config");
|
|
13
11
|
const merge_plugins_1 = require("./merge-plugins");
|
|
14
12
|
// This is shamelessly taken from CRA and modified for NX use
|
|
15
13
|
// https://github.com/facebook/create-react-app/blob/4784997f0682e75eb32a897b4ffe34d735912e6c/packages/react-scripts/config/env.js#L71
|
|
@@ -120,7 +118,6 @@ const webpack = async (storybookWebpackConfig = {}, options) => {
|
|
|
120
118
|
catch {
|
|
121
119
|
throw new Error(`'@nx/webpack' package is not installed. Install it and try again.`);
|
|
122
120
|
}
|
|
123
|
-
const { withNx, withWeb } = require('@nx/webpack');
|
|
124
121
|
const projectData = await getProjectData(options);
|
|
125
122
|
const tsconfigPath = (0, fs_1.existsSync)((0, path_1.join)(projectData.projectRoot, 'tsconfig.storybook.json'))
|
|
126
123
|
? (0, path_1.join)(projectData.projectRoot, 'tsconfig.storybook.json')
|
|
@@ -141,18 +138,21 @@ const webpack = async (storybookWebpackConfig = {}, options) => {
|
|
|
141
138
|
extractCss: storybookWebpackConfig.mode === 'production',
|
|
142
139
|
target: 'web',
|
|
143
140
|
};
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
141
|
+
const finalConfig = {};
|
|
142
|
+
const configOptions = {
|
|
143
|
+
...builderOptions,
|
|
144
|
+
projectName: undefined,
|
|
145
|
+
targetName: undefined,
|
|
146
|
+
configurationName: undefined,
|
|
147
|
+
projectGraph: undefined,
|
|
148
|
+
};
|
|
149
|
+
(0, internal_2.applyBaseConfig)({
|
|
150
|
+
...configOptions,
|
|
151
|
+
assets: builderOptions.assets ?? [],
|
|
152
|
+
skipTypeChecking: true,
|
|
153
|
+
}, finalConfig);
|
|
154
|
+
(0, internal_2.applyWebConfig)(configOptions, finalConfig);
|
|
155
|
+
(0, apply_react_config_1.applyReactConfig)({}, finalConfig);
|
|
156
156
|
return {
|
|
157
157
|
...storybookWebpackConfig,
|
|
158
158
|
module: {
|
|
@@ -176,7 +176,7 @@ const webpack = async (storybookWebpackConfig = {}, options) => {
|
|
|
176
176
|
[]), ...(finalConfig.resolve
|
|
177
177
|
.plugins ?? [])),
|
|
178
178
|
},
|
|
179
|
-
plugins: (0, merge_plugins_1.mergePlugins)(new
|
|
179
|
+
plugins: (0, merge_plugins_1.mergePlugins)(new webpack_1.DefinePlugin(getClientEnvironment(storybookWebpackConfig.mode).stringified), ...(storybookWebpackConfig.plugins ?? []), ...(finalConfig.plugins ?? [])),
|
|
180
180
|
};
|
|
181
181
|
};
|
|
182
182
|
exports.webpack = webpack;
|
|
@@ -3,11 +3,7 @@ import type { NxWebpackExecutionContext, WithWebOptions } from '@nx/webpack';
|
|
|
3
3
|
export interface WithReactOptions extends WithWebOptions {
|
|
4
4
|
}
|
|
5
5
|
/**
|
|
6
|
-
* @deprecated
|
|
7
|
-
*
|
|
8
|
-
* `nx g @nx/webpack:convert-to-inferred`. See
|
|
9
|
-
* https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
|
|
10
|
-
* @param {WithReactOptions} pluginOptions
|
|
11
|
-
* @returns {NxWebpackPlugin}
|
|
6
|
+
* @deprecated Use `NxReactWebpackPlugin` from `@nx/react/webpack-plugin`.
|
|
7
|
+
* This inert stub will be removed in Nx v25.
|
|
12
8
|
*/
|
|
13
|
-
export declare function withReact(
|
|
9
|
+
export declare function withReact(_options?: WithReactOptions): (config: Configuration, _context?: NxWebpackExecutionContext) => Configuration;
|
|
@@ -1,27 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withReact = withReact;
|
|
4
|
-
const apply_react_config_1 = require("./nx-react-webpack-plugin/lib/apply-react-config");
|
|
5
4
|
const deprecation_1 = require("../src/utils/deprecation");
|
|
6
|
-
|
|
5
|
+
// TODO(v25): remove the inert config-helper stubs in this file.
|
|
7
6
|
/**
|
|
8
|
-
* @deprecated
|
|
9
|
-
*
|
|
10
|
-
* `nx g @nx/webpack:convert-to-inferred`. See
|
|
11
|
-
* https://nx.dev/docs/guides/tasks--caching/convert-to-inferred for details.
|
|
12
|
-
* @param {WithReactOptions} pluginOptions
|
|
13
|
-
* @returns {NxWebpackPlugin}
|
|
7
|
+
* @deprecated Use `NxReactWebpackPlugin` from `@nx/react/webpack-plugin`.
|
|
8
|
+
* This inert stub will be removed in Nx v25.
|
|
14
9
|
*/
|
|
15
|
-
function withReact(
|
|
10
|
+
function withReact(_options = {}) {
|
|
16
11
|
(0, deprecation_1.warnReactWithReactDeprecation)();
|
|
17
|
-
return
|
|
18
|
-
const { withWeb } = require('@nx/webpack');
|
|
19
|
-
if (processed.has(config))
|
|
20
|
-
return config;
|
|
21
|
-
// Apply web config for CSS, JSX, index.html handling, etc.
|
|
22
|
-
config = withWeb(pluginOptions)(config, context);
|
|
23
|
-
(0, apply_react_config_1.applyReactConfig)({}, config);
|
|
24
|
-
processed.add(config);
|
|
25
|
-
return config;
|
|
26
|
-
};
|
|
12
|
+
return (config, _context) => config;
|
|
27
13
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { waitForReactRouterServe as waitForDevServer } from './src/utils/react-router-serve-ready-check';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.waitForDevServer = void 0;
|
|
4
|
+
var react_router_serve_ready_check_1 = require("./src/utils/react-router-serve-ready-check");
|
|
5
|
+
Object.defineProperty(exports, "waitForDevServer", { enumerable: true, get: function () { return react_router_serve_ready_check_1.waitForReactRouterServe; } });
|
|
@@ -48,6 +48,7 @@ function bundlerDeps(bundler) {
|
|
|
48
48
|
dependencies: {},
|
|
49
49
|
devDependencies: {
|
|
50
50
|
'@module-federation/vite': mfVersions.moduleFederationVitePluginVersion,
|
|
51
|
+
'@nx/vite': versions_2.nxVersion,
|
|
51
52
|
'@vitejs/plugin-react': mfVersions.vitejsPluginReactVersion,
|
|
52
53
|
vite: mfVersions.viteVersion,
|
|
53
54
|
},
|
|
@@ -57,6 +58,7 @@ function bundlerDeps(bundler) {
|
|
|
57
58
|
dependencies: {},
|
|
58
59
|
devDependencies: {
|
|
59
60
|
'@module-federation/rsbuild-plugin': mfVersions.moduleFederationRsbuildPluginVersion,
|
|
61
|
+
'@nx/rsbuild': versions_2.nxVersion,
|
|
60
62
|
'@rsbuild/core': mfVersions.rsbuildCoreVersion,
|
|
61
63
|
'@rsbuild/plugin-react': mfVersions.rsbuildPluginReactVersion,
|
|
62
64
|
},
|
|
@@ -69,6 +71,7 @@ function bundlerDeps(bundler) {
|
|
|
69
71
|
'@module-federation/enhanced': mfVersions.moduleFederationEnhancedVersion,
|
|
70
72
|
},
|
|
71
73
|
devDependencies: {
|
|
74
|
+
'@nx/rspack': versions_2.nxVersion,
|
|
72
75
|
'@rspack/cli': mfVersions.rspackCliVersion,
|
|
73
76
|
'@rspack/core': mfVersions.rspackCoreVersion,
|
|
74
77
|
'@rspack/dev-server': mfVersions.rspackDevServerVersion,
|
|
@@ -26,7 +26,6 @@ const add_rsbuild_1 = require("./lib/bundlers/add-rsbuild");
|
|
|
26
26
|
const add_vite_1 = require("./lib/bundlers/add-vite");
|
|
27
27
|
async function applicationGenerator(tree, schema) {
|
|
28
28
|
return await applicationGeneratorInternal(tree, {
|
|
29
|
-
addPlugin: false,
|
|
30
29
|
useProjectJson: true,
|
|
31
30
|
...schema,
|
|
32
31
|
});
|
|
@@ -34,7 +33,7 @@ async function applicationGenerator(tree, schema) {
|
|
|
34
33
|
async function applicationGeneratorInternal(tree, schema) {
|
|
35
34
|
(0, assert_supported_react_version_1.assertSupportedReactVersion)(tree);
|
|
36
35
|
const tasks = [];
|
|
37
|
-
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(tree, schema.
|
|
36
|
+
const addTsPlugin = (0, internal_2.shouldConfigureTsSolutionSetup)(tree, schema.useTsSolution);
|
|
38
37
|
const jsInitTask = await (0, js_1.initGenerator)(tree, {
|
|
39
38
|
...schema,
|
|
40
39
|
tsConfigName: schema.rootProject ? 'tsconfig.json' : 'tsconfig.base.json',
|
|
@@ -59,25 +58,6 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
59
58
|
useReactRouterPlugin: options.useReactRouter,
|
|
60
59
|
});
|
|
61
60
|
tasks.push(initTask);
|
|
62
|
-
if (!options.addPlugin) {
|
|
63
|
-
const nxJson = (0, devkit_1.readNxJson)(tree) ?? {};
|
|
64
|
-
const existing = findBuildDefault(nxJson.targetDefaults);
|
|
65
|
-
if (!existing) {
|
|
66
|
-
(0, internal_1.upsertTargetDefault)(tree, nxJson, {
|
|
67
|
-
target: 'build',
|
|
68
|
-
cache: true,
|
|
69
|
-
dependsOn: ['^build'],
|
|
70
|
-
});
|
|
71
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
72
|
-
}
|
|
73
|
-
else if (!existing.dependsOn) {
|
|
74
|
-
(0, internal_1.upsertTargetDefault)(tree, nxJson, {
|
|
75
|
-
target: 'build',
|
|
76
|
-
dependsOn: ['^build'],
|
|
77
|
-
});
|
|
78
|
-
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
61
|
if (options.bundler === 'webpack') {
|
|
82
62
|
await (0, add_webpack_1.initWebpack)(tree, options, tasks);
|
|
83
63
|
}
|
|
@@ -160,19 +140,4 @@ async function applicationGeneratorInternal(tree, schema) {
|
|
|
160
140
|
});
|
|
161
141
|
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
162
142
|
}
|
|
163
|
-
function findBuildDefault(td) {
|
|
164
|
-
if (!td)
|
|
165
|
-
return undefined;
|
|
166
|
-
const value = td['build'];
|
|
167
|
-
if (value === undefined)
|
|
168
|
-
return undefined;
|
|
169
|
-
if (Array.isArray(value)) {
|
|
170
|
-
const found = value.find((e) => e.filter === undefined);
|
|
171
|
-
if (!found)
|
|
172
|
-
return undefined;
|
|
173
|
-
const { filter: _f, ...rest } = found;
|
|
174
|
-
return rest;
|
|
175
|
-
}
|
|
176
|
-
return value;
|
|
177
|
-
}
|
|
178
143
|
exports.default = applicationGenerator;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<%_ if (rspackPluginOptions) { _%>
|
|
2
1
|
const { NxAppRspackPlugin } = require('@nx/rspack/app-plugin');
|
|
3
2
|
const { NxReactRspackPlugin } = require('@nx/rspack/react-plugin');
|
|
4
3
|
const { join } = require('path');
|
|
@@ -26,28 +25,6 @@ module.exports = {
|
|
|
26
25
|
outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none',
|
|
27
26
|
optimization: process.env['NODE_ENV'] === 'production',
|
|
28
27
|
}),
|
|
29
|
-
new NxReactRspackPlugin(
|
|
30
|
-
// Uncomment this line if you don't want to use SVGR
|
|
31
|
-
// See: https://react-svgr.com/
|
|
32
|
-
// svgr: false
|
|
33
|
-
}),
|
|
28
|
+
new NxReactRspackPlugin(),
|
|
34
29
|
],
|
|
35
30
|
};
|
|
36
|
-
<%_ } else { _%>
|
|
37
|
-
const { composePlugins, withNx, withReact } = require('@nx/rspack');
|
|
38
|
-
|
|
39
|
-
// Nx plugins for rspack.
|
|
40
|
-
module.exports = composePlugins(
|
|
41
|
-
withNx(),
|
|
42
|
-
withReact({
|
|
43
|
-
// Uncomment this line if you don't want to use SVGR
|
|
44
|
-
// See: https://react-svgr.com/
|
|
45
|
-
// svgr: false
|
|
46
|
-
}),
|
|
47
|
-
(config) => {
|
|
48
|
-
// Update the rspack config as needed here.
|
|
49
|
-
// e.g. `config.plugins.push(new MyPlugin())`
|
|
50
|
-
return config;
|
|
51
|
-
}
|
|
52
|
-
);
|
|
53
|
-
<%_ } _%>
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
<%_ if (webpackPluginOptions) { _%>
|
|
2
1
|
const { NxAppWebpackPlugin } = require('@nx/webpack/app-plugin');
|
|
3
2
|
const { NxReactWebpackPlugin } = require('@nx/react/webpack-plugin');
|
|
4
3
|
const { join } = require('path');
|
|
@@ -28,30 +27,6 @@ module.exports = {
|
|
|
28
27
|
outputHashing: process.env['NODE_ENV'] === 'production' ? 'all' : 'none',
|
|
29
28
|
optimization: process.env['NODE_ENV'] === 'production',
|
|
30
29
|
}),
|
|
31
|
-
new NxReactWebpackPlugin(
|
|
32
|
-
// Uncomment this line if you don't want to use SVGR
|
|
33
|
-
// See: https://react-svgr.com/
|
|
34
|
-
// svgr: false
|
|
35
|
-
}),
|
|
30
|
+
new NxReactWebpackPlugin(),
|
|
36
31
|
],
|
|
37
32
|
};
|
|
38
|
-
<%_ } else { _%>
|
|
39
|
-
const { composePlugins, withNx } = require('@nx/webpack');
|
|
40
|
-
const { withReact } = require('@nx/react');
|
|
41
|
-
|
|
42
|
-
// Nx plugins for webpack.
|
|
43
|
-
module.exports = composePlugins(
|
|
44
|
-
withNx(),
|
|
45
|
-
withReact({
|
|
46
|
-
// Uncomment this line if you don't want to use SVGR
|
|
47
|
-
// See: https://react-svgr.com/
|
|
48
|
-
// svgr: false
|
|
49
|
-
}),
|
|
50
|
-
(config) => {
|
|
51
|
-
// Update the webpack config as needed here.
|
|
52
|
-
// e.g. `config.plugins.push(new MyPlugin())`
|
|
53
|
-
config.output.clean = true;
|
|
54
|
-
return config;
|
|
55
|
-
}
|
|
56
|
-
);
|
|
57
|
-
<%_ } _%>
|