@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/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js
CHANGED
|
@@ -4,143 +4,16 @@ exports.default = moduleFederationSsrDevServer;
|
|
|
4
4
|
const devkit_1 = require("@nx/devkit");
|
|
5
5
|
const ssr_dev_server_impl_1 = require("@nx/webpack/src/executors/ssr-dev-server/ssr-dev-server.impl");
|
|
6
6
|
const path_1 = require("path");
|
|
7
|
-
const
|
|
7
|
+
const utils_1 = require("@nx/module-federation/src/executors/utils");
|
|
8
8
|
const async_iterable_1 = require("@nx/devkit/src/utils/async-iterable");
|
|
9
|
-
const child_process_1 = require("child_process");
|
|
10
9
|
const fs_1 = require("fs");
|
|
11
|
-
const parse_static_remotes_config_1 = require("@nx/webpack/src/utils/module-federation/parse-static-remotes-config");
|
|
12
|
-
const file_server_impl_1 = require("@nx/web/src/executors/file-server/file-server.impl");
|
|
13
|
-
const cache_directory_1 = require("nx/src/utils/cache-directory");
|
|
14
|
-
const start_ssr_remote_proxies_1 = require("@nx/webpack/src/utils/module-federation/start-ssr-remote-proxies");
|
|
15
10
|
const wait_for_port_open_1 = require("@nx/web/src/utils/wait-for-port-open");
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
...options,
|
|
19
|
-
ssl: options.ssl ?? false,
|
|
20
|
-
sslCert: options.sslCert ? (0, path_1.join)(devkit_1.workspaceRoot, options.sslCert) : undefined,
|
|
21
|
-
sslKey: options.sslKey ? (0, path_1.join)(devkit_1.workspaceRoot, options.sslKey) : undefined,
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
function getBuildOptions(buildTarget, context) {
|
|
25
|
-
const target = (0, devkit_1.parseTargetString)(buildTarget, context);
|
|
26
|
-
const buildOptions = (0, devkit_1.readTargetOptions)(target, context);
|
|
27
|
-
return {
|
|
28
|
-
...buildOptions,
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
async function* startSsrStaticRemotesFileServer(ssrStaticRemotesConfig, context, options) {
|
|
32
|
-
if (ssrStaticRemotesConfig.remotes.length === 0) {
|
|
33
|
-
yield { success: true };
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
// The directories are usually generated with /browser and /server suffixes so we need to copy them to a common directory
|
|
37
|
-
const commonOutputDirectory = (0, path_1.join)(devkit_1.workspaceRoot, 'tmp/static-remotes');
|
|
38
|
-
for (const app of ssrStaticRemotesConfig.remotes) {
|
|
39
|
-
const remoteConfig = ssrStaticRemotesConfig.config[app];
|
|
40
|
-
(0, fs_1.cpSync)(remoteConfig.outputPath, (0, path_1.join)(commonOutputDirectory, remoteConfig.urlSegment), {
|
|
41
|
-
force: true,
|
|
42
|
-
recursive: true,
|
|
43
|
-
});
|
|
44
|
-
}
|
|
45
|
-
const staticRemotesIter = (0, file_server_impl_1.default)({
|
|
46
|
-
cors: true,
|
|
47
|
-
watch: false,
|
|
48
|
-
staticFilePath: commonOutputDirectory,
|
|
49
|
-
parallel: false,
|
|
50
|
-
spa: false,
|
|
51
|
-
withDeps: false,
|
|
52
|
-
host: options.host,
|
|
53
|
-
port: options.staticRemotesPort,
|
|
54
|
-
ssl: options.ssl,
|
|
55
|
-
sslCert: options.sslCert,
|
|
56
|
-
sslKey: options.sslKey,
|
|
57
|
-
cacheSeconds: -1,
|
|
58
|
-
}, context);
|
|
59
|
-
yield* staticRemotesIter;
|
|
60
|
-
}
|
|
61
|
-
async function startRemotes(remotes, context, options) {
|
|
62
|
-
const remoteIters = [];
|
|
63
|
-
const target = 'serve';
|
|
64
|
-
for (const app of remotes) {
|
|
65
|
-
const remoteProjectServeTarget = context.projectGraph.nodes[app].data.targets[target];
|
|
66
|
-
const isUsingModuleFederationSsrDevServerExecutor = remoteProjectServeTarget.executor.includes('module-federation-ssr-dev-server');
|
|
67
|
-
const configurationOverride = options.devRemotes?.find((remote) => typeof remote !== 'string' && remote.remoteName === app)?.configuration;
|
|
68
|
-
{
|
|
69
|
-
const defaultOverrides = {
|
|
70
|
-
...(options.host ? { host: options.host } : {}),
|
|
71
|
-
...(options.ssl ? { ssl: options.ssl } : {}),
|
|
72
|
-
...(options.sslCert ? { sslCert: options.sslCert } : {}),
|
|
73
|
-
...(options.sslKey ? { sslKey: options.sslKey } : {}),
|
|
74
|
-
};
|
|
75
|
-
const overrides = {
|
|
76
|
-
watch: true,
|
|
77
|
-
...defaultOverrides,
|
|
78
|
-
...(isUsingModuleFederationSsrDevServerExecutor
|
|
79
|
-
? { isInitialHost: false }
|
|
80
|
-
: {}),
|
|
81
|
-
};
|
|
82
|
-
remoteIters.push(await (0, devkit_1.runExecutor)({
|
|
83
|
-
project: app,
|
|
84
|
-
target,
|
|
85
|
-
configuration: configurationOverride ?? context.configurationName,
|
|
86
|
-
}, overrides, context));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
return remoteIters;
|
|
90
|
-
}
|
|
91
|
-
async function buildSsrStaticRemotes(staticRemotesConfig, nxBin, context, options) {
|
|
92
|
-
if (!staticRemotesConfig.remotes.length) {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
devkit_1.logger.info(`Nx is building ${staticRemotesConfig.remotes.length} static remotes...`);
|
|
96
|
-
const mapLocationOfRemotes = {};
|
|
97
|
-
for (const remoteApp of staticRemotesConfig.remotes) {
|
|
98
|
-
mapLocationOfRemotes[remoteApp] = `http${options.ssl ? 's' : ''}://${options.host}:${options.staticRemotesPort}/${staticRemotesConfig.config[remoteApp].urlSegment}`;
|
|
99
|
-
}
|
|
100
|
-
await new Promise((resolve) => {
|
|
101
|
-
const childProcess = (0, child_process_1.fork)(nxBin, [
|
|
102
|
-
'run-many',
|
|
103
|
-
'--target=server',
|
|
104
|
-
'--projects',
|
|
105
|
-
staticRemotesConfig.remotes.join(','),
|
|
106
|
-
...(context.configurationName
|
|
107
|
-
? [`--configuration=${context.configurationName}`]
|
|
108
|
-
: []),
|
|
109
|
-
...(options.parallel ? [`--parallel=${options.parallel}`] : []),
|
|
110
|
-
], {
|
|
111
|
-
cwd: context.root,
|
|
112
|
-
stdio: ['ignore', 'pipe', 'pipe', 'ipc'],
|
|
113
|
-
});
|
|
114
|
-
// Add a listener to the child process to capture the build log
|
|
115
|
-
const remoteBuildLogFile = (0, path_1.join)(cache_directory_1.workspaceDataDirectory, `${new Date().toISOString().replace(/[:\.]/g, '_')}-build.log`);
|
|
116
|
-
const remoteBuildLogStream = (0, fs_1.createWriteStream)(remoteBuildLogFile);
|
|
117
|
-
childProcess.stdout.on('data', (data) => {
|
|
118
|
-
const ANSII_CODE_REGEX = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
119
|
-
const stdoutString = data.toString().replace(ANSII_CODE_REGEX, '');
|
|
120
|
-
remoteBuildLogStream.write(stdoutString);
|
|
121
|
-
// in addition to writing into the stdout stream, also show error directly in console
|
|
122
|
-
// so the error is easily discoverable. 'ERROR in' is the key word to search in webpack output.
|
|
123
|
-
if (stdoutString.includes('ERROR in')) {
|
|
124
|
-
devkit_1.logger.log(stdoutString);
|
|
125
|
-
}
|
|
126
|
-
if (stdoutString.includes('Successfully ran target server')) {
|
|
127
|
-
childProcess.stdout.removeAllListeners('data');
|
|
128
|
-
devkit_1.logger.info(`Nx Built ${staticRemotesConfig.remotes.length} static remotes.`);
|
|
129
|
-
resolve();
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
process.on('SIGTERM', () => childProcess.kill('SIGTERM'));
|
|
133
|
-
process.on('exit', () => childProcess.kill('SIGTERM'));
|
|
134
|
-
});
|
|
135
|
-
return mapLocationOfRemotes;
|
|
136
|
-
}
|
|
11
|
+
const lib_1 = require("./lib");
|
|
137
12
|
async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
138
|
-
const options = normalizeOptions(ssrDevServerOptions);
|
|
139
|
-
// Force Node to resolve to look for the nx binary that is inside node_modules
|
|
140
|
-
const nxBin = require.resolve('nx/bin/nx');
|
|
13
|
+
const options = (0, lib_1.normalizeOptions)(ssrDevServerOptions);
|
|
141
14
|
let iter = (0, ssr_dev_server_impl_1.default)(options, context);
|
|
142
15
|
const projectConfig = context.projectsConfigurations.projects[context.projectName];
|
|
143
|
-
const buildOptions = getBuildOptions(options.browserTarget, context);
|
|
16
|
+
const buildOptions = (0, lib_1.getBuildOptions)(options.browserTarget, context);
|
|
144
17
|
let pathToManifestFile = (0, path_1.join)(context.root, projectConfig.sourceRoot, 'assets/module-federation.manifest.json');
|
|
145
18
|
if (options.pathToManifestFile) {
|
|
146
19
|
const userPathToManifestFile = (0, path_1.join)(context.root, options.pathToManifestFile);
|
|
@@ -155,28 +28,7 @@ async function* moduleFederationSsrDevServer(ssrDevServerOptions, context) {
|
|
|
155
28
|
if (!options.isInitialHost) {
|
|
156
29
|
return yield* iter;
|
|
157
30
|
}
|
|
158
|
-
const
|
|
159
|
-
const remoteNames = options.devRemotes?.map((remote) => typeof remote === 'string' ? remote : remote.remoteName);
|
|
160
|
-
const remotes = (0, module_federation_1.getRemotes)(remoteNames, options.skipRemotes, moduleFederationConfig, {
|
|
161
|
-
projectName: context.projectName,
|
|
162
|
-
projectGraph: context.projectGraph,
|
|
163
|
-
root: context.root,
|
|
164
|
-
}, pathToManifestFile);
|
|
165
|
-
options.staticRemotesPort ??= remotes.staticRemotePort;
|
|
166
|
-
process.env.NX_MF_DEV_REMOTES = JSON.stringify([
|
|
167
|
-
...(remotes.devRemotes.map((r) => typeof r === 'string' ? r : r.remoteName) ?? []),
|
|
168
|
-
projectConfig.name,
|
|
169
|
-
]);
|
|
170
|
-
const staticRemotesConfig = (0, parse_static_remotes_config_1.parseStaticSsrRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
171
|
-
const mappedLocationsOfStaticRemotes = await buildSsrStaticRemotes(staticRemotesConfig, nxBin, context, options);
|
|
172
|
-
const devRemoteIters = await startRemotes(remotes.devRemotes, context, options);
|
|
173
|
-
const staticRemotesIter = startSsrStaticRemotesFileServer(staticRemotesConfig, context, options);
|
|
174
|
-
(0, start_ssr_remote_proxies_1.startSsrRemoteProxies)(staticRemotesConfig, mappedLocationsOfStaticRemotes, options.ssl
|
|
175
|
-
? {
|
|
176
|
-
pathToCert: options.sslCert,
|
|
177
|
-
pathToKey: options.sslKey,
|
|
178
|
-
}
|
|
179
|
-
: undefined);
|
|
31
|
+
const { staticRemotesIter, devRemoteIters, remotes } = await (0, utils_1.startRemoteIterators)(options, context, lib_1.startRemotes, pathToManifestFile, 'react', true);
|
|
180
32
|
const combined = (0, async_iterable_1.combineAsyncIterables)(staticRemotesIter, ...devRemoteIters);
|
|
181
33
|
let refs = 1 + (devRemoteIters?.length ?? 0);
|
|
182
34
|
for await (const result of combined) {
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { WebSsrDevServerOptions } from '@nx/webpack/src/executors/ssr-dev-server/schema';
|
|
2
|
+
import { DevRemoteDefinition } from '@nx/module-federation/src/executors/utils';
|
|
3
|
+
|
|
4
|
+
export type ModuleFederationSsrDevServerOptions = WebSsrDevServerOptions & {
|
|
5
|
+
devRemotes?: (
|
|
6
|
+
| string
|
|
7
|
+
| {
|
|
8
|
+
remoteName: string;
|
|
9
|
+
configuration: string;
|
|
10
|
+
}
|
|
11
|
+
)[];
|
|
12
|
+
|
|
13
|
+
skipRemotes?: string[];
|
|
14
|
+
host: string;
|
|
15
|
+
pathToManifestFile?: string;
|
|
16
|
+
staticRemotesPort?: number;
|
|
17
|
+
parallel?: number;
|
|
18
|
+
ssl?: boolean;
|
|
19
|
+
sslKey?: string;
|
|
20
|
+
sslCert?: string;
|
|
21
|
+
isInitialHost?: boolean;
|
|
22
|
+
verbose?: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export type NormalizedModuleFederationSsrDevServerOptions =
|
|
26
|
+
ModuleFederationSsrDevServerOptions & {
|
|
27
|
+
devRemotes: DevRemoteDefinition[];
|
|
28
|
+
verbose: boolean;
|
|
29
|
+
};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 2,
|
|
3
|
+
"continuous": true,
|
|
3
4
|
"outputCapture": "direct-nodejs",
|
|
4
5
|
"title": "Module Federation SSR Dev Server",
|
|
5
|
-
"description": "Serve a SSR host application along with its known remotes.",
|
|
6
|
+
"description": "Serve a SSR Consumer (host) application along with its known Producers (remotes).",
|
|
6
7
|
"cli": "nx",
|
|
7
8
|
"type": "object",
|
|
8
9
|
"properties": {
|
|
@@ -27,16 +28,18 @@
|
|
|
27
28
|
"items": {
|
|
28
29
|
"type": "string"
|
|
29
30
|
},
|
|
30
|
-
"description": "List of remote applications to run in development mode (i.e. using serve target).",
|
|
31
|
-
"x-priority": "important"
|
|
31
|
+
"description": "List of Producer (remote) applications to run in development mode (i.e. using serve target).",
|
|
32
|
+
"x-priority": "important",
|
|
33
|
+
"alias": "devProducers"
|
|
32
34
|
},
|
|
33
35
|
"skipRemotes": {
|
|
34
36
|
"type": "array",
|
|
35
37
|
"items": {
|
|
36
38
|
"type": "string"
|
|
37
39
|
},
|
|
38
|
-
"description": "List of remote applications to not automatically serve, either statically or in development mode.",
|
|
39
|
-
"x-priority": "important"
|
|
40
|
+
"description": "List of Producer (remote) applications to not automatically serve, either statically or in development mode.",
|
|
41
|
+
"x-priority": "important",
|
|
42
|
+
"alias": "skipProducers"
|
|
40
43
|
},
|
|
41
44
|
"host": {
|
|
42
45
|
"type": "string",
|
|
@@ -45,11 +48,12 @@
|
|
|
45
48
|
},
|
|
46
49
|
"staticRemotesPort": {
|
|
47
50
|
"type": "number",
|
|
48
|
-
"description": "The port at which to serve the file-server for the static remotes."
|
|
51
|
+
"description": "The port at which to serve the file-server for the static Producers (remotes).",
|
|
52
|
+
"alias": "staticProducersPort"
|
|
49
53
|
},
|
|
50
54
|
"pathToManifestFile": {
|
|
51
55
|
"type": "string",
|
|
52
|
-
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic remote applications relative to the workspace root."
|
|
56
|
+
"description": "Path to a Module Federation manifest file (e.g. `my/path/to/module-federation.manifest.json`) containing the dynamic Producer (remote) applications relative to the workspace root."
|
|
53
57
|
},
|
|
54
58
|
"ssl": {
|
|
55
59
|
"type": "boolean",
|
|
@@ -66,9 +70,10 @@
|
|
|
66
70
|
},
|
|
67
71
|
"isInitialHost": {
|
|
68
72
|
"type": "boolean",
|
|
69
|
-
"description": "Whether the host that is running this executor is the first in the project tree to do so.",
|
|
73
|
+
"description": "Whether the Consumer (host) that is running this executor is the first in the project tree to do so.",
|
|
70
74
|
"default": true,
|
|
71
|
-
"x-priority": "internal"
|
|
75
|
+
"x-priority": "internal",
|
|
76
|
+
"alias": "isInitialConsumer"
|
|
72
77
|
}
|
|
73
78
|
},
|
|
74
79
|
"required": ["browserTarget", "serverTarget"]
|
package/src/executors/module-federation-static-server/module-federation-static-server.impl.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ModuleFederationStaticServerSchema } from './schema';
|
|
2
2
|
import { ModuleFederationDevServerOptions } from '../module-federation-dev-server/schema';
|
|
3
3
|
import { ExecutorContext } from 'nx/src/config/misc-interfaces';
|
|
4
|
-
import { StaticRemotesConfig } from '@nx/
|
|
4
|
+
import { StaticRemotesConfig } from '@nx/module-federation/src/utils';
|
|
5
5
|
export declare function startProxies(staticRemotesConfig: StaticRemotesConfig, hostServeOptions: ModuleFederationDevServerOptions, mappedLocationOfHost: string, mappedLocationsOfRemotes: Record<string, string>, sslOptions?: {
|
|
6
6
|
pathToCert: string;
|
|
7
7
|
pathToKey: string;
|
|
@@ -9,4 +9,4 @@ export declare function startProxies(staticRemotesConfig: StaticRemotesConfig, h
|
|
|
9
9
|
export default function moduleFederationStaticServer(schema: ModuleFederationStaticServerSchema, context: ExecutorContext): AsyncGenerator<{
|
|
10
10
|
success: boolean;
|
|
11
11
|
baseUrl: string;
|
|
12
|
-
}, any,
|
|
12
|
+
}, any, any>;
|
package/src/executors/module-federation-static-server/module-federation-static-server.impl.js
CHANGED
|
@@ -5,9 +5,8 @@ exports.default = moduleFederationStaticServer;
|
|
|
5
5
|
const path_1 = require("path");
|
|
6
6
|
const devkit_1 = require("@nx/devkit");
|
|
7
7
|
const fs_1 = require("fs");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const build_static_remotes_1 = require("../../utils/build-static.remotes");
|
|
8
|
+
const utils_1 = require("@nx/module-federation/src/utils");
|
|
9
|
+
const utils_2 = require("@nx/module-federation/src/executors/utils");
|
|
11
10
|
const child_process_1 = require("child_process");
|
|
12
11
|
const process = require("node:process");
|
|
13
12
|
const file_server_impl_1 = require("@nx/web/src/executors/file-server/file-server.impl");
|
|
@@ -59,7 +58,7 @@ async function buildHost(nxBin, buildTarget, context) {
|
|
|
59
58
|
}
|
|
60
59
|
if (stdoutString.includes('Successfully ran target build')) {
|
|
61
60
|
staticProcess.stdout.removeAllListeners('data');
|
|
62
|
-
devkit_1.logger.info(`NX Built host`);
|
|
61
|
+
devkit_1.logger.info(`NX Built Consumer (host)`);
|
|
63
62
|
res();
|
|
64
63
|
}
|
|
65
64
|
});
|
|
@@ -68,7 +67,7 @@ async function buildHost(nxBin, buildTarget, context) {
|
|
|
68
67
|
staticProcess.stdout.removeAllListeners('data');
|
|
69
68
|
staticProcess.stderr.removeAllListeners('data');
|
|
70
69
|
if (code !== 0) {
|
|
71
|
-
rej(`
|
|
70
|
+
rej(`Consumer (host) failed to build. See above for details.`);
|
|
72
71
|
}
|
|
73
72
|
else {
|
|
74
73
|
res();
|
|
@@ -133,8 +132,8 @@ function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHos
|
|
|
133
132
|
process.on('SIGTERM', () => proxyServer.close());
|
|
134
133
|
process.on('exit', () => proxyServer.close());
|
|
135
134
|
}
|
|
136
|
-
devkit_1.logger.info(`NX Static remotes proxies started successfully`);
|
|
137
|
-
devkit_1.logger.info(`NX Starting static host proxy...`);
|
|
135
|
+
devkit_1.logger.info(`NX Static Producers (remotes) proxies started successfully`);
|
|
136
|
+
devkit_1.logger.info(`NX Starting static Consumer (host) proxy...`);
|
|
138
137
|
const expressProxy = express();
|
|
139
138
|
expressProxy.use(createProxyMiddleware({
|
|
140
139
|
target: mappedLocationOfHost,
|
|
@@ -156,7 +155,7 @@ function startProxies(staticRemotesConfig, hostServeOptions, mappedLocationOfHos
|
|
|
156
155
|
.listen(hostServeOptions.port);
|
|
157
156
|
process.on('SIGTERM', () => proxyServer.close());
|
|
158
157
|
process.on('exit', () => proxyServer.close());
|
|
159
|
-
devkit_1.logger.info('NX Static host proxy started successfully');
|
|
158
|
+
devkit_1.logger.info('NX Static Consumer (host) proxy started successfully');
|
|
160
159
|
}
|
|
161
160
|
async function* moduleFederationStaticServer(schema, context) {
|
|
162
161
|
// Force Node to resolve to look for the nx binary that is inside node_modules
|
|
@@ -164,15 +163,15 @@ async function* moduleFederationStaticServer(schema, context) {
|
|
|
164
163
|
// Get the remotes from the module federation config
|
|
165
164
|
const p = context.projectsConfigurations.projects[context.projectName];
|
|
166
165
|
const options = getBuildAndServeOptionsFromServeTarget(schema.serveTarget, context);
|
|
167
|
-
const moduleFederationConfig = (0,
|
|
168
|
-
const remotes = (0,
|
|
166
|
+
const moduleFederationConfig = (0, utils_1.getModuleFederationConfig)(options.buildOptions.tsConfig, context.root, p.root, 'react');
|
|
167
|
+
const remotes = (0, utils_1.getRemotes)([], options.serveOptions.skipRemotes, moduleFederationConfig, {
|
|
169
168
|
projectName: context.projectName,
|
|
170
169
|
projectGraph: context.projectGraph,
|
|
171
170
|
root: context.root,
|
|
172
171
|
}, options.pathToManifestFile);
|
|
173
|
-
const staticRemotesConfig = (0,
|
|
172
|
+
const staticRemotesConfig = (0, utils_1.parseStaticRemotesConfig)([...remotes.staticRemotes, ...remotes.dynamicRemotes], context);
|
|
174
173
|
options.serveOptions.staticRemotesPort ??= remotes.staticRemotePort;
|
|
175
|
-
const mappedLocationsOfStaticRemotes = await (0,
|
|
174
|
+
const mappedLocationsOfStaticRemotes = await (0, utils_2.buildStaticRemotes)(staticRemotesConfig, nxBin, context, options.serveOptions);
|
|
176
175
|
// Build the host
|
|
177
176
|
const hostUrlSegment = (0, path_1.basename)(options.buildOptions.outputPath);
|
|
178
177
|
const mappedLocationOfHost = `http${options.serveOptions.ssl ? 's' : ''}://${options.serveOptions.host}:${options.serveOptions.staticRemotesPort}/${hostUrlSegment}`;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 2,
|
|
3
|
+
"continuous": true,
|
|
3
4
|
"outputCapture": "direct-nodejs",
|
|
4
5
|
"title": "Module Federation Static Dev Server",
|
|
5
|
-
"description": "Serve a host application statically along with
|
|
6
|
+
"description": "Serve a Consumer (host) application statically along with its Producers (remotes).",
|
|
6
7
|
"cli": "nx",
|
|
7
8
|
"type": "object",
|
|
8
9
|
"properties": {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Schema } from './schema';
|
|
2
1
|
import { GeneratorCallback, Tree } from '@nx/devkit';
|
|
3
|
-
|
|
4
|
-
export declare function
|
|
2
|
+
import { Schema } from './schema';
|
|
3
|
+
export declare function applicationGenerator(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
4
|
+
export declare function applicationGeneratorInternal(tree: Tree, schema: Schema): Promise<GeneratorCallback>;
|
|
5
5
|
export default applicationGenerator;
|