@nx/react 16.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE +22 -0
- package/README.md +63 -0
- package/ast-utils.d.ts +1 -0
- package/ast-utils.js +12 -0
- package/ast-utils.js.map +1 -0
- package/babel.d.ts +16 -0
- package/babel.js +52 -0
- package/babel.js.map +1 -0
- package/executors.json +26 -0
- package/generators.json +223 -0
- package/index.d.ts +21 -0
- package/index.js +47 -0
- package/index.js.map +1 -0
- package/migrations.json +870 -0
- package/module-federation.d.ts +4 -0
- package/module-federation.js +13 -0
- package/module-federation.js.map +1 -0
- package/package.json +49 -0
- package/plugins/bundle-rollup.d.ts +1 -0
- package/plugins/bundle-rollup.js +42 -0
- package/plugins/bundle-rollup.js.map +1 -0
- package/plugins/component-testing/index.d.ts +38 -0
- package/plugins/component-testing/index.js +122 -0
- package/plugins/component-testing/index.js.map +1 -0
- package/plugins/component-testing/webpack-fallback.d.ts +5 -0
- package/plugins/component-testing/webpack-fallback.js +135 -0
- package/plugins/component-testing/webpack-fallback.js.map +1 -0
- package/plugins/jest.d.ts +1 -0
- package/plugins/jest.js +62 -0
- package/plugins/jest.js.map +1 -0
- package/plugins/storybook/index.d.ts +3 -0
- package/plugins/storybook/index.js +77 -0
- package/plugins/storybook/index.js.map +1 -0
- package/plugins/storybook/merge-plugins.d.ts +3 -0
- package/plugins/storybook/merge-plugins.js +18 -0
- package/plugins/storybook/merge-plugins.js.map +1 -0
- package/plugins/webpack.d.ts +3 -0
- package/plugins/webpack.js +15 -0
- package/plugins/webpack.js.map +1 -0
- package/plugins/with-react.d.ts +12 -0
- package/plugins/with-react.js +82 -0
- package/plugins/with-react.js.map +1 -0
- package/src/executors/module-federation-dev-server/compat.d.ts +2 -0
- package/src/executors/module-federation-dev-server/compat.js +6 -0
- package/src/executors/module-federation-dev-server/compat.js.map +1 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +11 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +55 -0
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js.map +1 -0
- package/src/executors/module-federation-dev-server/schema.json +96 -0
- package/src/executors/module-federation-ssr-dev-server/compat.d.ts +2 -0
- package/src/executors/module-federation-ssr-dev-server/compat.js +6 -0
- package/src/executors/module-federation-ssr-dev-server/compat.js.map +1 -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 +71 -0
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js.map +1 -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 +129 -0
- package/src/generators/application/application.js.map +1 -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/.babelrc__tmpl__ +13 -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/environments/environment.prod.ts__tmpl__ +3 -0
- package/src/generators/application/files/base-webpack/src/environments/environment.ts__tmpl__ +6 -0
- package/src/generators/application/files/base-webpack/src/favicon.ico +0 -0
- package/src/generators/application/files/base-webpack/src/index.html +14 -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__ +9 -0
- package/src/generators/application/files/nx-welcome/src/app/nx-welcome.tsx +845 -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__ +37 -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__ +36 -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__ +35 -0
- package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +29 -0
- package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +40 -0
- package/src/generators/application/lib/add-cypress.d.ts +3 -0
- package/src/generators/application/lib/add-cypress.js +22 -0
- package/src/generators/application/lib/add-cypress.js.map +1 -0
- package/src/generators/application/lib/add-jest.d.ts +3 -0
- package/src/generators/application/lib/add-jest.js +17 -0
- package/src/generators/application/lib/add-jest.js.map +1 -0
- package/src/generators/application/lib/add-project.d.ts +2 -0
- package/src/generators/application/lib/add-project.js +98 -0
- package/src/generators/application/lib/add-project.js.map +1 -0
- package/src/generators/application/lib/add-routing.d.ts +3 -0
- package/src/generators/application/lib/add-routing.js +32 -0
- package/src/generators/application/lib/add-routing.js.map +1 -0
- package/src/generators/application/lib/create-application-files.d.ts +3 -0
- package/src/generators/application/lib/create-application-files.js +47 -0
- package/src/generators/application/lib/create-application-files.js.map +1 -0
- package/src/generators/application/lib/find-free-port.d.ts +2 -0
- package/src/generators/application/lib/find-free-port.js +18 -0
- package/src/generators/application/lib/find-free-port.js.map +1 -0
- package/src/generators/application/lib/get-app-tests.d.ts +2 -0
- package/src/generators/application/lib/get-app-tests.js +22 -0
- package/src/generators/application/lib/get-app-tests.js.map +1 -0
- package/src/generators/application/lib/install-common-dependencies.d.ts +3 -0
- package/src/generators/application/lib/install-common-dependencies.js +29 -0
- package/src/generators/application/lib/install-common-dependencies.js.map +1 -0
- package/src/generators/application/lib/normalize-options.d.ts +5 -0
- package/src/generators/application/lib/normalize-options.js +60 -0
- package/src/generators/application/lib/normalize-options.js.map +1 -0
- package/src/generators/application/lib/set-defaults.d.ts +3 -0
- package/src/generators/application/lib/set-defaults.js +23 -0
- package/src/generators/application/lib/set-defaults.js.map +1 -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/lib/update-jest-config.js.map +1 -0
- package/src/generators/application/schema.d.ts +44 -0
- package/src/generators/application/schema.json +196 -0
- package/src/generators/component/component.d.ts +5 -0
- package/src/generators/component/component.js +141 -0
- package/src/generators/component/component.js.map +1 -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__ +71 -0
- package/src/generators/component/get-component-tests.d.ts +2 -0
- package/src/generators/component/get-component-tests.js +13 -0
- package/src/generators/component/get-component-tests.js.map +1 -0
- package/src/generators/component/noramlized-schema.d.ts +8 -0
- package/src/generators/component/noramlized-schema.js +3 -0
- package/src/generators/component/noramlized-schema.js.map +1 -0
- package/src/generators/component/schema.d.ts +20 -0
- package/src/generators/component/schema.json +153 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +14 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.js +105 -0
- package/src/generators/component-cypress-spec/component-cypress-spec.js.map +1 -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 +81 -0
- package/src/generators/component-story/component-story.js.map +1 -0
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +32 -0
- package/src/generators/component-story/schema.json +36 -0
- package/src/generators/component-test/component-test.d.ts +4 -0
- package/src/generators/component-test/component-test.js +78 -0
- package/src/generators/component-test/component-test.js.map +1 -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 +3 -0
- package/src/generators/component-test/schema.js.map +1 -0
- package/src/generators/component-test/schema.json +31 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +9 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +34 -0
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js.map +1 -0
- package/src/generators/cypress-component-configuration/files/cypress/support/commands.ts__tpl__ +42 -0
- package/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ +8 -0
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts +4 -0
- package/src/generators/cypress-component-configuration/lib/add-files.js +75 -0
- package/src/generators/cypress-component-configuration/lib/add-files.js.map +1 -0
- package/src/generators/cypress-component-configuration/lib/update-configs.d.ts +7 -0
- package/src/generators/cypress-component-configuration/lib/update-configs.js +30 -0
- package/src/generators/cypress-component-configuration/lib/update-configs.js.map +1 -0
- package/src/generators/cypress-component-configuration/schema.d.ts +7 -0
- package/src/generators/cypress-component-configuration/schema.json +54 -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 +117 -0
- package/src/generators/hook/hook.js.map +1 -0
- package/src/generators/hook/schema.d.ts +11 -0
- package/src/generators/hook/schema.json +77 -0
- package/src/generators/host/files/common/src/app/__fileName__.tsx__tmpl__ +33 -0
- package/src/generators/host/files/module-federation/module-federation.config.js__tmpl__ +6 -0
- package/src/generators/host/files/module-federation/src/main.ts__tmpl__ +1 -0
- package/src/generators/host/files/module-federation/src/remotes.d.ts__tmpl__ +4 -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__ +13 -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__ +15 -0
- package/src/generators/host/files/module-federation-ssr/webpack.server.config.js__tmpl__ +12 -0
- package/src/generators/host/host.d.ts +4 -0
- package/src/generators/host/host.js +67 -0
- package/src/generators/host/host.js.map +1 -0
- package/src/generators/host/lib/add-module-federation-files.d.ts +5 -0
- package/src/generators/host/lib/add-module-federation-files.js +21 -0
- package/src/generators/host/lib/add-module-federation-files.js.map +1 -0
- package/src/generators/host/lib/setup-ssr-for-host.d.ts +6 -0
- package/src/generators/host/lib/setup-ssr-for-host.js +27 -0
- package/src/generators/host/lib/setup-ssr-for-host.js.map +1 -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 +16 -0
- package/src/generators/host/lib/update-module-federation-e2e-project.js.map +1 -0
- package/src/generators/host/schema.d.ts +31 -0
- package/src/generators/host/schema.json +168 -0
- package/src/generators/init/init.d.ts +5 -0
- package/src/generators/init/init.js +80 -0
- package/src/generators/init/init.js.map +1 -0
- package/src/generators/init/schema.d.ts +11 -0
- package/src/generators/init/schema.json +49 -0
- package/src/generators/library/files/common/.babelrc__tmpl__ +16 -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 +38 -0
- package/src/generators/library/lib/add-linting.js.map +1 -0
- package/src/generators/library/lib/add-rollup-build-target.d.ts +3 -0
- package/src/generators/library/lib/add-rollup-build-target.js +59 -0
- package/src/generators/library/lib/add-rollup-build-target.js.map +1 -0
- package/src/generators/library/lib/create-files.d.ts +3 -0
- package/src/generators/library/lib/create-files.js +26 -0
- package/src/generators/library/lib/create-files.js.map +1 -0
- package/src/generators/library/lib/install-common-dependencies.d.ts +3 -0
- package/src/generators/library/lib/install-common-dependencies.js +30 -0
- package/src/generators/library/lib/install-common-dependencies.js.map +1 -0
- package/src/generators/library/lib/maybe-js.d.ts +2 -0
- package/src/generators/library/lib/maybe-js.js +10 -0
- package/src/generators/library/lib/maybe-js.js.map +1 -0
- package/src/generators/library/lib/normalize-options.d.ts +3 -0
- package/src/generators/library/lib/normalize-options.js +57 -0
- package/src/generators/library/lib/normalize-options.js.map +1 -0
- package/src/generators/library/lib/set-defaults.d.ts +3 -0
- package/src/generators/library/lib/set-defaults.js +16 -0
- package/src/generators/library/lib/set-defaults.js.map +1 -0
- package/src/generators/library/lib/update-app-routes.d.ts +3 -0
- package/src/generators/library/lib/update-app-routes.js +63 -0
- package/src/generators/library/lib/update-app-routes.js.map +1 -0
- package/src/generators/library/library.d.ts +5 -0
- package/src/generators/library/library.js +128 -0
- package/src/generators/library/library.js.map +1 -0
- package/src/generators/library/schema.d.ts +43 -0
- package/src/generators/library/schema.json +192 -0
- package/src/generators/redux/files/__directory__/__fileName__.slice.spec.ts__tmpl__ +53 -0
- package/src/generators/redux/files/__directory__/__fileName__.slice.ts__tmpl__ +129 -0
- package/src/generators/redux/redux.d.ts +5 -0
- package/src/generators/redux/redux.js +117 -0
- package/src/generators/redux/redux.js.map +1 -0
- package/src/generators/redux/schema.d.ts +20 -0
- package/src/generators/redux/schema.json +47 -0
- package/src/generators/remote/files/module-federation/module-federation.config.js__tmpl__ +6 -0
- package/src/generators/remote/files/module-federation/src/main.ts__tmpl__ +1 -0
- package/src/generators/remote/files/module-federation/src/remote-entry.ts__tmpl__ +1 -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/lib/setup-ssr-for-remote.d.ts +4 -0
- package/src/generators/remote/lib/setup-ssr-for-remote.js +32 -0
- package/src/generators/remote/lib/setup-ssr-for-remote.js.map +1 -0
- package/src/generators/remote/lib/update-host-with-remote.d.ts +2 -0
- package/src/generators/remote/lib/update-host-with-remote.js +53 -0
- package/src/generators/remote/lib/update-host-with-remote.js.map +1 -0
- package/src/generators/remote/remote.d.ts +6 -0
- package/src/generators/remote/remote.js +56 -0
- package/src/generators/remote/remote.js.map +1 -0
- package/src/generators/remote/schema.d.ts +26 -0
- package/src/generators/remote/schema.json +167 -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__ +15 -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 +5 -0
- package/src/generators/setup-ssr/setup-ssr.js +162 -0
- package/src/generators/setup-ssr/setup-ssr.js.map +1 -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/add-tailwind-style-imports.js.map +1 -0
- package/src/generators/setup-tailwind/lib/update-project.d.ts +3 -0
- package/src/generators/setup-tailwind/lib/update-project.js +15 -0
- package/src/generators/setup-tailwind/lib/update-project.js.map +1 -0
- package/src/generators/setup-tailwind/schema.d.ts +6 -0
- package/src/generators/setup-tailwind/schema.js +3 -0
- package/src/generators/setup-tailwind/schema.js.map +1 -0
- package/src/generators/setup-tailwind/schema.json +47 -0
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +5 -0
- package/src/generators/setup-tailwind/setup-tailwind.js +39 -0
- package/src/generators/setup-tailwind/setup-tailwind.js.map +1 -0
- package/src/generators/stories/schema.json +59 -0
- package/src/generators/stories/stories.d.ts +15 -0
- package/src/generators/stories/stories.js +118 -0
- package/src/generators/stories/stories.js.map +1 -0
- package/src/generators/storybook-configuration/configuration.d.ts +5 -0
- package/src/generators/storybook-configuration/configuration.js +64 -0
- package/src/generators/storybook-configuration/configuration.js.map +1 -0
- package/src/generators/storybook-configuration/schema.d.ts +17 -0
- package/src/generators/storybook-configuration/schema.json +103 -0
- package/src/migrations/update-12-0-0/remove-react-redux-types-package.d.ts +3 -0
- package/src/migrations/update-12-0-0/remove-react-redux-types-package.js +13 -0
- package/src/migrations/update-12-0-0/remove-react-redux-types-package.js.map +1 -0
- package/src/migrations/update-12-0-0/update-emotion-setup.d.ts +3 -0
- package/src/migrations/update-12-0-0/update-emotion-setup.js +67 -0
- package/src/migrations/update-12-0-0/update-emotion-setup.js.map +1 -0
- package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.d.ts +3 -0
- package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js +27 -0
- package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js.map +1 -0
- package/src/migrations/update-12-8-0/update-12-8-0.d.ts +3 -0
- package/src/migrations/update-12-8-0/update-12-8-0.js +15 -0
- package/src/migrations/update-12-8-0/update-12-8-0.js.map +1 -0
- package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.d.ts +3 -0
- package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js +38 -0
- package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js.map +1 -0
- package/src/migrations/update-13-0-0/update-emotion-setup.d.ts +3 -0
- package/src/migrations/update-13-0-0/update-emotion-setup.js +39 -0
- package/src/migrations/update-13-0-0/update-emotion-setup.js.map +1 -0
- package/src/migrations/update-13-0-0/webpack5-changes-utils.d.ts +11 -0
- package/src/migrations/update-13-0-0/webpack5-changes-utils.js +269 -0
- package/src/migrations/update-13-0-0/webpack5-changes-utils.js.map +1 -0
- package/src/migrations/update-13-10-0/update-13-10-0.d.ts +3 -0
- package/src/migrations/update-13-10-0/update-13-10-0.js +29 -0
- package/src/migrations/update-13-10-0/update-13-10-0.js.map +1 -0
- package/src/migrations/update-14-0-0/add-default-development-configurations.d.ts +3 -0
- package/src/migrations/update-14-0-0/add-default-development-configurations.js +40 -0
- package/src/migrations/update-14-0-0/add-default-development-configurations.js.map +1 -0
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.d.ts +3 -0
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js +27 -0
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js.map +1 -0
- package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.d.ts +5 -0
- package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js +69 -0
- package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js.map +1 -0
- package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.d.ts +3 -0
- package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js +38 -0
- package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js.map +1 -0
- package/src/migrations/update-14-6-0/add-preset-jest-config.d.ts +3 -0
- package/src/migrations/update-14-6-0/add-preset-jest-config.js +40 -0
- package/src/migrations/update-14-6-0/add-preset-jest-config.js.map +1 -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 +39 -0
- package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js.map +1 -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 +17 -0
- package/src/migrations/update-15-3-0/update-rollup-executor.js.map +1 -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 +108 -0
- package/src/migrations/update-15-6-3/webpack-config-setup.js.map +1 -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 +13 -0
- package/src/migrations/update-16-0-0-add-nx-packages/update-16-0-0-add-nx-packages.js.map +1 -0
- package/src/module-federation/ast-utils.d.ts +8 -0
- package/src/module-federation/ast-utils.js +103 -0
- package/src/module-federation/ast-utils.js.map +1 -0
- package/src/module-federation/load-config.d.ts +3 -0
- package/src/module-federation/load-config.js +17 -0
- package/src/module-federation/load-config.js.map +1 -0
- package/src/module-federation/models.d.ts +24 -0
- package/src/module-federation/models.js +3 -0
- package/src/module-federation/models.js.map +1 -0
- package/src/module-federation/package-json.d.ts +8 -0
- package/src/module-federation/package-json.js +14 -0
- package/src/module-federation/package-json.js.map +1 -0
- package/src/module-federation/utils.d.ts +10 -0
- package/src/module-federation/utils.js +38 -0
- package/src/module-federation/utils.js.map +1 -0
- package/src/module-federation/with-module-federation-ssr.d.ts +2 -0
- package/src/module-federation/with-module-federation-ssr.js +48 -0
- package/src/module-federation/with-module-federation-ssr.js.map +1 -0
- package/src/module-federation/with-module-federation.d.ts +7 -0
- package/src/module-federation/with-module-federation.js +50 -0
- package/src/module-federation/with-module-federation.js.map +1 -0
- package/src/rules/add-styled-dependencies.d.ts +2 -0
- package/src/rules/add-styled-dependencies.js +16 -0
- package/src/rules/add-styled-dependencies.js.map +1 -0
- package/src/rules/update-module-federation-project.d.ts +6 -0
- package/src/rules/update-module-federation-project.js +34 -0
- package/src/rules/update-module-federation-project.js.map +1 -0
- package/src/utils/assertion.d.ts +1 -0
- package/src/utils/assertion.js +20 -0
- package/src/utils/assertion.js.map +1 -0
- package/src/utils/ast-utils.d.ts +29 -0
- package/src/utils/ast-utils.js +526 -0
- package/src/utils/ast-utils.js.map +1 -0
- package/src/utils/component-props.d.ts +15 -0
- package/src/utils/component-props.js +61 -0
- package/src/utils/component-props.js.map +1 -0
- package/src/utils/create-ts-config.d.ts +9 -0
- package/src/utils/create-ts-config.js +64 -0
- package/src/utils/create-ts-config.js.map +1 -0
- package/src/utils/dependencies.d.ts +7 -0
- package/src/utils/dependencies.js +3 -0
- package/src/utils/dependencies.js.map +1 -0
- package/src/utils/format-file.d.ts +1 -0
- package/src/utils/format-file.js +13 -0
- package/src/utils/format-file.js.map +1 -0
- package/src/utils/get-in-source-vitest-tests-template.d.ts +1 -0
- package/src/utils/get-in-source-vitest-tests-template.js +22 -0
- package/src/utils/get-in-source-vitest-tests-template.js.map +1 -0
- package/src/utils/jest-utils.d.ts +1 -0
- package/src/utils/jest-utils.js +10 -0
- package/src/utils/jest-utils.js.map +1 -0
- package/src/utils/lint.d.ts +37 -0
- package/src/utils/lint.js +68 -0
- package/src/utils/lint.js.map +1 -0
- package/src/utils/styled.d.ts +4 -0
- package/src/utils/styled.js +33 -0
- package/src/utils/styled.js.map +1 -0
- package/src/utils/testing-generators.d.ts +3 -0
- package/src/utils/testing-generators.js +35 -0
- package/src/utils/testing-generators.js.map +1 -0
- package/src/utils/versions.d.ts +43 -0
- package/src/utils/versions.js +51 -0
- package/src/utils/versions.js.map +1 -0
- package/tailwind.d.ts +6 -0
- package/tailwind.js +30 -0
- package/tailwind.js.map +1 -0
- package/typings/cssmodule.d.ts +24 -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,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"$id": "GeneratorReactSSRSetup",
|
|
4
|
+
"cli": "nx",
|
|
5
|
+
"title": "Generate SSR setup for a React app",
|
|
6
|
+
"description": "Create the additional configuration required to enable SSR via Express for a React application.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"project": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"description": "The name of the application to add SSR support to.",
|
|
12
|
+
"$default": {
|
|
13
|
+
"$source": "argv",
|
|
14
|
+
"index": 0
|
|
15
|
+
},
|
|
16
|
+
"x-prompt": "What app would you like to add SSR support to?",
|
|
17
|
+
"x-dropdown": "projects",
|
|
18
|
+
"x-priority": "important"
|
|
19
|
+
},
|
|
20
|
+
"appComponentImportPath": {
|
|
21
|
+
"type": "string",
|
|
22
|
+
"description": "The import path of the <App/ > component, relative to project sourceRoot.",
|
|
23
|
+
"default": "app/app"
|
|
24
|
+
},
|
|
25
|
+
"serverPort": {
|
|
26
|
+
"type": "number",
|
|
27
|
+
"default": 4200,
|
|
28
|
+
"description": "The port for the Express server.",
|
|
29
|
+
"x-priority": "important"
|
|
30
|
+
},
|
|
31
|
+
"skipFormat": {
|
|
32
|
+
"type": "boolean",
|
|
33
|
+
"description": "Skip formatting the workspace after the generator completes.",
|
|
34
|
+
"x-priority": "internal"
|
|
35
|
+
},
|
|
36
|
+
"extraInclude": {
|
|
37
|
+
"type": "array",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string"
|
|
40
|
+
},
|
|
41
|
+
"hidden": true,
|
|
42
|
+
"description": "Extra include entries in tsconfig.",
|
|
43
|
+
"default": []
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"required": ["project"],
|
|
47
|
+
"additionalProperties": false
|
|
48
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Tree } from '@nx/devkit';
|
|
2
|
+
import type { Schema } from './schema';
|
|
3
|
+
export declare function setupSsrGenerator(tree: Tree, options: Schema): Promise<import("@nx/devkit").GeneratorCallback>;
|
|
4
|
+
export default setupSsrGenerator;
|
|
5
|
+
export declare const setupSsrSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupSsrSchematic = exports.setupSsrGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const init_1 = require("../init/init");
|
|
7
|
+
const versions_1 = require("../../utils/versions");
|
|
8
|
+
const ast_utils_1 = require("../../utils/ast-utils");
|
|
9
|
+
const ensure_typescript_1 = require("@nx/js/src/utils/typescript/ensure-typescript");
|
|
10
|
+
let tsModule;
|
|
11
|
+
function readEntryFile(host, path) {
|
|
12
|
+
if (!tsModule) {
|
|
13
|
+
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
14
|
+
}
|
|
15
|
+
const content = host.read(path, 'utf-8');
|
|
16
|
+
return {
|
|
17
|
+
content,
|
|
18
|
+
source: tsModule.createSourceFile(path, content, tsModule.ScriptTarget.Latest, true),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
function setupSsrGenerator(tree, options) {
|
|
22
|
+
var _a, _b, _c, _d, _e;
|
|
23
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
yield (0, init_1.default)(tree, { skipFormat: true });
|
|
25
|
+
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
26
|
+
const projectRoot = projectConfig.root;
|
|
27
|
+
const appImportCandidates = [
|
|
28
|
+
(_a = options.appComponentImportPath) !== null && _a !== void 0 ? _a : 'app/app',
|
|
29
|
+
'app',
|
|
30
|
+
'App',
|
|
31
|
+
'app/App',
|
|
32
|
+
'App/App',
|
|
33
|
+
].map((importPath) => {
|
|
34
|
+
return {
|
|
35
|
+
importPath,
|
|
36
|
+
filePath: (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot || projectConfig.root, `${importPath}.tsx`),
|
|
37
|
+
};
|
|
38
|
+
});
|
|
39
|
+
const appComponentInfo = appImportCandidates.find((candidate) => tree.exists(candidate.filePath));
|
|
40
|
+
if (!appComponentInfo) {
|
|
41
|
+
throw new Error(`Cannot find an import path for <App/> component. Try passing setting --appComponentImportPath option.`);
|
|
42
|
+
}
|
|
43
|
+
if (!projectConfig.targets.build || !projectConfig.targets.serve) {
|
|
44
|
+
throw new Error(`Project ${options.project} does not have build and serve targets`);
|
|
45
|
+
}
|
|
46
|
+
if (projectConfig.targets.server) {
|
|
47
|
+
throw new Error(`Project ${options.project} already has a server target.`);
|
|
48
|
+
}
|
|
49
|
+
const originalOutputPath = (_c = (_b = projectConfig.targets.build) === null || _b === void 0 ? void 0 : _b.options) === null || _c === void 0 ? void 0 : _c.outputPath;
|
|
50
|
+
if (!originalOutputPath) {
|
|
51
|
+
throw new Error(`Project ${options.project} does not contain a outputPath for the build target.`);
|
|
52
|
+
}
|
|
53
|
+
projectConfig.targets.build.options.outputPath = (0, devkit_1.joinPathFragments)(originalOutputPath, 'browser');
|
|
54
|
+
projectConfig.targets = Object.assign(Object.assign({}, projectConfig.targets), { server: {
|
|
55
|
+
dependsOn: ['build'],
|
|
56
|
+
executor: '@nrwl/webpack:webpack',
|
|
57
|
+
outputs: ['{options.outputPath}'],
|
|
58
|
+
defaultConfiguration: 'production',
|
|
59
|
+
options: {
|
|
60
|
+
target: 'node',
|
|
61
|
+
main: `${projectRoot}/server.ts`,
|
|
62
|
+
outputPath: (0, devkit_1.joinPathFragments)(originalOutputPath, 'server'),
|
|
63
|
+
tsConfig: `${projectRoot}/tsconfig.server.json`,
|
|
64
|
+
compiler: 'babel',
|
|
65
|
+
externalDependencies: 'all',
|
|
66
|
+
outputHashing: 'none',
|
|
67
|
+
isolatedConfig: true,
|
|
68
|
+
webpackConfig: (0, devkit_1.joinPathFragments)(projectRoot, 'webpack.config.js'),
|
|
69
|
+
},
|
|
70
|
+
configurations: {
|
|
71
|
+
development: {
|
|
72
|
+
optimization: false,
|
|
73
|
+
sourceMap: true,
|
|
74
|
+
},
|
|
75
|
+
production: {
|
|
76
|
+
fileReplacements: [
|
|
77
|
+
{
|
|
78
|
+
replace: `${projectRoot}/src/environments/environment.ts`,
|
|
79
|
+
with: `${projectRoot}/src/environments/environment.prod.ts`,
|
|
80
|
+
},
|
|
81
|
+
],
|
|
82
|
+
sourceMap: false,
|
|
83
|
+
},
|
|
84
|
+
},
|
|
85
|
+
}, 'serve-browser': projectConfig.targets.serve, 'serve-server': {
|
|
86
|
+
executor: '@nrwl/js:node',
|
|
87
|
+
defaultConfiguration: 'development',
|
|
88
|
+
options: {
|
|
89
|
+
buildTarget: `${options.project}:server:development`,
|
|
90
|
+
buildTargetOptions: {
|
|
91
|
+
watch: true,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
configurations: {
|
|
95
|
+
development: {},
|
|
96
|
+
production: {
|
|
97
|
+
buildTarget: `${options.project}:server:production`,
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
}, serve: {
|
|
101
|
+
executor: '@nrwl/webpack:ssr-dev-server',
|
|
102
|
+
defaultConfiguration: 'development',
|
|
103
|
+
options: {
|
|
104
|
+
browserTarget: `${options.project}:build:development`,
|
|
105
|
+
serverTarget: `${options.project}:serve-server:development`,
|
|
106
|
+
port: options.serverPort,
|
|
107
|
+
browserTargetOptions: {
|
|
108
|
+
watch: true,
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
configurations: {
|
|
112
|
+
development: {},
|
|
113
|
+
production: {
|
|
114
|
+
browserTarget: `${options.project}:build:production`,
|
|
115
|
+
serverTarget: `${options.project}:serve-server:production`,
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
} });
|
|
119
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
|
120
|
+
const nxJson = (0, devkit_1.readNxJson)(tree);
|
|
121
|
+
if (((_d = nxJson.tasksRunnerOptions) === null || _d === void 0 ? void 0 : _d.default) &&
|
|
122
|
+
!nxJson.tasksRunnerOptions.default.options.cacheableOperations.includes('server')) {
|
|
123
|
+
nxJson.tasksRunnerOptions.default.options.cacheableOperations = [
|
|
124
|
+
...nxJson.tasksRunnerOptions.default.options.cacheableOperations,
|
|
125
|
+
'server',
|
|
126
|
+
];
|
|
127
|
+
}
|
|
128
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), projectRoot, {
|
|
129
|
+
tmpl: '',
|
|
130
|
+
extraInclude: ((_e = options.extraInclude) === null || _e === void 0 ? void 0 : _e.length) > 0
|
|
131
|
+
? `"${options.extraInclude.join('", "')}",`
|
|
132
|
+
: '',
|
|
133
|
+
appComponentImport: appComponentInfo.importPath,
|
|
134
|
+
browserBuildOutputPath: projectConfig.targets.build.options.outputPath,
|
|
135
|
+
});
|
|
136
|
+
// Add <StaticRouter> to server main if needed.
|
|
137
|
+
// TODO: need to read main.server.tsx not main.tsx.
|
|
138
|
+
const appContent = tree.read(appComponentInfo.filePath, 'utf-8');
|
|
139
|
+
const isRouterPresent = appContent.match(/react-router-dom/);
|
|
140
|
+
if (isRouterPresent) {
|
|
141
|
+
const serverEntry = (0, devkit_1.joinPathFragments)(projectRoot, 'src/main.server.tsx');
|
|
142
|
+
const { content, source } = readEntryFile(tree, serverEntry);
|
|
143
|
+
const changes = (0, devkit_1.applyChangesToString)(content, (0, ast_utils_1.addStaticRouter)(serverEntry, source));
|
|
144
|
+
tree.write(serverEntry, changes);
|
|
145
|
+
}
|
|
146
|
+
(0, devkit_1.updateNxJson)(tree, nxJson);
|
|
147
|
+
const installTask = (0, devkit_1.addDependenciesToPackageJson)(tree, {
|
|
148
|
+
express: versions_1.expressVersion,
|
|
149
|
+
isbot: versions_1.isbotVersion,
|
|
150
|
+
cors: versions_1.corsVersion,
|
|
151
|
+
}, {
|
|
152
|
+
'@types/express': versions_1.typesExpressVersion,
|
|
153
|
+
'@types/cors': versions_1.typesCorsVersion,
|
|
154
|
+
});
|
|
155
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
156
|
+
return installTask;
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
exports.setupSsrGenerator = setupSsrGenerator;
|
|
160
|
+
exports.default = setupSsrGenerator;
|
|
161
|
+
exports.setupSsrSchematic = (0, devkit_1.convertNxGenerator)(setupSsrGenerator);
|
|
162
|
+
//# sourceMappingURL=setup-ssr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-ssr.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/setup-ssr/setup-ssr.ts"],"names":[],"mappings":";;;;AACA,uCAYoB;AACpB,uCAAyC;AAGzC,mDAM8B;AAC9B,qDAAwD;AACxD,qFAAiF;AAEjF,IAAI,QAAqC,CAAC;AAE1C,SAAS,aAAa,CACpB,IAAU,EACV,IAAY;IAEZ,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzC,OAAO;QACL,OAAO;QACP,MAAM,EAAE,QAAQ,CAAC,gBAAgB,CAC/B,IAAI,EACJ,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL;KACF,CAAC;AACJ,CAAC;AAOD,SAAsB,iBAAiB,CAAC,IAAU,EAAE,OAAe;;;QACjE,MAAM,IAAA,cAAa,EAAC,IAAI,EAAE,EAAE,UAAU,EAAE,IAAI,EAAE,CAAC,CAAC;QAChD,MAAM,aAAa,GAAG,IAAA,iCAAwB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CAAC,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { join } = require('path');
|
|
2
|
+
|
|
3
|
+
// Note: If you use library-specific PostCSS/Tailwind configuration then you should remove the `postcssConfig` build
|
|
4
|
+
// option from your application's configuration (i.e. project.json).
|
|
5
|
+
//
|
|
6
|
+
// See: https://nx.dev/guides/using-tailwind-css-in-react#step-4:-applying-configuration-to-libraries
|
|
7
|
+
|
|
8
|
+
module.exports = {
|
|
9
|
+
plugins: {
|
|
10
|
+
tailwindcss: {
|
|
11
|
+
config: join(__dirname, 'tailwind.config.js'),
|
|
12
|
+
},
|
|
13
|
+
autoprefixer: {},
|
|
14
|
+
},
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { createGlobPatternsForDependencies } = require('@nrwl/react/tailwind');
|
|
2
|
+
const { join } = require('path');
|
|
3
|
+
|
|
4
|
+
/** @type {import('tailwindcss').Config} */
|
|
5
|
+
module.exports = {
|
|
6
|
+
content: [
|
|
7
|
+
join(
|
|
8
|
+
__dirname,
|
|
9
|
+
'{src,pages,components}/**/*!(*.stories|*.spec).{ts,tsx,html}'
|
|
10
|
+
),
|
|
11
|
+
...createGlobPatternsForDependencies(__dirname),
|
|
12
|
+
],
|
|
13
|
+
theme: {
|
|
14
|
+
extend: {},
|
|
15
|
+
},
|
|
16
|
+
plugins: [],
|
|
17
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.addTailwindStyleImports = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
const knownLocations = [
|
|
6
|
+
// Plain React
|
|
7
|
+
'src/styles.css',
|
|
8
|
+
'src/styles.scss',
|
|
9
|
+
'src/styles.styl',
|
|
10
|
+
'src/styles.less',
|
|
11
|
+
// Next.js
|
|
12
|
+
'pages/styles.css',
|
|
13
|
+
'pages/styles.scss',
|
|
14
|
+
'pages/styles.styl',
|
|
15
|
+
'pages/styles.less',
|
|
16
|
+
];
|
|
17
|
+
function addTailwindStyleImports(tree, project, _options) {
|
|
18
|
+
const candidates = knownLocations.map((x) => (0, devkit_1.joinPathFragments)(project.root, x));
|
|
19
|
+
const stylesPath = candidates.find((x) => tree.exists(x));
|
|
20
|
+
if (stylesPath) {
|
|
21
|
+
const content = tree.read(stylesPath).toString();
|
|
22
|
+
tree.write(stylesPath, `@tailwind base;\n@tailwind components;\n@tailwind utilities;\n${content}`);
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
devkit_1.logger.warn((0, devkit_1.stripIndents) `
|
|
26
|
+
Could not find stylesheet to update. Add the following imports to your stylesheet (e.g. styles.css):
|
|
27
|
+
|
|
28
|
+
@tailwind base;
|
|
29
|
+
@tailwind components;
|
|
30
|
+
@tailwind utilities;
|
|
31
|
+
|
|
32
|
+
See our guide for more details: https://nx.dev/guides/using-tailwind-css-in-react`);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.addTailwindStyleImports = addTailwindStyleImports;
|
|
36
|
+
//# sourceMappingURL=add-tailwind-style-imports.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"add-tailwind-style-imports.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/setup-tailwind/lib/add-tailwind-style-imports.ts"],"names":[],"mappings":";;;AAAA,uCAMoB;AAKpB,MAAM,cAAc,GAAG;IACrB,cAAc;IACd,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IAEjB,UAAU;IACV,kBAAkB;IAClB,mBAAmB;IACnB,mBAAmB;IACnB,mBAAmB;CACpB,CAAC;AAEF,SAAgB,uBAAuB,CACrC,IAAU,EACV,OAA6B,EAC7B,QAA8B;IAE9B,MAAM,UAAU,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAC1C,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CACnC,CAAC;IACF,MAAM,UAAU,GAAG,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;IAE1D,IAAI,UAAU,EAAE;QACd,MAAM,OAAO,GAAG,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjD,IAAI,CAAC,KAAK,CACR,UAAU,EACV,iEAAiE,OAAO,EAAE,CAC3E,CAAC;KACH;SAAM;QACL,eAAM,CAAC,IAAI,CACT,IAAA,qBAAY,EAAA;;;;;;;0FAOwE,CACrF,CAAC;KACH;AACH,CAAC;AA5BD,0DA4BC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.updateProject = void 0;
|
|
4
|
+
const devkit_1 = require("@nx/devkit");
|
|
5
|
+
function updateProject(tree, config, options) {
|
|
6
|
+
var _a, _b, _c;
|
|
7
|
+
var _d;
|
|
8
|
+
if (((_b = (_a = config === null || config === void 0 ? void 0 : config.targets) === null || _a === void 0 ? void 0 : _a.build) === null || _b === void 0 ? void 0 : _b.executor) === '@nrwl/webpack:webpack') {
|
|
9
|
+
(_c = (_d = config.targets.build).options) !== null && _c !== void 0 ? _c : (_d.options = {});
|
|
10
|
+
config.targets.build.options.postcssConfig = (0, devkit_1.joinPathFragments)(config.root, 'postcss.config.js');
|
|
11
|
+
(0, devkit_1.updateProjectConfiguration)(tree, options.project, config);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.updateProject = updateProject;
|
|
15
|
+
//# sourceMappingURL=update-project.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update-project.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/setup-tailwind/lib/update-project.ts"],"names":[],"mappings":";;;AACA,uCAA2E;AAI3E,SAAgB,aAAa,CAC3B,IAAU,EACV,MAA4B,EAC5B,OAA6B;;;IAE7B,IAAI,CAAA,MAAA,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,OAAO,0CAAE,KAAK,0CAAE,QAAQ,MAAK,uBAAuB,EAAE;QAChE,YAAA,MAAM,CAAC,OAAO,CAAC,KAAK,EAAC,OAAO,uCAAP,OAAO,GAAK,EAAE,EAAC;QACpC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,aAAa,GAAG,IAAA,0BAAiB,EAC5D,MAAM,CAAC,IAAI,EACX,mBAAmB,CACpB,CAAC;QACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;KAC3D;AACH,CAAC;AAbD,sCAaC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/setup-tailwind/schema.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxReactTailwindSetupGenerator",
|
|
5
|
+
"title": "Configures Tailwind CSS for an application or a buildable/publishable library.",
|
|
6
|
+
"description": "Adds the Tailwind CSS configuration files for a given React project and installs, if needed, the packages required for Tailwind CSS to work.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"examples": [
|
|
9
|
+
{
|
|
10
|
+
"command": "nx g setup-tailwind --project=my-app",
|
|
11
|
+
"description": "Initialize Tailwind configuration for the `my-app` project."
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"properties": {
|
|
15
|
+
"project": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "The name of the project to add the Tailwind CSS setup for.",
|
|
18
|
+
"alias": "p",
|
|
19
|
+
"$default": {
|
|
20
|
+
"$source": "argv",
|
|
21
|
+
"index": 0
|
|
22
|
+
},
|
|
23
|
+
"x-dropdown": "projects",
|
|
24
|
+
"x-prompt": "What project would you like to add the Tailwind CSS setup?",
|
|
25
|
+
"x-priority": "important"
|
|
26
|
+
},
|
|
27
|
+
"buildTarget": {
|
|
28
|
+
"type": "string",
|
|
29
|
+
"description": "The name of the target used to build the project. This option is not needed in most cases.",
|
|
30
|
+
"default": "build",
|
|
31
|
+
"x-priority": "important"
|
|
32
|
+
},
|
|
33
|
+
"skipFormat": {
|
|
34
|
+
"type": "boolean",
|
|
35
|
+
"description": "Skips formatting the workspace after the generator completes.",
|
|
36
|
+
"x-priority": "internal"
|
|
37
|
+
},
|
|
38
|
+
"skipPackageJson": {
|
|
39
|
+
"type": "boolean",
|
|
40
|
+
"default": false,
|
|
41
|
+
"description": "Do not add dependencies to `package.json`.",
|
|
42
|
+
"x-priority": "internal"
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"additionalProperties": false,
|
|
46
|
+
"required": ["project"]
|
|
47
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { GeneratorCallback, Tree } from '@nx/devkit';
|
|
2
|
+
import type { SetupTailwindOptions } from './schema';
|
|
3
|
+
export declare function setupTailwindGenerator(tree: Tree, options: SetupTailwindOptions): Promise<GeneratorCallback>;
|
|
4
|
+
export default setupTailwindGenerator;
|
|
5
|
+
export declare const setupTailwindSchematic: (generatorOptions: SetupTailwindOptions) => (tree: any, context: any) => Promise<any>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setupTailwindSchematic = exports.setupTailwindGenerator = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const devkit_1 = require("@nx/devkit");
|
|
6
|
+
const versions_1 = require("../../utils/versions");
|
|
7
|
+
const add_tailwind_style_imports_1 = require("./lib/add-tailwind-style-imports");
|
|
8
|
+
const update_project_1 = require("./lib/update-project");
|
|
9
|
+
function setupTailwindGenerator(tree, options) {
|
|
10
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
+
const tasks = [];
|
|
12
|
+
const project = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
13
|
+
if (tree.exists((0, devkit_1.joinPathFragments)(project.root, 'postcss.config.js')) ||
|
|
14
|
+
tree.exists((0, devkit_1.joinPathFragments)(project.root, 'tailwind.config.js'))) {
|
|
15
|
+
devkit_1.logger.info(`Skipping setup since there are existing PostCSS or Tailwind configuration files. For manual setup instructions, see https://nx.dev/guides/using-tailwind-css-in-react.`);
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files'), project.root, {
|
|
19
|
+
tmpl: '',
|
|
20
|
+
});
|
|
21
|
+
(0, add_tailwind_style_imports_1.addTailwindStyleImports)(tree, project, options);
|
|
22
|
+
(0, update_project_1.updateProject)(tree, project, options);
|
|
23
|
+
if (!options.skipPackageJson) {
|
|
24
|
+
tasks.push((0, devkit_1.addDependenciesToPackageJson)(tree, {}, {
|
|
25
|
+
autoprefixer: versions_1.autoprefixerVersion,
|
|
26
|
+
postcss: versions_1.postcssVersion,
|
|
27
|
+
tailwindcss: versions_1.tailwindcssVersion,
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
if (!options.skipFormat) {
|
|
31
|
+
yield (0, devkit_1.formatFiles)(tree);
|
|
32
|
+
}
|
|
33
|
+
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
exports.setupTailwindGenerator = setupTailwindGenerator;
|
|
37
|
+
exports.default = setupTailwindGenerator;
|
|
38
|
+
exports.setupTailwindSchematic = (0, devkit_1.convertNxGenerator)(setupTailwindGenerator);
|
|
39
|
+
//# sourceMappingURL=setup-tailwind.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"setup-tailwind.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/setup-tailwind/setup-tailwind.ts"],"names":[],"mappings":";;;;AACA,uCASoB;AAEpB,mDAI8B;AAE9B,iFAA2E;AAC3E,yDAAqD;AAErD,SAAsB,sBAAsB,CAC1C,IAAU,EACV,OAA6B;;QAE7B,MAAM,KAAK,GAAwB,EAAE,CAAC;QACtC,MAAM,OAAO,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEhE,IACE,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;YACjE,IAAI,CAAC,MAAM,CAAC,IAAA,0BAAiB,EAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,CAAC,CAAC,EAClE;YACA,eAAM,CAAC,IAAI,CACT,wKAAwK,CACzK,CAAC;YACF,OAAO;SACR;QAED,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,EAAE;YACzE,IAAI,EAAE,EAAE;SACT,CAAC,CAAC;QAEH,IAAA,oDAAuB,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAEhD,IAAA,8BAAa,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;QAEtC,IAAI,CAAC,OAAO,CAAC,eAAe,EAAE;YAC5B,KAAK,CAAC,IAAI,CACR,IAAA,qCAA4B,EAC1B,IAAI,EACJ,EAAE,EACF;gBACE,YAAY,EAAE,8BAAmB;gBACjC,OAAO,EAAE,yBAAc;gBACvB,WAAW,EAAE,6BAAkB;aAChC,CACF,CACF,CAAC;SACH;QAED,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE;YACvB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,IAAA,yBAAgB,EAAC,GAAG,KAAK,CAAC,CAAC;IACpC,CAAC;CAAA;AA5CD,wDA4CC;AAED,kBAAe,sBAAsB,CAAC;AAEzB,QAAA,sBAAsB,GAAG,IAAA,2BAAkB,EACtD,sBAAsB,CACvB,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/schema",
|
|
3
|
+
"cli": "nx",
|
|
4
|
+
"$id": "NxReactStorybookStories",
|
|
5
|
+
"title": "Generate React Storybook stories",
|
|
6
|
+
"description": "Generate stories/specs for all components declared in a project.",
|
|
7
|
+
"type": "object",
|
|
8
|
+
"properties": {
|
|
9
|
+
"project": {
|
|
10
|
+
"type": "string",
|
|
11
|
+
"aliases": ["name", "projectName"],
|
|
12
|
+
"description": "Project for which to generate stories.",
|
|
13
|
+
"$default": {
|
|
14
|
+
"$source": "projectName",
|
|
15
|
+
"index": 0
|
|
16
|
+
},
|
|
17
|
+
"x-prompt": "For which project do you want to generate stories?",
|
|
18
|
+
"x-priority": "important"
|
|
19
|
+
},
|
|
20
|
+
"generateCypressSpecs": {
|
|
21
|
+
"type": "boolean",
|
|
22
|
+
"description": "Automatically generate `*.spec.ts` files in the cypress e2e app generated by the cypress-configure generator.",
|
|
23
|
+
"x-prompt": "Do you want to generate Cypress specs as well?",
|
|
24
|
+
"x-priority": "important"
|
|
25
|
+
},
|
|
26
|
+
"cypressProject": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "The Cypress project to generate the stories under. This is inferred from `project` by default."
|
|
29
|
+
},
|
|
30
|
+
"js": {
|
|
31
|
+
"type": "boolean",
|
|
32
|
+
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
33
|
+
"default": false
|
|
34
|
+
},
|
|
35
|
+
"ignorePaths": {
|
|
36
|
+
"type": "array",
|
|
37
|
+
"description": "Paths to ignore when looking for components.",
|
|
38
|
+
"items": {
|
|
39
|
+
"type": "string",
|
|
40
|
+
"description": "Path to ignore."
|
|
41
|
+
},
|
|
42
|
+
"examples": [
|
|
43
|
+
"apps/my-app/src/not-stories/**",
|
|
44
|
+
"**/**/src/**/not-stories/**",
|
|
45
|
+
"libs/my-lib/**/*.something.ts",
|
|
46
|
+
"**/**/src/**/*.other.*",
|
|
47
|
+
"libs/my-lib/src/not-stories/**,**/**/src/**/*.other.*,apps/my-app/**/*.something.ts"
|
|
48
|
+
]
|
|
49
|
+
},
|
|
50
|
+
"skipFormat": {
|
|
51
|
+
"description": "Skip formatting files.",
|
|
52
|
+
"type": "boolean",
|
|
53
|
+
"default": false,
|
|
54
|
+
"x-priority": "internal"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"required": ["project"],
|
|
58
|
+
"examplesFile": "../../../docs/stories-examples.md"
|
|
59
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ProjectConfiguration, Tree } from '@nx/devkit';
|
|
2
|
+
export interface StorybookStoriesSchema {
|
|
3
|
+
project: string;
|
|
4
|
+
generateCypressSpecs: boolean;
|
|
5
|
+
js?: boolean;
|
|
6
|
+
cypressProject?: string;
|
|
7
|
+
ignorePaths?: string[];
|
|
8
|
+
skipFormat?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare function projectRootPath(tree: Tree, config: ProjectConfiguration): Promise<string>;
|
|
11
|
+
export declare function containsComponentDeclaration(tree: Tree, componentPath: string): boolean;
|
|
12
|
+
export declare function createAllStories(tree: Tree, projectName: string, generateCypressSpecs: boolean, js: boolean, cypressProject?: string, ignorePaths?: string[]): Promise<void>;
|
|
13
|
+
export declare function storiesGenerator(host: Tree, schema: StorybookStoriesSchema): Promise<void>;
|
|
14
|
+
export default storiesGenerator;
|
|
15
|
+
export declare const storiesSchematic: (generatorOptions: StorybookStoriesSchema) => (tree: any, context: any) => Promise<any>;
|