@nx/react 0.0.0-pr-31222-862e973 → 0.0.0-pr-31313-387cdca
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/LICENSE +1 -1
- package/README.md +1 -1
- package/generators.json +9 -13
- package/index.d.ts +1 -2
- package/index.js +2 -5
- package/mf/dynamic-federation.d.ts +64 -0
- package/mf/dynamic-federation.js +64 -0
- package/migrations.json +80 -148
- package/module-federation.d.ts +6 -4
- package/module-federation.js +16 -7
- package/package.json +11 -11
- package/plugins/bundle-rollup.js +4 -1
- package/plugins/component-testing/index.js +1 -1
- package/plugins/jest.js +6 -11
- package/plugins/nx-react-webpack-plugin/lib/apply-react-config.js +6 -22
- package/plugins/storybook/index.js +1 -2
- package/plugins/with-react.d.ts +4 -0
- package/router-plugin.d.ts +1 -0
- package/router-plugin.js +5 -0
- package/src/executors/module-federation-dev-server/lib/index.d.ts +2 -0
- package/src/executors/module-federation-dev-server/lib/index.js +5 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.d.ts +4 -0
- package/src/executors/module-federation-dev-server/lib/normalize-options.js +19 -0
- package/src/executors/module-federation-dev-server/lib/start-remotes.d.ts +5 -0
- package/src/executors/module-federation-dev-server/lib/start-remotes.js +33 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +1 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +6 -110
- package/src/executors/module-federation-dev-server/schema.d.ts +9 -7
- package/src/executors/module-federation-dev-server/schema.json +15 -10
- package/src/executors/module-federation-ssr-dev-server/lib/index.d.ts +2 -0
- package/src/executors/module-federation-ssr-dev-server/lib/index.js +5 -0
- package/src/executors/module-federation-ssr-dev-server/lib/normalize-options.d.ts +4 -0
- package/src/executors/module-federation-ssr-dev-server/lib/normalize-options.js +23 -0
- package/src/executors/module-federation-ssr-dev-server/lib/start-remotes.d.ts +5 -0
- package/src/executors/module-federation-ssr-dev-server/lib/start-remotes.js +34 -0
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +1 -17
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +5 -153
- package/src/executors/module-federation-ssr-dev-server/schema.d.ts +29 -0
- package/src/executors/module-federation-ssr-dev-server/schema.json +14 -9
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts +2 -2
- package/src/executors/module-federation-static-server/module-federation-static-server.impl.js +11 -12
- package/src/executors/module-federation-static-server/schema.json +2 -1
- package/src/generators/application/application.d.ts +3 -3
- package/src/generators/application/application.js +108 -186
- package/src/generators/application/files/base-rsbuild/src/app/__fileName__.spec.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-rsbuild/src/assets/.gitkeep +0 -0
- package/src/generators/application/files/base-rsbuild/src/favicon.ico +0 -0
- package/src/generators/application/files/base-rsbuild/src/index.html +14 -0
- package/src/generators/application/files/base-rsbuild/src/main.tsx__tmpl__ +32 -0
- package/src/generators/application/files/base-rsbuild/tsconfig.app.json__tmpl__ +31 -0
- package/src/generators/application/files/base-rspack/rspack.config.js__tmpl__ +53 -0
- package/src/generators/application/files/base-rspack/src/app/__fileName__.spec.tsx__tmpl__ +3 -3
- package/src/generators/application/files/base-rspack/src/main.tsx__tmpl__ +27 -5
- package/src/generators/application/files/base-rspack/tsconfig.app.json__tmpl__ +21 -4
- package/src/generators/application/files/base-vite/src/app/__fileName__.spec.tsx__tmpl__ +3 -3
- package/src/generators/application/files/base-vite/src/main.tsx__tmpl__ +31 -6
- package/src/generators/application/files/base-vite/tsconfig.app.json__tmpl__ +20 -3
- package/src/generators/application/files/base-webpack/src/app/__fileName__.spec.tsx__tmpl__ +3 -3
- package/src/generators/application/files/base-webpack/src/main.tsx__tmpl__ +22 -2
- package/src/generators/application/files/base-webpack/tsconfig.app.json__tmpl__ +21 -4
- package/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +4 -4
- package/src/generators/application/files/react-router-ssr/common/app/app-nav.tsx__tmpl__ +14 -0
- package/src/generators/application/files/react-router-ssr/common/app/entry.client.tsx__tmpl__ +18 -0
- package/src/generators/application/files/react-router-ssr/common/app/entry.server.tsx__tmpl__ +74 -0
- package/src/generators/application/files/react-router-ssr/common/app/root.tsx__tmpl__ +51 -0
- package/src/generators/application/files/react-router-ssr/common/app/routes/about.tsx__tmpl__ +7 -0
- package/src/generators/application/files/react-router-ssr/common/app/routes.tsx__tmpl__ +6 -0
- package/src/generators/application/files/react-router-ssr/common/public/favicon.ico +0 -0
- package/src/generators/application/files/react-router-ssr/common/react-router.config.ts__tmpl__ +5 -0
- package/src/generators/application/files/react-router-ssr/common/tests/routes/_index.spec.tsx__tmpl__ +16 -0
- package/src/generators/application/files/react-router-ssr/common/tsconfig.app.json__tmpl__ +23 -0
- package/src/generators/application/files/react-router-ssr/common/tsconfig.json__tmpl__ +27 -0
- package/src/generators/application/files/react-router-ssr/non-root/.gitignore__tmpl__ +5 -0
- package/src/generators/application/files/react-router-ssr/non-root/package.json__tmpl__ +21 -0
- package/src/generators/application/files/react-router-ssr/nx-welcome/claimed/app/nx-welcome.tsx__tmpl__ +866 -0
- package/src/generators/application/files/react-router-ssr/nx-welcome/not-configured/app/nx-welcome.tsx__tmpl__ +866 -0
- package/src/generators/application/files/react-router-ssr/nx-welcome/unclaimed/app/nx-welcome.tsx__tmpl__ +864 -0
- package/src/generators/application/files/react-router-ssr/ts-solution/package.json__tmpl__ +21 -0
- package/src/generators/application/files/react-router-ssr/ts-solution/tsconfig.app.json__tmpl__ +39 -0
- package/src/generators/application/files/style-css-module/src/app/__fileName__.tsx__tmpl__ +28 -18
- package/src/generators/application/files/style-global-css/src/app/__fileName__.tsx__tmpl__ +29 -20
- package/src/generators/application/files/style-none/src/app/__fileName__.tsx__tmpl__ +26 -16
- package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +31 -22
- package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +30 -21
- package/src/generators/application/files/style-tailwind/src/app/__fileName__.tsx__tmpl__ +29 -19
- package/src/generators/application/lib/add-e2e.d.ts +1 -1
- package/src/generators/application/lib/add-e2e.js +74 -65
- package/src/generators/application/lib/add-jest.js +27 -2
- package/src/generators/application/lib/add-linting.d.ts +4 -0
- package/src/generators/application/lib/add-linting.js +86 -0
- package/src/generators/application/lib/add-project.js +112 -6
- package/src/generators/application/lib/add-routing.js +1 -1
- package/src/generators/application/lib/bundlers/add-rsbuild.d.ts +4 -0
- package/src/generators/application/lib/bundlers/add-rsbuild.js +63 -0
- package/src/generators/application/lib/bundlers/add-rspack.d.ts +4 -0
- package/src/generators/application/lib/bundlers/add-rspack.js +37 -0
- package/src/generators/application/lib/bundlers/add-vite.d.ts +4 -0
- package/src/generators/application/lib/bundlers/add-vite.js +76 -0
- package/src/generators/application/lib/bundlers/add-webpack.d.ts +3 -0
- package/src/generators/application/lib/bundlers/add-webpack.js +18 -0
- package/src/generators/application/lib/create-application-files.d.ts +61 -0
- package/src/generators/application/lib/create-application-files.js +102 -19
- package/src/generators/application/lib/get-app-tests.js +10 -11
- package/src/generators/application/lib/install-common-dependencies.d.ts +1 -1
- package/src/generators/application/lib/install-common-dependencies.js +18 -4
- package/src/generators/application/lib/normalize-options.d.ts +1 -3
- package/src/generators/application/lib/normalize-options.js +17 -19
- package/src/generators/application/lib/update-jest-config.js +5 -0
- package/src/generators/application/schema.d.ts +12 -6
- package/src/generators/application/schema.json +44 -42
- package/src/generators/component/component.d.ts +0 -1
- package/src/generators/component/component.js +19 -37
- package/src/generators/component/files/__fileName__.__ext__ +83 -0
- package/src/generators/component/lib/normalize-options.js +13 -15
- package/src/generators/component/schema.d.ts +13 -25
- package/src/generators/component/schema.json +13 -49
- package/src/generators/component-story/component-story.js +1 -2
- package/src/generators/component-story/files/jsx/__componentFileName__.stories.jsx__tmpl__ +5 -5
- package/src/generators/component-story/files/tsx/__componentFileName__.stories.tsx__tmpl__ +3 -4
- package/src/generators/component-test/component-test.js +1 -1
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +0 -2
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts +1 -1
- package/src/generators/cypress-component-configuration/lib/add-files.js +7 -4
- package/src/generators/federate-module/federate-module.js +12 -22
- package/src/generators/federate-module/schema.d.ts +0 -1
- package/src/generators/federate-module/schema.json +13 -12
- package/src/generators/hook/files/{__fileName__.ts__tmpl__ → __fileName__.__ext__} +3 -1
- package/src/generators/hook/hook.d.ts +0 -1
- package/src/generators/hook/hook.js +35 -83
- package/src/generators/hook/schema.d.ts +4 -17
- package/src/generators/hook/schema.json +19 -46
- package/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +28 -21
- package/src/generators/host/files/common/src/main.js__tmpl__ +12 -9
- package/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +28 -28
- package/src/generators/host/files/common-ts/src/main.ts__tmpl__ +12 -9
- package/src/generators/host/files/rspack-common/src/app/__fileName__.jsx__tmpl__ +22 -13
- package/src/generators/host/files/rspack-common/src/main.jsx__tmpl__ +12 -9
- package/src/generators/host/files/rspack-module-federation/module-federation.config.js__tmpl__ +8 -5
- package/src/generators/host/files/rspack-module-federation/rspack.config.js__tmpl__ +37 -13
- package/src/generators/host/files/rspack-module-federation/rspack.config.prod.js__tmpl__ +60 -30
- package/src/generators/host/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +16 -5
- package/src/generators/host/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +66 -0
- package/src/generators/host/files/rspack-module-federation-ssr/server.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +49 -0
- package/src/generators/host/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +16 -7
- package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +66 -0
- package/src/generators/host/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +1 -1
- package/src/generators/host/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +49 -0
- package/src/generators/host/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +22 -19
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.prod.ts__tmpl__ +61 -30
- package/src/generators/host/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +37 -13
- package/src/generators/host/files/webpack-module-federation/module-federation.config.js__tmpl__ +8 -5
- package/src/generators/host/files/webpack-module-federation/webpack.config.js__tmpl__ +1 -1
- package/src/generators/host/files/webpack-module-federation/webpack.config.prod.js__tmpl__ +24 -22
- package/src/generators/host/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +10 -7
- package/src/generators/host/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +2 -2
- package/src/generators/host/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +10 -7
- package/src/generators/host/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/host/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +22 -19
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.prod.ts__tmpl__ +25 -23
- package/src/generators/host/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +4 -3
- package/src/generators/host/host.d.ts +0 -1
- package/src/generators/host/host.js +31 -27
- package/src/generators/host/lib/add-module-federation-files.js +29 -13
- package/src/generators/host/lib/normalize-host-name.d.ts +2 -0
- package/src/generators/host/lib/normalize-host-name.js +12 -0
- package/src/generators/host/lib/normalize-remote.js +10 -6
- package/src/generators/host/lib/setup-ssr-for-host.d.ts +3 -3
- package/src/generators/host/lib/setup-ssr-for-host.js +46 -22
- package/src/generators/host/lib/update-module-federation-tsconfig.d.ts +3 -0
- package/src/generators/host/lib/update-module-federation-tsconfig.js +39 -0
- package/src/generators/host/schema.d.ts +2 -5
- package/src/generators/host/schema.json +16 -27
- package/src/generators/init/init.d.ts +1 -1
- package/src/generators/init/init.js +31 -6
- package/src/generators/init/schema.d.ts +2 -0
- package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +1 -1
- package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +1 -1
- package/src/generators/library/lib/add-linting.js +1 -1
- package/src/generators/library/lib/add-rollup-build-target.d.ts +3 -1
- package/src/generators/library/lib/add-rollup-build-target.js +34 -32
- package/src/generators/library/lib/create-files.d.ts +1 -1
- package/src/generators/library/lib/create-files.js +23 -2
- package/src/generators/library/lib/determine-entry-fields.d.ts +3 -0
- package/src/generators/library/lib/determine-entry-fields.js +22 -0
- package/src/generators/library/lib/install-common-dependencies.d.ts +1 -1
- package/src/generators/library/lib/install-common-dependencies.js +5 -3
- package/src/generators/library/lib/normalize-options.js +11 -6
- package/src/generators/library/library.js +80 -35
- package/src/generators/library/schema.d.ts +5 -5
- package/src/generators/library/schema.json +38 -36
- package/src/generators/redux/files/js/__fileName__.__ext__ +114 -0
- package/src/generators/redux/files/{__fileName__.slice.spec.ts__tmpl__ → js/__fileName__.spec.__ext__} +1 -1
- package/src/generators/redux/files/ts/__fileName__.spec.__ext__ +56 -0
- package/src/generators/redux/redux.d.ts +0 -1
- package/src/generators/redux/redux.js +27 -36
- package/src/generators/redux/schema.d.ts +12 -8
- package/src/generators/redux/schema.json +21 -23
- package/src/generators/remote/files/rspack-module-federation/module-federation.config.js__tmpl__ +10 -7
- package/src/generators/remote/files/rspack-module-federation/rspack.config.js__tmpl__ +40 -13
- package/src/generators/remote/files/rspack-module-federation-ssr/module-federation.server.config.js__tmpl__ +13 -4
- package/src/generators/remote/files/rspack-module-federation-ssr/rspack.config.js__tmpl__ +69 -0
- package/src/generators/remote/files/rspack-module-federation-ssr/server.ts__tmpl__ +2 -2
- package/src/generators/remote/files/rspack-module-federation-ssr/src/main.server.tsx__tmpl__ +45 -0
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +13 -4
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.config.ts__tmpl__ +69 -0
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/server.ts__tmpl__ +2 -2
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/src/main.server.tsx__tmpl__ +45 -0
- package/src/generators/remote/files/rspack-module-federation-ts/module-federation.config.ts__tmpl__ +11 -8
- package/src/generators/remote/files/rspack-module-federation-ts/rspack.config.ts__tmpl__ +40 -13
- package/src/generators/remote/files/webpack-module-federation/module-federation.config.js__tmpl__ +10 -7
- package/src/generators/remote/files/webpack-module-federation/webpack.config.js__tmpl__ +1 -1
- package/src/generators/remote/files/webpack-module-federation-ssr/module-federation.server.config.js__tmpl__ +7 -4
- package/src/generators/remote/files/webpack-module-federation-ssr/webpack.server.config.js__tmpl__ +2 -2
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +8 -5
- package/src/generators/remote/files/webpack-module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +2 -2
- package/src/generators/remote/files/webpack-module-federation-ts/module-federation.config.ts__tmpl__ +11 -8
- package/src/generators/remote/files/webpack-module-federation-ts/webpack.config.ts__tmpl__ +2 -2
- package/src/generators/remote/lib/setup-ssr-for-remote.d.ts +1 -1
- package/src/generators/remote/lib/setup-ssr-for-remote.js +37 -15
- package/src/generators/remote/lib/setup-tspath-for-remote.js +1 -3
- package/src/generators/remote/lib/update-host-with-remote.js +2 -2
- package/src/generators/remote/remote.d.ts +0 -1
- package/src/generators/remote/remote.js +57 -33
- package/src/generators/remote/schema.d.ts +2 -5
- package/src/generators/remote/schema.json +16 -27
- package/src/generators/setup-tailwind/lib/update-project.js +1 -2
- package/src/generators/stories/schema.json +0 -10
- package/src/generators/stories/stories.d.ts +1 -3
- package/src/generators/stories/stories.js +9 -20
- package/src/generators/storybook-configuration/configuration.js +2 -11
- package/src/generators/storybook-configuration/schema.d.ts +0 -3
- package/src/generators/storybook-configuration/schema.json +0 -15
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +11 -6
- package/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.d.ts +2 -0
- package/src/migrations/update-20-2-0/migrate-mf-imports-to-new-package.js +66 -0
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.d.ts +2 -0
- package/src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package.js +41 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.d.ts +2 -0
- package/src/migrations/update-20-3-0/ensure-nx-module-federation-package.js +18 -0
- package/src/migrations/update-21-0-0/update-babel-loose.d.ts +2 -0
- package/src/migrations/update-21-0-0/update-babel-loose.js +30 -0
- package/src/plugins/router-plugin.d.ts +10 -0
- package/src/plugins/router-plugin.js +221 -0
- package/src/rules/update-module-federation-project.d.ts +2 -1
- package/src/rules/update-module-federation-project.js +37 -48
- package/src/utils/add-mf-env-to-inputs.d.ts +1 -1
- package/src/utils/add-mf-env-to-inputs.js +8 -11
- package/src/utils/assertion.d.ts +2 -0
- package/src/utils/assertion.js +6 -0
- package/src/utils/ast-utils.d.ts +1 -1
- package/src/utils/ast-utils.js +2 -2
- package/src/utils/create-ts-config.js +57 -7
- package/src/utils/ct-utils.d.ts +1 -1
- package/src/utils/ct-utils.js +2 -7
- package/src/utils/has-rsbuild-plugin.d.ts +2 -0
- package/src/utils/has-rsbuild-plugin.js +10 -0
- package/src/utils/has-rspack-plugin.d.ts +2 -0
- package/src/utils/has-rspack-plugin.js +10 -0
- package/src/utils/testing-generators.js +2 -4
- package/src/utils/version-utils.d.ts +14 -0
- package/src/utils/version-utils.js +56 -0
- package/src/utils/versions.d.ts +25 -17
- package/src/utils/versions.js +28 -19
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +0 -84
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +0 -13
- package/src/generators/component-cypress-spec/component-cypress-spec.js +0 -104
- package/src/generators/component-cypress-spec/files/__componentName__.__fileExt__ +0 -13
- package/src/generators/component-cypress-spec/schema.json +0 -45
- package/src/generators/host/files/rspack-module-federation-ssr/rspack.server.config.js__tmpl__ +0 -16
- package/src/generators/host/files/rspack-module-federation-ssr-ts/rspack.server.config.ts__tmpl__ +0 -16
- package/src/generators/library/files/common/package.json__tmpl__ +0 -4
- package/src/generators/library/files/vite/package.json__tmpl__ +0 -12
- package/src/generators/remote/files/rspack-module-federation-ssr/rspack.server.config.js__tmpl__ +0 -16
- package/src/generators/remote/files/rspack-module-federation-ssr-ts/rspack.server.config.ts__tmpl__ +0 -16
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +0 -2
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +0 -9
- package/src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package.d.ts +0 -2
- package/src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package.js +0 -8
- package/src/migrations/update-16-3-0/remove-types-react-router-dom-package.d.ts +0 -2
- package/src/migrations/update-16-3-0/remove-types-react-router-dom-package.js +0 -8
- package/src/migrations/update-16-7-0/add-babel-core.d.ts +0 -2
- package/src/migrations/update-16-7-0/add-babel-core.js +0 -14
- package/src/migrations/update-16-7-0-add-typings/update-16-7-0-add-typings.d.ts +0 -2
- package/src/migrations/update-16-7-0-add-typings/update-16-7-0-add-typings.js +0 -57
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.d.ts +0 -2
- package/src/migrations/update-18-1-1/fix-target-defaults-inputs.js +0 -53
- package/src/module-federation/load-config.d.ts +0 -3
- package/src/module-federation/load-config.js +0 -15
- package/src/module-federation/models.d.ts +0 -24
- package/src/module-federation/models.js +0 -2
- package/src/module-federation/package-json.d.ts +0 -8
- package/src/module-federation/package-json.js +0 -12
- package/src/module-federation/utils.d.ts +0 -12
- package/src/module-federation/utils.js +0 -75
- package/src/module-federation/with-module-federation-ssr.d.ts +0 -2
- package/src/module-federation/with-module-federation-ssr.js +0 -50
- package/src/module-federation/with-module-federation.d.ts +0 -7
- package/src/module-federation/with-module-federation.js +0 -63
- package/src/utils/build-static.remotes.d.ts +0 -4
- package/src/utils/build-static.remotes.js +0 -65
- package/src/utils/format-file.d.ts +0 -1
- package/src/utils/format-file.js +0 -11
- /package/src/generators/component/files/{__fileName__.spec.tsx__tmpl__ → __fileName__.spec.__ext__} +0 -0
- /package/src/generators/hook/files/{__fileName__.spec.tsx__tmpl__ → __fileName__.spec.__specExt__} +0 -0
- /package/src/generators/redux/files/{__fileName__.slice.ts__tmpl__ → ts/__fileName__.__ext__} +0 -0
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
[](https://circleci.com/gh/nrwl/nx)
|
|
11
11
|
[]()
|
|
12
|
-
[](https://www.npmjs.com/package/nx)
|
|
13
13
|
[]()
|
|
14
14
|
[](http://commitizen.github.io/cz-cli/)
|
|
15
15
|
[](https://gitter.im/nrwl-nx/community?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
package/generators.json
CHANGED
|
@@ -25,13 +25,13 @@
|
|
|
25
25
|
"description": "Create a React library."
|
|
26
26
|
},
|
|
27
27
|
"component": {
|
|
28
|
-
"factory": "./src/generators/component/component
|
|
28
|
+
"factory": "./src/generators/component/component",
|
|
29
29
|
"schema": "./src/generators/component/schema.json",
|
|
30
30
|
"description": "Create a React component.",
|
|
31
31
|
"aliases": ["c"]
|
|
32
32
|
},
|
|
33
33
|
"redux": {
|
|
34
|
-
"factory": "./src/generators/redux/redux
|
|
34
|
+
"factory": "./src/generators/redux/redux",
|
|
35
35
|
"schema": "./src/generators/redux/schema.json",
|
|
36
36
|
"description": "Create a Redux slice for a project.",
|
|
37
37
|
"aliases": ["slice"]
|
|
@@ -54,29 +54,25 @@
|
|
|
54
54
|
"description": "Create stories/specs for all components declared in an app or library.",
|
|
55
55
|
"hidden": false
|
|
56
56
|
},
|
|
57
|
-
"component-cypress-spec": {
|
|
58
|
-
"factory": "./src/generators/component-cypress-spec/component-cypress-spec#componentCypressGenerator",
|
|
59
|
-
"schema": "./src/generators/component-cypress-spec/schema.json",
|
|
60
|
-
"description": "Create a Cypress spec for a UI component that has a story.",
|
|
61
|
-
"hidden": false
|
|
62
|
-
},
|
|
63
57
|
"hook": {
|
|
64
|
-
"factory": "./src/generators/hook/hook
|
|
58
|
+
"factory": "./src/generators/hook/hook",
|
|
65
59
|
"schema": "./src/generators/hook/schema.json",
|
|
66
60
|
"description": "Create a hook.",
|
|
67
61
|
"aliases": ["c"]
|
|
68
62
|
},
|
|
69
63
|
"host": {
|
|
70
|
-
"factory": "./src/generators/host/host
|
|
64
|
+
"factory": "./src/generators/host/host",
|
|
71
65
|
"schema": "./src/generators/host/schema.json",
|
|
72
66
|
"x-type": "application",
|
|
73
|
-
"description": "Generate a host react application"
|
|
67
|
+
"description": "Generate a host react application",
|
|
68
|
+
"aliases": ["consumer"]
|
|
74
69
|
},
|
|
75
70
|
"remote": {
|
|
76
|
-
"factory": "./src/generators/remote/remote
|
|
71
|
+
"factory": "./src/generators/remote/remote",
|
|
77
72
|
"schema": "./src/generators/remote/schema.json",
|
|
78
73
|
"x-type": "application",
|
|
79
|
-
"description": "Generate a remote react application"
|
|
74
|
+
"description": "Generate a remote react application",
|
|
75
|
+
"aliases": ["producer"]
|
|
80
76
|
},
|
|
81
77
|
"cypress-component-configuration": {
|
|
82
78
|
"factory": "./src/generators/cypress-component-configuration/cypress-component-configuration#cypressComponentConfigGenerator",
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { NxReactWebpackPlugin as _NxReactWebpackPlugin } from './plugins/nx-react-webpack-plugin/nx-react-webpack-plugin';
|
|
2
|
-
/** @deprecated Use '@nx/react/webpack-plugin' instead. */
|
|
2
|
+
/** @deprecated Use '@nx/react/webpack-plugin' instead, which can improve graph creation by 150-200ms per file. */
|
|
3
3
|
export declare const NxReactWebpackPlugin: typeof _NxReactWebpackPlugin;
|
|
4
4
|
export { extraEslintDependencies, extendReactEslintJson, } from './src/utils/lint';
|
|
5
5
|
export { cssInJsDependenciesBabel } from './src/utils/styled';
|
|
@@ -8,7 +8,6 @@ export { reactDomVersion, reactVersion } from './src/utils/versions';
|
|
|
8
8
|
export { applicationGenerator } from './src/generators/application/application';
|
|
9
9
|
export { componentGenerator } from './src/generators/component/component';
|
|
10
10
|
export { hookGenerator } from './src/generators/hook/hook';
|
|
11
|
-
export { componentCypressGenerator } from './src/generators/component-cypress-spec/component-cypress-spec';
|
|
12
11
|
export { componentStoryGenerator } from './src/generators/component-story/component-story';
|
|
13
12
|
export { libraryGenerator } from './src/generators/library/library';
|
|
14
13
|
export { reactInitGenerator } from './src/generators/init/init';
|
package/index.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setupTailwindGenerator = exports.componentTestGenerator = exports.cypressComponentConfigGenerator = exports.remoteGenerator = exports.hostGenerator = exports.storybookConfigurationGenerator = exports.storiesGenerator = exports.reduxGenerator = exports.reactInitGenerator = exports.libraryGenerator = exports.componentStoryGenerator = exports.
|
|
3
|
+
exports.setupTailwindGenerator = exports.componentTestGenerator = exports.cypressComponentConfigGenerator = exports.remoteGenerator = exports.hostGenerator = 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.cssInJsDependenciesBabel = exports.extendReactEslintJson = exports.extraEslintDependencies = exports.NxReactWebpackPlugin = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const nx_react_webpack_plugin_1 = require("./plugins/nx-react-webpack-plugin/nx-react-webpack-plugin");
|
|
6
|
-
|
|
7
|
-
/** @deprecated Use '@nx/react/webpack-plugin' instead. */
|
|
6
|
+
/** @deprecated Use '@nx/react/webpack-plugin' instead, which can improve graph creation by 150-200ms per file. */
|
|
8
7
|
exports.NxReactWebpackPlugin = nx_react_webpack_plugin_1.NxReactWebpackPlugin;
|
|
9
8
|
var lint_1 = require("./src/utils/lint");
|
|
10
9
|
Object.defineProperty(exports, "extraEslintDependencies", { enumerable: true, get: function () { return lint_1.extraEslintDependencies; } });
|
|
@@ -22,8 +21,6 @@ var component_1 = require("./src/generators/component/component");
|
|
|
22
21
|
Object.defineProperty(exports, "componentGenerator", { enumerable: true, get: function () { return component_1.componentGenerator; } });
|
|
23
22
|
var hook_1 = require("./src/generators/hook/hook");
|
|
24
23
|
Object.defineProperty(exports, "hookGenerator", { enumerable: true, get: function () { return hook_1.hookGenerator; } });
|
|
25
|
-
var component_cypress_spec_1 = require("./src/generators/component-cypress-spec/component-cypress-spec");
|
|
26
|
-
Object.defineProperty(exports, "componentCypressGenerator", { enumerable: true, get: function () { return component_cypress_spec_1.componentCypressGenerator; } });
|
|
27
24
|
var component_story_1 = require("./src/generators/component-story/component-story");
|
|
28
25
|
Object.defineProperty(exports, "componentStoryGenerator", { enumerable: true, get: function () { return component_story_1.componentStoryGenerator; } });
|
|
29
26
|
var library_1 = require("./src/generators/library/library");
|
|
@@ -1,5 +1,69 @@
|
|
|
1
1
|
export type ResolveRemoteUrlFunction = (remoteName: string) => string | Promise<string>;
|
|
2
|
+
/**
|
|
3
|
+
* @deprecated Use Runtime Helpers from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
4
|
+
*/
|
|
2
5
|
export declare function setRemoteUrlResolver(_resolveRemoteUrl: ResolveRemoteUrlFunction): void;
|
|
6
|
+
/**
|
|
7
|
+
* @deprecated Use init() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
8
|
+
* If you have a remote app called `my-remote-app` and you want to use the `http://localhost:4201/mf-manifest.json` as the remote url, you should change it from:
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { setRemoteDefinitions } from '@nx/react/mf';
|
|
11
|
+
*
|
|
12
|
+
* setRemoteDefinitions({
|
|
13
|
+
* 'my-remote-app': 'http://localhost:4201/mf-manifest.json'
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
16
|
+
* to use init():
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { init } from '@module-federation/enhanced/runtime';
|
|
19
|
+
*
|
|
20
|
+
* init({
|
|
21
|
+
* name: 'host',
|
|
22
|
+
* remotes: [{
|
|
23
|
+
* name: 'my-remote-app',
|
|
24
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
|
25
|
+
* }]
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
3
29
|
export declare function setRemoteDefinitions(definitions: Record<string, string>): void;
|
|
30
|
+
/**
|
|
31
|
+
* @deprecated Use registerRemotes() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
32
|
+
* If you set a remote app with `setRemoteDefinition` such as:
|
|
33
|
+
* ```ts
|
|
34
|
+
* import { setRemoteDefinition } from '@nx/react/mf';
|
|
35
|
+
*
|
|
36
|
+
* setRemoteDefinition(
|
|
37
|
+
* 'my-remote-app',
|
|
38
|
+
* 'http://localhost:4201/mf-manifest.json'
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
* change it to use registerRemotes():
|
|
42
|
+
* ```ts
|
|
43
|
+
* import { registerRemotes } from '@module-federation/enhanced/runtime';
|
|
44
|
+
*
|
|
45
|
+
* registerRemotes([
|
|
46
|
+
* {
|
|
47
|
+
* name: 'my-remote-app',
|
|
48
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
|
49
|
+
* }
|
|
50
|
+
* ]);
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
4
53
|
export declare function setRemoteDefinition(remoteName: string, remoteUrl: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* @deprecated Use loadRemote() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
56
|
+
* If you set a load a remote with `loadRemoteModule` such as:
|
|
57
|
+
* ```ts
|
|
58
|
+
* import { loadRemoteModule } from '@nx/react/mf';
|
|
59
|
+
*
|
|
60
|
+
* loadRemoteModule('my-remote-app', './Module').then(m => m.RemoteEntryModule);
|
|
61
|
+
* ```
|
|
62
|
+
* change it to use loadRemote():
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { loadRemote } from '@module-federation/enhanced/runtime';
|
|
65
|
+
*
|
|
66
|
+
* loadRemote<typeof import('my-remote-app/Module')>('my-remote-app/Module').then(m => m.RemoteEntryModule);
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
5
69
|
export declare function loadRemoteModule(remoteName: string, moduleName: string): Promise<any>;
|
package/mf/dynamic-federation.js
CHANGED
|
@@ -9,15 +9,79 @@ let resolveRemoteUrl;
|
|
|
9
9
|
const remoteModuleMap = new Map();
|
|
10
10
|
const remoteContainerMap = new Map();
|
|
11
11
|
let initialSharingScopeCreated = false;
|
|
12
|
+
/**
|
|
13
|
+
* @deprecated Use Runtime Helpers from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
14
|
+
*/
|
|
12
15
|
function setRemoteUrlResolver(_resolveRemoteUrl) {
|
|
13
16
|
resolveRemoteUrl = _resolveRemoteUrl;
|
|
14
17
|
}
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use init() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
20
|
+
* If you have a remote app called `my-remote-app` and you want to use the `http://localhost:4201/mf-manifest.json` as the remote url, you should change it from:
|
|
21
|
+
* ```ts
|
|
22
|
+
* import { setRemoteDefinitions } from '@nx/react/mf';
|
|
23
|
+
*
|
|
24
|
+
* setRemoteDefinitions({
|
|
25
|
+
* 'my-remote-app': 'http://localhost:4201/mf-manifest.json'
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
28
|
+
* to use init():
|
|
29
|
+
* ```ts
|
|
30
|
+
* import { init } from '@module-federation/enhanced/runtime';
|
|
31
|
+
*
|
|
32
|
+
* init({
|
|
33
|
+
* name: 'host',
|
|
34
|
+
* remotes: [{
|
|
35
|
+
* name: 'my-remote-app',
|
|
36
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
|
37
|
+
* }]
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
15
41
|
function setRemoteDefinitions(definitions) {
|
|
16
42
|
remoteUrlDefinitions = definitions;
|
|
17
43
|
}
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated Use registerRemotes() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
46
|
+
* If you set a remote app with `setRemoteDefinition` such as:
|
|
47
|
+
* ```ts
|
|
48
|
+
* import { setRemoteDefinition } from '@nx/react/mf';
|
|
49
|
+
*
|
|
50
|
+
* setRemoteDefinition(
|
|
51
|
+
* 'my-remote-app',
|
|
52
|
+
* 'http://localhost:4201/mf-manifest.json'
|
|
53
|
+
* );
|
|
54
|
+
* ```
|
|
55
|
+
* change it to use registerRemotes():
|
|
56
|
+
* ```ts
|
|
57
|
+
* import { registerRemotes } from '@module-federation/enhanced/runtime';
|
|
58
|
+
*
|
|
59
|
+
* registerRemotes([
|
|
60
|
+
* {
|
|
61
|
+
* name: 'my-remote-app',
|
|
62
|
+
* entry: 'http://localhost:4201/mf-manifest.json'
|
|
63
|
+
* }
|
|
64
|
+
* ]);
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
18
67
|
function setRemoteDefinition(remoteName, remoteUrl) {
|
|
19
68
|
remoteUrlDefinitions[remoteName] = remoteUrl;
|
|
20
69
|
}
|
|
70
|
+
/**
|
|
71
|
+
* @deprecated Use loadRemote() from '@module-federation/enhanced/runtime' instead. This will be removed in Nx 22.
|
|
72
|
+
* If you set a load a remote with `loadRemoteModule` such as:
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { loadRemoteModule } from '@nx/react/mf';
|
|
75
|
+
*
|
|
76
|
+
* loadRemoteModule('my-remote-app', './Module').then(m => m.RemoteEntryModule);
|
|
77
|
+
* ```
|
|
78
|
+
* change it to use loadRemote():
|
|
79
|
+
* ```ts
|
|
80
|
+
* import { loadRemote } from '@module-federation/enhanced/runtime';
|
|
81
|
+
*
|
|
82
|
+
* loadRemote<typeof import('my-remote-app/Module')>('my-remote-app/Module').then(m => m.RemoteEntryModule);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
21
85
|
async function loadRemoteModule(remoteName, moduleName) {
|
|
22
86
|
const remoteModuleKey = `${remoteName}:${moduleName}`;
|
|
23
87
|
if (remoteModuleMap.has(remoteModuleKey)) {
|
package/migrations.json
CHANGED
|
@@ -1,47 +1,5 @@
|
|
|
1
1
|
{
|
|
2
2
|
"generators": {
|
|
3
|
-
"update-16-0-0-add-nx-packages": {
|
|
4
|
-
"cli": "nx",
|
|
5
|
-
"version": "16.0.0-beta.1",
|
|
6
|
-
"description": "Replace @nrwl/react with @nx/react",
|
|
7
|
-
"implementation": "./src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages"
|
|
8
|
-
},
|
|
9
|
-
"update-16-2-0-remove-package": {
|
|
10
|
-
"cli": "nx",
|
|
11
|
-
"version": "16.2.0-beta.0",
|
|
12
|
-
"description": "Remove react-test-renderer from package.json",
|
|
13
|
-
"implementation": "./src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package"
|
|
14
|
-
},
|
|
15
|
-
"remove-types-react-router-dom": {
|
|
16
|
-
"cli": "nx",
|
|
17
|
-
"version": "16.3.0-beta.2",
|
|
18
|
-
"description": "Remove @types/react-router-dom from package.json",
|
|
19
|
-
"implementation": "./src/migrations/update-16-3-0/remove-types-react-router-dom-package"
|
|
20
|
-
},
|
|
21
|
-
"add-babel-core": {
|
|
22
|
-
"cli": "nx",
|
|
23
|
-
"version": "16.7.0-beta.2",
|
|
24
|
-
"description": "Add @babel/core to package.json if @babel/preset-react is present",
|
|
25
|
-
"implementation": "./src/migrations/update-16-7-0/add-babel-core"
|
|
26
|
-
},
|
|
27
|
-
"update-16-7-0-add-typings": {
|
|
28
|
-
"cli": "nx",
|
|
29
|
-
"version": "16.7.0-beta.2",
|
|
30
|
-
"description": "Add @nx/react types to tsconfig types array",
|
|
31
|
-
"implementation": "./src/migrations/update-16-7-0-add-typings/update-16-7-0-add-typings"
|
|
32
|
-
},
|
|
33
|
-
"add-module-federation-env-var-to-target-defaults": {
|
|
34
|
-
"cli": "nx",
|
|
35
|
-
"version": "18.0.0-beta.0",
|
|
36
|
-
"description": "Add NX_MF_DEV_SERVER_STATIC_REMOTES to inputs for task hashing when '@nx/webpack:webpack' is used for Module Federation.",
|
|
37
|
-
"factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults"
|
|
38
|
-
},
|
|
39
|
-
"fix-target-defaults-for-webpack": {
|
|
40
|
-
"cli": "nx",
|
|
41
|
-
"version": "18.1.1-beta.0",
|
|
42
|
-
"description": "Ensure targetDefaults inputs for task hashing when '@nx/webpack:webpack' is used are correct for Module Federation.",
|
|
43
|
-
"factory": "./src/migrations/update-18-1-1/fix-target-defaults-inputs"
|
|
44
|
-
},
|
|
45
3
|
"update-19-6-0-turn-module-federation-dts-off": {
|
|
46
4
|
"cli": "nx",
|
|
47
5
|
"version": "19.6.0-beta.4",
|
|
@@ -59,117 +17,39 @@
|
|
|
59
17
|
"version": "19.6.1-beta.0",
|
|
60
18
|
"description": "Ensure Target Defaults are set correctly for Module Federation.",
|
|
61
19
|
"factory": "./src/migrations/update-19-6-1/ensure-depends-on-for-mf"
|
|
62
|
-
}
|
|
63
|
-
},
|
|
64
|
-
"packageJsonUpdates": {
|
|
65
|
-
"16.3.0": {
|
|
66
|
-
"version": "16.3.0-beta.2",
|
|
67
|
-
"packages": {
|
|
68
|
-
"react-router-dom": {
|
|
69
|
-
"version": "6.11.2",
|
|
70
|
-
"alwaysAddToPackageJson": false
|
|
71
|
-
},
|
|
72
|
-
"@svgr/rollup": {
|
|
73
|
-
"version": "^8.0.1",
|
|
74
|
-
"alwaysAddToPackageJson": false
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
20
|
},
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
"alwaysAddToPackageJson": false
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
"16.4.0-beta.7": {
|
|
88
|
-
"version": "16.4.0-beta.7",
|
|
89
|
-
"packages": {
|
|
90
|
-
"@types/react": {
|
|
91
|
-
"version": "18.2.12",
|
|
92
|
-
"alwaysAddToPackageJson": false
|
|
93
|
-
},
|
|
94
|
-
"@types/react-dom": {
|
|
95
|
-
"version": "18.2.5",
|
|
96
|
-
"alwaysAddToPackageJson": false
|
|
97
|
-
},
|
|
98
|
-
"@types/react-is": {
|
|
99
|
-
"version": "18.2.0",
|
|
100
|
-
"alwaysAddToPackageJson": false
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
"16.4.0-beta.8": {
|
|
105
|
-
"version": "16.4.0-beta.8",
|
|
106
|
-
"packages": {
|
|
107
|
-
"@emotion/styled": {
|
|
108
|
-
"version": "11.11.0",
|
|
109
|
-
"alwaysAddToPackageJson": false
|
|
110
|
-
},
|
|
111
|
-
"@emotion/react": {
|
|
112
|
-
"version": "11.11.1",
|
|
113
|
-
"alwaysAddToPackageJson": false
|
|
114
|
-
},
|
|
115
|
-
"@emotion/babel-plugin": {
|
|
116
|
-
"version": "11.11.0",
|
|
117
|
-
"alwaysAddToPackageJson": false
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
},
|
|
121
|
-
"16.4.0-beta.11": {
|
|
122
|
-
"version": "16.4.0-beta.11",
|
|
123
|
-
"packages": {
|
|
124
|
-
"@types/react": {
|
|
125
|
-
"version": "18.2.13",
|
|
126
|
-
"alwaysAddToPackageJson": false
|
|
127
|
-
},
|
|
128
|
-
"@types/react-dom": {
|
|
129
|
-
"version": "18.2.6",
|
|
130
|
-
"alwaysAddToPackageJson": false
|
|
131
|
-
},
|
|
132
|
-
"@types/react-is": {
|
|
133
|
-
"version": "18.2.1",
|
|
134
|
-
"alwaysAddToPackageJson": false
|
|
135
|
-
}
|
|
136
|
-
}
|
|
21
|
+
"update-20-2-0-update-module-federation-config-import": {
|
|
22
|
+
"cli": "nx",
|
|
23
|
+
"version": "20.2.0-beta.2",
|
|
24
|
+
"description": "Update the ModuleFederationConfig import use @nx/module-federation.",
|
|
25
|
+
"factory": "./src/migrations/update-20-2-0/migrate-mf-imports-to-new-package"
|
|
137
26
|
},
|
|
138
|
-
"
|
|
139
|
-
"
|
|
140
|
-
"
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
"alwaysAddToPackageJson": false
|
|
144
|
-
}
|
|
145
|
-
}
|
|
27
|
+
"update-20-2-0-update-with-module-federation-import": {
|
|
28
|
+
"cli": "nx",
|
|
29
|
+
"version": "20.2.0-beta.2",
|
|
30
|
+
"description": "Update the withModuleFederation import use @nx/module-federation/webpack.",
|
|
31
|
+
"factory": "./src/migrations/update-20-2-0/migrate-with-mf-import-to-new-package"
|
|
146
32
|
},
|
|
147
|
-
"
|
|
148
|
-
"
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"alwaysAddToPackageJson": false
|
|
153
|
-
},
|
|
154
|
-
"@types/react-dom": {
|
|
155
|
-
"version": "18.2.9",
|
|
156
|
-
"alwaysAddToPackageJson": false
|
|
157
|
-
},
|
|
158
|
-
"@types/react-is": {
|
|
159
|
-
"version": "18.2.2",
|
|
160
|
-
"alwaysAddToPackageJson": false
|
|
161
|
-
}
|
|
162
|
-
}
|
|
33
|
+
"ensure-nx-module-federation-package": {
|
|
34
|
+
"cli": "nx",
|
|
35
|
+
"version": "20.3.0-beta.2",
|
|
36
|
+
"description": "If workspace includes Module Federation projects, ensure the new @nx/module-federation package is installed.",
|
|
37
|
+
"factory": "./src/migrations/update-20-3-0/ensure-nx-module-federation-package"
|
|
163
38
|
},
|
|
164
|
-
"
|
|
165
|
-
"
|
|
166
|
-
"
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
"alwaysAddToPackageJson": false
|
|
170
|
-
}
|
|
171
|
-
}
|
|
39
|
+
"add-mf-env-var-to-target-defaults": {
|
|
40
|
+
"cli": "nx",
|
|
41
|
+
"version": "20.4.0-beta.0",
|
|
42
|
+
"description": "Add NX_MF_DEV_REMOTES to inputs for task hashing when '@nx/webpack:webpack' or '@nx/rspack:rspack' is used for Module Federation.",
|
|
43
|
+
"factory": "./src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults"
|
|
172
44
|
},
|
|
45
|
+
"update-21-0-0-update-babel-loose": {
|
|
46
|
+
"cli": "nx",
|
|
47
|
+
"version": "21.0.0-beta.11",
|
|
48
|
+
"description": "Replaces `classProperties.loose` option with `loose`.",
|
|
49
|
+
"factory": "./src/migrations/update-21-0-0/update-babel-loose"
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
"packageJsonUpdates": {
|
|
173
53
|
"19.0.0": {
|
|
174
54
|
"version": "19.0.0-beta.12",
|
|
175
55
|
"packages": {
|
|
@@ -242,6 +122,58 @@
|
|
|
242
122
|
"alwaysAddToPackageJson": false
|
|
243
123
|
}
|
|
244
124
|
}
|
|
125
|
+
},
|
|
126
|
+
"20.0.0": {
|
|
127
|
+
"version": "20.0.0-beta.8",
|
|
128
|
+
"packages": {
|
|
129
|
+
"eslint-plugin-import": {
|
|
130
|
+
"version": "2.31.0",
|
|
131
|
+
"alwaysAddToPackageJson": false
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
},
|
|
135
|
+
"20.1.0": {
|
|
136
|
+
"version": "20.1.0-beta.0",
|
|
137
|
+
"packages": {
|
|
138
|
+
"eslint-plugin-react-hooks": {
|
|
139
|
+
"version": "5.0.0",
|
|
140
|
+
"alwaysAddToPackageJson": false
|
|
141
|
+
},
|
|
142
|
+
"eslint-plugin-jsx-a11y": {
|
|
143
|
+
"version": "6.10.1",
|
|
144
|
+
"alwaysAddToPackageJson": false
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"20.2.0": {
|
|
149
|
+
"version": "20.2.0-beta.3",
|
|
150
|
+
"packages": {
|
|
151
|
+
"@module-federation/enhanced": {
|
|
152
|
+
"version": "0.7.6",
|
|
153
|
+
"alwaysAddToPackageJson": false
|
|
154
|
+
},
|
|
155
|
+
"@module-federation/runtime": {
|
|
156
|
+
"version": "0.7.6",
|
|
157
|
+
"alwaysAddToPackageJson": false
|
|
158
|
+
},
|
|
159
|
+
"@module-federation/sdk": {
|
|
160
|
+
"version": "0.7.6",
|
|
161
|
+
"alwaysAddToPackageJson": false
|
|
162
|
+
},
|
|
163
|
+
"@module-federation/node": {
|
|
164
|
+
"version": "2.6.11",
|
|
165
|
+
"alwaysAddToPackageJson": false
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
"20.3.0": {
|
|
170
|
+
"version": "20.3.0-beta.0",
|
|
171
|
+
"packages": {
|
|
172
|
+
"@testing-library/react": {
|
|
173
|
+
"version": "16.1.0",
|
|
174
|
+
"alwaysAddToPackageJson": false
|
|
175
|
+
}
|
|
176
|
+
}
|
|
245
177
|
}
|
|
246
178
|
}
|
|
247
179
|
}
|
package/module-federation.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { withModuleFederation } from '
|
|
2
|
-
import { withModuleFederationForSSR } from '
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { withModuleFederation } from '@nx/module-federation/webpack';
|
|
2
|
+
import { withModuleFederationForSSR } from '@nx/module-federation/webpack';
|
|
3
|
+
/**
|
|
4
|
+
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22.
|
|
5
|
+
*/
|
|
6
|
+
export { withModuleFederation, withModuleFederationForSSR };
|
package/module-federation.js
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.withModuleFederationForSSR = exports.withModuleFederation = void 0;
|
|
4
|
-
const
|
|
5
|
-
Object.defineProperty(exports, "withModuleFederation", { enumerable: true, get: function () { return
|
|
6
|
-
const
|
|
7
|
-
Object.defineProperty(exports, "withModuleFederationForSSR", { enumerable: true, get: function () { return
|
|
4
|
+
const webpack_1 = require("@nx/module-federation/webpack");
|
|
5
|
+
Object.defineProperty(exports, "withModuleFederation", { enumerable: true, get: function () { return webpack_1.withModuleFederation; } });
|
|
6
|
+
const webpack_2 = require("@nx/module-federation/webpack");
|
|
7
|
+
Object.defineProperty(exports, "withModuleFederationForSSR", { enumerable: true, get: function () { return webpack_2.withModuleFederationForSSR; } });
|
|
8
8
|
// Support for older generated code: `const withModuleFederation = require('@nx/react/module-federation')`
|
|
9
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22.
|
|
11
|
+
*/
|
|
12
|
+
module.exports = webpack_1.withModuleFederation;
|
|
10
13
|
// Allow newer generated code to work: `const { withModuleFederation } = require(...)`;
|
|
11
|
-
|
|
12
|
-
module.
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22.
|
|
16
|
+
*/
|
|
17
|
+
module.exports.withModuleFederation = webpack_1.withModuleFederation;
|
|
18
|
+
/**
|
|
19
|
+
* @deprecated Use `@nx/module-federation/webpack` instead. This will be removed in Nx v22.
|
|
20
|
+
*/
|
|
21
|
+
module.exports.withModuleFederationForSSR = webpack_2.withModuleFederationForSSR;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nx/react",
|
|
3
|
-
"version": "0.0.0-pr-
|
|
3
|
+
"version": "0.0.0-pr-31313-387cdca",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The React plugin for Nx contains executors and generators for managing React applications and libraries within an Nx workspace. It provides:\n\n\n- Integration with libraries such as Jest, Vitest, Playwright, Cypress, and Storybook.\n\n- Generators for applications, libraries, components, hooks, and more.\n\n- Library build support for publishing packages to npm or other registries.\n\n- Utilities for automatic workspace refactoring.",
|
|
6
6
|
"repository": {
|
|
@@ -38,18 +38,18 @@
|
|
|
38
38
|
"minimatch": "9.0.3",
|
|
39
39
|
"picocolors": "^1.1.0",
|
|
40
40
|
"tslib": "^2.3.0",
|
|
41
|
-
"@
|
|
42
|
-
"@nx/
|
|
43
|
-
"@nx/
|
|
44
|
-
"@nx/
|
|
45
|
-
"@nx/
|
|
46
|
-
"express": "^4.
|
|
47
|
-
"http-proxy-middleware": "^3.0.
|
|
48
|
-
"
|
|
41
|
+
"@nx/devkit": "0.0.0-pr-31313-387cdca",
|
|
42
|
+
"@nx/js": "0.0.0-pr-31313-387cdca",
|
|
43
|
+
"@nx/eslint": "0.0.0-pr-31313-387cdca",
|
|
44
|
+
"@nx/web": "0.0.0-pr-31313-387cdca",
|
|
45
|
+
"@nx/module-federation": "0.0.0-pr-31313-387cdca",
|
|
46
|
+
"express": "^4.21.2",
|
|
47
|
+
"http-proxy-middleware": "^3.0.3",
|
|
48
|
+
"semver": "^7.6.3"
|
|
49
49
|
},
|
|
50
50
|
"publishConfig": {
|
|
51
51
|
"access": "public"
|
|
52
52
|
},
|
|
53
|
-
"
|
|
54
|
-
"
|
|
53
|
+
"types": "./index.d.ts",
|
|
54
|
+
"type": "commonjs"
|
|
55
55
|
}
|
package/plugins/bundle-rollup.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
// TODO(
|
|
3
|
+
// TODO(v22): Remove this in Nx 22 and migrate to explicit rollup.config.cjs files.
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Use `withNx` function from `@nx/rollup/with-nx` in your rollup.config.cjs file instead. Use `nx g @nx/rollup:convert-to-inferred` to generate the rollup.config.cjs file if it does not exist.
|
|
6
|
+
*/
|
|
4
7
|
function getRollupOptions(options) {
|
|
5
8
|
const extraGlobals = {
|
|
6
9
|
react: 'React',
|
|
@@ -167,7 +167,7 @@ function buildTargetWebpack(ctx, buildTarget, componentTestingProjectName) {
|
|
|
167
167
|
}
|
|
168
168
|
return async () => {
|
|
169
169
|
customWebpack = await customWebpack;
|
|
170
|
-
// TODO(
|
|
170
|
+
// TODO(v22): Component testing need to be agnostic of the underlying executor. With Crystal, we're not using `@nx/webpack:webpack` by default.
|
|
171
171
|
// We need to decouple CT from the build target of the app, we just care about bundler config (e.g. webpack.config.js).
|
|
172
172
|
// The generated setup should support both Webpack and Vite as documented here: https://docs.cypress.io/guides/component-testing/react/overview
|
|
173
173
|
// Related issue: https://github.com/nrwl/nx/issues/21546
|
package/plugins/jest.js
CHANGED
|
@@ -16,17 +16,12 @@ module.exports = {
|
|
|
16
16
|
module.exports = {
|
|
17
17
|
__esModule: true,
|
|
18
18
|
default: ${assetFilename},
|
|
19
|
-
ReactComponent:
|
|
20
|
-
return
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
props: Object.assign({}, props, {
|
|
26
|
-
children: ${assetFilename}
|
|
27
|
-
})
|
|
28
|
-
};
|
|
29
|
-
}),
|
|
19
|
+
ReactComponent: function ${componentName}(props) {
|
|
20
|
+
return React.createElement(
|
|
21
|
+
'svg',
|
|
22
|
+
Object.assign({}, props, { children: ${assetFilename} })
|
|
23
|
+
);
|
|
24
|
+
},
|
|
30
25
|
};`,
|
|
31
26
|
};
|
|
32
27
|
}
|