@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "<%= projectName %>",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {},
|
|
6
|
+
"dependencies": {
|
|
7
|
+
"@react-router/node": "<%= reactRouterVersion %>",
|
|
8
|
+
"@react-router/serve": "<%= reactRouterVersion %>",
|
|
9
|
+
"isbot": "<%= reactRouterIsBotVersion %>",
|
|
10
|
+
"react": "<%= reactVersion %>",
|
|
11
|
+
"react-dom": "<%= reactVersion %>",
|
|
12
|
+
"react-router": "<%= reactRouterVersion %>"
|
|
13
|
+
},
|
|
14
|
+
"devDependencies": {
|
|
15
|
+
"@react-router/dev": "<%= reactRouterVersion %>",
|
|
16
|
+
"@types/node": "<%= typesNodeVersion %>",
|
|
17
|
+
"@types/react": "<%= reactVersion %>",
|
|
18
|
+
"@types/react-dom": "<%= reactVersion %>"
|
|
19
|
+
},
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
}
|
package/src/generators/application/files/react-router-ssr/ts-solution/tsconfig.app.json__tmpl__
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "<%= offsetFromRoot %>tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "dist",
|
|
5
|
+
"lib": ["DOM", "DOM.Iterable", "ES2019"],
|
|
6
|
+
"types": ["@react-router/node", "vite/client"],
|
|
7
|
+
"isolatedModules": true,
|
|
8
|
+
"esModuleInterop": true,
|
|
9
|
+
"jsx": "react-jsx",
|
|
10
|
+
"module": "ESNext",
|
|
11
|
+
"moduleResolution": "Bundler",
|
|
12
|
+
"resolveJsonModule": true,
|
|
13
|
+
"target": "ES2022",
|
|
14
|
+
"strict": true,
|
|
15
|
+
"allowJs": true,
|
|
16
|
+
"skipLibCheck": true,
|
|
17
|
+
"forceConsistentCasingInFileNames": true
|
|
18
|
+
},
|
|
19
|
+
"include": [
|
|
20
|
+
"app/**/*.ts",
|
|
21
|
+
"app/**/*.tsx",
|
|
22
|
+
"app/**/*.js",
|
|
23
|
+
"app/**/*.jsx",
|
|
24
|
+
"**/.server/**/*.ts",
|
|
25
|
+
"**/.server/**/*.tsx",
|
|
26
|
+
"**/.client/**/*.ts",
|
|
27
|
+
"**/.client/**/*.tsx"
|
|
28
|
+
],
|
|
29
|
+
"exclude": [
|
|
30
|
+
"tests/**/*.spec.ts",
|
|
31
|
+
"tests/**/*.test.ts",
|
|
32
|
+
"tests/**/*.spec.tsx",
|
|
33
|
+
"tests/**/*.test.tsx",
|
|
34
|
+
"tests/**/*.spec.js",
|
|
35
|
+
"tests/**/*.test.js",
|
|
36
|
+
"tests/**/*.spec.jsx",
|
|
37
|
+
"tests/**/*.test.jsx"
|
|
38
|
+
]
|
|
39
|
+
}
|
|
@@ -1,35 +1,45 @@
|
|
|
1
1
|
<% if (classComponent) { %>
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
<% } %>
|
|
4
|
-
//
|
|
5
|
-
import styles from './<%= fileName %>.module.<%= style %>';
|
|
6
|
-
<% if (!minimal) { %>
|
|
3
|
+
<%_ } _%>
|
|
4
|
+
// Uncomment this line to use CSS modules
|
|
5
|
+
// import styles from './<%= fileName %>.module.<%= style %>';
|
|
6
|
+
<%_ if (!minimal) { _%>
|
|
7
7
|
import NxWelcome from "./nx-welcome";
|
|
8
|
-
<% } %>
|
|
8
|
+
<%_ } _%>
|
|
9
9
|
|
|
10
|
-
<% if (classComponent) { %>
|
|
10
|
+
<%_ if (classComponent) { _%>
|
|
11
11
|
export class App extends Component {
|
|
12
|
-
render() {
|
|
13
|
-
|
|
12
|
+
override render() {
|
|
13
|
+
return (
|
|
14
|
+
<div>
|
|
15
|
+
<%_ if (!minimal) { _%>
|
|
16
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
17
|
+
<%_ } else { _%>
|
|
18
|
+
<h1>
|
|
19
|
+
<span> Hello there, </span>
|
|
20
|
+
Welcome <%= projectName %> 👋
|
|
21
|
+
</h1>
|
|
22
|
+
<%_ } _%>
|
|
23
|
+
</div>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
<%_ } else { _%>
|
|
14
28
|
export function App() {
|
|
15
|
-
<% } %>
|
|
16
29
|
return (
|
|
17
30
|
<div>
|
|
18
|
-
|
|
31
|
+
<%_ if (!minimal) { _%>
|
|
19
32
|
<NxWelcome title="<%= projectName %>"/>
|
|
20
|
-
|
|
33
|
+
<%_ } else { _%>
|
|
21
34
|
<h1>
|
|
22
35
|
<span> Hello there, </span>
|
|
23
36
|
Welcome <%= projectName %> 👋
|
|
24
37
|
</h1>
|
|
25
|
-
|
|
26
|
-
</div>
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
<% } else { %>
|
|
38
|
+
<%_ } _%>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
31
41
|
}
|
|
32
|
-
<% } %>
|
|
42
|
+
<%_ } _%>
|
|
33
43
|
|
|
34
44
|
export default App;
|
|
35
45
|
|
|
@@ -1,35 +1,44 @@
|
|
|
1
|
-
<% if (classComponent) { %>
|
|
1
|
+
<%_ if (classComponent) { _%>
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
<% } %>
|
|
3
|
+
<%_ } _%>
|
|
4
4
|
import './<%= fileName %>.<%= style %>';
|
|
5
|
-
<% if (!minimal) { %>
|
|
5
|
+
<%_ if (!minimal) { _%>
|
|
6
6
|
import NxWelcome from "./nx-welcome";
|
|
7
|
-
<% } %>
|
|
7
|
+
<%_ } _%>
|
|
8
8
|
|
|
9
|
-
<% if (classComponent) { %>
|
|
9
|
+
<%_ if (classComponent) { _%>
|
|
10
10
|
export class App extends Component {
|
|
11
|
-
render() {
|
|
12
|
-
|
|
11
|
+
override render() {
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<%_ if (!minimal) { _%>
|
|
15
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
16
|
+
<%_ } else { _%>
|
|
17
|
+
<h1>
|
|
18
|
+
<span> Hello there, </span>
|
|
19
|
+
Welcome <%= projectName %> 👋
|
|
20
|
+
</h1>
|
|
21
|
+
<%_ } _%>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
<%_ } else { _%>
|
|
13
27
|
export function App() {
|
|
14
|
-
<% } %>
|
|
15
28
|
return (
|
|
16
|
-
|
|
17
|
-
<% if (!minimal) { %>
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
<div>
|
|
30
|
+
<%_ if (!minimal) { _%>
|
|
31
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
32
|
+
<%_ } else { _%>
|
|
20
33
|
<h1>
|
|
21
34
|
<span> Hello there, </span>
|
|
22
35
|
Welcome <%= projectName %> 👋
|
|
23
36
|
</h1>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
37
|
+
<%_ } _%>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
28
40
|
}
|
|
29
|
-
<% }
|
|
30
|
-
}
|
|
31
|
-
<% } %>
|
|
32
|
-
|
|
41
|
+
<%_ } _%>
|
|
33
42
|
export default App;
|
|
34
43
|
|
|
35
44
|
<% if (inSourceTests === true) { %> <%- inSourceVitestTests %> <% } %>
|
|
@@ -1,33 +1,43 @@
|
|
|
1
|
-
<% if (classComponent) { %>
|
|
1
|
+
<%_ if (classComponent) { _%>
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
<% } %>
|
|
4
|
-
<% if (!minimal) { %>
|
|
3
|
+
<%_ } _%>
|
|
4
|
+
<%_ if (!minimal) { _%>
|
|
5
5
|
import NxWelcome from "./nx-welcome";
|
|
6
|
-
<% } %>
|
|
6
|
+
<%_ } _%>
|
|
7
7
|
|
|
8
|
-
<% if (classComponent) { %>
|
|
8
|
+
<%_ if (classComponent) { _%>
|
|
9
9
|
export class App extends Component {
|
|
10
10
|
override render() {
|
|
11
|
-
|
|
11
|
+
return (
|
|
12
|
+
<div>
|
|
13
|
+
<%_ if (!minimal) { _%>
|
|
14
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
15
|
+
<%_ } else { _%>
|
|
16
|
+
<h1>
|
|
17
|
+
<span> Hello there, </span>
|
|
18
|
+
Welcome <%= projectName %> 👋
|
|
19
|
+
</h1>
|
|
20
|
+
<%_ } _%>
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
<%_ } else { _%>
|
|
12
26
|
export function App() {
|
|
13
|
-
<% } %>
|
|
14
27
|
return (
|
|
15
28
|
<div>
|
|
16
|
-
|
|
29
|
+
<%_ if (!minimal) { _%>
|
|
17
30
|
<NxWelcome title="<%= projectName %>"/>
|
|
18
|
-
|
|
31
|
+
<%_ } else { _%>
|
|
19
32
|
<h1>
|
|
20
33
|
<span> Hello there, </span>
|
|
21
34
|
Welcome <%= projectName %> 👋
|
|
22
35
|
</h1>
|
|
23
|
-
|
|
24
|
-
</div>
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
<% } else { %>
|
|
36
|
+
<%_ } _%>
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
29
39
|
}
|
|
30
|
-
<% } %>
|
|
40
|
+
<%_ } _%>
|
|
31
41
|
|
|
32
42
|
export default App;
|
|
33
43
|
|
|
@@ -1,36 +1,45 @@
|
|
|
1
|
-
<% if (classComponent) { %>
|
|
1
|
+
<%_ if (classComponent) { _%>
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
<% } %>
|
|
4
|
-
<% if (!minimal) { %>
|
|
3
|
+
<%_ } _%>
|
|
4
|
+
<%_ if (!minimal) { _%>
|
|
5
5
|
import NxWelcome from "./nx-welcome";
|
|
6
|
-
<% } %>
|
|
6
|
+
<%_ } _%>
|
|
7
7
|
|
|
8
|
-
<% if (classComponent) { %>
|
|
8
|
+
<%_ if (classComponent) { _%>
|
|
9
9
|
export class App extends Component {
|
|
10
|
-
render() {
|
|
11
|
-
|
|
10
|
+
override render() {
|
|
11
|
+
return (
|
|
12
|
+
<div>
|
|
13
|
+
<style jsx>{`/** your style here **/`}</style>
|
|
14
|
+
<%_ if (!minimal) { _%>
|
|
15
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
16
|
+
<%_ } else { _%>
|
|
17
|
+
<h1>
|
|
18
|
+
<span> Hello there, </span>
|
|
19
|
+
Welcome <%= projectName %> 👋
|
|
20
|
+
</h1>
|
|
21
|
+
<%_ } _%>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
<%_ } else { _%>
|
|
12
27
|
export function App() {
|
|
13
|
-
<% } %>
|
|
14
28
|
return (
|
|
15
29
|
<div>
|
|
16
30
|
<style jsx>{`/** your style here **/`}</style>
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
31
|
+
<%_ if (!minimal) { _%>
|
|
32
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
33
|
+
<%_ } else { _%>
|
|
34
|
+
<h1>
|
|
35
|
+
<span> Hello there, </span>
|
|
36
|
+
Welcome <%= projectName %> 👋
|
|
37
|
+
</h1>
|
|
38
|
+
<%_ } _%>
|
|
25
39
|
</div>
|
|
26
40
|
);
|
|
27
|
-
|
|
28
|
-
<% if (classComponent) { %>
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
<% } else { %>
|
|
32
41
|
}
|
|
33
|
-
<% } %>
|
|
42
|
+
<%_ } _%>
|
|
34
43
|
|
|
35
44
|
export default App;
|
|
36
45
|
|
package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__
CHANGED
|
@@ -1,39 +1,48 @@
|
|
|
1
|
-
<% if (classComponent) { %>
|
|
1
|
+
<%_ if (classComponent) { _%>
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
<% } %>
|
|
3
|
+
<%_ } _%>
|
|
4
4
|
import styled from '<%= styledModule %>';
|
|
5
|
-
<% if (!minimal) { %>
|
|
5
|
+
<%_ if (!minimal) { _%>
|
|
6
6
|
import NxWelcome from "./nx-welcome";
|
|
7
|
-
<% } %>
|
|
7
|
+
<%_ } _%>
|
|
8
8
|
|
|
9
9
|
const StyledApp = styled.div`
|
|
10
10
|
// Your style here
|
|
11
11
|
`;
|
|
12
12
|
|
|
13
|
-
<% if (classComponent) { %>
|
|
13
|
+
<%_ if (classComponent) { _%>
|
|
14
14
|
export class App extends Component {
|
|
15
|
-
render() {
|
|
16
|
-
|
|
17
|
-
export function App() {
|
|
18
|
-
<% } %>
|
|
19
|
-
return (
|
|
15
|
+
override render() {
|
|
16
|
+
return (
|
|
20
17
|
<StyledApp>
|
|
21
|
-
<% if (!minimal) { %>
|
|
18
|
+
<%_ if (!minimal) { _%>
|
|
22
19
|
<NxWelcome title="<%= projectName %>"/>
|
|
23
|
-
<% } else { %>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<% } %>
|
|
20
|
+
<%_ } else { _%>
|
|
21
|
+
<h1>
|
|
22
|
+
<span> Hello there, </span>
|
|
23
|
+
Welcome <%= projectName %> 👋
|
|
24
|
+
</h1>
|
|
25
|
+
<%_ } _%>
|
|
29
26
|
</StyledApp>
|
|
30
|
-
|
|
31
|
-
<% if (classComponent) { %>
|
|
27
|
+
);
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
|
-
<% } else { %>
|
|
30
|
+
<%_ } else { _%>
|
|
31
|
+
export function App() {
|
|
32
|
+
return (
|
|
33
|
+
<StyledApp>
|
|
34
|
+
<%_ if (!minimal) { _%>
|
|
35
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
36
|
+
<%_ } else { _%>
|
|
37
|
+
<h1>
|
|
38
|
+
<span> Hello there, </span>
|
|
39
|
+
Welcome <%= projectName %> 👋
|
|
40
|
+
</h1>
|
|
41
|
+
<%_ } _%>
|
|
42
|
+
</StyledApp>
|
|
43
|
+
);
|
|
35
44
|
}
|
|
36
|
-
<% } %>
|
|
45
|
+
<%_ } _%>
|
|
37
46
|
|
|
38
47
|
export default App;
|
|
39
48
|
|
|
@@ -1,34 +1,44 @@
|
|
|
1
|
-
<% if (classComponent) { %>
|
|
1
|
+
<%_ if (classComponent) { _%>
|
|
2
2
|
import { Component } from 'react';
|
|
3
|
-
<% } if (!minimal) { %>
|
|
3
|
+
<%_ } if (!minimal) { _%>
|
|
4
4
|
import NxWelcome from "./nx-welcome";
|
|
5
|
-
<% } if (bundler === "rspack") { %>
|
|
5
|
+
<%_ } if (bundler === "rspack" || bundler === 'rsbuild') { _%>
|
|
6
6
|
import '../styles.css';
|
|
7
|
-
<% } %>
|
|
7
|
+
<%_ } _%>
|
|
8
8
|
|
|
9
|
-
<% if (classComponent) { %>
|
|
9
|
+
<%_ if (classComponent) { _%>
|
|
10
10
|
export class App extends Component {
|
|
11
|
-
render() {
|
|
12
|
-
|
|
11
|
+
override render() {
|
|
12
|
+
return (
|
|
13
|
+
<div>
|
|
14
|
+
<%_ if (!minimal) { _%>
|
|
15
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
16
|
+
<%_ } else { _%>
|
|
17
|
+
<h1>
|
|
18
|
+
<span> Hello there, </span>
|
|
19
|
+
Welcome <%= projectName %> 👋
|
|
20
|
+
</h1>
|
|
21
|
+
<%_ } _%>
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
<%_ } else { _%>
|
|
13
27
|
export function App() {
|
|
14
|
-
<% } %>
|
|
15
28
|
return (
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
29
|
+
<div>
|
|
30
|
+
<%_ if (!minimal) { _%>
|
|
31
|
+
<NxWelcome title="<%= projectName %>"/>
|
|
32
|
+
<%_ } else { _%>
|
|
20
33
|
<h1>
|
|
21
34
|
<span> Hello there, </span>
|
|
22
35
|
Welcome <%= projectName %> 👋
|
|
23
36
|
</h1>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
<% } else { %>
|
|
37
|
+
<%_ } _%>
|
|
38
|
+
</div>
|
|
39
|
+
);
|
|
30
40
|
}
|
|
31
|
-
<% } %>
|
|
41
|
+
<%_ } _%>
|
|
32
42
|
|
|
33
43
|
export default App;
|
|
34
44
|
|
|
@@ -6,10 +6,13 @@ const web_1 = require("@nx/web");
|
|
|
6
6
|
const versions_1 = require("../../../utils/versions");
|
|
7
7
|
const has_webpack_plugin_1 = require("../../../utils/has-webpack-plugin");
|
|
8
8
|
const has_vite_plugin_1 = require("../../../utils/has-vite-plugin");
|
|
9
|
-
const
|
|
10
|
-
const
|
|
9
|
+
const has_rspack_plugin_1 = require("../../../utils/has-rspack-plugin");
|
|
10
|
+
const has_rsbuild_plugin_1 = require("../../../utils/has-rsbuild-plugin");
|
|
11
11
|
async function addE2e(tree, options) {
|
|
12
12
|
const hasNxBuildPlugin = (options.bundler === 'webpack' && (0, has_webpack_plugin_1.hasWebpackPlugin)(tree)) ||
|
|
13
|
+
(options.bundler === 'rspack' && (0, has_rspack_plugin_1.hasRspackPlugin)(tree)) ||
|
|
14
|
+
(options.bundler === 'rsbuild' &&
|
|
15
|
+
(await (0, has_rsbuild_plugin_1.hasRsbuildPlugin)(tree, options.appProjectRoot))) ||
|
|
13
16
|
(options.bundler === 'vite' && (0, has_vite_plugin_1.hasVitePlugin)(tree));
|
|
14
17
|
let e2eWebServerInfo = {
|
|
15
18
|
e2eWebServerAddress: `http://localhost:${options.devServerPort ?? 4200}`,
|
|
@@ -22,9 +25,20 @@ async function addE2e(tree, options) {
|
|
|
22
25
|
const { getWebpackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/webpack', versions_1.nxVersion);
|
|
23
26
|
e2eWebServerInfo = await getWebpackE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `webpack.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.devServerPort ?? 4200);
|
|
24
27
|
}
|
|
28
|
+
else if (options.bundler === 'rspack') {
|
|
29
|
+
const { getRspackE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/rspack', versions_1.nxVersion);
|
|
30
|
+
e2eWebServerInfo = await getRspackE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `rspack.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.devServerPort ?? 4200);
|
|
31
|
+
}
|
|
25
32
|
else if (options.bundler === 'vite') {
|
|
26
|
-
const { getViteE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
27
|
-
e2eWebServerInfo =
|
|
33
|
+
const { getViteE2EWebServerInfo, getReactRouterE2EWebServerInfo } = (0, devkit_1.ensurePackage)('@nx/vite', versions_1.nxVersion);
|
|
34
|
+
e2eWebServerInfo = options.useReactRouter
|
|
35
|
+
? await getReactRouterE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.devServerPort ?? 4200)
|
|
36
|
+
: await getViteE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `vite.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.devServerPort ?? 4200);
|
|
37
|
+
}
|
|
38
|
+
else if (options.bundler === 'rsbuild') {
|
|
39
|
+
(0, devkit_1.ensurePackage)('@nx/rsbuild', versions_1.nxVersion);
|
|
40
|
+
const { getRsbuildE2EWebServerInfo } = await Promise.resolve().then(() => require('@nx/rsbuild/config-utils'));
|
|
41
|
+
e2eWebServerInfo = await getRsbuildE2EWebServerInfo(tree, options.projectName, (0, devkit_1.joinPathFragments)(options.appProjectRoot, `rsbuild.config.${options.js ? 'js' : 'ts'}`), options.addPlugin, options.devServerPort ?? 4200);
|
|
28
42
|
}
|
|
29
43
|
if (!hasNxBuildPlugin) {
|
|
30
44
|
await (0, web_1.webStaticServeGenerator)(tree, {
|
|
@@ -36,65 +50,78 @@ async function addE2e(tree, options) {
|
|
|
36
50
|
switch (options.e2eTestRunner) {
|
|
37
51
|
case 'cypress': {
|
|
38
52
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/cypress', versions_1.nxVersion);
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
53
|
+
const packageJson = {
|
|
54
|
+
name: options.e2eProjectName,
|
|
55
|
+
version: '0.0.1',
|
|
56
|
+
private: true,
|
|
57
|
+
};
|
|
58
|
+
if (!options.useProjectJson) {
|
|
59
|
+
packageJson.nx = {
|
|
60
|
+
implicitDependencies: [options.projectName],
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
65
|
+
projectType: 'application',
|
|
66
|
+
root: options.e2eProjectRoot,
|
|
67
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
68
|
+
targets: {},
|
|
69
|
+
implicitDependencies: [options.projectName],
|
|
70
|
+
tags: [],
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
74
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
75
|
+
}
|
|
47
76
|
const e2eTask = await configurationGenerator(tree, {
|
|
48
77
|
...options,
|
|
49
78
|
project: options.e2eProjectName,
|
|
50
79
|
directory: 'src',
|
|
51
80
|
// the name and root are already normalized, instruct the generator to use them as is
|
|
52
|
-
bundler: options.bundler === 'rspack'
|
|
81
|
+
bundler: options.bundler === 'rspack'
|
|
82
|
+
? 'webpack'
|
|
83
|
+
: options.bundler === 'rsbuild'
|
|
84
|
+
? 'none'
|
|
85
|
+
: options.bundler,
|
|
53
86
|
skipFormat: true,
|
|
54
87
|
devServerTarget: e2eWebServerInfo.e2eDevServerTarget,
|
|
55
88
|
baseUrl: e2eWebServerInfo.e2eWebServerAddress,
|
|
56
89
|
jsx: true,
|
|
57
90
|
rootProject: options.rootProject,
|
|
58
|
-
webServerCommands:
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
: undefined,
|
|
64
|
-
ciWebServerCommand: hasNxBuildPlugin
|
|
65
|
-
? e2eWebServerInfo.e2eCiWebServerCommand
|
|
66
|
-
: undefined,
|
|
91
|
+
webServerCommands: {
|
|
92
|
+
default: e2eWebServerInfo.e2eWebServerCommand,
|
|
93
|
+
production: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
94
|
+
},
|
|
95
|
+
ciWebServerCommand: e2eWebServerInfo.e2eCiWebServerCommand,
|
|
67
96
|
ciBaseUrl: e2eWebServerInfo.e2eCiBaseUrl,
|
|
68
97
|
});
|
|
69
|
-
if (options.addPlugin ||
|
|
70
|
-
(0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
|
71
|
-
? p === '@nx/cypress/plugin'
|
|
72
|
-
: p.plugin === '@nx/cypress/plugin')) {
|
|
73
|
-
let buildTarget = '^build';
|
|
74
|
-
if (hasNxBuildPlugin) {
|
|
75
|
-
const configFile = options.bundler === 'webpack'
|
|
76
|
-
? 'webpack.config.js'
|
|
77
|
-
: options.bundler === 'vite'
|
|
78
|
-
? `vite.config.${options.js ? 'js' : 'ts'}`
|
|
79
|
-
: 'webpack.config.js';
|
|
80
|
-
const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/${options.bundler}/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, configFile));
|
|
81
|
-
if (matchingPlugin && typeof matchingPlugin !== 'string') {
|
|
82
|
-
buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/cypress/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `cypress.config.${options.js ? 'js' : 'ts'}`));
|
|
86
|
-
}
|
|
87
98
|
return e2eTask;
|
|
88
99
|
}
|
|
89
100
|
case 'playwright': {
|
|
90
101
|
const { configurationGenerator } = (0, devkit_1.ensurePackage)('@nx/playwright', versions_1.nxVersion);
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
102
|
+
const packageJson = {
|
|
103
|
+
name: options.e2eProjectName,
|
|
104
|
+
version: '0.0.1',
|
|
105
|
+
private: true,
|
|
106
|
+
};
|
|
107
|
+
if (!options.useProjectJson) {
|
|
108
|
+
packageJson.nx = {
|
|
109
|
+
implicitDependencies: [options.projectName],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
else {
|
|
113
|
+
(0, devkit_1.addProjectConfiguration)(tree, options.e2eProjectName, {
|
|
114
|
+
projectType: 'application',
|
|
115
|
+
root: options.e2eProjectRoot,
|
|
116
|
+
sourceRoot: (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'src'),
|
|
117
|
+
targets: {},
|
|
118
|
+
implicitDependencies: [options.projectName],
|
|
119
|
+
tags: [],
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
if (!options.useProjectJson || options.isUsingTsSolutionConfig) {
|
|
123
|
+
(0, devkit_1.writeJson)(tree, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, 'package.json'), packageJson);
|
|
124
|
+
}
|
|
98
125
|
const e2eTask = await configurationGenerator(tree, {
|
|
99
126
|
project: options.e2eProjectName,
|
|
100
127
|
skipFormat: true,
|
|
@@ -108,24 +135,6 @@ async function addE2e(tree, options) {
|
|
|
108
135
|
rootProject: options.rootProject,
|
|
109
136
|
addPlugin: options.addPlugin,
|
|
110
137
|
});
|
|
111
|
-
if (options.addPlugin ||
|
|
112
|
-
(0, devkit_1.readNxJson)(tree).plugins?.find((p) => typeof p === 'string'
|
|
113
|
-
? p === '@nx/playwright/plugin'
|
|
114
|
-
: p.plugin === '@nx/playwright/plugin')) {
|
|
115
|
-
let buildTarget = '^build';
|
|
116
|
-
if (hasNxBuildPlugin) {
|
|
117
|
-
const configFile = options.bundler === 'webpack'
|
|
118
|
-
? 'webpack.config.js'
|
|
119
|
-
: options.bundler === 'vite'
|
|
120
|
-
? `vite.config.${options.js ? 'js' : 'ts'}`
|
|
121
|
-
: 'webpack.config.js';
|
|
122
|
-
const matchingPlugin = await (0, find_plugin_for_config_file_1.findPluginForConfigFile)(tree, `@nx/${options.bundler}/plugin`, (0, devkit_1.joinPathFragments)(options.appProjectRoot, configFile));
|
|
123
|
-
if (matchingPlugin && typeof matchingPlugin !== 'string') {
|
|
124
|
-
buildTarget = `^${matchingPlugin.options?.buildTargetName ?? 'build'}`;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
await (0, target_defaults_utils_1.addE2eCiTargetDefaults)(tree, '@nx/playwright/plugin', buildTarget, (0, devkit_1.joinPathFragments)(options.e2eProjectRoot, `playwright.config.ts`));
|
|
128
|
-
}
|
|
129
138
|
return e2eTask;
|
|
130
139
|
}
|
|
131
140
|
case 'none':
|