@nx/react 0.0.0-pr-22179-271588f
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 +22 -0
- package/README.md +68 -0
- package/ast-utils.d.ts +1 -0
- package/ast-utils.js +11 -0
- package/babel.d.ts +20 -0
- package/babel.js +50 -0
- package/executors.json +14 -0
- package/generators.json +112 -0
- package/index.d.ts +22 -0
- package/index.js +47 -0
- package/mf/dynamic-federation.d.ts +4 -0
- package/mf/dynamic-federation.js +75 -0
- package/mf/index.d.ts +1 -0
- package/mf/index.js +7 -0
- package/migrations.json +310 -0
- package/module-federation.d.ts +4 -0
- package/module-federation.js +12 -0
- package/package.json +49 -0
- package/plugins/bundle-rollup.d.ts +1 -0
- package/plugins/bundle-rollup.js +47 -0
- package/plugins/component-testing/index.d.ts +37 -0
- package/plugins/component-testing/index.js +222 -0
- package/plugins/component-testing/webpack-fallback.d.ts +5 -0
- package/plugins/component-testing/webpack-fallback.js +125 -0
- package/plugins/jest.d.ts +1 -0
- package/plugins/jest.js +59 -0
- package/plugins/nx-react-webpack-plugin/lib/apply-react-config.d.ts +4 -0
- package/plugins/nx-react-webpack-plugin/lib/apply-react-config.js +60 -0
- package/plugins/nx-react-webpack-plugin/nx-react-webpack-plugin.d.ts +8 -0
- package/plugins/nx-react-webpack-plugin/nx-react-webpack-plugin.js +13 -0
- package/plugins/storybook/index.d.ts +3 -0
- package/plugins/storybook/index.js +174 -0
- package/plugins/storybook/merge-plugins.d.ts +3 -0
- package/plugins/storybook/merge-plugins.js +17 -0
- package/plugins/webpack.d.ts +1 -0
- package/plugins/webpack.js +6 -0
- package/plugins/with-react.d.ts +10 -0
- package/plugins/with-react.js +22 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +25 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +211 -0
- package/src/executors/module-federation-dev-server/schema.json +114 -0
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +9 -0
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +106 -0
- package/src/executors/module-federation-ssr-dev-server/schema.json +48 -0
- package/src/generators/application/application.d.ts +5 -0
- package/src/generators/application/application.js +232 -0
- package/src/generators/application/files/base-rspack/src/app/__fileName__.spec.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-rspack/src/assets/.gitkeep +0 -0
- package/src/generators/application/files/base-rspack/src/favicon.ico +0 -0
- package/src/generators/application/files/base-rspack/src/index.html +14 -0
- package/src/generators/application/files/base-rspack/src/main.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-rspack/tsconfig.app.json__tmpl__ +14 -0
- package/src/generators/application/files/base-vite/index.html__tmpl__ +16 -0
- package/src/generators/application/files/base-vite/public/favicon.ico +0 -0
- package/src/generators/application/files/base-vite/src/app/__fileName__.spec.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-vite/src/assets/.gitkeep +0 -0
- package/src/generators/application/files/base-vite/src/environments/environment.prod.ts__tmpl__ +3 -0
- package/src/generators/application/files/base-vite/src/environments/environment.ts__tmpl__ +6 -0
- package/src/generators/application/files/base-vite/src/main.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-vite/tsconfig.app.json__tmpl__ +14 -0
- package/src/generators/application/files/base-webpack/src/app/__fileName__.spec.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-webpack/src/assets/.gitkeep +0 -0
- package/src/generators/application/files/base-webpack/src/favicon.ico +0 -0
- package/src/generators/application/files/base-webpack/src/index.html +12 -0
- package/src/generators/application/files/base-webpack/src/main.tsx__tmpl__ +10 -0
- package/src/generators/application/files/base-webpack/tsconfig.app.json__tmpl__ +14 -0
- package/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +50 -0
- package/src/generators/application/files/nx-welcome/src/app/nx-welcome.tsx +886 -0
- package/src/generators/application/files/style-css-module/src/app/__fileName__.module.__style__ +1 -0
- package/src/generators/application/files/style-css-module/src/app/__fileName__.tsx__tmpl__ +36 -0
- package/src/generators/application/files/style-css-module/src/styles.__style__ +1 -0
- package/src/generators/application/files/style-global-css/src/app/__fileName__.__style__ +1 -0
- package/src/generators/application/files/style-global-css/src/app/__fileName__.tsx__tmpl__ +35 -0
- package/src/generators/application/files/style-global-css/src/styles.__style__ +1 -0
- package/src/generators/application/files/style-none/src/app/__fileName__.tsx__tmpl__ +34 -0
- package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +37 -0
- package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +40 -0
- package/src/generators/application/files/style-tailwind/src/app/__fileName__.tsx__tmpl__ +33 -0
- package/src/generators/application/files/style-tailwind/src/styles.css +1 -0
- package/src/generators/application/lib/add-e2e.d.ts +3 -0
- package/src/generators/application/lib/add-e2e.js +79 -0
- package/src/generators/application/lib/add-jest.d.ts +3 -0
- package/src/generators/application/lib/add-jest.js +21 -0
- package/src/generators/application/lib/add-project.d.ts +3 -0
- package/src/generators/application/lib/add-project.js +96 -0
- package/src/generators/application/lib/add-routing.d.ts +3 -0
- package/src/generators/application/lib/add-routing.js +27 -0
- package/src/generators/application/lib/create-application-files.d.ts +3 -0
- package/src/generators/application/lib/create-application-files.js +143 -0
- package/src/generators/application/lib/find-free-port.d.ts +2 -0
- package/src/generators/application/lib/find-free-port.js +16 -0
- package/src/generators/application/lib/get-app-tests.d.ts +2 -0
- package/src/generators/application/lib/get-app-tests.js +21 -0
- package/src/generators/application/lib/install-common-dependencies.d.ts +3 -0
- package/src/generators/application/lib/install-common-dependencies.js +47 -0
- package/src/generators/application/lib/normalize-options.d.ts +5 -0
- package/src/generators/application/lib/normalize-options.js +72 -0
- package/src/generators/application/lib/set-defaults.d.ts +3 -0
- package/src/generators/application/lib/set-defaults.js +43 -0
- package/src/generators/application/lib/show-possible-warnings.d.ts +3 -0
- package/src/generators/application/lib/show-possible-warnings.js +11 -0
- package/src/generators/application/lib/update-jest-config.d.ts +3 -0
- package/src/generators/application/lib/update-jest-config.js +30 -0
- package/src/generators/application/schema.d.ts +45 -0
- package/src/generators/application/schema.json +201 -0
- package/src/generators/component/component.d.ts +5 -0
- package/src/generators/component/component.js +93 -0
- package/src/generators/component/files/__fileName__.__style__ +0 -0
- package/src/generators/component/files/__fileName__.module.__style__ +7 -0
- package/src/generators/component/files/__fileName__.spec.tsx__tmpl__ +7 -0
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +88 -0
- package/src/generators/component/lib/get-component-tests.d.ts +2 -0
- package/src/generators/component/lib/get-component-tests.js +12 -0
- package/src/generators/component/lib/normalize-options.d.ts +3 -0
- package/src/generators/component/lib/normalize-options.js +50 -0
- package/src/generators/component/schema.d.ts +48 -0
- package/src/generators/component/schema.json +150 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +13 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.js +100 -0
- package/src/generators/component-cypress-spec/files/__componentName__.__fileExt__ +13 -0
- package/src/generators/component-cypress-spec/schema.json +44 -0
- package/src/generators/component-story/component-story.d.ts +12 -0
- package/src/generators/component-story/component-story.js +72 -0
- package/src/generators/component-story/files/jsx/__componentFileName__.stories.jsx__tmpl__ +29 -0
- package/src/generators/component-story/files/tsx/__componentFileName__.stories.tsx__tmpl__ +36 -0
- package/src/generators/component-story/schema.json +42 -0
- package/src/generators/component-test/component-test.d.ts +4 -0
- package/src/generators/component-test/component-test.js +76 -0
- package/src/generators/component-test/files/__fileName__.cy__ext__ +21 -0
- package/src/generators/component-test/schema.d.ts +4 -0
- package/src/generators/component-test/schema.js +2 -0
- package/src/generators/component-test/schema.json +31 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +10 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +51 -0
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts +4 -0
- package/src/generators/cypress-component-configuration/lib/add-files.js +45 -0
- package/src/generators/cypress-component-configuration/schema.d.ts +8 -0
- package/src/generators/cypress-component-configuration/schema.json +54 -0
- package/src/generators/federate-module/federate-module.d.ts +4 -0
- package/src/generators/federate-module/federate-module.js +70 -0
- package/src/generators/federate-module/lib/utils.d.ts +23 -0
- package/src/generators/federate-module/lib/utils.js +100 -0
- package/src/generators/federate-module/schema.d.ts +13 -0
- package/src/generators/federate-module/schema.json +83 -0
- package/src/generators/hook/files/__fileName__.spec.tsx__tmpl__ +18 -0
- package/src/generators/hook/files/__fileName__.ts__tmpl__ +15 -0
- package/src/generators/hook/hook.d.ts +5 -0
- package/src/generators/hook/hook.js +131 -0
- package/src/generators/hook/schema.d.ts +24 -0
- package/src/generators/hook/schema.json +84 -0
- package/src/generators/host/files/common/src/app/__fileName__.js__tmpl__ +33 -0
- package/src/generators/host/files/common/src/main.js__tmpl__ +10 -0
- package/src/generators/host/files/common/tsconfig.lint.json__tmpl__ +19 -0
- package/src/generators/host/files/common-ts/src/app/__fileName__.tsx__tmpl__ +41 -0
- package/src/generators/host/files/common-ts/src/main.ts__tmpl__ +10 -0
- package/src/generators/host/files/module-federation/module-federation.config.js__tmpl__ +21 -0
- package/src/generators/host/files/module-federation/webpack.config.js__tmpl__ +12 -0
- package/src/generators/host/files/module-federation/webpack.config.prod.js__tmpl__ +32 -0
- package/src/generators/host/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +16 -0
- package/src/generators/host/files/module-federation-ssr/server.ts__tmpl__ +28 -0
- package/src/generators/host/files/module-federation-ssr/tsconfig.server.json__tmpl__ +17 -0
- package/src/generators/host/files/module-federation-ssr/webpack.server.config.js__tmpl__ +12 -0
- package/src/generators/host/files/module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +13 -0
- package/src/generators/host/files/module-federation-ssr-ts/server.ts__tmpl__ +28 -0
- package/src/generators/host/files/module-federation-ssr-ts/tsconfig.server.json__tmpl__ +17 -0
- package/src/generators/host/files/module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +12 -0
- package/src/generators/host/files/module-federation-ts/module-federation.config.ts__tmpl__ +25 -0
- package/src/generators/host/files/module-federation-ts/webpack.config.prod.ts__tmpl__ +33 -0
- package/src/generators/host/files/module-federation-ts/webpack.config.ts__tmpl__ +12 -0
- package/src/generators/host/host.d.ts +5 -0
- package/src/generators/host/host.js +95 -0
- package/src/generators/host/lib/add-module-federation-files.d.ts +6 -0
- package/src/generators/host/lib/add-module-federation-files.js +52 -0
- package/src/generators/host/lib/normalize-remote.d.ts +4 -0
- package/src/generators/host/lib/normalize-remote.js +28 -0
- package/src/generators/host/lib/setup-ssr-for-host.d.ts +6 -0
- package/src/generators/host/lib/setup-ssr-for-host.js +33 -0
- package/src/generators/host/lib/update-module-federation-e2e-project.d.ts +3 -0
- package/src/generators/host/lib/update-module-federation-e2e-project.js +20 -0
- package/src/generators/host/schema.d.ts +37 -0
- package/src/generators/host/schema.json +184 -0
- package/src/generators/init/init.d.ts +4 -0
- package/src/generators/init/init.js +23 -0
- package/src/generators/init/schema.d.ts +5 -0
- package/src/generators/init/schema.json +27 -0
- package/src/generators/library/files/common/README.md +7 -0
- package/src/generators/library/files/common/package.json__tmpl__ +4 -0
- package/src/generators/library/files/common/src/index.ts__tmpl__ +0 -0
- package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +14 -0
- package/src/generators/library/files/vite/README.md +7 -0
- package/src/generators/library/files/vite/package.json__tmpl__ +12 -0
- package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +14 -0
- package/src/generators/library/lib/add-linting.d.ts +3 -0
- package/src/generators/library/lib/add-linting.js +36 -0
- package/src/generators/library/lib/add-rollup-build-target.d.ts +4 -0
- package/src/generators/library/lib/add-rollup-build-target.js +59 -0
- package/src/generators/library/lib/create-files.d.ts +3 -0
- package/src/generators/library/lib/create-files.js +53 -0
- package/src/generators/library/lib/install-common-dependencies.d.ts +3 -0
- package/src/generators/library/lib/install-common-dependencies.js +47 -0
- package/src/generators/library/lib/normalize-options.d.ts +3 -0
- package/src/generators/library/lib/normalize-options.js +92 -0
- package/src/generators/library/lib/set-defaults.d.ts +3 -0
- package/src/generators/library/lib/set-defaults.js +23 -0
- package/src/generators/library/lib/update-app-routes.d.ts +3 -0
- package/src/generators/library/lib/update-app-routes.js +62 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +193 -0
- package/src/generators/library/schema.d.ts +45 -0
- package/src/generators/library/schema.json +198 -0
- package/src/generators/redux/files/__fileName__.slice.spec.ts__tmpl__ +56 -0
- package/src/generators/redux/files/__fileName__.slice.ts__tmpl__ +129 -0
- package/src/generators/redux/redux.d.ts +5 -0
- package/src/generators/redux/redux.js +143 -0
- package/src/generators/redux/schema.d.ts +23 -0
- package/src/generators/redux/schema.json +51 -0
- package/src/generators/remote/files/common/src/main.js__tmpl__ +1 -0
- package/src/generators/remote/files/common/src/remote-entry.js__tmpl__ +1 -0
- package/src/generators/remote/files/common-ts/src/main.ts__tmpl__ +1 -0
- package/src/generators/remote/files/common-ts/src/remote-entry.ts__tmpl__ +1 -0
- package/src/generators/remote/files/module-federation/module-federation.config.js__tmpl__ +9 -0
- package/src/generators/remote/files/module-federation/webpack.config.js__tmpl__ +12 -0
- package/src/generators/remote/files/module-federation/webpack.config.prod.js__tmpl__ +1 -0
- package/src/generators/remote/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +6 -0
- package/src/generators/remote/files/module-federation-ssr/server.ts__tmpl__ +45 -0
- package/src/generators/remote/files/module-federation-ssr/webpack.server.config.js__tmpl__ +12 -0
- package/src/generators/remote/files/module-federation-ssr-ts/module-federation.server.config.ts__tmpl__ +10 -0
- package/src/generators/remote/files/module-federation-ssr-ts/server.ts__tmpl__ +45 -0
- package/src/generators/remote/files/module-federation-ssr-ts/tsconfig.lint.json__tmpl__ +19 -0
- package/src/generators/remote/files/module-federation-ssr-ts/webpack.server.config.ts__tmpl__ +12 -0
- package/src/generators/remote/files/module-federation-ts/module-federation.config.ts__tmpl__ +13 -0
- package/src/generators/remote/files/module-federation-ts/tsconfig.lint.json__tmpl__ +19 -0
- package/src/generators/remote/files/module-federation-ts/webpack.config.prod.ts__tmpl__ +1 -0
- package/src/generators/remote/files/module-federation-ts/webpack.config.ts__tmpl__ +12 -0
- package/src/generators/remote/lib/add-remote-to-dynamic-host.d.ts +2 -0
- package/src/generators/remote/lib/add-remote-to-dynamic-host.js +11 -0
- package/src/generators/remote/lib/setup-ssr-for-remote.d.ts +4 -0
- package/src/generators/remote/lib/setup-ssr-for-remote.js +40 -0
- package/src/generators/remote/lib/setup-tspath-for-remote.d.ts +3 -0
- package/src/generators/remote/lib/setup-tspath-for-remote.js +15 -0
- package/src/generators/remote/lib/update-host-with-remote.d.ts +2 -0
- package/src/generators/remote/lib/update-host-with-remote.js +64 -0
- package/src/generators/remote/remote.d.ts +7 -0
- package/src/generators/remote/remote.js +104 -0
- package/src/generators/remote/schema.d.ts +34 -0
- package/src/generators/remote/schema.json +183 -0
- package/src/generators/setup-ssr/files/server.ts__tmpl__ +28 -0
- package/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +47 -0
- package/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +17 -0
- package/src/generators/setup-ssr/schema.d.ts +7 -0
- package/src/generators/setup-ssr/schema.json +48 -0
- package/src/generators/setup-ssr/setup-ssr.d.ts +4 -0
- package/src/generators/setup-ssr/setup-ssr.js +183 -0
- package/src/generators/setup-tailwind/files/postcss.config.js__tmpl__ +15 -0
- package/src/generators/setup-tailwind/files/tailwind.config.js__tmpl__ +17 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +36 -0
- package/src/generators/setup-tailwind/lib/update-project.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/update-project.js +13 -0
- package/src/generators/setup-tailwind/schema.d.ts +6 -0
- package/src/generators/setup-tailwind/schema.js +2 -0
- package/src/generators/setup-tailwind/schema.json +47 -0
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +4 -0
- package/src/generators/setup-tailwind/setup-tailwind.js +35 -0
- package/src/generators/stories/schema.json +67 -0
- package/src/generators/stories/stories.d.ts +15 -0
- package/src/generators/stories/stories.js +130 -0
- package/src/generators/storybook-configuration/configuration.d.ts +6 -0
- package/src/generators/storybook-configuration/configuration.js +74 -0
- package/src/generators/storybook-configuration/schema.d.ts +16 -0
- package/src/generators/storybook-configuration/schema.json +95 -0
- package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.d.ts +3 -0
- package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js +37 -0
- package/src/migrations/update-15-3-0/update-rollup-executor.d.ts +3 -0
- package/src/migrations/update-15-3-0/update-rollup-executor.js +15 -0
- package/src/migrations/update-15-6-3/webpack-config-setup.d.ts +2 -0
- package/src/migrations/update-15-6-3/webpack-config-setup.js +103 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.d.ts +2 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js +9 -0
- package/src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package.d.ts +2 -0
- package/src/migrations/update-16-2-0-remove-package/update-16-2-0-remove-package.js +8 -0
- package/src/migrations/update-16-3-0/remove-types-react-router-dom-package.d.ts +2 -0
- package/src/migrations/update-16-3-0/remove-types-react-router-dom-package.js +8 -0
- package/src/migrations/update-16-7-0/add-babel-core.d.ts +2 -0
- package/src/migrations/update-16-7-0/add-babel-core.js +14 -0
- package/src/migrations/update-16-7-0-add-typings/update-16-7-0-add-typings.d.ts +2 -0
- package/src/migrations/update-16-7-0-add-typings/update-16-7-0-add-typings.js +57 -0
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.d.ts +2 -0
- package/src/migrations/update-18-0-0/add-mf-env-var-to-target-defaults.js +26 -0
- package/src/module-federation/ast-utils.d.ts +8 -0
- package/src/module-federation/ast-utils.js +102 -0
- package/src/module-federation/load-config.d.ts +3 -0
- package/src/module-federation/load-config.js +16 -0
- package/src/module-federation/models.d.ts +24 -0
- package/src/module-federation/models.js +2 -0
- package/src/module-federation/package-json.d.ts +8 -0
- package/src/module-federation/package-json.js +13 -0
- package/src/module-federation/utils.d.ts +12 -0
- package/src/module-federation/utils.js +76 -0
- package/src/module-federation/with-module-federation-ssr.d.ts +2 -0
- package/src/module-federation/with-module-federation-ssr.js +34 -0
- package/src/module-federation/with-module-federation.d.ts +7 -0
- package/src/module-federation/with-module-federation.js +50 -0
- package/src/rules/add-styled-dependencies.d.ts +5 -0
- package/src/rules/add-styled-dependencies.js +17 -0
- package/src/rules/update-module-federation-project.d.ts +9 -0
- package/src/rules/update-module-federation-project.js +50 -0
- package/src/utils/add-mf-env-to-inputs.d.ts +2 -0
- package/src/utils/add-mf-env-to-inputs.js +24 -0
- package/src/utils/assertion.d.ts +1 -0
- package/src/utils/assertion.js +19 -0
- package/src/utils/ast-utils.d.ts +29 -0
- package/src/utils/ast-utils.js +522 -0
- package/src/utils/component-props.d.ts +15 -0
- package/src/utils/component-props.js +60 -0
- package/src/utils/create-ts-config.d.ts +9 -0
- package/src/utils/create-ts-config.js +65 -0
- package/src/utils/ct-utils.d.ts +14 -0
- package/src/utils/ct-utils.js +94 -0
- package/src/utils/dependencies.d.ts +7 -0
- package/src/utils/dependencies.js +2 -0
- package/src/utils/format-file.d.ts +1 -0
- package/src/utils/format-file.js +12 -0
- package/src/utils/get-in-source-vitest-tests-template.d.ts +1 -0
- package/src/utils/get-in-source-vitest-tests-template.js +21 -0
- package/src/utils/has-vite-plugin.d.ts +2 -0
- package/src/utils/has-vite-plugin.js +11 -0
- package/src/utils/has-webpack-plugin.d.ts +2 -0
- package/src/utils/has-webpack-plugin.js +11 -0
- package/src/utils/jest-utils.d.ts +1 -0
- package/src/utils/jest-utils.js +9 -0
- package/src/utils/lint.d.ts +36 -0
- package/src/utils/lint.js +24 -0
- package/src/utils/maybe-js.d.ts +3 -0
- package/src/utils/maybe-js.js +9 -0
- package/src/utils/styled.d.ts +3 -0
- package/src/utils/styled.js +62 -0
- package/src/utils/testing-generators.d.ts +3 -0
- package/src/utils/testing-generators.js +30 -0
- package/src/utils/versions.d.ts +46 -0
- package/src/utils/versions.js +54 -0
- package/tailwind.d.ts +6 -0
- package/tailwind.js +29 -0
- package/typings/cssmodule.d.ts +19 -0
- package/typings/image.d.ts +48 -0
- package/typings/style.d.ts +9 -0
- package/typings/styled-jsx.d.ts +8 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type * as ts from 'typescript';
|
|
2
|
+
export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
|
|
3
|
+
export declare function getDefaultsForComponent(sourceFile: ts.SourceFile, cmpDeclaration: ts.Node): {
|
|
4
|
+
propsTypeName: string;
|
|
5
|
+
props: {
|
|
6
|
+
name: string;
|
|
7
|
+
defaultValue: any;
|
|
8
|
+
}[];
|
|
9
|
+
argTypes: {
|
|
10
|
+
name: string;
|
|
11
|
+
type: string;
|
|
12
|
+
actionText: string;
|
|
13
|
+
}[];
|
|
14
|
+
};
|
|
15
|
+
export declare function getImportForType(sourceFile: ts.SourceFile, typeName: string): ts.Statement;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getImportForType = exports.getDefaultsForComponent = exports.getArgsDefaultValue = void 0;
|
|
4
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
5
|
+
const ast_utils_1 = require("./ast-utils");
|
|
6
|
+
let tsModule;
|
|
7
|
+
// TODO: candidate to refactor with the angular component story
|
|
8
|
+
function getArgsDefaultValue(property) {
|
|
9
|
+
if (!tsModule) {
|
|
10
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
11
|
+
}
|
|
12
|
+
const typeNameToDefault = {
|
|
13
|
+
[tsModule.SyntaxKind.StringKeyword]: "''",
|
|
14
|
+
[tsModule.SyntaxKind.NumberKeyword]: 0,
|
|
15
|
+
[tsModule.SyntaxKind.BooleanKeyword]: false,
|
|
16
|
+
};
|
|
17
|
+
const resolvedValue = typeNameToDefault[property];
|
|
18
|
+
if (typeof resolvedValue === undefined) {
|
|
19
|
+
return "''";
|
|
20
|
+
}
|
|
21
|
+
else {
|
|
22
|
+
return resolvedValue;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.getArgsDefaultValue = getArgsDefaultValue;
|
|
26
|
+
function getDefaultsForComponent(sourceFile, cmpDeclaration) {
|
|
27
|
+
if (!tsModule) {
|
|
28
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
29
|
+
}
|
|
30
|
+
const propsInterface = (0, ast_utils_1.getComponentPropsInterface)(sourceFile, cmpDeclaration);
|
|
31
|
+
let propsTypeName = null;
|
|
32
|
+
let props = [];
|
|
33
|
+
let argTypes = [];
|
|
34
|
+
if (propsInterface) {
|
|
35
|
+
propsTypeName = propsInterface.name.text;
|
|
36
|
+
props = propsInterface.members.map((member) => {
|
|
37
|
+
if (member.type.kind === tsModule.SyntaxKind.FunctionType) {
|
|
38
|
+
argTypes.push({
|
|
39
|
+
name: member.name.text,
|
|
40
|
+
type: 'action',
|
|
41
|
+
actionText: `${member.name.text} executed!`,
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
return {
|
|
46
|
+
name: member.name.text,
|
|
47
|
+
defaultValue: getArgsDefaultValue(member.type.kind),
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
props = props.filter((p) => p && p.defaultValue !== undefined);
|
|
52
|
+
}
|
|
53
|
+
return { propsTypeName, props, argTypes };
|
|
54
|
+
}
|
|
55
|
+
exports.getDefaultsForComponent = getDefaultsForComponent;
|
|
56
|
+
function getImportForType(sourceFile, typeName) {
|
|
57
|
+
return sourceFile.statements.find((statement) => tsModule.isImportDeclaration(statement) &&
|
|
58
|
+
statement.getText().includes(typeName));
|
|
59
|
+
}
|
|
60
|
+
exports.getImportForType = getImportForType;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Tree } from 'nx/src/generators/tree';
|
|
2
|
+
export declare function createTsConfig(host: Tree, projectRoot: string, type: 'app' | 'lib', options: {
|
|
3
|
+
strict?: boolean;
|
|
4
|
+
style?: string;
|
|
5
|
+
bundler?: string;
|
|
6
|
+
rootProject?: boolean;
|
|
7
|
+
unitTestRunner?: string;
|
|
8
|
+
}, relativePathToRootTsConfig: string): void;
|
|
9
|
+
export declare function extractTsConfigBase(host: Tree): void;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extractTsConfigBase = exports.createTsConfig = void 0;
|
|
4
|
+
const shared = require("@nx/js/src/utils/typescript/create-ts-config");
|
|
5
|
+
const json_1 = require("nx/src/generators/utils/json");
|
|
6
|
+
function createTsConfig(host, projectRoot, type, options, relativePathToRootTsConfig) {
|
|
7
|
+
const json = {
|
|
8
|
+
compilerOptions: {
|
|
9
|
+
jsx: 'react-jsx',
|
|
10
|
+
allowJs: false,
|
|
11
|
+
esModuleInterop: false,
|
|
12
|
+
allowSyntheticDefaultImports: true,
|
|
13
|
+
strict: options.strict,
|
|
14
|
+
},
|
|
15
|
+
files: [],
|
|
16
|
+
include: [],
|
|
17
|
+
references: [
|
|
18
|
+
{
|
|
19
|
+
path: type === 'app' ? './tsconfig.app.json' : './tsconfig.lib.json',
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
if (options.style === '@emotion/styled') {
|
|
24
|
+
json.compilerOptions.jsxImportSource = '@emotion/react';
|
|
25
|
+
}
|
|
26
|
+
if (options.bundler === 'vite') {
|
|
27
|
+
json.compilerOptions.types =
|
|
28
|
+
options.unitTestRunner === 'vitest'
|
|
29
|
+
? ['vite/client', 'vitest']
|
|
30
|
+
: ['vite/client'];
|
|
31
|
+
}
|
|
32
|
+
// inline tsconfig.base.json into the project
|
|
33
|
+
if (options.rootProject) {
|
|
34
|
+
json.compileOnSave = false;
|
|
35
|
+
json.compilerOptions = {
|
|
36
|
+
...shared.tsConfigBaseOptions,
|
|
37
|
+
...json.compilerOptions,
|
|
38
|
+
};
|
|
39
|
+
json.exclude = ['node_modules', 'tmp'];
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
json.extends = relativePathToRootTsConfig;
|
|
43
|
+
}
|
|
44
|
+
(0, json_1.writeJson)(host, `${projectRoot}/tsconfig.json`, json);
|
|
45
|
+
const tsconfigProjectPath = `${projectRoot}/tsconfig.${type}.json`;
|
|
46
|
+
if (options.bundler === 'vite' && host.exists(tsconfigProjectPath)) {
|
|
47
|
+
(0, json_1.updateJson)(host, tsconfigProjectPath, (json) => {
|
|
48
|
+
json.compilerOptions ??= {};
|
|
49
|
+
const types = new Set(json.compilerOptions.types ?? []);
|
|
50
|
+
types.add('node');
|
|
51
|
+
types.add('vite/client');
|
|
52
|
+
json.compilerOptions.types = Array.from(types);
|
|
53
|
+
return json;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.createTsConfig = createTsConfig;
|
|
58
|
+
function extractTsConfigBase(host) {
|
|
59
|
+
shared.extractTsConfigBase(host);
|
|
60
|
+
if (host.exists('vite.config.ts')) {
|
|
61
|
+
const vite = host.read('vite.config.ts').toString();
|
|
62
|
+
host.write('vite.config.ts', vite.replace(`projects: []`, `projects: ['tsconfig.base.json']`));
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
exports.extractTsConfigBase = extractTsConfigBase;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import { type FoundTarget } from '@nx/cypress/src/utils/find-target-options';
|
|
3
|
+
export declare function configureCypressCT(tree: Tree, options: {
|
|
4
|
+
project: string;
|
|
5
|
+
buildTarget: string;
|
|
6
|
+
bundler: 'vite' | 'webpack';
|
|
7
|
+
validExecutorNames: Set<string>;
|
|
8
|
+
}): Promise<FoundTarget>;
|
|
9
|
+
export declare function getBundlerFromTarget(found: FoundTarget, tree: Tree): Promise<'vite' | 'webpack'>;
|
|
10
|
+
export declare function getActualBundler(tree: Tree, options: {
|
|
11
|
+
buildTarget?: string;
|
|
12
|
+
bundler?: 'vite' | 'webpack';
|
|
13
|
+
}, found: FoundTarget): Promise<"vite" | "webpack">;
|
|
14
|
+
export declare function isComponent(tree: Tree, filePath: string): boolean;
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isComponent = exports.getActualBundler = exports.getBundlerFromTarget = exports.configureCypressCT = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
6
|
+
const ast_utils_1 = require("./ast-utils");
|
|
7
|
+
let tsModule;
|
|
8
|
+
const allowedFileExt = new RegExp(/\.[jt]sx?/);
|
|
9
|
+
const isSpecFile = new RegExp(/(spec|test)\./);
|
|
10
|
+
async function configureCypressCT(tree, options) {
|
|
11
|
+
let found = { target: options.buildTarget, config: undefined };
|
|
12
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
13
|
+
// Specifically undefined as a workaround for Remix to pass an empty string as the buildTarget
|
|
14
|
+
if (options.buildTarget === undefined) {
|
|
15
|
+
const { findBuildConfig } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/find-target-options'));
|
|
16
|
+
found = await findBuildConfig(tree, {
|
|
17
|
+
project: options.project,
|
|
18
|
+
buildTarget: options.buildTarget,
|
|
19
|
+
validExecutorNames: options.validExecutorNames,
|
|
20
|
+
});
|
|
21
|
+
assertValidConfig(found?.config);
|
|
22
|
+
}
|
|
23
|
+
else if (options.buildTarget) {
|
|
24
|
+
const projectGraph = await (0, devkit_1.createProjectGraphAsync)();
|
|
25
|
+
const { project, target } = (0, devkit_1.parseTargetString)(options.buildTarget, projectGraph);
|
|
26
|
+
const buildTargetProject = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
27
|
+
const executor = buildTargetProject.targets?.[target]?.executor;
|
|
28
|
+
if (!executor || !options.validExecutorNames.has(executor)) {
|
|
29
|
+
throw new Error(`Cypress Component Testing is not currently supported for this project. Please check https://github.com/nrwl/nx/issues/21546 for more information.`);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const { addDefaultCTConfig, getProjectCypressConfigPath } = await Promise.resolve().then(() => require('@nx/cypress/src/utils/config'));
|
|
33
|
+
const ctConfigOptions = {
|
|
34
|
+
bundler: options.bundler ?? (await getActualBundler(tree, options, found)),
|
|
35
|
+
};
|
|
36
|
+
if (projectConfig.targets?.['component-test']?.executor ===
|
|
37
|
+
'@nx/cypress:cypress') {
|
|
38
|
+
projectConfig.targets['component-test'].options = {
|
|
39
|
+
...projectConfig.targets['component-test'].options,
|
|
40
|
+
devServerTarget: found.target,
|
|
41
|
+
skipServe: true,
|
|
42
|
+
};
|
|
43
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
|
44
|
+
}
|
|
45
|
+
else {
|
|
46
|
+
ctConfigOptions.buildTarget = found.target;
|
|
47
|
+
}
|
|
48
|
+
const cypressConfigFilePath = getProjectCypressConfigPath(tree, projectConfig.root);
|
|
49
|
+
const updatedCyConfig = await addDefaultCTConfig(tree.read(cypressConfigFilePath, 'utf-8'), ctConfigOptions);
|
|
50
|
+
tree.write(cypressConfigFilePath, `import { nxComponentTestingPreset } from '@nx/react/plugins/component-testing';\n${updatedCyConfig}`);
|
|
51
|
+
return found;
|
|
52
|
+
}
|
|
53
|
+
exports.configureCypressCT = configureCypressCT;
|
|
54
|
+
function assertValidConfig(config) {
|
|
55
|
+
if (!config) {
|
|
56
|
+
throw new Error('Unable to find a valid build configuration. Try passing in a target for an app. --build-target=<project>:<target>[:<configuration>]');
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
async function getBundlerFromTarget(found, tree) {
|
|
60
|
+
if (found.target && found.config?.executor) {
|
|
61
|
+
return found.config.executor === '@nrwl/vite:build' ||
|
|
62
|
+
found.config.executor === '@nx/vite:build'
|
|
63
|
+
? 'vite'
|
|
64
|
+
: 'webpack';
|
|
65
|
+
}
|
|
66
|
+
const { target, project } = (0, devkit_1.parseTargetString)(found.target, await (0, devkit_1.createProjectGraphAsync)());
|
|
67
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
68
|
+
const executor = projectConfig?.targets?.[target]?.executor;
|
|
69
|
+
return executor === '@nrwl/vite:build' || executor === '@nx/vite:build'
|
|
70
|
+
? 'vite'
|
|
71
|
+
: 'webpack';
|
|
72
|
+
}
|
|
73
|
+
exports.getBundlerFromTarget = getBundlerFromTarget;
|
|
74
|
+
async function getActualBundler(tree, options, found) {
|
|
75
|
+
// Specifically undefined to allow Remix workaround of passing an empty string
|
|
76
|
+
const actualBundler = options.buildTarget !== undefined && options.bundler
|
|
77
|
+
? options.bundler
|
|
78
|
+
: await getBundlerFromTarget(found, tree);
|
|
79
|
+
return actualBundler;
|
|
80
|
+
}
|
|
81
|
+
exports.getActualBundler = getActualBundler;
|
|
82
|
+
function isComponent(tree, filePath) {
|
|
83
|
+
if (!tsModule) {
|
|
84
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
85
|
+
}
|
|
86
|
+
if (isSpecFile.test(filePath) || !allowedFileExt.test(filePath)) {
|
|
87
|
+
return false;
|
|
88
|
+
}
|
|
89
|
+
const content = tree.read(filePath, 'utf-8');
|
|
90
|
+
const sourceFile = tsModule.createSourceFile(filePath, content, tsModule.ScriptTarget.Latest, true);
|
|
91
|
+
const cmpDeclaration = (0, ast_utils_1.getComponentNode)(sourceFile);
|
|
92
|
+
return !!cmpDeclaration;
|
|
93
|
+
}
|
|
94
|
+
exports.isComponent = isComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function formatFile(content: any, ...values: any[]): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.formatFile = void 0;
|
|
4
|
+
const prettier_1 = require("prettier");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
function formatFile(content, ...values) {
|
|
7
|
+
return (0, prettier_1.format)((0, devkit_1.stripIndents)(content, values), {
|
|
8
|
+
singleQuote: true,
|
|
9
|
+
parser: 'typescript',
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
exports.formatFile = formatFile;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getInSourceVitestTestsTemplate(testContent: string): string;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getInSourceVitestTestsTemplate = void 0;
|
|
4
|
+
function getInSourceVitestTestsTemplate(testContent) {
|
|
5
|
+
return `
|
|
6
|
+
if (import.meta.vitest) {
|
|
7
|
+
// add tests related to your file here
|
|
8
|
+
// For more information please visit the Vitest docs site here: https://vitest.dev/guide/in-source.html
|
|
9
|
+
|
|
10
|
+
const { it, expect, beforeEach } = import.meta.vitest;
|
|
11
|
+
let render: typeof import('@testing-library/react').render;
|
|
12
|
+
|
|
13
|
+
beforeEach(async () => {
|
|
14
|
+
render = (await import('@testing-library/react')).render;
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
${testContent}
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
20
|
+
}
|
|
21
|
+
exports.getInSourceVitestTestsTemplate = getInSourceVitestTestsTemplate;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasVitePlugin = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function hasVitePlugin(tree) {
|
|
6
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
7
|
+
return !!nxJson.plugins?.some((p) => typeof p === 'string'
|
|
8
|
+
? p === '@nx/vite/plugin'
|
|
9
|
+
: p.plugin === '@nx/vite/plugin');
|
|
10
|
+
}
|
|
11
|
+
exports.hasVitePlugin = hasVitePlugin;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.hasWebpackPlugin = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function hasWebpackPlugin(tree) {
|
|
6
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
7
|
+
return !!nxJson.plugins?.some((p) => typeof p === 'string'
|
|
8
|
+
? p === '@nx/webpack/plugin'
|
|
9
|
+
: p.plugin === '@nx/webpack/plugin');
|
|
10
|
+
}
|
|
11
|
+
exports.hasWebpackPlugin = hasWebpackPlugin;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function updateJestConfigContent(content: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateJestConfigContent = void 0;
|
|
4
|
+
function updateJestConfigContent(content) {
|
|
5
|
+
return content
|
|
6
|
+
.replace('transform: {', "transform: {\n '^(?!.*\\\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest',")
|
|
7
|
+
.replace(`'babel-jest'`, `['babel-jest', { presets: ['@nx/react/babel'] }]`);
|
|
8
|
+
}
|
|
9
|
+
exports.updateJestConfigContent = updateJestConfigContent;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Linter } from 'eslint';
|
|
2
|
+
export declare const extraEslintDependencies: {
|
|
3
|
+
dependencies: {};
|
|
4
|
+
devDependencies: {
|
|
5
|
+
'eslint-plugin-import': string;
|
|
6
|
+
'eslint-plugin-jsx-a11y': string;
|
|
7
|
+
'eslint-plugin-react': string;
|
|
8
|
+
'eslint-plugin-react-hooks': string;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @deprecated Use `addExtendsToLintConfig` from `@nx/eslint` instead.
|
|
13
|
+
*/
|
|
14
|
+
export declare const extendReactEslintJson: (json: Linter.Config) => {
|
|
15
|
+
ignorePatterns?: string | string[];
|
|
16
|
+
root?: boolean;
|
|
17
|
+
$schema?: string;
|
|
18
|
+
env?: {
|
|
19
|
+
[name: string]: boolean;
|
|
20
|
+
};
|
|
21
|
+
globals?: {
|
|
22
|
+
[name: string]: boolean | "off" | "readonly" | "readable" | "writable" | "writeable";
|
|
23
|
+
};
|
|
24
|
+
noInlineConfig?: boolean;
|
|
25
|
+
overrides?: Linter.ConfigOverride<Linter.RulesRecord>[];
|
|
26
|
+
parser?: string;
|
|
27
|
+
parserOptions?: Linter.ParserOptions;
|
|
28
|
+
plugins?: string[];
|
|
29
|
+
processor?: string;
|
|
30
|
+
reportUnusedDisableDirectives?: boolean;
|
|
31
|
+
settings?: {
|
|
32
|
+
[name: string]: any;
|
|
33
|
+
};
|
|
34
|
+
rules?: Partial<Linter.RulesRecord>;
|
|
35
|
+
extends: string[];
|
|
36
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extendReactEslintJson = exports.extraEslintDependencies = void 0;
|
|
4
|
+
const versions_1 = require("./versions");
|
|
5
|
+
exports.extraEslintDependencies = {
|
|
6
|
+
dependencies: {},
|
|
7
|
+
devDependencies: {
|
|
8
|
+
'eslint-plugin-import': versions_1.eslintPluginImportVersion,
|
|
9
|
+
'eslint-plugin-jsx-a11y': versions_1.eslintPluginJsxA11yVersion,
|
|
10
|
+
'eslint-plugin-react': versions_1.eslintPluginReactVersion,
|
|
11
|
+
'eslint-plugin-react-hooks': versions_1.eslintPluginReactHooksVersion,
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* @deprecated Use `addExtendsToLintConfig` from `@nx/eslint` instead.
|
|
16
|
+
*/
|
|
17
|
+
const extendReactEslintJson = (json) => {
|
|
18
|
+
const { extends: pluginExtends, ...config } = json;
|
|
19
|
+
return {
|
|
20
|
+
extends: ['plugin:@nx/react', ...(pluginExtends || [])],
|
|
21
|
+
...config,
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
exports.extendReactEslintJson = extendReactEslintJson;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.maybeJs = void 0;
|
|
4
|
+
function maybeJs(options, path) {
|
|
5
|
+
return options.js && (path.endsWith('.ts') || path.endsWith('.tsx'))
|
|
6
|
+
? path.replace(/\.tsx?$/, '.js')
|
|
7
|
+
: path;
|
|
8
|
+
}
|
|
9
|
+
exports.maybeJs = maybeJs;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cssInJsDependenciesSwc = exports.cssInJsDependenciesBabel = void 0;
|
|
4
|
+
const versions_1 = require("./versions");
|
|
5
|
+
exports.cssInJsDependenciesBabel = {
|
|
6
|
+
'styled-components': {
|
|
7
|
+
dependencies: {
|
|
8
|
+
'react-is': versions_1.reactIsVersion,
|
|
9
|
+
'styled-components': versions_1.styledComponentsVersion,
|
|
10
|
+
},
|
|
11
|
+
devDependencies: {
|
|
12
|
+
'@types/styled-components': versions_1.typesStyledComponentsVersion,
|
|
13
|
+
'@types/react-is': versions_1.typesReactIsVersion,
|
|
14
|
+
'babel-plugin-styled-components': versions_1.babelPluginStyledComponentsVersion,
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
'@emotion/styled': {
|
|
18
|
+
dependencies: {
|
|
19
|
+
'@emotion/styled': versions_1.emotionStyledVersion,
|
|
20
|
+
'@emotion/react': versions_1.emotionReactVersion,
|
|
21
|
+
},
|
|
22
|
+
devDependencies: {
|
|
23
|
+
'@emotion/babel-plugin': versions_1.emotionBabelPlugin,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
'styled-jsx': {
|
|
27
|
+
dependencies: {
|
|
28
|
+
'styled-jsx': versions_1.styledJsxVersion,
|
|
29
|
+
},
|
|
30
|
+
devDependencies: {},
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
exports.cssInJsDependenciesSwc = {
|
|
34
|
+
'styled-components': {
|
|
35
|
+
dependencies: {
|
|
36
|
+
'react-is': versions_1.reactIsVersion,
|
|
37
|
+
'styled-components': versions_1.styledComponentsVersion,
|
|
38
|
+
},
|
|
39
|
+
devDependencies: {
|
|
40
|
+
'@types/styled-components': versions_1.typesStyledComponentsVersion,
|
|
41
|
+
'@types/react-is': versions_1.typesReactIsVersion,
|
|
42
|
+
'@swc/plugin-styled-components': versions_1.swcPluginStyledComponentsVersion,
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
'@emotion/styled': {
|
|
46
|
+
dependencies: {
|
|
47
|
+
'@emotion/styled': versions_1.emotionStyledVersion,
|
|
48
|
+
'@emotion/react': versions_1.emotionReactVersion,
|
|
49
|
+
},
|
|
50
|
+
devDependencies: {
|
|
51
|
+
'@swc/plugin-emotion': versions_1.swcPluginEmotionVersion,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
'styled-jsx': {
|
|
55
|
+
dependencies: {
|
|
56
|
+
'styled-jsx': versions_1.styledJsxVersion,
|
|
57
|
+
},
|
|
58
|
+
devDependencies: {
|
|
59
|
+
'@swc/plugin-styled-jsx': versions_1.swcPluginStyledJsxVersion,
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createLib = exports.createApp = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const application_1 = require("../generators/application/application");
|
|
6
|
+
const eslint_1 = require("@nx/eslint");
|
|
7
|
+
async function createApp(tree, appName) {
|
|
8
|
+
await (0, application_1.default)(tree, {
|
|
9
|
+
e2eTestRunner: 'none',
|
|
10
|
+
linter: eslint_1.Linter.EsLint,
|
|
11
|
+
skipFormat: true,
|
|
12
|
+
style: 'css',
|
|
13
|
+
unitTestRunner: 'none',
|
|
14
|
+
name: appName,
|
|
15
|
+
projectNameAndRootFormat: 'as-provided',
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
exports.createApp = createApp;
|
|
19
|
+
async function createLib(tree, libName) {
|
|
20
|
+
const { fileName } = (0, devkit_1.names)(libName);
|
|
21
|
+
tree.write(`/${fileName}/src/index.ts`, `import React from 'react';\n`);
|
|
22
|
+
(0, devkit_1.addProjectConfiguration)(tree, fileName, {
|
|
23
|
+
tags: [],
|
|
24
|
+
root: `${fileName}`,
|
|
25
|
+
projectType: 'library',
|
|
26
|
+
sourceRoot: `${fileName}/src`,
|
|
27
|
+
targets: {},
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.createLib = createLib;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export declare const nxVersion: any;
|
|
2
|
+
export declare const nxRspackVersion = "*";
|
|
3
|
+
export declare const reactVersion = "18.2.0";
|
|
4
|
+
export declare const reactDomVersion = "18.2.0";
|
|
5
|
+
export declare const reactIsVersion = "18.2.0";
|
|
6
|
+
export declare const swcLoaderVersion = "0.1.15";
|
|
7
|
+
export declare const babelLoaderVersion = "^9.1.2";
|
|
8
|
+
export declare const typesReactVersion = "18.2.33";
|
|
9
|
+
export declare const typesReactDomVersion = "18.2.14";
|
|
10
|
+
export declare const typesReactIsVersion = "18.2.2";
|
|
11
|
+
export declare const typesNodeVersion = "18.16.9";
|
|
12
|
+
export declare const babelPresetReactVersion = "^7.14.5";
|
|
13
|
+
export declare const babelCoreVersion = "^7.14.5";
|
|
14
|
+
export declare const styledComponentsVersion = "5.3.6";
|
|
15
|
+
export declare const typesStyledComponentsVersion = "5.1.26";
|
|
16
|
+
export declare const emotionStyledVersion = "11.11.0";
|
|
17
|
+
export declare const emotionReactVersion = "11.11.1";
|
|
18
|
+
export declare const emotionBabelPlugin = "11.11.0";
|
|
19
|
+
export declare const styledJsxVersion = "5.1.2";
|
|
20
|
+
export declare const reactRouterDomVersion = "6.11.2";
|
|
21
|
+
export declare const testingLibraryReactVersion = "14.0.0";
|
|
22
|
+
export declare const reduxjsToolkitVersion = "1.9.3";
|
|
23
|
+
export declare const reactReduxVersion = "8.0.5";
|
|
24
|
+
export declare const reactTestRendererVersion = "18.2.0";
|
|
25
|
+
export declare const eslintPluginImportVersion = "2.27.5";
|
|
26
|
+
export declare const eslintPluginJsxA11yVersion = "6.7.1";
|
|
27
|
+
export declare const eslintPluginReactVersion = "7.32.2";
|
|
28
|
+
export declare const eslintPluginReactHooksVersion = "4.6.0";
|
|
29
|
+
export declare const babelPluginStyledComponentsVersion = "1.10.7";
|
|
30
|
+
export declare const tsLibVersion = "^2.3.0";
|
|
31
|
+
export declare const postcssVersion = "8.4.21";
|
|
32
|
+
export declare const tailwindcssVersion = "3.2.7";
|
|
33
|
+
export declare const autoprefixerVersion = "10.4.13";
|
|
34
|
+
export declare const expressVersion = "~4.18.2";
|
|
35
|
+
export declare const typesExpressVersion = "4.17.17";
|
|
36
|
+
export declare const isbotVersion = "^3.6.5";
|
|
37
|
+
export declare const corsVersion = "~2.8.5";
|
|
38
|
+
export declare const typesCorsVersion = "~2.8.12";
|
|
39
|
+
export declare const moduleFederationNodeVersion = "~0.9.9";
|
|
40
|
+
export declare const lessVersion = "3.12.2";
|
|
41
|
+
export declare const sassVersion = "^1.55.0";
|
|
42
|
+
export declare const rollupPluginUrlVersion = "^7.0.0";
|
|
43
|
+
export declare const svgrRollupVersion = "^8.0.1";
|
|
44
|
+
export declare const swcPluginStyledJsxVersion = "^1.5.67";
|
|
45
|
+
export declare const swcPluginEmotionVersion = "^2.5.67";
|
|
46
|
+
export declare const swcPluginStyledComponentsVersion = "^1.5.67";
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.swcPluginStyledComponentsVersion = exports.swcPluginEmotionVersion = exports.swcPluginStyledJsxVersion = exports.svgrRollupVersion = exports.rollupPluginUrlVersion = exports.sassVersion = exports.lessVersion = exports.moduleFederationNodeVersion = exports.typesCorsVersion = exports.corsVersion = exports.isbotVersion = exports.typesExpressVersion = exports.expressVersion = exports.autoprefixerVersion = exports.tailwindcssVersion = exports.postcssVersion = exports.tsLibVersion = exports.babelPluginStyledComponentsVersion = exports.eslintPluginReactHooksVersion = exports.eslintPluginReactVersion = exports.eslintPluginJsxA11yVersion = exports.eslintPluginImportVersion = exports.reactTestRendererVersion = exports.reactReduxVersion = exports.reduxjsToolkitVersion = exports.testingLibraryReactVersion = exports.reactRouterDomVersion = exports.styledJsxVersion = exports.emotionBabelPlugin = exports.emotionReactVersion = exports.emotionStyledVersion = exports.typesStyledComponentsVersion = exports.styledComponentsVersion = exports.babelCoreVersion = exports.babelPresetReactVersion = exports.typesNodeVersion = exports.typesReactIsVersion = exports.typesReactDomVersion = exports.typesReactVersion = exports.babelLoaderVersion = exports.swcLoaderVersion = exports.reactIsVersion = exports.reactDomVersion = exports.reactVersion = exports.nxRspackVersion = exports.nxVersion = void 0;
|
|
4
|
+
exports.nxVersion = require('../../package.json').version;
|
|
5
|
+
// Always pull the latest version until we merge rspack plugin into the repo.
|
|
6
|
+
exports.nxRspackVersion = '*';
|
|
7
|
+
exports.reactVersion = '18.2.0';
|
|
8
|
+
exports.reactDomVersion = '18.2.0';
|
|
9
|
+
exports.reactIsVersion = '18.2.0';
|
|
10
|
+
exports.swcLoaderVersion = '0.1.15';
|
|
11
|
+
exports.babelLoaderVersion = '^9.1.2';
|
|
12
|
+
exports.typesReactVersion = '18.2.33';
|
|
13
|
+
exports.typesReactDomVersion = '18.2.14';
|
|
14
|
+
exports.typesReactIsVersion = '18.2.2';
|
|
15
|
+
exports.typesNodeVersion = '18.16.9';
|
|
16
|
+
exports.babelPresetReactVersion = '^7.14.5';
|
|
17
|
+
exports.babelCoreVersion = '^7.14.5';
|
|
18
|
+
exports.styledComponentsVersion = '5.3.6';
|
|
19
|
+
exports.typesStyledComponentsVersion = '5.1.26';
|
|
20
|
+
exports.emotionStyledVersion = '11.11.0';
|
|
21
|
+
exports.emotionReactVersion = '11.11.1';
|
|
22
|
+
exports.emotionBabelPlugin = '11.11.0';
|
|
23
|
+
// WARNING: This needs to be in sync with Next.js' dependency or else there might be issues.
|
|
24
|
+
exports.styledJsxVersion = '5.1.2';
|
|
25
|
+
exports.reactRouterDomVersion = '6.11.2';
|
|
26
|
+
exports.testingLibraryReactVersion = '14.0.0';
|
|
27
|
+
exports.reduxjsToolkitVersion = '1.9.3';
|
|
28
|
+
exports.reactReduxVersion = '8.0.5';
|
|
29
|
+
exports.reactTestRendererVersion = '18.2.0';
|
|
30
|
+
exports.eslintPluginImportVersion = '2.27.5';
|
|
31
|
+
exports.eslintPluginJsxA11yVersion = '6.7.1';
|
|
32
|
+
exports.eslintPluginReactVersion = '7.32.2';
|
|
33
|
+
exports.eslintPluginReactHooksVersion = '4.6.0';
|
|
34
|
+
exports.babelPluginStyledComponentsVersion = '1.10.7';
|
|
35
|
+
exports.tsLibVersion = '^2.3.0';
|
|
36
|
+
exports.postcssVersion = '8.4.21';
|
|
37
|
+
exports.tailwindcssVersion = '3.2.7';
|
|
38
|
+
exports.autoprefixerVersion = '10.4.13';
|
|
39
|
+
// SSR and Module Federation
|
|
40
|
+
exports.expressVersion = '~4.18.2';
|
|
41
|
+
exports.typesExpressVersion = '4.17.17';
|
|
42
|
+
exports.isbotVersion = '^3.6.5';
|
|
43
|
+
exports.corsVersion = '~2.8.5';
|
|
44
|
+
exports.typesCorsVersion = '~2.8.12';
|
|
45
|
+
exports.moduleFederationNodeVersion = '~0.9.9';
|
|
46
|
+
// style preprocessors
|
|
47
|
+
exports.lessVersion = '3.12.2';
|
|
48
|
+
exports.sassVersion = '^1.55.0';
|
|
49
|
+
// rollup plugins (if needed)
|
|
50
|
+
exports.rollupPluginUrlVersion = '^7.0.0';
|
|
51
|
+
exports.svgrRollupVersion = '^8.0.1';
|
|
52
|
+
exports.swcPluginStyledJsxVersion = '^1.5.67';
|
|
53
|
+
exports.swcPluginEmotionVersion = '^2.5.67';
|
|
54
|
+
exports.swcPluginStyledComponentsVersion = '^1.5.67';
|