@nrwl/react 15.9.2 → 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/ast-utils.d.ts +1 -1
- package/ast-utils.js +2 -9
- package/ast-utils.js.map +1 -1
- package/babel.d.ts +0 -16
- package/babel.js +1 -51
- package/babel.js.map +1 -1
- package/executors.json +8 -8
- package/generators.json +2 -221
- package/index.d.ts +1 -21
- package/index.js +1 -43
- package/index.js.map +1 -1
- package/module-federation.d.ts +1 -4
- package/module-federation.js +2 -10
- package/module-federation.js.map +1 -1
- package/package.json +7 -16
- package/plugins/bundle-rollup.d.ts +0 -1
- package/plugins/bundle-rollup.js +1 -41
- package/plugins/bundle-rollup.js.map +1 -1
- package/plugins/component-testing/index.d.ts +1 -38
- package/plugins/component-testing/index.js +1 -118
- package/plugins/component-testing/index.js.map +1 -1
- package/plugins/jest.d.ts +0 -1
- package/plugins/jest.js +1 -61
- package/plugins/jest.js.map +1 -1
- package/plugins/storybook/index.d.ts +1 -3
- package/plugins/storybook/index.js +1 -73
- package/plugins/storybook/index.js.map +1 -1
- package/plugins/webpack.d.ts +1 -3
- package/plugins/webpack.js +2 -12
- package/plugins/webpack.js.map +1 -1
- package/plugins/with-react.d.ts +1 -12
- package/plugins/with-react.js +2 -79
- package/plugins/with-react.js.map +1 -1
- package/tailwind.d.ts +1 -6
- package/tailwind.js +2 -26
- package/tailwind.js.map +1 -1
- package/README.md +0 -63
- package/migrations.json +0 -864
- package/plugins/component-testing/webpack-fallback.d.ts +0 -5
- package/plugins/component-testing/webpack-fallback.js +0 -135
- package/plugins/component-testing/webpack-fallback.js.map +0 -1
- package/plugins/storybook/merge-plugins.d.ts +0 -3
- package/plugins/storybook/merge-plugins.js +0 -18
- package/plugins/storybook/merge-plugins.js.map +0 -1
- package/src/executors/module-federation-dev-server/compat.d.ts +0 -2
- package/src/executors/module-federation-dev-server/compat.js +0 -6
- package/src/executors/module-federation-dev-server/compat.js.map +0 -1
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -11
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -55
- package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js.map +0 -1
- package/src/executors/module-federation-dev-server/schema.json +0 -96
- package/src/executors/module-federation-ssr-dev-server/compat.d.ts +0 -2
- package/src/executors/module-federation-ssr-dev-server/compat.js +0 -6
- package/src/executors/module-federation-ssr-dev-server/compat.js.map +0 -1
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -9
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -71
- package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js.map +0 -1
- package/src/executors/module-federation-ssr-dev-server/schema.json +0 -48
- package/src/generators/application/application.d.ts +0 -5
- package/src/generators/application/application.js +0 -129
- package/src/generators/application/application.js.map +0 -1
- package/src/generators/application/files/base-vite/index.html__tmpl__ +0 -16
- 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__ +0 -10
- 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__ +0 -3
- package/src/generators/application/files/base-vite/src/environments/environment.ts__tmpl__ +0 -6
- package/src/generators/application/files/base-vite/src/main.tsx__tmpl__ +0 -10
- package/src/generators/application/files/base-vite/tsconfig.app.json__tmpl__ +0 -14
- package/src/generators/application/files/base-webpack/.babelrc__tmpl__ +0 -13
- package/src/generators/application/files/base-webpack/src/app/__fileName__.spec.tsx__tmpl__ +0 -10
- 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__ +0 -3
- package/src/generators/application/files/base-webpack/src/environments/environment.ts__tmpl__ +0 -6
- package/src/generators/application/files/base-webpack/src/favicon.ico +0 -0
- package/src/generators/application/files/base-webpack/src/index.html +0 -14
- package/src/generators/application/files/base-webpack/src/main.tsx__tmpl__ +0 -10
- package/src/generators/application/files/base-webpack/tsconfig.app.json__tmpl__ +0 -14
- package/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +0 -9
- package/src/generators/application/files/nx-welcome/src/app/nx-welcome.tsx +0 -845
- package/src/generators/application/files/style-css-module/src/app/__fileName__.module.__style__ +0 -1
- package/src/generators/application/files/style-css-module/src/app/__fileName__.tsx__tmpl__ +0 -37
- package/src/generators/application/files/style-css-module/src/styles.__style__ +0 -1
- package/src/generators/application/files/style-global-css/src/app/__fileName__.__style__ +0 -1
- package/src/generators/application/files/style-global-css/src/app/__fileName__.tsx__tmpl__ +0 -36
- package/src/generators/application/files/style-global-css/src/styles.__style__ +0 -1
- package/src/generators/application/files/style-none/src/app/__fileName__.tsx__tmpl__ +0 -35
- package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +0 -29
- package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +0 -40
- package/src/generators/application/lib/add-cypress.d.ts +0 -3
- package/src/generators/application/lib/add-cypress.js +0 -22
- package/src/generators/application/lib/add-cypress.js.map +0 -1
- package/src/generators/application/lib/add-jest.d.ts +0 -3
- package/src/generators/application/lib/add-jest.js +0 -17
- package/src/generators/application/lib/add-jest.js.map +0 -1
- package/src/generators/application/lib/add-project.d.ts +0 -2
- package/src/generators/application/lib/add-project.js +0 -98
- package/src/generators/application/lib/add-project.js.map +0 -1
- package/src/generators/application/lib/add-routing.d.ts +0 -3
- package/src/generators/application/lib/add-routing.js +0 -32
- package/src/generators/application/lib/add-routing.js.map +0 -1
- package/src/generators/application/lib/create-application-files.d.ts +0 -3
- package/src/generators/application/lib/create-application-files.js +0 -47
- package/src/generators/application/lib/create-application-files.js.map +0 -1
- package/src/generators/application/lib/find-free-port.d.ts +0 -2
- package/src/generators/application/lib/find-free-port.js +0 -18
- package/src/generators/application/lib/find-free-port.js.map +0 -1
- package/src/generators/application/lib/get-app-tests.d.ts +0 -2
- package/src/generators/application/lib/get-app-tests.js +0 -22
- package/src/generators/application/lib/get-app-tests.js.map +0 -1
- package/src/generators/application/lib/install-common-dependencies.d.ts +0 -3
- package/src/generators/application/lib/install-common-dependencies.js +0 -29
- package/src/generators/application/lib/install-common-dependencies.js.map +0 -1
- package/src/generators/application/lib/normalize-options.d.ts +0 -5
- package/src/generators/application/lib/normalize-options.js +0 -60
- package/src/generators/application/lib/normalize-options.js.map +0 -1
- package/src/generators/application/lib/set-defaults.d.ts +0 -3
- package/src/generators/application/lib/set-defaults.js +0 -23
- package/src/generators/application/lib/set-defaults.js.map +0 -1
- package/src/generators/application/lib/update-jest-config.d.ts +0 -3
- package/src/generators/application/lib/update-jest-config.js +0 -30
- package/src/generators/application/lib/update-jest-config.js.map +0 -1
- package/src/generators/application/schema.d.ts +0 -45
- package/src/generators/application/schema.json +0 -202
- package/src/generators/component/component.d.ts +0 -5
- package/src/generators/component/component.js +0 -141
- package/src/generators/component/component.js.map +0 -1
- package/src/generators/component/files/__fileName__.__style__ +0 -0
- package/src/generators/component/files/__fileName__.module.__style__ +0 -7
- package/src/generators/component/files/__fileName__.spec.tsx__tmpl__ +0 -7
- package/src/generators/component/files/__fileName__.tsx__tmpl__ +0 -71
- package/src/generators/component/get-component-tests.d.ts +0 -2
- package/src/generators/component/get-component-tests.js +0 -13
- package/src/generators/component/get-component-tests.js.map +0 -1
- package/src/generators/component/noramlized-schema.d.ts +0 -8
- package/src/generators/component/noramlized-schema.js +0 -3
- package/src/generators/component/noramlized-schema.js.map +0 -1
- package/src/generators/component/schema.d.ts +0 -20
- package/src/generators/component/schema.json +0 -153
- package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +0 -14
- package/src/generators/component-cypress-spec/component-cypress-spec.js +0 -105
- package/src/generators/component-cypress-spec/component-cypress-spec.js.map +0 -1
- package/src/generators/component-cypress-spec/files/__componentName__.__fileExt__ +0 -13
- package/src/generators/component-cypress-spec/schema.json +0 -44
- package/src/generators/component-story/component-story.d.ts +0 -12
- package/src/generators/component-story/component-story.js +0 -81
- package/src/generators/component-story/component-story.js.map +0 -1
- package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -32
- package/src/generators/component-story/schema.json +0 -36
- package/src/generators/component-test/component-test.d.ts +0 -4
- package/src/generators/component-test/component-test.js +0 -78
- package/src/generators/component-test/component-test.js.map +0 -1
- package/src/generators/component-test/files/__fileName__.cy__ext__ +0 -21
- package/src/generators/component-test/schema.d.ts +0 -4
- package/src/generators/component-test/schema.js +0 -3
- package/src/generators/component-test/schema.js.map +0 -1
- package/src/generators/component-test/schema.json +0 -31
- package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +0 -9
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js +0 -34
- package/src/generators/cypress-component-configuration/cypress-component-configuration.js.map +0 -1
- package/src/generators/cypress-component-configuration/files/cypress/support/commands.ts__tpl__ +0 -42
- package/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ +0 -8
- package/src/generators/cypress-component-configuration/lib/add-files.d.ts +0 -4
- package/src/generators/cypress-component-configuration/lib/add-files.js +0 -75
- package/src/generators/cypress-component-configuration/lib/add-files.js.map +0 -1
- package/src/generators/cypress-component-configuration/lib/update-configs.d.ts +0 -7
- package/src/generators/cypress-component-configuration/lib/update-configs.js +0 -30
- package/src/generators/cypress-component-configuration/lib/update-configs.js.map +0 -1
- package/src/generators/cypress-component-configuration/schema.d.ts +0 -7
- package/src/generators/cypress-component-configuration/schema.json +0 -54
- package/src/generators/hook/files/__fileName__.spec.tsx__tmpl__ +0 -18
- package/src/generators/hook/files/__fileName__.ts__tmpl__ +0 -15
- package/src/generators/hook/hook.d.ts +0 -5
- package/src/generators/hook/hook.js +0 -117
- package/src/generators/hook/hook.js.map +0 -1
- package/src/generators/hook/schema.d.ts +0 -11
- package/src/generators/hook/schema.json +0 -77
- package/src/generators/host/files/common/src/app/__fileName__.tsx__tmpl__ +0 -33
- package/src/generators/host/files/module-federation/module-federation.config.js__tmpl__ +0 -6
- package/src/generators/host/files/module-federation/src/main.ts__tmpl__ +0 -1
- package/src/generators/host/files/module-federation/src/remotes.d.ts__tmpl__ +0 -4
- package/src/generators/host/files/module-federation/webpack.config.js__tmpl__ +0 -12
- package/src/generators/host/files/module-federation/webpack.config.prod.js__tmpl__ +0 -32
- package/src/generators/host/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -13
- package/src/generators/host/files/module-federation-ssr/server.ts__tmpl__ +0 -28
- package/src/generators/host/files/module-federation-ssr/tsconfig.server.json__tmpl__ +0 -15
- package/src/generators/host/files/module-federation-ssr/webpack.server.config.js__tmpl__ +0 -12
- package/src/generators/host/host.d.ts +0 -4
- package/src/generators/host/host.js +0 -67
- package/src/generators/host/host.js.map +0 -1
- package/src/generators/host/lib/add-module-federation-files.d.ts +0 -5
- package/src/generators/host/lib/add-module-federation-files.js +0 -21
- package/src/generators/host/lib/add-module-federation-files.js.map +0 -1
- package/src/generators/host/lib/setup-ssr-for-host.d.ts +0 -6
- package/src/generators/host/lib/setup-ssr-for-host.js +0 -27
- package/src/generators/host/lib/setup-ssr-for-host.js.map +0 -1
- package/src/generators/host/lib/update-module-federation-e2e-project.d.ts +0 -3
- package/src/generators/host/lib/update-module-federation-e2e-project.js +0 -16
- package/src/generators/host/lib/update-module-federation-e2e-project.js.map +0 -1
- package/src/generators/host/schema.d.ts +0 -32
- package/src/generators/host/schema.json +0 -174
- package/src/generators/init/init.d.ts +0 -5
- package/src/generators/init/init.js +0 -80
- package/src/generators/init/init.js.map +0 -1
- package/src/generators/init/schema.d.ts +0 -11
- package/src/generators/init/schema.json +0 -49
- package/src/generators/library/files/common/.babelrc__tmpl__ +0 -16
- package/src/generators/library/files/common/README.md +0 -7
- package/src/generators/library/files/common/package.json__tmpl__ +0 -4
- package/src/generators/library/files/common/src/index.ts__tmpl__ +0 -0
- package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +0 -14
- package/src/generators/library/files/vite/README.md +0 -7
- package/src/generators/library/files/vite/package.json__tmpl__ +0 -12
- package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +0 -14
- package/src/generators/library/lib/add-linting.d.ts +0 -3
- package/src/generators/library/lib/add-linting.js +0 -38
- package/src/generators/library/lib/add-linting.js.map +0 -1
- package/src/generators/library/lib/add-rollup-build-target.d.ts +0 -3
- package/src/generators/library/lib/add-rollup-build-target.js +0 -59
- package/src/generators/library/lib/add-rollup-build-target.js.map +0 -1
- package/src/generators/library/lib/create-files.d.ts +0 -3
- package/src/generators/library/lib/create-files.js +0 -26
- package/src/generators/library/lib/create-files.js.map +0 -1
- package/src/generators/library/lib/install-common-dependencies.d.ts +0 -3
- package/src/generators/library/lib/install-common-dependencies.js +0 -30
- package/src/generators/library/lib/install-common-dependencies.js.map +0 -1
- package/src/generators/library/lib/maybe-js.d.ts +0 -2
- package/src/generators/library/lib/maybe-js.js +0 -10
- package/src/generators/library/lib/maybe-js.js.map +0 -1
- package/src/generators/library/lib/normalize-options.d.ts +0 -3
- package/src/generators/library/lib/normalize-options.js +0 -57
- package/src/generators/library/lib/normalize-options.js.map +0 -1
- package/src/generators/library/lib/set-defaults.d.ts +0 -3
- package/src/generators/library/lib/set-defaults.js +0 -16
- package/src/generators/library/lib/set-defaults.js.map +0 -1
- package/src/generators/library/lib/update-app-routes.d.ts +0 -3
- package/src/generators/library/lib/update-app-routes.js +0 -63
- package/src/generators/library/lib/update-app-routes.js.map +0 -1
- package/src/generators/library/library.d.ts +0 -5
- package/src/generators/library/library.js +0 -126
- package/src/generators/library/library.js.map +0 -1
- package/src/generators/library/schema.d.ts +0 -44
- package/src/generators/library/schema.json +0 -198
- package/src/generators/redux/files/__directory__/__fileName__.slice.spec.ts__tmpl__ +0 -53
- package/src/generators/redux/files/__directory__/__fileName__.slice.ts__tmpl__ +0 -129
- package/src/generators/redux/redux.d.ts +0 -5
- package/src/generators/redux/redux.js +0 -117
- package/src/generators/redux/redux.js.map +0 -1
- package/src/generators/redux/schema.d.ts +0 -20
- package/src/generators/redux/schema.json +0 -47
- package/src/generators/remote/files/module-federation/module-federation.config.js__tmpl__ +0 -6
- package/src/generators/remote/files/module-federation/src/main.ts__tmpl__ +0 -1
- package/src/generators/remote/files/module-federation/src/remote-entry.ts__tmpl__ +0 -1
- package/src/generators/remote/files/module-federation/webpack.config.js__tmpl__ +0 -12
- package/src/generators/remote/files/module-federation/webpack.config.prod.js__tmpl__ +0 -1
- package/src/generators/remote/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -6
- package/src/generators/remote/files/module-federation-ssr/server.ts__tmpl__ +0 -45
- package/src/generators/remote/files/module-federation-ssr/webpack.server.config.js__tmpl__ +0 -12
- package/src/generators/remote/lib/setup-ssr-for-remote.d.ts +0 -4
- package/src/generators/remote/lib/setup-ssr-for-remote.js +0 -32
- package/src/generators/remote/lib/setup-ssr-for-remote.js.map +0 -1
- package/src/generators/remote/lib/update-host-with-remote.d.ts +0 -2
- package/src/generators/remote/lib/update-host-with-remote.js +0 -53
- package/src/generators/remote/lib/update-host-with-remote.js.map +0 -1
- package/src/generators/remote/remote.d.ts +0 -6
- package/src/generators/remote/remote.js +0 -56
- package/src/generators/remote/remote.js.map +0 -1
- package/src/generators/remote/schema.d.ts +0 -27
- package/src/generators/remote/schema.json +0 -173
- package/src/generators/setup-ssr/files/server.ts__tmpl__ +0 -28
- package/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +0 -47
- package/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +0 -15
- package/src/generators/setup-ssr/schema.d.ts +0 -7
- package/src/generators/setup-ssr/schema.json +0 -48
- package/src/generators/setup-ssr/setup-ssr.d.ts +0 -5
- package/src/generators/setup-ssr/setup-ssr.js +0 -162
- package/src/generators/setup-ssr/setup-ssr.js.map +0 -1
- package/src/generators/setup-tailwind/files/postcss.config.js__tmpl__ +0 -15
- package/src/generators/setup-tailwind/files/tailwind.config.js__tmpl__ +0 -17
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +0 -36
- package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js.map +0 -1
- package/src/generators/setup-tailwind/lib/update-project.d.ts +0 -3
- package/src/generators/setup-tailwind/lib/update-project.js +0 -15
- package/src/generators/setup-tailwind/lib/update-project.js.map +0 -1
- package/src/generators/setup-tailwind/schema.d.ts +0 -6
- package/src/generators/setup-tailwind/schema.js +0 -3
- package/src/generators/setup-tailwind/schema.js.map +0 -1
- package/src/generators/setup-tailwind/schema.json +0 -47
- package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
- package/src/generators/setup-tailwind/setup-tailwind.js +0 -39
- package/src/generators/setup-tailwind/setup-tailwind.js.map +0 -1
- package/src/generators/stories/schema.json +0 -59
- package/src/generators/stories/stories.d.ts +0 -15
- package/src/generators/stories/stories.js +0 -118
- package/src/generators/stories/stories.js.map +0 -1
- package/src/generators/storybook-configuration/configuration.d.ts +0 -5
- package/src/generators/storybook-configuration/configuration.js +0 -65
- package/src/generators/storybook-configuration/configuration.js.map +0 -1
- package/src/generators/storybook-configuration/schema.d.ts +0 -18
- package/src/generators/storybook-configuration/schema.json +0 -109
- package/src/migrations/update-12-0-0/remove-react-redux-types-package.d.ts +0 -3
- package/src/migrations/update-12-0-0/remove-react-redux-types-package.js +0 -13
- package/src/migrations/update-12-0-0/remove-react-redux-types-package.js.map +0 -1
- package/src/migrations/update-12-0-0/update-emotion-setup.d.ts +0 -3
- package/src/migrations/update-12-0-0/update-emotion-setup.js +0 -67
- package/src/migrations/update-12-0-0/update-emotion-setup.js.map +0 -1
- package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.d.ts +0 -3
- package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js +0 -27
- package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js.map +0 -1
- package/src/migrations/update-12-8-0/update-12-8-0.d.ts +0 -3
- package/src/migrations/update-12-8-0/update-12-8-0.js +0 -15
- package/src/migrations/update-12-8-0/update-12-8-0.js.map +0 -1
- package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.d.ts +0 -3
- package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js +0 -38
- package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js.map +0 -1
- package/src/migrations/update-13-0-0/update-emotion-setup.d.ts +0 -3
- package/src/migrations/update-13-0-0/update-emotion-setup.js +0 -39
- package/src/migrations/update-13-0-0/update-emotion-setup.js.map +0 -1
- package/src/migrations/update-13-0-0/webpack5-changes-utils.d.ts +0 -11
- package/src/migrations/update-13-0-0/webpack5-changes-utils.js +0 -269
- package/src/migrations/update-13-0-0/webpack5-changes-utils.js.map +0 -1
- package/src/migrations/update-13-10-0/update-13-10-0.d.ts +0 -3
- package/src/migrations/update-13-10-0/update-13-10-0.js +0 -29
- package/src/migrations/update-13-10-0/update-13-10-0.js.map +0 -1
- package/src/migrations/update-14-0-0/add-default-development-configurations.d.ts +0 -3
- package/src/migrations/update-14-0-0/add-default-development-configurations.js +0 -40
- package/src/migrations/update-14-0-0/add-default-development-configurations.js.map +0 -1
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.d.ts +0 -3
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js +0 -27
- package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js.map +0 -1
- package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.d.ts +0 -5
- package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js +0 -69
- package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js.map +0 -1
- package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.d.ts +0 -3
- package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js +0 -38
- package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js.map +0 -1
- package/src/migrations/update-14-6-0/add-preset-jest-config.d.ts +0 -3
- package/src/migrations/update-14-6-0/add-preset-jest-config.js +0 -40
- package/src/migrations/update-14-6-0/add-preset-jest-config.js.map +0 -1
- package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.d.ts +0 -3
- package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js +0 -39
- package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js.map +0 -1
- package/src/migrations/update-15-3-0/update-rollup-executor.d.ts +0 -3
- package/src/migrations/update-15-3-0/update-rollup-executor.js +0 -17
- package/src/migrations/update-15-3-0/update-rollup-executor.js.map +0 -1
- package/src/migrations/update-15-6-3/webpack-config-setup.d.ts +0 -2
- package/src/migrations/update-15-6-3/webpack-config-setup.js +0 -108
- package/src/migrations/update-15-6-3/webpack-config-setup.js.map +0 -1
- package/src/module-federation/ast-utils.d.ts +0 -8
- package/src/module-federation/ast-utils.js +0 -103
- package/src/module-federation/ast-utils.js.map +0 -1
- package/src/module-federation/load-config.d.ts +0 -3
- package/src/module-federation/load-config.js +0 -17
- package/src/module-federation/load-config.js.map +0 -1
- package/src/module-federation/models.d.ts +0 -24
- package/src/module-federation/models.js +0 -3
- package/src/module-federation/models.js.map +0 -1
- package/src/module-federation/package-json.d.ts +0 -8
- package/src/module-federation/package-json.js +0 -14
- package/src/module-federation/package-json.js.map +0 -1
- package/src/module-federation/utils.d.ts +0 -10
- package/src/module-federation/utils.js +0 -38
- package/src/module-federation/utils.js.map +0 -1
- package/src/module-federation/with-module-federation-ssr.d.ts +0 -2
- package/src/module-federation/with-module-federation-ssr.js +0 -48
- package/src/module-federation/with-module-federation-ssr.js.map +0 -1
- package/src/module-federation/with-module-federation.d.ts +0 -7
- package/src/module-federation/with-module-federation.js +0 -50
- package/src/module-federation/with-module-federation.js.map +0 -1
- package/src/rules/add-styled-dependencies.d.ts +0 -2
- package/src/rules/add-styled-dependencies.js +0 -16
- package/src/rules/add-styled-dependencies.js.map +0 -1
- package/src/rules/update-module-federation-project.d.ts +0 -6
- package/src/rules/update-module-federation-project.js +0 -34
- package/src/rules/update-module-federation-project.js.map +0 -1
- package/src/utils/assertion.d.ts +0 -1
- package/src/utils/assertion.js +0 -20
- package/src/utils/assertion.js.map +0 -1
- package/src/utils/ast-utils.d.ts +0 -29
- package/src/utils/ast-utils.js +0 -526
- package/src/utils/ast-utils.js.map +0 -1
- package/src/utils/component-props.d.ts +0 -15
- package/src/utils/component-props.js +0 -61
- package/src/utils/component-props.js.map +0 -1
- package/src/utils/create-ts-config.d.ts +0 -9
- package/src/utils/create-ts-config.js +0 -64
- package/src/utils/create-ts-config.js.map +0 -1
- package/src/utils/dependencies.d.ts +0 -7
- package/src/utils/dependencies.js +0 -3
- package/src/utils/dependencies.js.map +0 -1
- package/src/utils/format-file.d.ts +0 -1
- package/src/utils/format-file.js +0 -13
- package/src/utils/format-file.js.map +0 -1
- package/src/utils/get-in-source-vitest-tests-template.d.ts +0 -1
- package/src/utils/get-in-source-vitest-tests-template.js +0 -22
- package/src/utils/get-in-source-vitest-tests-template.js.map +0 -1
- package/src/utils/jest-utils.d.ts +0 -1
- package/src/utils/jest-utils.js +0 -10
- package/src/utils/jest-utils.js.map +0 -1
- package/src/utils/lint.d.ts +0 -37
- package/src/utils/lint.js +0 -68
- package/src/utils/lint.js.map +0 -1
- package/src/utils/styled.d.ts +0 -4
- package/src/utils/styled.js +0 -33
- package/src/utils/styled.js.map +0 -1
- package/src/utils/testing-generators.d.ts +0 -3
- package/src/utils/testing-generators.js +0 -36
- package/src/utils/testing-generators.js.map +0 -1
- package/src/utils/versions.d.ts +0 -43
- package/src/utils/versions.js +0 -51
- package/src/utils/versions.js.map +0 -1
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.librarySchematic = exports.libraryGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const js_1 = require("@nrwl/js");
|
|
7
|
-
const versions_1 = require("../../utils/versions");
|
|
8
|
-
const component_1 = require("../component/component");
|
|
9
|
-
const init_1 = require("../init/init");
|
|
10
|
-
const jest_utils_1 = require("../../utils/jest-utils");
|
|
11
|
-
const normalize_options_1 = require("./lib/normalize-options");
|
|
12
|
-
const add_rollup_build_target_1 = require("./lib/add-rollup-build-target");
|
|
13
|
-
const add_linting_1 = require("./lib/add-linting");
|
|
14
|
-
const update_app_routes_1 = require("./lib/update-app-routes");
|
|
15
|
-
const create_files_1 = require("./lib/create-files");
|
|
16
|
-
const create_ts_config_1 = require("../../utils/create-ts-config");
|
|
17
|
-
const install_common_dependencies_1 = require("./lib/install-common-dependencies");
|
|
18
|
-
const set_defaults_1 = require("./lib/set-defaults");
|
|
19
|
-
function libraryGenerator(host, schema) {
|
|
20
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
21
|
-
const tasks = [];
|
|
22
|
-
const options = (0, normalize_options_1.normalizeOptions)(host, schema);
|
|
23
|
-
if (options.publishable === true && !schema.importPath) {
|
|
24
|
-
throw new Error(`For publishable libs you have to provide a proper "--importPath" which needs to be a valid npm package name (e.g. my-awesome-lib or @myorg/my-lib)`);
|
|
25
|
-
}
|
|
26
|
-
if (!options.component) {
|
|
27
|
-
options.style = 'none';
|
|
28
|
-
}
|
|
29
|
-
const initTask = yield (0, init_1.default)(host, Object.assign(Object.assign({}, options), { e2eTestRunner: 'none', skipFormat: true, skipBabelConfig: options.bundler === 'vite', skipHelperLibs: options.bundler === 'vite' }));
|
|
30
|
-
tasks.push(initTask);
|
|
31
|
-
(0, devkit_1.addProjectConfiguration)(host, options.name, {
|
|
32
|
-
root: options.projectRoot,
|
|
33
|
-
sourceRoot: (0, devkit_1.joinPathFragments)(options.projectRoot, 'src'),
|
|
34
|
-
projectType: 'library',
|
|
35
|
-
tags: options.parsedTags,
|
|
36
|
-
targets: {},
|
|
37
|
-
});
|
|
38
|
-
const lintTask = yield (0, add_linting_1.addLinting)(host, options);
|
|
39
|
-
tasks.push(lintTask);
|
|
40
|
-
(0, create_files_1.createFiles)(host, options);
|
|
41
|
-
// Set up build target
|
|
42
|
-
if (options.buildable && options.bundler === 'vite') {
|
|
43
|
-
const { viteConfigurationGenerator } = (0, devkit_1.ensurePackage)('@nrwl/vite', versions_1.nxVersion);
|
|
44
|
-
const viteTask = yield viteConfigurationGenerator(host, {
|
|
45
|
-
uiFramework: 'react',
|
|
46
|
-
project: options.name,
|
|
47
|
-
newProject: true,
|
|
48
|
-
includeLib: true,
|
|
49
|
-
inSourceTests: options.inSourceTests,
|
|
50
|
-
includeVitest: options.unitTestRunner === 'vitest',
|
|
51
|
-
skipFormat: true,
|
|
52
|
-
});
|
|
53
|
-
tasks.push(viteTask);
|
|
54
|
-
}
|
|
55
|
-
else if (options.buildable && options.bundler === 'rollup') {
|
|
56
|
-
const rollupTask = yield (0, add_rollup_build_target_1.addRollupBuildTarget)(host, options);
|
|
57
|
-
tasks.push(rollupTask);
|
|
58
|
-
}
|
|
59
|
-
// Set up test target
|
|
60
|
-
if (options.unitTestRunner === 'jest') {
|
|
61
|
-
const { jestProjectGenerator } = (0, devkit_1.ensurePackage)('@nrwl/jest', versions_1.nxVersion);
|
|
62
|
-
const jestTask = yield jestProjectGenerator(host, Object.assign(Object.assign({}, options), { project: options.name, setupFile: 'none', supportTsx: true, skipSerializers: true, compiler: options.compiler, skipFormat: true }));
|
|
63
|
-
tasks.push(jestTask);
|
|
64
|
-
const jestConfigPath = (0, devkit_1.joinPathFragments)(options.projectRoot, options.js ? 'jest.config.js' : 'jest.config.ts');
|
|
65
|
-
if (options.compiler === 'babel' && host.exists(jestConfigPath)) {
|
|
66
|
-
const updatedContent = (0, jest_utils_1.updateJestConfigContent)(host.read(jestConfigPath, 'utf-8'));
|
|
67
|
-
host.write(jestConfigPath, updatedContent);
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
else if (options.unitTestRunner === 'vitest' &&
|
|
71
|
-
options.bundler !== 'vite' // tests are already configured if bundler is vite
|
|
72
|
-
) {
|
|
73
|
-
const { vitestGenerator } = (0, devkit_1.ensurePackage)('@nrwl/vite', versions_1.nxVersion);
|
|
74
|
-
const vitestTask = yield vitestGenerator(host, {
|
|
75
|
-
uiFramework: 'react',
|
|
76
|
-
project: options.name,
|
|
77
|
-
coverageProvider: 'c8',
|
|
78
|
-
inSourceTests: options.inSourceTests,
|
|
79
|
-
skipFormat: true,
|
|
80
|
-
});
|
|
81
|
-
tasks.push(vitestTask);
|
|
82
|
-
}
|
|
83
|
-
if (options.component) {
|
|
84
|
-
const componentTask = yield (0, component_1.default)(host, {
|
|
85
|
-
name: options.name,
|
|
86
|
-
project: options.name,
|
|
87
|
-
flat: true,
|
|
88
|
-
style: options.style,
|
|
89
|
-
skipTests: options.unitTestRunner === 'none' ||
|
|
90
|
-
(options.unitTestRunner === 'vitest' && options.inSourceTests == true),
|
|
91
|
-
export: true,
|
|
92
|
-
routing: options.routing,
|
|
93
|
-
js: options.js,
|
|
94
|
-
pascalCaseFiles: options.pascalCaseFiles,
|
|
95
|
-
inSourceTests: options.inSourceTests,
|
|
96
|
-
skipFormat: true,
|
|
97
|
-
});
|
|
98
|
-
tasks.push(componentTask);
|
|
99
|
-
}
|
|
100
|
-
if (options.publishable || options.buildable) {
|
|
101
|
-
(0, devkit_1.updateJson)(host, `${options.projectRoot}/package.json`, (json) => {
|
|
102
|
-
json.name = options.importPath;
|
|
103
|
-
return json;
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
if (!options.skipPackageJson) {
|
|
107
|
-
const installReactTask = yield (0, install_common_dependencies_1.installCommonDependencies)(host, options);
|
|
108
|
-
tasks.push(installReactTask);
|
|
109
|
-
}
|
|
110
|
-
const routeTask = (0, update_app_routes_1.updateAppRoutes)(host, options);
|
|
111
|
-
tasks.push(routeTask);
|
|
112
|
-
(0, set_defaults_1.setDefaults)(host, options);
|
|
113
|
-
(0, create_ts_config_1.extractTsConfigBase)(host);
|
|
114
|
-
if (!options.skipTsConfig) {
|
|
115
|
-
(0, js_1.updateRootTsConfig)(host, options);
|
|
116
|
-
}
|
|
117
|
-
if (!options.skipFormat) {
|
|
118
|
-
yield (0, devkit_1.formatFiles)(host);
|
|
119
|
-
}
|
|
120
|
-
return (0, devkit_1.runTasksInSerial)(...tasks);
|
|
121
|
-
});
|
|
122
|
-
}
|
|
123
|
-
exports.libraryGenerator = libraryGenerator;
|
|
124
|
-
exports.default = libraryGenerator;
|
|
125
|
-
exports.librarySchematic = (0, devkit_1.convertNxGenerator)(libraryGenerator);
|
|
126
|
-
//# sourceMappingURL=library.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"library.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/library/library.ts"],"names":[],"mappings":";;;;AAAA,yCAUsB;AAEtB,iCAA8C;AAE9C,mDAAiD;AACjD,sDAAwD;AACxD,uCAAyC;AAEzC,uDAAiE;AACjE,+DAA2D;AAC3D,2EAAqE;AACrE,mDAA+C;AAC/C,+DAA0D;AAC1D,qDAAiD;AACjD,mEAAmE;AACnE,mFAA8E;AAC9E,qDAAiD;AAEjD,SAAsB,gBAAgB,CAAC,IAAU,EAAE,MAAc;;QAC/D,MAAM,KAAK,GAAwB,EAAE,CAAC;QAEtC,MAAM,OAAO,GAAG,IAAA,oCAAgB,EAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAC/C,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtD,MAAM,IAAI,KAAK,CACb,oJAAoJ,CACrJ,CAAC;SACH;QACD,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE;YACtB,OAAO,CAAC,KAAK,GAAG,MAAM,CAAC;SACxB;QAED,MAAM,QAAQ,GAAG,MAAM,IAAA,cAAa,EAAC,IAAI,kCACpC,OAAO,KACV,aAAa,EAAE,MAAM,EACrB,UAAU,EAAE,IAAI,EAChB,eAAe,EAAE,OAAO,CAAC,OA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C;YACxE,KAAK,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SAC9B;QAED,MAAM,SAAS,GAAG,IAAA,mCAAe,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACjD,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACtB,IAAA,0BAAW,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAE3B,IAAA,sCAAmB,EAAC,IAAI,CAAC,CAAC;QAC1B,IAAI,CAAC,OAAO,CAAC,YAAY,EAAE;YACzB,IAAA,uBAAkB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;SACnC;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;AAjJD,4CAiJC;AAED,kBAAe,gBAAgB,CAAC;AACnB,QAAA,gBAAgB,GAAG,IAAA,2BAAkB,EAAC,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import type { Linter } from '@nrwl/linter';
|
|
2
|
-
import { SupportedStyles } from '../../../typings/style';
|
|
3
|
-
|
|
4
|
-
export interface Schema {
|
|
5
|
-
appProject?: string;
|
|
6
|
-
buildable?: boolean;
|
|
7
|
-
bundler?: 'none' | 'rollup' | 'vite';
|
|
8
|
-
compiler?: 'babel' | 'swc';
|
|
9
|
-
component?: boolean;
|
|
10
|
-
directory?: string;
|
|
11
|
-
globalCss?: boolean;
|
|
12
|
-
importPath?: string;
|
|
13
|
-
inSourceTests?: boolean;
|
|
14
|
-
js?: boolean;
|
|
15
|
-
linter: Linter;
|
|
16
|
-
name: string;
|
|
17
|
-
pascalCaseFiles?: boolean;
|
|
18
|
-
publishable?: boolean;
|
|
19
|
-
routing?: boolean;
|
|
20
|
-
setParserOptionsProject?: boolean;
|
|
21
|
-
skipFormat?: boolean;
|
|
22
|
-
skipPackageJson?: boolean;
|
|
23
|
-
skipTsConfig?: boolean;
|
|
24
|
-
standaloneConfig?: boolean;
|
|
25
|
-
strict?: boolean;
|
|
26
|
-
style: SupportedStyles;
|
|
27
|
-
tags?: string;
|
|
28
|
-
unitTestRunner?: 'jest' | 'vitest' | 'none';
|
|
29
|
-
minimal?: boolean;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export interface NormalizedSchema extends Schema {
|
|
33
|
-
js: boolean;
|
|
34
|
-
name: string;
|
|
35
|
-
fileName: string;
|
|
36
|
-
projectRoot: string;
|
|
37
|
-
routePath: string;
|
|
38
|
-
projectDirectory: string;
|
|
39
|
-
parsedTags: string[];
|
|
40
|
-
appMain?: string;
|
|
41
|
-
appSourceRoot?: string;
|
|
42
|
-
libsDir?: string;
|
|
43
|
-
unitTestRunner: 'jest' | 'vitest' | 'none';
|
|
44
|
-
}
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxReactLibrary",
|
|
5
|
-
"title": "Create a React Library",
|
|
6
|
-
"description": "Create a React Library for an Nx workspace.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g lib mylib --directory=myapp",
|
|
11
|
-
"description": "Generate `libs/myapp/mylib`"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"command": "nx g lib mylib --appProject=myapp",
|
|
15
|
-
"description": "Generate a library with routes and add them to `myapp`"
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"properties": {
|
|
19
|
-
"name": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "Library name",
|
|
22
|
-
"$default": {
|
|
23
|
-
"$source": "argv",
|
|
24
|
-
"index": 0
|
|
25
|
-
},
|
|
26
|
-
"x-prompt": "What name would you like to use for the library?",
|
|
27
|
-
"pattern": "^[a-zA-Z].*$",
|
|
28
|
-
"x-priority": "important"
|
|
29
|
-
},
|
|
30
|
-
"directory": {
|
|
31
|
-
"type": "string",
|
|
32
|
-
"description": "A directory where the lib is placed.",
|
|
33
|
-
"alias": "dir",
|
|
34
|
-
"x-priority": "important"
|
|
35
|
-
},
|
|
36
|
-
"style": {
|
|
37
|
-
"description": "The file extension to be used for style files.",
|
|
38
|
-
"type": "string",
|
|
39
|
-
"default": "css",
|
|
40
|
-
"alias": "s",
|
|
41
|
-
"x-prompt": {
|
|
42
|
-
"message": "Which stylesheet format would you like to use?",
|
|
43
|
-
"type": "list",
|
|
44
|
-
"items": [
|
|
45
|
-
{ "value": "css", "label": "CSS" },
|
|
46
|
-
{
|
|
47
|
-
"value": "scss",
|
|
48
|
-
"label": "SASS(.scss) [ http://sass-lang.com ]"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"value": "styl",
|
|
52
|
-
"label": "Stylus(.styl) [ http://stylus-lang.com ]"
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
"value": "less",
|
|
56
|
-
"label": "LESS [ http://lesscss.org ]"
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
"value": "styled-components",
|
|
60
|
-
"label": "styled-components [ https://styled-components.com ]"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"value": "@emotion/styled",
|
|
64
|
-
"label": "emotion [ https://emotion.sh ]"
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
"value": "styled-jsx",
|
|
68
|
-
"label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
"value": "none",
|
|
72
|
-
"label": "None"
|
|
73
|
-
}
|
|
74
|
-
]
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"linter": {
|
|
78
|
-
"description": "The tool to use for running lint checks.",
|
|
79
|
-
"type": "string",
|
|
80
|
-
"enum": ["eslint", "none"],
|
|
81
|
-
"default": "eslint"
|
|
82
|
-
},
|
|
83
|
-
"unitTestRunner": {
|
|
84
|
-
"type": "string",
|
|
85
|
-
"enum": ["jest", "vitest", "none"],
|
|
86
|
-
"description": "Test runner to use for unit tests.",
|
|
87
|
-
"x-prompt": "What unit test runner should be used?"
|
|
88
|
-
},
|
|
89
|
-
"inSourceTests": {
|
|
90
|
-
"type": "boolean",
|
|
91
|
-
"default": false,
|
|
92
|
-
"description": "When using Vitest, separate spec files will not be generated and instead will be included within the source files."
|
|
93
|
-
},
|
|
94
|
-
"tags": {
|
|
95
|
-
"type": "string",
|
|
96
|
-
"description": "Add tags to the library (used for linting).",
|
|
97
|
-
"alias": "t"
|
|
98
|
-
},
|
|
99
|
-
"skipFormat": {
|
|
100
|
-
"description": "Skip formatting files.",
|
|
101
|
-
"type": "boolean",
|
|
102
|
-
"default": false,
|
|
103
|
-
"x-priority": "internal"
|
|
104
|
-
},
|
|
105
|
-
"skipTsConfig": {
|
|
106
|
-
"type": "boolean",
|
|
107
|
-
"default": false,
|
|
108
|
-
"description": "Do not update `tsconfig.json` for development experience.",
|
|
109
|
-
"x-priority": "internal"
|
|
110
|
-
},
|
|
111
|
-
"pascalCaseFiles": {
|
|
112
|
-
"type": "boolean",
|
|
113
|
-
"description": "Use pascal case component file name (e.g. `App.tsx`).",
|
|
114
|
-
"alias": "P",
|
|
115
|
-
"default": false
|
|
116
|
-
},
|
|
117
|
-
"routing": {
|
|
118
|
-
"type": "boolean",
|
|
119
|
-
"description": "Generate library with routes."
|
|
120
|
-
},
|
|
121
|
-
"appProject": {
|
|
122
|
-
"type": "string",
|
|
123
|
-
"description": "The application project to add the library route to.",
|
|
124
|
-
"alias": "a"
|
|
125
|
-
},
|
|
126
|
-
"publishable": {
|
|
127
|
-
"type": "boolean",
|
|
128
|
-
"description": "Create a publishable library."
|
|
129
|
-
},
|
|
130
|
-
"buildable": {
|
|
131
|
-
"type": "boolean",
|
|
132
|
-
"default": false,
|
|
133
|
-
"description": "Generate a buildable library that uses rollup to bundle.",
|
|
134
|
-
"x-deprecated": "Use the `bundler` option for greater control (none, vite, rollup)."
|
|
135
|
-
},
|
|
136
|
-
"importPath": {
|
|
137
|
-
"type": "string",
|
|
138
|
-
"description": "The library name used to import it, like `@myorg/my-awesome-lib`."
|
|
139
|
-
},
|
|
140
|
-
"component": {
|
|
141
|
-
"type": "boolean",
|
|
142
|
-
"description": "Generate a default component.",
|
|
143
|
-
"default": true
|
|
144
|
-
},
|
|
145
|
-
"js": {
|
|
146
|
-
"type": "boolean",
|
|
147
|
-
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
148
|
-
"default": false
|
|
149
|
-
},
|
|
150
|
-
"globalCss": {
|
|
151
|
-
"type": "boolean",
|
|
152
|
-
"description": "When `true`, the stylesheet is generated using global CSS instead of CSS modules (e.g. file is `*.css` rather than `*.module.css`).",
|
|
153
|
-
"default": false
|
|
154
|
-
},
|
|
155
|
-
"strict": {
|
|
156
|
-
"type": "boolean",
|
|
157
|
-
"description": "Whether to enable tsconfig strict mode or not.",
|
|
158
|
-
"default": true
|
|
159
|
-
},
|
|
160
|
-
"setParserOptionsProject": {
|
|
161
|
-
"type": "boolean",
|
|
162
|
-
"description": "Whether or not to configure the ESLint `parserOptions.project` option. We do not do this by default for lint performance reasons.",
|
|
163
|
-
"default": false
|
|
164
|
-
},
|
|
165
|
-
"standaloneConfig": {
|
|
166
|
-
"description": "Split the project configuration into `<projectRoot>/project.json` rather than including it inside `workspace.json`.",
|
|
167
|
-
"type": "boolean",
|
|
168
|
-
"default": true,
|
|
169
|
-
"x-deprecated": "Nx only supports standaloneConfig"
|
|
170
|
-
},
|
|
171
|
-
"bundler": {
|
|
172
|
-
"type": "string",
|
|
173
|
-
"description": "The bundler to use. Choosing 'none' means this library is not buildable.",
|
|
174
|
-
"enum": ["none", "vite", "rollup"],
|
|
175
|
-
"default": "none",
|
|
176
|
-
"x-prompt": "Which bundler would you like to use to build the library? Choose 'none' to skip build setup.",
|
|
177
|
-
"x-priority": "important"
|
|
178
|
-
},
|
|
179
|
-
"compiler": {
|
|
180
|
-
"type": "string",
|
|
181
|
-
"enum": ["babel", "swc"],
|
|
182
|
-
"default": "babel",
|
|
183
|
-
"description": "Which compiler to use. Only applies to `bundler: 'rollup'`."
|
|
184
|
-
},
|
|
185
|
-
"skipPackageJson": {
|
|
186
|
-
"description": "Do not add dependencies to `package.json`.",
|
|
187
|
-
"type": "boolean",
|
|
188
|
-
"default": false,
|
|
189
|
-
"x-priority": "internal"
|
|
190
|
-
},
|
|
191
|
-
"minimal": {
|
|
192
|
-
"description": "Create a React library with a minimal setup, no separate test files.",
|
|
193
|
-
"type": "boolean",
|
|
194
|
-
"default": false
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
"required": ["name"]
|
|
198
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { fetch<%= className %>, <%= propertyName %>Adapter, <%= propertyName %>Reducer } from './<%= fileName %>.slice';
|
|
2
|
-
|
|
3
|
-
describe('<%= propertyName %> reducer', () => {
|
|
4
|
-
it('should handle initial state', () => {
|
|
5
|
-
const expected = <%= propertyName %>Adapter.getInitialState({
|
|
6
|
-
loadingStatus: 'not loaded',
|
|
7
|
-
error: null
|
|
8
|
-
});
|
|
9
|
-
|
|
10
|
-
expect(<%= propertyName %>Reducer(undefined, { type: '' })).toEqual(expected);
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('should handle fetch<%= className %>s', () => {
|
|
14
|
-
let state = <%= propertyName %>Reducer(
|
|
15
|
-
undefined,
|
|
16
|
-
fetch<%= className %>.pending(null, null)
|
|
17
|
-
);
|
|
18
|
-
|
|
19
|
-
expect(state).toEqual(
|
|
20
|
-
expect.objectContaining({
|
|
21
|
-
loadingStatus: 'loading',
|
|
22
|
-
error: null,
|
|
23
|
-
entities: {}
|
|
24
|
-
})
|
|
25
|
-
);
|
|
26
|
-
|
|
27
|
-
state = <%= propertyName %>Reducer(
|
|
28
|
-
state,
|
|
29
|
-
fetch<%= className %>.fulfilled([{ id: 1 }], null, null)
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
expect(state).toEqual(
|
|
33
|
-
expect.objectContaining({
|
|
34
|
-
loadingStatus: 'loaded',
|
|
35
|
-
error: null,
|
|
36
|
-
entities: { 1: { id: 1 } }
|
|
37
|
-
})
|
|
38
|
-
);
|
|
39
|
-
|
|
40
|
-
state = <%= propertyName %>Reducer(
|
|
41
|
-
state,
|
|
42
|
-
fetch<%= className %>.rejected(new Error('Uh oh'), null, null)
|
|
43
|
-
);
|
|
44
|
-
|
|
45
|
-
expect(state).toEqual(
|
|
46
|
-
expect.objectContaining({
|
|
47
|
-
loadingStatus: 'error',
|
|
48
|
-
error: 'Uh oh',
|
|
49
|
-
entities: { 1: { id: 1 } }
|
|
50
|
-
})
|
|
51
|
-
);
|
|
52
|
-
});
|
|
53
|
-
});
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
createAsyncThunk,
|
|
3
|
-
createEntityAdapter,
|
|
4
|
-
createSelector,
|
|
5
|
-
createSlice,
|
|
6
|
-
EntityState,
|
|
7
|
-
PayloadAction
|
|
8
|
-
} from '@reduxjs/toolkit';
|
|
9
|
-
|
|
10
|
-
export const <%= constantName %>_FEATURE_KEY = '<%= propertyName %>';
|
|
11
|
-
|
|
12
|
-
/*
|
|
13
|
-
* Update these interfaces according to your requirements.
|
|
14
|
-
*/
|
|
15
|
-
export interface <%= className %>Entity {
|
|
16
|
-
id: number;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface <%= className %>State extends EntityState<<%= className %>Entity> {
|
|
20
|
-
loadingStatus: 'not loaded' | 'loading' | 'loaded' | 'error';
|
|
21
|
-
error: string;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export const <%= propertyName %>Adapter = createEntityAdapter<<%= className %>Entity>();
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Export an effect using createAsyncThunk from
|
|
28
|
-
* the Redux Toolkit: https://redux-toolkit.js.org/api/createAsyncThunk
|
|
29
|
-
*
|
|
30
|
-
* e.g.
|
|
31
|
-
* ```
|
|
32
|
-
* import React, { useEffect } from 'react';
|
|
33
|
-
* import { useDispatch } from 'react-redux';
|
|
34
|
-
*
|
|
35
|
-
* // ...
|
|
36
|
-
*
|
|
37
|
-
* const dispatch = useDispatch();
|
|
38
|
-
* useEffect(() => {
|
|
39
|
-
* dispatch(fetch<%= className %>())
|
|
40
|
-
* }, [dispatch]);
|
|
41
|
-
* ```
|
|
42
|
-
*/
|
|
43
|
-
export const fetch<%= className %> = createAsyncThunk(
|
|
44
|
-
'<%= propertyName %>/fetchStatus',
|
|
45
|
-
async (_, thunkAPI) => {
|
|
46
|
-
/**
|
|
47
|
-
* Replace this with your custom fetch call.
|
|
48
|
-
* For example, `return myApi.get<%= className %>s()`;
|
|
49
|
-
* Right now we just return an empty array.
|
|
50
|
-
*/
|
|
51
|
-
return Promise.resolve([]);
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
|
|
55
|
-
export const initial<%= className %>State: <%= className %>State = <%= propertyName %>Adapter.getInitialState({
|
|
56
|
-
loadingStatus: 'not loaded',
|
|
57
|
-
error: null
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export const <%= propertyName %>Slice = createSlice({
|
|
61
|
-
name: <%= constantName %>_FEATURE_KEY,
|
|
62
|
-
initialState: initial<%= className %>State,
|
|
63
|
-
reducers: {
|
|
64
|
-
add: <%= propertyName %>Adapter.addOne,
|
|
65
|
-
remove: <%= propertyName %>Adapter.removeOne
|
|
66
|
-
// ...
|
|
67
|
-
},
|
|
68
|
-
extraReducers: builder => {
|
|
69
|
-
builder
|
|
70
|
-
.addCase(fetch<%= className %>.pending, (state: <%= className %>State) => {
|
|
71
|
-
state.loadingStatus = 'loading';
|
|
72
|
-
})
|
|
73
|
-
.addCase(fetch<%= className %>.fulfilled, (state: <%= className %>State, action: PayloadAction<<%= className %>Entity[]>) => {
|
|
74
|
-
<%= propertyName %>Adapter.setAll(state, action.payload);
|
|
75
|
-
state.loadingStatus = 'loaded';
|
|
76
|
-
})
|
|
77
|
-
.addCase(fetch<%= className %>.rejected, (state: <%= className %>State, action) => {
|
|
78
|
-
state.loadingStatus = 'error';
|
|
79
|
-
state.error = action.error.message;
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
/*
|
|
85
|
-
* Export reducer for store configuration.
|
|
86
|
-
*/
|
|
87
|
-
export const <%= propertyName %>Reducer = <%= propertyName %>Slice.reducer;
|
|
88
|
-
|
|
89
|
-
/*
|
|
90
|
-
* Export action creators to be dispatched. For use with the `useDispatch` hook.
|
|
91
|
-
*
|
|
92
|
-
* e.g.
|
|
93
|
-
* ```
|
|
94
|
-
* import React, { useEffect } from 'react';
|
|
95
|
-
* import { useDispatch } from 'react-redux';
|
|
96
|
-
*
|
|
97
|
-
* // ...
|
|
98
|
-
*
|
|
99
|
-
* const dispatch = useDispatch();
|
|
100
|
-
* useEffect(() => {
|
|
101
|
-
* dispatch(<%= propertyName %>Actions.add({ id: 1 }))
|
|
102
|
-
* }, [dispatch]);
|
|
103
|
-
* ```
|
|
104
|
-
*
|
|
105
|
-
* See: https://react-redux.js.org/next/api/hooks#usedispatch
|
|
106
|
-
*/
|
|
107
|
-
export const <%= propertyName %>Actions = <%= propertyName %>Slice.actions;
|
|
108
|
-
|
|
109
|
-
/*
|
|
110
|
-
* Export selectors to query state. For use with the `useSelector` hook.
|
|
111
|
-
*
|
|
112
|
-
* e.g.
|
|
113
|
-
* ```
|
|
114
|
-
* import { useSelector } from 'react-redux';
|
|
115
|
-
*
|
|
116
|
-
* // ...
|
|
117
|
-
*
|
|
118
|
-
* const entities = useSelector(selectAll<%= className %>);
|
|
119
|
-
* ```
|
|
120
|
-
*
|
|
121
|
-
* See: https://react-redux.js.org/next/api/hooks#useselector
|
|
122
|
-
*/
|
|
123
|
-
const { selectAll, selectEntities } = <%= propertyName %>Adapter.getSelectors();
|
|
124
|
-
|
|
125
|
-
export const get<%= className %>State = (rootState: unknown): <%= className %>State => rootState[<%= constantName %>_FEATURE_KEY];
|
|
126
|
-
|
|
127
|
-
export const selectAll<%= className %> = createSelector(get<%= className %>State, selectAll);
|
|
128
|
-
|
|
129
|
-
export const select<%= className %>Entities = createSelector(get<%= className %>State, selectEntities);
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Schema } from './schema';
|
|
2
|
-
import { Tree } from '@nrwl/devkit';
|
|
3
|
-
export declare function reduxGenerator(host: Tree, schema: Schema): Promise<import("@nrwl/devkit").GeneratorCallback>;
|
|
4
|
-
export default reduxGenerator;
|
|
5
|
-
export declare const reduxSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|