@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,31 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxReactCypressComponentTest",
|
|
5
|
-
"title": "Add Cypress component test",
|
|
6
|
-
"description": "Add a Cypress component test for a component.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g @nrwl/react:component-test --project=my-react-project --component-path=src/lib/fancy-component.tsx",
|
|
11
|
-
"description": "Create a cypress component test for FancyComponent"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"properties": {
|
|
15
|
-
"project": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "The name of the project the component is apart of",
|
|
18
|
-
"x-dropdown": "projects",
|
|
19
|
-
"x-prompt": "What project is this component apart of?",
|
|
20
|
-
"x-priority": "important"
|
|
21
|
-
},
|
|
22
|
-
"componentPath": {
|
|
23
|
-
"type": "string",
|
|
24
|
-
"description": "Path to component, from the project source root",
|
|
25
|
-
"x-prompt": "What is the path to the component?",
|
|
26
|
-
"x-priority": "important"
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
"required": ["project", "componentPath"],
|
|
30
|
-
"examplesFile": "../../../docs/component-test-examples.md"
|
|
31
|
-
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import { CypressComponentConfigurationSchema } from './schema.d';
|
|
3
|
-
/**
|
|
4
|
-
* This is for using cypresses own Component testing, if you want to use test
|
|
5
|
-
* storybook components then use componentCypressGenerator instead.
|
|
6
|
-
*
|
|
7
|
-
*/
|
|
8
|
-
export declare function cypressComponentConfigGenerator(tree: Tree, options: CypressComponentConfigurationSchema): Promise<() => void>;
|
|
9
|
-
export default cypressComponentConfigGenerator;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.cypressComponentConfigGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const versions_1 = require("../../utils/versions");
|
|
7
|
-
const add_files_1 = require("./lib/add-files");
|
|
8
|
-
const update_configs_1 = require("./lib/update-configs");
|
|
9
|
-
/**
|
|
10
|
-
* This is for using cypresses own Component testing, if you want to use test
|
|
11
|
-
* storybook components then use componentCypressGenerator instead.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
function cypressComponentConfigGenerator(tree, options) {
|
|
15
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const { cypressComponentProject } = (0, devkit_1.ensurePackage)('@nrwl/cypress', versions_1.nxVersion);
|
|
17
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
18
|
-
const installTask = yield cypressComponentProject(tree, {
|
|
19
|
-
project: options.project,
|
|
20
|
-
skipFormat: true,
|
|
21
|
-
});
|
|
22
|
-
const found = yield (0, update_configs_1.updateProjectConfig)(tree, options);
|
|
23
|
-
yield (0, add_files_1.addFiles)(tree, projectConfig, options, found);
|
|
24
|
-
if (options.skipFormat) {
|
|
25
|
-
yield (0, devkit_1.formatFiles)(tree);
|
|
26
|
-
}
|
|
27
|
-
return () => {
|
|
28
|
-
installTask();
|
|
29
|
-
};
|
|
30
|
-
});
|
|
31
|
-
}
|
|
32
|
-
exports.cypressComponentConfigGenerator = cypressComponentConfigGenerator;
|
|
33
|
-
exports.default = cypressComponentConfigGenerator;
|
|
34
|
-
//# sourceMappingURL=cypress-component-configuration.js.map
|
package/src/generators/cypress-component-configuration/cypress-component-configuration.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cypress-component-configuration.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/cypress-component-configuration/cypress-component-configuration.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AACtB,mDAAiD;AACjD,+CAA2C;AAC3C,yDAAwE;AAGxE;;;;GAIG;AACH,SAAsB,+BAA+B,CACnD,IAAU,EACV,OAA4C;;QAE5C,MAAM,EAAE,uBAAuB,EAAE,GAAG,IAAA,sBAAa,EAAC,eAAe,EAAE,oBAAS,CAAC,CAAC;QAC9E,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACtE,MAAM,WAAW,GAAG,MAAM,uBAAuB,CAAC,IAAI,EAAE;YACtD,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,UAAU,EAAE,IAAI;SACjB,CAAC,CAAC;QAEH,MAAM,KAAK,GAAgB,MAAM,IAAA,oCAAmB,EAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACpE,MAAM,IAAA,oBAAQ,EAAC,IAAI,EAAE,aAAa,EAAE,OAAO,EAAE,KAAK,CAAC,CAAC;QACpD,IAAI,OAAO,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;QAED,OAAO,GAAG,EAAE;YACV,WAAW,EAAE,CAAC;QAChB,CAAC,CAAC;IACJ,CAAC;CAAA;AApBD,0EAoBC;AAED,kBAAe,+BAA+B,CAAC"}
|
package/src/generators/cypress-component-configuration/files/cypress/support/commands.ts__tpl__
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/// <reference types="cypress" />
|
|
2
|
-
import { mount } from 'cypress/react18'
|
|
3
|
-
|
|
4
|
-
// ***********************************************
|
|
5
|
-
// This example commands.ts shows you how to
|
|
6
|
-
// create various custom commands and overwrite
|
|
7
|
-
// existing commands.
|
|
8
|
-
//
|
|
9
|
-
// For more comprehensive examples of custom
|
|
10
|
-
// commands please read more here:
|
|
11
|
-
// https://on.cypress.io/custom-commands
|
|
12
|
-
// ***********************************************
|
|
13
|
-
|
|
14
|
-
declare global {
|
|
15
|
-
// eslint-disable-next-line @typescript-eslint/no-namespace
|
|
16
|
-
namespace Cypress {
|
|
17
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
18
|
-
interface Chainable<Subject> {
|
|
19
|
-
login(email: string, password: string): void;
|
|
20
|
-
mount: typeof mount;
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
Cypress.Commands.add('mount', mount)
|
|
26
|
-
|
|
27
|
-
//
|
|
28
|
-
// -- This is a parent command --
|
|
29
|
-
Cypress.Commands.add('login', (email, password) => {
|
|
30
|
-
console.log('Custom command example: Login', email, password);
|
|
31
|
-
});
|
|
32
|
-
//
|
|
33
|
-
// -- This is a child command --
|
|
34
|
-
// Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... })
|
|
35
|
-
//
|
|
36
|
-
//
|
|
37
|
-
// -- This is a dual command --
|
|
38
|
-
// Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... })
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
// -- This will overwrite an existing command --
|
|
42
|
-
// Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... })
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import { ProjectConfiguration, Tree } from '@nrwl/devkit';
|
|
2
|
-
import { CypressComponentConfigurationSchema } from '../schema';
|
|
3
|
-
import { FoundTarget } from './update-configs';
|
|
4
|
-
export declare function addFiles(tree: Tree, projectConfig: ProjectConfiguration, options: CypressComponentConfigurationSchema, found: FoundTarget): Promise<void>;
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.addFiles = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
const versions_1 = require("nx/src/utils/versions");
|
|
7
|
-
const ast_utils_1 = require("../../../utils/ast-utils");
|
|
8
|
-
const component_test_1 = require("../../component-test/component-test");
|
|
9
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
10
|
-
let tsModule;
|
|
11
|
-
const allowedFileExt = new RegExp(/\.[jt]sx?/g);
|
|
12
|
-
const isSpecFile = new RegExp(/(spec|test)\./g);
|
|
13
|
-
function addFiles(tree, projectConfig, options, found) {
|
|
14
|
-
var _a;
|
|
15
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
16
|
-
const cypressConfigPath = (0, devkit_1.joinPathFragments)(projectConfig.root, 'cypress.config.ts');
|
|
17
|
-
if (tree.exists(cypressConfigPath)) {
|
|
18
|
-
tree.delete(cypressConfigPath);
|
|
19
|
-
}
|
|
20
|
-
const actualBundler = yield getBundler(found, tree);
|
|
21
|
-
if (options.bundler && options.bundler !== actualBundler) {
|
|
22
|
-
devkit_1.logger.warn(`You have specified ${options.bundler} as the bundler but this project is configured to use ${actualBundler}.
|
|
23
|
-
This may cause errors. If you are seeing errors, try removing the --bundler option.`);
|
|
24
|
-
}
|
|
25
|
-
(0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '..', 'files'), projectConfig.root, {
|
|
26
|
-
tpl: '',
|
|
27
|
-
bundler: (_a = options.bundler) !== null && _a !== void 0 ? _a : actualBundler,
|
|
28
|
-
});
|
|
29
|
-
if (options.bundler === 'webpack' ||
|
|
30
|
-
(!options.bundler && actualBundler === 'webpack')) {
|
|
31
|
-
(0, devkit_1.addDependenciesToPackageJson)(tree, {}, { '@nrwl/webpack': versions_1.nxVersion });
|
|
32
|
-
}
|
|
33
|
-
if (options.generateTests) {
|
|
34
|
-
const filePaths = [];
|
|
35
|
-
(0, devkit_1.visitNotIgnoredFiles)(tree, projectConfig.sourceRoot, (filePath) => {
|
|
36
|
-
if (isComponent(tree, filePath)) {
|
|
37
|
-
filePaths.push(filePath);
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
for (const filePath of filePaths) {
|
|
41
|
-
yield (0, component_test_1.componentTestGenerator)(tree, {
|
|
42
|
-
project: options.project,
|
|
43
|
-
componentPath: filePath,
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
exports.addFiles = addFiles;
|
|
50
|
-
function getBundler(found, tree) {
|
|
51
|
-
var _a, _b, _c;
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
if (found.target && ((_a = found.config) === null || _a === void 0 ? void 0 : _a.executor)) {
|
|
54
|
-
return found.config.executor === '@nrwl/vite:build' ? 'vite' : 'webpack';
|
|
55
|
-
}
|
|
56
|
-
const { target, project } = (0, devkit_1.parseTargetString)(found.target, yield (0, devkit_1.createProjectGraphAsync)());
|
|
57
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, project);
|
|
58
|
-
return ((_c = (_b = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.targets) === null || _b === void 0 ? void 0 : _b[target]) === null || _c === void 0 ? void 0 : _c.executor) === '@nrwl/vite:build'
|
|
59
|
-
? 'vite'
|
|
60
|
-
: 'webpack';
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
function isComponent(tree, filePath) {
|
|
64
|
-
if (!tsModule) {
|
|
65
|
-
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
66
|
-
}
|
|
67
|
-
if (isSpecFile.test(filePath) || !allowedFileExt.test(filePath)) {
|
|
68
|
-
return false;
|
|
69
|
-
}
|
|
70
|
-
const content = tree.read(filePath, 'utf-8');
|
|
71
|
-
const sourceFile = tsModule.createSourceFile(filePath, content, tsModule.ScriptTarget.Latest, true);
|
|
72
|
-
const cmpDeclaration = (0, ast_utils_1.getComponentNode)(sourceFile);
|
|
73
|
-
return !!cmpDeclaration;
|
|
74
|
-
}
|
|
75
|
-
//# sourceMappingURL=add-files.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"add-files.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/cypress-component-configuration/lib/add-files.ts"],"names":[],"mappings":";;;;AAAA,yCAYsB;AACtB,oDAAkD;AAClD,wDAA4D;AAC5D,wEAA6E;AAG7E,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAE1C,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,YAAY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I,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC7C,MAAM,UAAU,GAAG,QAAQ,CAAC,gBAAgB,CAC1C,QAAQ,EACR,OAAO,EACP,QAAQ,CAAC,YAAY,CAAC,MAAM,EAC5B,IAAI,CACL,CAAC;IAEF,MAAM,cAAc,GAAG,IAAA,4BAAgB,EAAC,UAAU,CAAC,CAAC;IACpD,OAAO,CAAC,CAAC,cAAc,CAAC;AAC1B,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { TargetConfiguration, Tree } from '@nrwl/devkit';
|
|
2
|
-
import { CypressComponentConfigurationSchema } from '../schema';
|
|
3
|
-
export interface FoundTarget {
|
|
4
|
-
config?: TargetConfiguration;
|
|
5
|
-
target: string;
|
|
6
|
-
}
|
|
7
|
-
export declare function updateProjectConfig(tree: Tree, options: CypressComponentConfigurationSchema): Promise<FoundTarget>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.updateProjectConfig = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
6
|
-
function updateProjectConfig(tree, options) {
|
|
7
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
8
|
-
const { findBuildConfig } = yield Promise.resolve().then(() => require('@nrwl/cypress/src/utils/find-target-options'));
|
|
9
|
-
const found = yield findBuildConfig(tree, {
|
|
10
|
-
project: options.project,
|
|
11
|
-
buildTarget: options.buildTarget,
|
|
12
|
-
validExecutorNames: new Set([
|
|
13
|
-
'@nrwl/webpack:webpack',
|
|
14
|
-
'@nrwl/vite:build',
|
|
15
|
-
]),
|
|
16
|
-
});
|
|
17
|
-
assetValidConfig(found === null || found === void 0 ? void 0 : found.config);
|
|
18
|
-
const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
|
|
19
|
-
projectConfig.targets['component-test'].options = Object.assign(Object.assign({}, projectConfig.targets['component-test'].options), { devServerTarget: found.target, skipServe: true });
|
|
20
|
-
(0, devkit_1.updateProjectConfiguration)(tree, options.project, projectConfig);
|
|
21
|
-
return found;
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
exports.updateProjectConfig = updateProjectConfig;
|
|
25
|
-
function assetValidConfig(config) {
|
|
26
|
-
if (!config) {
|
|
27
|
-
throw new Error('Unable to find a valid build configuration. Try passing in a target for a React app. --build-target=<project>:<target>[:<configuration>]');
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=update-configs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"update-configs.js","sourceRoot":"","sources":["../../../../../../../packages/react/src/generators/cypress-component-configuration/lib/update-configs.ts"],"names":[],"mappings":";;;;AAAA,yCAKsB;AAQtB,SAAsB,mBAAmB,CACvC,IAAU,EACV,OAA4C;;QAE5C,MAAM,EAAE,eAAe,EAAE,GAAG,2CAC1B,6CAA6C,EAC9C,CAAC;QACF,MAAM,KAAK,GAAG,MAAM,eAAe,CAAC,IAAI,EAAE;YACxC,OAAO,EAAE,OAAO,CAAC,OAAO;YACxB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,kBAAkB,EAAE,IAAI,GAAG,CAAS;gBAClC,uBAAuB;gBACvB,kBAAkB;aACnB,CAAC;SACH,CAAC,CAAC;QAEH,gBAAgB,CAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC;QAEhC,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QACtE,aAAa,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,mCAC1C,aAAa,CAAC,OAAO,CAAC,gBAAgB,CAAC,CAAC,OAAO,KAClD,eAAe,EAAE,KAAK,CAAC,MAAM,EAC7B,SAAS,EAAE,IAAI,GAChB,CAAC;QACF,IAAA,mCAA0B,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,EAAE,aAAa,CAAC,CAAC;QAEjE,OAAO,KAAK,CAAC;IACf,CAAC;CAAA;AA3BD,kDA2BC;AAED,SAAS,gBAAgB,CAAC,MAAe;IACvC,IAAI,CAAC,MAAM,EAAE;QACX,MAAM,IAAI,KAAK,CACb,0IAA0I,CAC3I,CAAC;KACH;AACH,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxReactCypressComponentTestConfiguration",
|
|
5
|
-
"title": "Add Cypress component testing",
|
|
6
|
-
"description": "Add a Cypress component testing configuration to an existing project.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g @nrwl/react:cypress-component-configuration --project=my-react-project",
|
|
11
|
-
"description": "Add component testing to your react project"
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"command": "nx g @nrwl/react:cypress-component-configuration --project=my-react-project --generate-tests",
|
|
15
|
-
"description": "Add component testing to your react project and generate component tests for your existing components"
|
|
16
|
-
}
|
|
17
|
-
],
|
|
18
|
-
"properties": {
|
|
19
|
-
"project": {
|
|
20
|
-
"type": "string",
|
|
21
|
-
"description": "The name of the project to add cypress component testing configuration to",
|
|
22
|
-
"x-dropdown": "projects",
|
|
23
|
-
"x-prompt": "What project should we add Cypress component testing to?",
|
|
24
|
-
"x-priority": "important"
|
|
25
|
-
},
|
|
26
|
-
"generateTests": {
|
|
27
|
-
"type": "boolean",
|
|
28
|
-
"description": "Generate default component tests for existing components in the project",
|
|
29
|
-
"x-prompt": "Automatically generate tests for components declared in this project?",
|
|
30
|
-
"default": false,
|
|
31
|
-
"x-priority": "important"
|
|
32
|
-
},
|
|
33
|
-
"buildTarget": {
|
|
34
|
-
"type": "string",
|
|
35
|
-
"description": "A build target used to configure Cypress component testing in the format of `project:target[:configuration]`. The build target should be from a React app. If not provided we will try to infer it from your projects usage.",
|
|
36
|
-
"pattern": "^[^:\\s]+:[^:\\s]+(:\\S+)?$"
|
|
37
|
-
},
|
|
38
|
-
"skipFormat": {
|
|
39
|
-
"type": "boolean",
|
|
40
|
-
"description": "Skip formatting files",
|
|
41
|
-
"default": false,
|
|
42
|
-
"x-priority": "internal"
|
|
43
|
-
},
|
|
44
|
-
"bundler": {
|
|
45
|
-
"description": "The bundler to use for Cypress Component Testing.",
|
|
46
|
-
"type": "string",
|
|
47
|
-
"enum": ["vite", "webpack"],
|
|
48
|
-
"hidden": true,
|
|
49
|
-
"x-priority": "internal"
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"required": ["project"],
|
|
53
|
-
"examplesFile": "../../../docs/cypress-component-configuration-examples.md"
|
|
54
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { act, renderHook } from '@testing-library/react';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
|
|
4
|
-
import <%= hookName %> from './<%= fileName %>';
|
|
5
|
-
|
|
6
|
-
describe('<%= hookName %>', () => {
|
|
7
|
-
it('should render successfully', () => {
|
|
8
|
-
const { result } = renderHook(() => <%= hookName %>());
|
|
9
|
-
|
|
10
|
-
expect(result.current.count).toBe(0);
|
|
11
|
-
|
|
12
|
-
act(() => {
|
|
13
|
-
result.current.increment()
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
expect(result.current.count).toBe(1);
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { useState, useCallback } from 'react'
|
|
2
|
-
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-empty-interface
|
|
4
|
-
export interface <%= hookTypeName %> {
|
|
5
|
-
count: number;
|
|
6
|
-
increment: () => void;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
export function <%= hookName %>(): <%= hookTypeName %> {
|
|
10
|
-
const [count, setCount] = useState(0)
|
|
11
|
-
const increment = useCallback(() => setCount((x) => x + 1), [])
|
|
12
|
-
return { count, increment }
|
|
13
|
-
};
|
|
14
|
-
|
|
15
|
-
export default <%= hookName %>;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Tree } from '@nrwl/devkit';
|
|
2
|
-
import { Schema } from './schema';
|
|
3
|
-
export declare function hookGenerator(host: Tree, schema: Schema): Promise<void>;
|
|
4
|
-
export default hookGenerator;
|
|
5
|
-
export declare const hookSchematic: (generatorOptions: Schema) => (tree: any, context: any) => Promise<any>;
|
|
@@ -1,117 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.hookSchematic = exports.hookGenerator = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
// TODO(jack): Remove inline renderHook function when RTL releases with its own version
|
|
6
|
-
const devkit_1 = require("@nrwl/devkit");
|
|
7
|
-
const ast_utils_1 = require("../../utils/ast-utils");
|
|
8
|
-
const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
|
|
9
|
-
function hookGenerator(host, schema) {
|
|
10
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
11
|
-
const options = yield normalizeOptions(host, schema);
|
|
12
|
-
createFiles(host, options);
|
|
13
|
-
addExportsToBarrel(host, options);
|
|
14
|
-
return yield (0, devkit_1.formatFiles)(host);
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
-
exports.hookGenerator = hookGenerator;
|
|
18
|
-
function createFiles(host, options) {
|
|
19
|
-
const hookDir = (0, devkit_1.joinPathFragments)(options.projectSourceRoot, options.directory);
|
|
20
|
-
(0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files'), hookDir, Object.assign(Object.assign({}, options), { tmpl: '' }));
|
|
21
|
-
for (const c of host.listChanges()) {
|
|
22
|
-
let deleteFile = false;
|
|
23
|
-
if (options.skipTests && /.*spec.ts/.test(c.path)) {
|
|
24
|
-
deleteFile = true;
|
|
25
|
-
}
|
|
26
|
-
if (deleteFile) {
|
|
27
|
-
host.delete(c.path);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (options.js) {
|
|
31
|
-
(0, devkit_1.toJS)(host);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
let tsModule;
|
|
35
|
-
function addExportsToBarrel(host, options) {
|
|
36
|
-
if (!tsModule) {
|
|
37
|
-
tsModule = (0, ensure_typescript_1.ensureTypescript)();
|
|
38
|
-
}
|
|
39
|
-
const workspace = (0, devkit_1.getProjects)(host);
|
|
40
|
-
const isApp = workspace.get(options.project).projectType === 'application';
|
|
41
|
-
if (options.export && !isApp) {
|
|
42
|
-
const indexFilePath = (0, devkit_1.joinPathFragments)(options.projectSourceRoot, options.js ? 'index.js' : 'index.ts');
|
|
43
|
-
const indexSource = host.read(indexFilePath, 'utf-8');
|
|
44
|
-
if (indexSource !== null) {
|
|
45
|
-
const indexSourceFile = tsModule.createSourceFile(indexFilePath, indexSource, tsModule.ScriptTarget.Latest, true);
|
|
46
|
-
const changes = (0, devkit_1.applyChangesToString)(indexSource, (0, ast_utils_1.addImport)(indexSourceFile, `export * from './${options.directory}/${options.fileName}';`));
|
|
47
|
-
host.write(indexFilePath, changes);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
function normalizeOptions(host, options) {
|
|
52
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
assertValidOptions(options);
|
|
54
|
-
let base = options.name;
|
|
55
|
-
if (base.startsWith('use-')) {
|
|
56
|
-
base = base.substring(4);
|
|
57
|
-
}
|
|
58
|
-
else if (base.startsWith('use')) {
|
|
59
|
-
base = base.substring(3);
|
|
60
|
-
}
|
|
61
|
-
const { className, fileName } = (0, devkit_1.names)(base);
|
|
62
|
-
const hookFilename = options.pascalCaseFiles
|
|
63
|
-
? 'use'.concat(className)
|
|
64
|
-
: 'use-'.concat(fileName);
|
|
65
|
-
const hookName = 'use'.concat(className);
|
|
66
|
-
const hookTypeName = 'Use'.concat(className);
|
|
67
|
-
const project = (0, devkit_1.getProjects)(host).get(options.project);
|
|
68
|
-
if (!project) {
|
|
69
|
-
devkit_1.logger.error(`Cannot find the ${options.project} project. Please double check the project name.`);
|
|
70
|
-
throw new Error();
|
|
71
|
-
}
|
|
72
|
-
const { sourceRoot: projectSourceRoot, projectType } = project;
|
|
73
|
-
const directory = yield getDirectory(host, options, base);
|
|
74
|
-
if (options.export && projectType === 'application') {
|
|
75
|
-
devkit_1.logger.warn(`The "--export" option should not be used with applications and will do nothing.`);
|
|
76
|
-
}
|
|
77
|
-
return Object.assign(Object.assign({}, options), { directory,
|
|
78
|
-
hookName,
|
|
79
|
-
hookTypeName, fileName: hookFilename, projectSourceRoot });
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
function getDirectory(host, options, baseHookName) {
|
|
83
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
84
|
-
const { className, fileName } = (0, devkit_1.names)(baseHookName);
|
|
85
|
-
const hookFileName = options.pascalCaseDirectory === true
|
|
86
|
-
? 'use'.concat(className)
|
|
87
|
-
: 'use-'.concat(fileName);
|
|
88
|
-
const workspace = (0, devkit_1.getProjects)(host);
|
|
89
|
-
let baseDir;
|
|
90
|
-
if (options.directory) {
|
|
91
|
-
baseDir = options.directory;
|
|
92
|
-
}
|
|
93
|
-
else {
|
|
94
|
-
baseDir =
|
|
95
|
-
workspace.get(options.project).projectType === 'application'
|
|
96
|
-
? 'app'
|
|
97
|
-
: 'lib';
|
|
98
|
-
}
|
|
99
|
-
return options.flat ? baseDir : (0, devkit_1.joinPathFragments)(baseDir, hookFileName);
|
|
100
|
-
});
|
|
101
|
-
}
|
|
102
|
-
function assertValidOptions(options) {
|
|
103
|
-
const slashes = ['/', '\\'];
|
|
104
|
-
slashes.forEach((s) => {
|
|
105
|
-
if (options.name.indexOf(s) !== -1) {
|
|
106
|
-
const [name, ...rest] = options.name.split(s).reverse();
|
|
107
|
-
let suggestion = rest.map((x) => x.toLowerCase()).join(s);
|
|
108
|
-
if (options.directory) {
|
|
109
|
-
suggestion = `${options.directory}${s}${suggestion}`;
|
|
110
|
-
}
|
|
111
|
-
throw new Error(`Found "${s}" in the hook name. Did you mean to use the --directory option (e.g. \`nx g c ${name} --directory ${suggestion}\`)?`);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
}
|
|
115
|
-
exports.default = hookGenerator;
|
|
116
|
-
exports.hookSchematic = (0, devkit_1.convertNxGenerator)(hookGenerator);
|
|
117
|
-
//# sourceMappingURL=hook.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"hook.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/hook/hook.ts"],"names":[],"mappings":";;;;AAAA,uFAAuF;AACvF,yCAWsB;AAGtB,qDAAkD;AAClD,uFAAmF;AASnF,SAAsB,aAAa,CAAC,IAAU,EAAE,MAAc;;QAC5D,MAAM,OAAO,GAAG,MAAM,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAErD,WAAW,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAC3B,kBAAkB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QAElC,OAAO,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACjC,CAAC;CAAA;AAPD,sCAOC;AAED,SAAS,WAAW,CAAC,IAAU,EAAE,OAAyB;IACxD,MAAM,OAAO,GAAG,IAAA,0BAAiB,EAC/B,OAAO,CAAC,iBAAiB,EACzB,OAAO,CAAC,SAAS,CAClB,CAAC;IAEF,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,SAAS,CAAC,EAAE,OAAO,kCAC/D,OAAO,KACV,IAAI,EAAE,EAAE,IACR,CAAC;IAEH,KAAK,MAAM,CAAC,IAAI,IAAI,C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EAAE;QACpB,IAAI,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE;YAClC,MAAM,CAAC,IAAI,EAAE,GAAG,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACxD,IAAI,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;YAC1D,IAAI,OAAO,CAAC,SAAS,EAAE;gBACrB,UAAU,GAAG,GAAG,OAAO,CAAC,SAAS,GAAG,CAAC,GAAG,UAAU,EAAE,CAAC;aACtD;YACD,MAAM,IAAI,KAAK,CACb,UAAU,CAAC,iFAAiF,IAAI,gBAAgB,UAAU,MAAM,CACjI,CAAC;SACH;IACH,CAAC,CAAC,CAAC;AACL,CAAC;AAED,kBAAe,aAAa,CAAC;AAEhB,QAAA,aAAa,GAAG,IAAA,2BAAkB,EAAC,aAAa,CAAC,CAAC"}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/schema",
|
|
3
|
-
"cli": "nx",
|
|
4
|
-
"$id": "NxReactHook",
|
|
5
|
-
"title": "Create a React Hook for Nx",
|
|
6
|
-
"description": "Create a React component using Hooks in a dedicated React project.",
|
|
7
|
-
"type": "object",
|
|
8
|
-
"examples": [
|
|
9
|
-
{
|
|
10
|
-
"command": "nx g hook my-hook --project=mylib",
|
|
11
|
-
"description": "Generate a hook in the `mylib` library"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"properties": {
|
|
15
|
-
"project": {
|
|
16
|
-
"type": "string",
|
|
17
|
-
"description": "The name of the project.",
|
|
18
|
-
"alias": "p",
|
|
19
|
-
"$default": {
|
|
20
|
-
"$source": "projectName"
|
|
21
|
-
},
|
|
22
|
-
"x-prompt": "What is the name of the project for this hook?",
|
|
23
|
-
"x-priority": "important"
|
|
24
|
-
},
|
|
25
|
-
"name": {
|
|
26
|
-
"type": "string",
|
|
27
|
-
"description": "The name of the hook.",
|
|
28
|
-
"$default": {
|
|
29
|
-
"$source": "argv",
|
|
30
|
-
"index": 0
|
|
31
|
-
},
|
|
32
|
-
"x-prompt": "What name would you like to use for the hook?",
|
|
33
|
-
"x-priority": "important"
|
|
34
|
-
},
|
|
35
|
-
"js": {
|
|
36
|
-
"type": "boolean",
|
|
37
|
-
"description": "Generate JavaScript files rather than TypeScript files.",
|
|
38
|
-
"default": false
|
|
39
|
-
},
|
|
40
|
-
"skipTests": {
|
|
41
|
-
"type": "boolean",
|
|
42
|
-
"description": "When true, does not create `spec.ts` test files for the new hook.",
|
|
43
|
-
"default": false,
|
|
44
|
-
"x-priority": "internal"
|
|
45
|
-
},
|
|
46
|
-
"directory": {
|
|
47
|
-
"type": "string",
|
|
48
|
-
"description": "Create the hook under this directory (can be nested).",
|
|
49
|
-
"x-priority": "important"
|
|
50
|
-
},
|
|
51
|
-
"flat": {
|
|
52
|
-
"type": "boolean",
|
|
53
|
-
"description": "Create hook at the source root rather than its own directory.",
|
|
54
|
-
"default": false
|
|
55
|
-
},
|
|
56
|
-
"export": {
|
|
57
|
-
"type": "boolean",
|
|
58
|
-
"description": "When true, the hook is exported from the project `index.ts` (if it exists).",
|
|
59
|
-
"alias": "e",
|
|
60
|
-
"default": false,
|
|
61
|
-
"x-prompt": "Should this hook be exported in the project?"
|
|
62
|
-
},
|
|
63
|
-
"pascalCaseFiles": {
|
|
64
|
-
"type": "boolean",
|
|
65
|
-
"description": "Use pascal case hook file name (e.g. `useHook.ts`).",
|
|
66
|
-
"alias": "P",
|
|
67
|
-
"default": false
|
|
68
|
-
},
|
|
69
|
-
"pascalCaseDirectory": {
|
|
70
|
-
"type": "boolean",
|
|
71
|
-
"description": "Use pascal case directory name (e.g. `useHook/useHook.ts`).",
|
|
72
|
-
"alias": "R",
|
|
73
|
-
"default": false
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
"required": ["name", "project"]
|
|
77
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
<% if (!minimal) { %>
|
|
3
|
-
import NxWelcome from "./nx-welcome";
|
|
4
|
-
<% } %>
|
|
5
|
-
import { Link, Route, Routes } from 'react-router-dom';
|
|
6
|
-
|
|
7
|
-
<% if (remotes.length > 0) { %>
|
|
8
|
-
<% remotes.forEach(function(r) { %>
|
|
9
|
-
const <%= r.className %> = React.lazy(() => import('<%= r.fileName %>/Module'));
|
|
10
|
-
<% }); %>
|
|
11
|
-
<% } %>
|
|
12
|
-
export function App() {
|
|
13
|
-
return (
|
|
14
|
-
<React.Suspense fallback={null}>
|
|
15
|
-
<ul>
|
|
16
|
-
<li><Link to="/">Home</Link></li>
|
|
17
|
-
<% remotes.forEach(function(r) { %>
|
|
18
|
-
<li><Link to="/<%=r.fileName%>"><%=r.className%></Link></li>
|
|
19
|
-
<% }); %>
|
|
20
|
-
</ul>
|
|
21
|
-
<Routes>
|
|
22
|
-
<% if (!minimal) { %>
|
|
23
|
-
<Route path="/" element={<NxWelcome title="<%= projectName %>"/>} />
|
|
24
|
-
<% } %>
|
|
25
|
-
<% remotes.forEach(function(r) { %>
|
|
26
|
-
<Route path="/<%=r.fileName%>" element={<<%= r.className %>/>} />
|
|
27
|
-
<% }); %>
|
|
28
|
-
</Routes>
|
|
29
|
-
</React.Suspense>
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export default App;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import('./bootstrap');
|