@nrwl/react 16.0.0-beta.0 → 16.0.0-beta.2

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.
Files changed (412) hide show
  1. package/ast-utils.d.ts +1 -1
  2. package/ast-utils.js +2 -9
  3. package/ast-utils.js.map +1 -1
  4. package/babel.d.ts +0 -16
  5. package/babel.js +1 -51
  6. package/babel.js.map +1 -1
  7. package/executors.json +8 -8
  8. package/generators.json +2 -221
  9. package/index.d.ts +1 -21
  10. package/index.js +1 -43
  11. package/index.js.map +1 -1
  12. package/module-federation.d.ts +1 -4
  13. package/module-federation.js +2 -10
  14. package/module-federation.js.map +1 -1
  15. package/package.json +7 -16
  16. package/plugins/bundle-rollup.d.ts +0 -1
  17. package/plugins/bundle-rollup.js +1 -41
  18. package/plugins/bundle-rollup.js.map +1 -1
  19. package/plugins/component-testing/index.d.ts +1 -38
  20. package/plugins/component-testing/index.js +1 -118
  21. package/plugins/component-testing/index.js.map +1 -1
  22. package/plugins/jest.d.ts +0 -1
  23. package/plugins/jest.js +1 -61
  24. package/plugins/jest.js.map +1 -1
  25. package/plugins/storybook/index.d.ts +1 -3
  26. package/plugins/storybook/index.js +1 -73
  27. package/plugins/storybook/index.js.map +1 -1
  28. package/plugins/webpack.d.ts +1 -3
  29. package/plugins/webpack.js +2 -12
  30. package/plugins/webpack.js.map +1 -1
  31. package/plugins/with-react.d.ts +1 -12
  32. package/plugins/with-react.js +2 -79
  33. package/plugins/with-react.js.map +1 -1
  34. package/tailwind.d.ts +1 -6
  35. package/tailwind.js +2 -26
  36. package/tailwind.js.map +1 -1
  37. package/README.md +0 -63
  38. package/migrations.json +0 -864
  39. package/plugins/component-testing/webpack-fallback.d.ts +0 -5
  40. package/plugins/component-testing/webpack-fallback.js +0 -135
  41. package/plugins/component-testing/webpack-fallback.js.map +0 -1
  42. package/plugins/storybook/merge-plugins.d.ts +0 -3
  43. package/plugins/storybook/merge-plugins.js +0 -18
  44. package/plugins/storybook/merge-plugins.js.map +0 -1
  45. package/src/executors/module-federation-dev-server/compat.d.ts +0 -2
  46. package/src/executors/module-federation-dev-server/compat.js +0 -6
  47. package/src/executors/module-federation-dev-server/compat.js.map +0 -1
  48. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.d.ts +0 -11
  49. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js +0 -55
  50. package/src/executors/module-federation-dev-server/module-federation-dev-server.impl.js.map +0 -1
  51. package/src/executors/module-federation-dev-server/schema.json +0 -96
  52. package/src/executors/module-federation-ssr-dev-server/compat.d.ts +0 -2
  53. package/src/executors/module-federation-ssr-dev-server/compat.js +0 -6
  54. package/src/executors/module-federation-ssr-dev-server/compat.js.map +0 -1
  55. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.d.ts +0 -9
  56. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js +0 -71
  57. package/src/executors/module-federation-ssr-dev-server/module-federation-ssr-dev-server.impl.js.map +0 -1
  58. package/src/executors/module-federation-ssr-dev-server/schema.json +0 -48
  59. package/src/generators/application/application.d.ts +0 -5
  60. package/src/generators/application/application.js +0 -129
  61. package/src/generators/application/application.js.map +0 -1
  62. package/src/generators/application/files/base-vite/index.html__tmpl__ +0 -16
  63. package/src/generators/application/files/base-vite/public/favicon.ico +0 -0
  64. package/src/generators/application/files/base-vite/src/app/__fileName__.spec.tsx__tmpl__ +0 -10
  65. package/src/generators/application/files/base-vite/src/assets/.gitkeep +0 -0
  66. package/src/generators/application/files/base-vite/src/environments/environment.prod.ts__tmpl__ +0 -3
  67. package/src/generators/application/files/base-vite/src/environments/environment.ts__tmpl__ +0 -6
  68. package/src/generators/application/files/base-vite/src/main.tsx__tmpl__ +0 -10
  69. package/src/generators/application/files/base-vite/tsconfig.app.json__tmpl__ +0 -14
  70. package/src/generators/application/files/base-webpack/.babelrc__tmpl__ +0 -13
  71. package/src/generators/application/files/base-webpack/src/app/__fileName__.spec.tsx__tmpl__ +0 -10
  72. package/src/generators/application/files/base-webpack/src/assets/.gitkeep +0 -0
  73. package/src/generators/application/files/base-webpack/src/environments/environment.prod.ts__tmpl__ +0 -3
  74. package/src/generators/application/files/base-webpack/src/environments/environment.ts__tmpl__ +0 -6
  75. package/src/generators/application/files/base-webpack/src/favicon.ico +0 -0
  76. package/src/generators/application/files/base-webpack/src/index.html +0 -14
  77. package/src/generators/application/files/base-webpack/src/main.tsx__tmpl__ +0 -10
  78. package/src/generators/application/files/base-webpack/tsconfig.app.json__tmpl__ +0 -14
  79. package/src/generators/application/files/base-webpack/webpack.config.js__tmpl__ +0 -9
  80. package/src/generators/application/files/nx-welcome/src/app/nx-welcome.tsx +0 -845
  81. package/src/generators/application/files/style-css-module/src/app/__fileName__.module.__style__ +0 -1
  82. package/src/generators/application/files/style-css-module/src/app/__fileName__.tsx__tmpl__ +0 -37
  83. package/src/generators/application/files/style-css-module/src/styles.__style__ +0 -1
  84. package/src/generators/application/files/style-global-css/src/app/__fileName__.__style__ +0 -1
  85. package/src/generators/application/files/style-global-css/src/app/__fileName__.tsx__tmpl__ +0 -36
  86. package/src/generators/application/files/style-global-css/src/styles.__style__ +0 -1
  87. package/src/generators/application/files/style-none/src/app/__fileName__.tsx__tmpl__ +0 -35
  88. package/src/generators/application/files/style-styled-jsx/src/app/__fileName__.tsx__tmpl__ +0 -29
  89. package/src/generators/application/files/style-styled-module/src/app/__fileName__.tsx__tmpl__ +0 -40
  90. package/src/generators/application/lib/add-cypress.d.ts +0 -3
  91. package/src/generators/application/lib/add-cypress.js +0 -22
  92. package/src/generators/application/lib/add-cypress.js.map +0 -1
  93. package/src/generators/application/lib/add-jest.d.ts +0 -3
  94. package/src/generators/application/lib/add-jest.js +0 -17
  95. package/src/generators/application/lib/add-jest.js.map +0 -1
  96. package/src/generators/application/lib/add-project.d.ts +0 -2
  97. package/src/generators/application/lib/add-project.js +0 -98
  98. package/src/generators/application/lib/add-project.js.map +0 -1
  99. package/src/generators/application/lib/add-routing.d.ts +0 -3
  100. package/src/generators/application/lib/add-routing.js +0 -32
  101. package/src/generators/application/lib/add-routing.js.map +0 -1
  102. package/src/generators/application/lib/create-application-files.d.ts +0 -3
  103. package/src/generators/application/lib/create-application-files.js +0 -47
  104. package/src/generators/application/lib/create-application-files.js.map +0 -1
  105. package/src/generators/application/lib/find-free-port.d.ts +0 -2
  106. package/src/generators/application/lib/find-free-port.js +0 -18
  107. package/src/generators/application/lib/find-free-port.js.map +0 -1
  108. package/src/generators/application/lib/get-app-tests.d.ts +0 -2
  109. package/src/generators/application/lib/get-app-tests.js +0 -22
  110. package/src/generators/application/lib/get-app-tests.js.map +0 -1
  111. package/src/generators/application/lib/install-common-dependencies.d.ts +0 -3
  112. package/src/generators/application/lib/install-common-dependencies.js +0 -29
  113. package/src/generators/application/lib/install-common-dependencies.js.map +0 -1
  114. package/src/generators/application/lib/normalize-options.d.ts +0 -5
  115. package/src/generators/application/lib/normalize-options.js +0 -60
  116. package/src/generators/application/lib/normalize-options.js.map +0 -1
  117. package/src/generators/application/lib/set-defaults.d.ts +0 -3
  118. package/src/generators/application/lib/set-defaults.js +0 -23
  119. package/src/generators/application/lib/set-defaults.js.map +0 -1
  120. package/src/generators/application/lib/update-jest-config.d.ts +0 -3
  121. package/src/generators/application/lib/update-jest-config.js +0 -30
  122. package/src/generators/application/lib/update-jest-config.js.map +0 -1
  123. package/src/generators/application/schema.d.ts +0 -45
  124. package/src/generators/application/schema.json +0 -202
  125. package/src/generators/component/component.d.ts +0 -5
  126. package/src/generators/component/component.js +0 -141
  127. package/src/generators/component/component.js.map +0 -1
  128. package/src/generators/component/files/__fileName__.__style__ +0 -0
  129. package/src/generators/component/files/__fileName__.module.__style__ +0 -7
  130. package/src/generators/component/files/__fileName__.spec.tsx__tmpl__ +0 -7
  131. package/src/generators/component/files/__fileName__.tsx__tmpl__ +0 -71
  132. package/src/generators/component/get-component-tests.d.ts +0 -2
  133. package/src/generators/component/get-component-tests.js +0 -13
  134. package/src/generators/component/get-component-tests.js.map +0 -1
  135. package/src/generators/component/noramlized-schema.d.ts +0 -8
  136. package/src/generators/component/noramlized-schema.js +0 -3
  137. package/src/generators/component/noramlized-schema.js.map +0 -1
  138. package/src/generators/component/schema.d.ts +0 -20
  139. package/src/generators/component/schema.json +0 -153
  140. package/src/generators/component-cypress-spec/component-cypress-spec.d.ts +0 -14
  141. package/src/generators/component-cypress-spec/component-cypress-spec.js +0 -105
  142. package/src/generators/component-cypress-spec/component-cypress-spec.js.map +0 -1
  143. package/src/generators/component-cypress-spec/files/__componentName__.__fileExt__ +0 -13
  144. package/src/generators/component-cypress-spec/schema.json +0 -44
  145. package/src/generators/component-story/component-story.d.ts +0 -12
  146. package/src/generators/component-story/component-story.js +0 -81
  147. package/src/generators/component-story/component-story.js.map +0 -1
  148. package/src/generators/component-story/files/__componentFileName__.stories.__fileExt__ +0 -32
  149. package/src/generators/component-story/schema.json +0 -36
  150. package/src/generators/component-test/component-test.d.ts +0 -4
  151. package/src/generators/component-test/component-test.js +0 -78
  152. package/src/generators/component-test/component-test.js.map +0 -1
  153. package/src/generators/component-test/files/__fileName__.cy__ext__ +0 -21
  154. package/src/generators/component-test/schema.d.ts +0 -4
  155. package/src/generators/component-test/schema.js +0 -3
  156. package/src/generators/component-test/schema.js.map +0 -1
  157. package/src/generators/component-test/schema.json +0 -31
  158. package/src/generators/cypress-component-configuration/cypress-component-configuration.d.ts +0 -9
  159. package/src/generators/cypress-component-configuration/cypress-component-configuration.js +0 -34
  160. package/src/generators/cypress-component-configuration/cypress-component-configuration.js.map +0 -1
  161. package/src/generators/cypress-component-configuration/files/cypress/support/commands.ts__tpl__ +0 -42
  162. package/src/generators/cypress-component-configuration/files/cypress.config.ts__tpl__ +0 -8
  163. package/src/generators/cypress-component-configuration/lib/add-files.d.ts +0 -4
  164. package/src/generators/cypress-component-configuration/lib/add-files.js +0 -75
  165. package/src/generators/cypress-component-configuration/lib/add-files.js.map +0 -1
  166. package/src/generators/cypress-component-configuration/lib/update-configs.d.ts +0 -7
  167. package/src/generators/cypress-component-configuration/lib/update-configs.js +0 -30
  168. package/src/generators/cypress-component-configuration/lib/update-configs.js.map +0 -1
  169. package/src/generators/cypress-component-configuration/schema.d.ts +0 -7
  170. package/src/generators/cypress-component-configuration/schema.json +0 -54
  171. package/src/generators/hook/files/__fileName__.spec.tsx__tmpl__ +0 -18
  172. package/src/generators/hook/files/__fileName__.ts__tmpl__ +0 -15
  173. package/src/generators/hook/hook.d.ts +0 -5
  174. package/src/generators/hook/hook.js +0 -117
  175. package/src/generators/hook/hook.js.map +0 -1
  176. package/src/generators/hook/schema.d.ts +0 -11
  177. package/src/generators/hook/schema.json +0 -77
  178. package/src/generators/host/files/common/src/app/__fileName__.tsx__tmpl__ +0 -33
  179. package/src/generators/host/files/module-federation/module-federation.config.js__tmpl__ +0 -6
  180. package/src/generators/host/files/module-federation/src/main.ts__tmpl__ +0 -1
  181. package/src/generators/host/files/module-federation/src/remotes.d.ts__tmpl__ +0 -4
  182. package/src/generators/host/files/module-federation/webpack.config.js__tmpl__ +0 -12
  183. package/src/generators/host/files/module-federation/webpack.config.prod.js__tmpl__ +0 -32
  184. package/src/generators/host/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -13
  185. package/src/generators/host/files/module-federation-ssr/server.ts__tmpl__ +0 -28
  186. package/src/generators/host/files/module-federation-ssr/tsconfig.server.json__tmpl__ +0 -15
  187. package/src/generators/host/files/module-federation-ssr/webpack.server.config.js__tmpl__ +0 -12
  188. package/src/generators/host/host.d.ts +0 -4
  189. package/src/generators/host/host.js +0 -67
  190. package/src/generators/host/host.js.map +0 -1
  191. package/src/generators/host/lib/add-module-federation-files.d.ts +0 -5
  192. package/src/generators/host/lib/add-module-federation-files.js +0 -21
  193. package/src/generators/host/lib/add-module-federation-files.js.map +0 -1
  194. package/src/generators/host/lib/setup-ssr-for-host.d.ts +0 -6
  195. package/src/generators/host/lib/setup-ssr-for-host.js +0 -27
  196. package/src/generators/host/lib/setup-ssr-for-host.js.map +0 -1
  197. package/src/generators/host/lib/update-module-federation-e2e-project.d.ts +0 -3
  198. package/src/generators/host/lib/update-module-federation-e2e-project.js +0 -16
  199. package/src/generators/host/lib/update-module-federation-e2e-project.js.map +0 -1
  200. package/src/generators/host/schema.d.ts +0 -32
  201. package/src/generators/host/schema.json +0 -174
  202. package/src/generators/init/init.d.ts +0 -5
  203. package/src/generators/init/init.js +0 -80
  204. package/src/generators/init/init.js.map +0 -1
  205. package/src/generators/init/schema.d.ts +0 -11
  206. package/src/generators/init/schema.json +0 -49
  207. package/src/generators/library/files/common/.babelrc__tmpl__ +0 -16
  208. package/src/generators/library/files/common/README.md +0 -7
  209. package/src/generators/library/files/common/package.json__tmpl__ +0 -4
  210. package/src/generators/library/files/common/src/index.ts__tmpl__ +0 -0
  211. package/src/generators/library/files/common/tsconfig.lib.json__tmpl__ +0 -14
  212. package/src/generators/library/files/vite/README.md +0 -7
  213. package/src/generators/library/files/vite/package.json__tmpl__ +0 -12
  214. package/src/generators/library/files/vite/tsconfig.lib.json__tmpl__ +0 -14
  215. package/src/generators/library/lib/add-linting.d.ts +0 -3
  216. package/src/generators/library/lib/add-linting.js +0 -38
  217. package/src/generators/library/lib/add-linting.js.map +0 -1
  218. package/src/generators/library/lib/add-rollup-build-target.d.ts +0 -3
  219. package/src/generators/library/lib/add-rollup-build-target.js +0 -59
  220. package/src/generators/library/lib/add-rollup-build-target.js.map +0 -1
  221. package/src/generators/library/lib/create-files.d.ts +0 -3
  222. package/src/generators/library/lib/create-files.js +0 -26
  223. package/src/generators/library/lib/create-files.js.map +0 -1
  224. package/src/generators/library/lib/install-common-dependencies.d.ts +0 -3
  225. package/src/generators/library/lib/install-common-dependencies.js +0 -30
  226. package/src/generators/library/lib/install-common-dependencies.js.map +0 -1
  227. package/src/generators/library/lib/maybe-js.d.ts +0 -2
  228. package/src/generators/library/lib/maybe-js.js +0 -10
  229. package/src/generators/library/lib/maybe-js.js.map +0 -1
  230. package/src/generators/library/lib/normalize-options.d.ts +0 -3
  231. package/src/generators/library/lib/normalize-options.js +0 -57
  232. package/src/generators/library/lib/normalize-options.js.map +0 -1
  233. package/src/generators/library/lib/set-defaults.d.ts +0 -3
  234. package/src/generators/library/lib/set-defaults.js +0 -16
  235. package/src/generators/library/lib/set-defaults.js.map +0 -1
  236. package/src/generators/library/lib/update-app-routes.d.ts +0 -3
  237. package/src/generators/library/lib/update-app-routes.js +0 -63
  238. package/src/generators/library/lib/update-app-routes.js.map +0 -1
  239. package/src/generators/library/library.d.ts +0 -5
  240. package/src/generators/library/library.js +0 -126
  241. package/src/generators/library/library.js.map +0 -1
  242. package/src/generators/library/schema.d.ts +0 -44
  243. package/src/generators/library/schema.json +0 -198
  244. package/src/generators/redux/files/__directory__/__fileName__.slice.spec.ts__tmpl__ +0 -53
  245. package/src/generators/redux/files/__directory__/__fileName__.slice.ts__tmpl__ +0 -129
  246. package/src/generators/redux/redux.d.ts +0 -5
  247. package/src/generators/redux/redux.js +0 -117
  248. package/src/generators/redux/redux.js.map +0 -1
  249. package/src/generators/redux/schema.d.ts +0 -20
  250. package/src/generators/redux/schema.json +0 -47
  251. package/src/generators/remote/files/module-federation/module-federation.config.js__tmpl__ +0 -6
  252. package/src/generators/remote/files/module-federation/src/main.ts__tmpl__ +0 -1
  253. package/src/generators/remote/files/module-federation/src/remote-entry.ts__tmpl__ +0 -1
  254. package/src/generators/remote/files/module-federation/webpack.config.js__tmpl__ +0 -12
  255. package/src/generators/remote/files/module-federation/webpack.config.prod.js__tmpl__ +0 -1
  256. package/src/generators/remote/files/module-federation-ssr/module-federation.server.config.js__tmpl__ +0 -6
  257. package/src/generators/remote/files/module-federation-ssr/server.ts__tmpl__ +0 -45
  258. package/src/generators/remote/files/module-federation-ssr/webpack.server.config.js__tmpl__ +0 -12
  259. package/src/generators/remote/lib/setup-ssr-for-remote.d.ts +0 -4
  260. package/src/generators/remote/lib/setup-ssr-for-remote.js +0 -32
  261. package/src/generators/remote/lib/setup-ssr-for-remote.js.map +0 -1
  262. package/src/generators/remote/lib/update-host-with-remote.d.ts +0 -2
  263. package/src/generators/remote/lib/update-host-with-remote.js +0 -53
  264. package/src/generators/remote/lib/update-host-with-remote.js.map +0 -1
  265. package/src/generators/remote/remote.d.ts +0 -6
  266. package/src/generators/remote/remote.js +0 -56
  267. package/src/generators/remote/remote.js.map +0 -1
  268. package/src/generators/remote/schema.d.ts +0 -27
  269. package/src/generators/remote/schema.json +0 -173
  270. package/src/generators/setup-ssr/files/server.ts__tmpl__ +0 -28
  271. package/src/generators/setup-ssr/files/src/main.server.tsx__tmpl__ +0 -47
  272. package/src/generators/setup-ssr/files/tsconfig.server.json__tmpl__ +0 -15
  273. package/src/generators/setup-ssr/schema.d.ts +0 -7
  274. package/src/generators/setup-ssr/schema.json +0 -48
  275. package/src/generators/setup-ssr/setup-ssr.d.ts +0 -5
  276. package/src/generators/setup-ssr/setup-ssr.js +0 -162
  277. package/src/generators/setup-ssr/setup-ssr.js.map +0 -1
  278. package/src/generators/setup-tailwind/files/postcss.config.js__tmpl__ +0 -15
  279. package/src/generators/setup-tailwind/files/tailwind.config.js__tmpl__ +0 -17
  280. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.d.ts +0 -3
  281. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js +0 -36
  282. package/src/generators/setup-tailwind/lib/add-tailwind-style-imports.js.map +0 -1
  283. package/src/generators/setup-tailwind/lib/update-project.d.ts +0 -3
  284. package/src/generators/setup-tailwind/lib/update-project.js +0 -15
  285. package/src/generators/setup-tailwind/lib/update-project.js.map +0 -1
  286. package/src/generators/setup-tailwind/schema.d.ts +0 -6
  287. package/src/generators/setup-tailwind/schema.js +0 -3
  288. package/src/generators/setup-tailwind/schema.js.map +0 -1
  289. package/src/generators/setup-tailwind/schema.json +0 -47
  290. package/src/generators/setup-tailwind/setup-tailwind.d.ts +0 -5
  291. package/src/generators/setup-tailwind/setup-tailwind.js +0 -39
  292. package/src/generators/setup-tailwind/setup-tailwind.js.map +0 -1
  293. package/src/generators/stories/schema.json +0 -59
  294. package/src/generators/stories/stories.d.ts +0 -15
  295. package/src/generators/stories/stories.js +0 -118
  296. package/src/generators/stories/stories.js.map +0 -1
  297. package/src/generators/storybook-configuration/configuration.d.ts +0 -5
  298. package/src/generators/storybook-configuration/configuration.js +0 -65
  299. package/src/generators/storybook-configuration/configuration.js.map +0 -1
  300. package/src/generators/storybook-configuration/schema.d.ts +0 -18
  301. package/src/generators/storybook-configuration/schema.json +0 -109
  302. package/src/migrations/update-12-0-0/remove-react-redux-types-package.d.ts +0 -3
  303. package/src/migrations/update-12-0-0/remove-react-redux-types-package.js +0 -13
  304. package/src/migrations/update-12-0-0/remove-react-redux-types-package.js.map +0 -1
  305. package/src/migrations/update-12-0-0/update-emotion-setup.d.ts +0 -3
  306. package/src/migrations/update-12-0-0/update-emotion-setup.js +0 -67
  307. package/src/migrations/update-12-0-0/update-emotion-setup.js.map +0 -1
  308. package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.d.ts +0 -3
  309. package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js +0 -27
  310. package/src/migrations/update-12-0-0/use-react-jsx-in-tsconfig.js.map +0 -1
  311. package/src/migrations/update-12-8-0/update-12-8-0.d.ts +0 -3
  312. package/src/migrations/update-12-8-0/update-12-8-0.js +0 -15
  313. package/src/migrations/update-12-8-0/update-12-8-0.js.map +0 -1
  314. package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.d.ts +0 -3
  315. package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js +0 -38
  316. package/src/migrations/update-13-0-0/migrate-storybook-to-webpack-5.js.map +0 -1
  317. package/src/migrations/update-13-0-0/update-emotion-setup.d.ts +0 -3
  318. package/src/migrations/update-13-0-0/update-emotion-setup.js +0 -39
  319. package/src/migrations/update-13-0-0/update-emotion-setup.js.map +0 -1
  320. package/src/migrations/update-13-0-0/webpack5-changes-utils.d.ts +0 -11
  321. package/src/migrations/update-13-0-0/webpack5-changes-utils.js +0 -269
  322. package/src/migrations/update-13-0-0/webpack5-changes-utils.js.map +0 -1
  323. package/src/migrations/update-13-10-0/update-13-10-0.d.ts +0 -3
  324. package/src/migrations/update-13-10-0/update-13-10-0.js +0 -29
  325. package/src/migrations/update-13-10-0/update-13-10-0.js.map +0 -1
  326. package/src/migrations/update-14-0-0/add-default-development-configurations.d.ts +0 -3
  327. package/src/migrations/update-14-0-0/add-default-development-configurations.js +0 -40
  328. package/src/migrations/update-14-0-0/add-default-development-configurations.js.map +0 -1
  329. package/src/migrations/update-14-0-0/replace-testing-library-react-hook.d.ts +0 -3
  330. package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js +0 -27
  331. package/src/migrations/update-14-0-0/replace-testing-library-react-hook.js.map +0 -1
  332. package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.d.ts +0 -5
  333. package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js +0 -69
  334. package/src/migrations/update-14-0-0/update-react-dom-render-for-v18.js.map +0 -1
  335. package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.d.ts +0 -3
  336. package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js +0 -38
  337. package/src/migrations/update-14-1-0/update-external-emotion-jsx-runtime.js.map +0 -1
  338. package/src/migrations/update-14-6-0/add-preset-jest-config.d.ts +0 -3
  339. package/src/migrations/update-14-6-0/add-preset-jest-config.js +0 -40
  340. package/src/migrations/update-14-6-0/add-preset-jest-config.js.map +0 -1
  341. package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.d.ts +0 -3
  342. package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js +0 -39
  343. package/src/migrations/update-15-3-0/install-webpack-rollup-dependencies.js.map +0 -1
  344. package/src/migrations/update-15-3-0/update-rollup-executor.d.ts +0 -3
  345. package/src/migrations/update-15-3-0/update-rollup-executor.js +0 -17
  346. package/src/migrations/update-15-3-0/update-rollup-executor.js.map +0 -1
  347. package/src/migrations/update-15-6-3/webpack-config-setup.d.ts +0 -2
  348. package/src/migrations/update-15-6-3/webpack-config-setup.js +0 -108
  349. package/src/migrations/update-15-6-3/webpack-config-setup.js.map +0 -1
  350. package/src/module-federation/ast-utils.d.ts +0 -8
  351. package/src/module-federation/ast-utils.js +0 -103
  352. package/src/module-federation/ast-utils.js.map +0 -1
  353. package/src/module-federation/load-config.d.ts +0 -3
  354. package/src/module-federation/load-config.js +0 -17
  355. package/src/module-federation/load-config.js.map +0 -1
  356. package/src/module-federation/models.d.ts +0 -24
  357. package/src/module-federation/models.js +0 -3
  358. package/src/module-federation/models.js.map +0 -1
  359. package/src/module-federation/package-json.d.ts +0 -8
  360. package/src/module-federation/package-json.js +0 -14
  361. package/src/module-federation/package-json.js.map +0 -1
  362. package/src/module-federation/utils.d.ts +0 -10
  363. package/src/module-federation/utils.js +0 -38
  364. package/src/module-federation/utils.js.map +0 -1
  365. package/src/module-federation/with-module-federation-ssr.d.ts +0 -2
  366. package/src/module-federation/with-module-federation-ssr.js +0 -48
  367. package/src/module-federation/with-module-federation-ssr.js.map +0 -1
  368. package/src/module-federation/with-module-federation.d.ts +0 -7
  369. package/src/module-federation/with-module-federation.js +0 -50
  370. package/src/module-federation/with-module-federation.js.map +0 -1
  371. package/src/rules/add-styled-dependencies.d.ts +0 -2
  372. package/src/rules/add-styled-dependencies.js +0 -16
  373. package/src/rules/add-styled-dependencies.js.map +0 -1
  374. package/src/rules/update-module-federation-project.d.ts +0 -6
  375. package/src/rules/update-module-federation-project.js +0 -34
  376. package/src/rules/update-module-federation-project.js.map +0 -1
  377. package/src/utils/assertion.d.ts +0 -1
  378. package/src/utils/assertion.js +0 -20
  379. package/src/utils/assertion.js.map +0 -1
  380. package/src/utils/ast-utils.d.ts +0 -29
  381. package/src/utils/ast-utils.js +0 -526
  382. package/src/utils/ast-utils.js.map +0 -1
  383. package/src/utils/component-props.d.ts +0 -15
  384. package/src/utils/component-props.js +0 -61
  385. package/src/utils/component-props.js.map +0 -1
  386. package/src/utils/create-ts-config.d.ts +0 -9
  387. package/src/utils/create-ts-config.js +0 -64
  388. package/src/utils/create-ts-config.js.map +0 -1
  389. package/src/utils/dependencies.d.ts +0 -7
  390. package/src/utils/dependencies.js +0 -3
  391. package/src/utils/dependencies.js.map +0 -1
  392. package/src/utils/format-file.d.ts +0 -1
  393. package/src/utils/format-file.js +0 -13
  394. package/src/utils/format-file.js.map +0 -1
  395. package/src/utils/get-in-source-vitest-tests-template.d.ts +0 -1
  396. package/src/utils/get-in-source-vitest-tests-template.js +0 -22
  397. package/src/utils/get-in-source-vitest-tests-template.js.map +0 -1
  398. package/src/utils/jest-utils.d.ts +0 -1
  399. package/src/utils/jest-utils.js +0 -10
  400. package/src/utils/jest-utils.js.map +0 -1
  401. package/src/utils/lint.d.ts +0 -37
  402. package/src/utils/lint.js +0 -68
  403. package/src/utils/lint.js.map +0 -1
  404. package/src/utils/styled.d.ts +0 -4
  405. package/src/utils/styled.js +0 -33
  406. package/src/utils/styled.js.map +0 -1
  407. package/src/utils/testing-generators.d.ts +0 -3
  408. package/src/utils/testing-generators.js +0 -36
  409. package/src/utils/testing-generators.js.map +0 -1
  410. package/src/utils/versions.d.ts +0 -43
  411. package/src/utils/versions.js +0 -51
  412. package/src/utils/versions.js.map +0 -1
@@ -1,153 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactComponent",
5
- "title": "Create a React Component",
6
- "description": "Create a React Component for Nx.",
7
- "type": "object",
8
- "examples": [
9
- {
10
- "command": "nx g component my-component --project=mylib",
11
- "description": "Generate a component in the `mylib` library"
12
- },
13
- {
14
- "command": "nx g component my-component --project=mylib --classComponent",
15
- "description": "Generate a class component in the `mylib` library"
16
- }
17
- ],
18
- "properties": {
19
- "project": {
20
- "type": "string",
21
- "description": "The name of the project.",
22
- "alias": "p",
23
- "$default": {
24
- "$source": "projectName"
25
- },
26
- "x-prompt": "What is the name of the project for this component?",
27
- "x-priority": "important"
28
- },
29
- "name": {
30
- "type": "string",
31
- "description": "The name of the component.",
32
- "$default": {
33
- "$source": "argv",
34
- "index": 0
35
- },
36
- "x-prompt": "What name would you like to use for the component?",
37
- "x-priority": "important"
38
- },
39
- "style": {
40
- "description": "The file extension to be used for style files.",
41
- "type": "string",
42
- "alias": "s",
43
- "default": "css",
44
- "x-prompt": {
45
- "message": "Which stylesheet format would you like to use?",
46
- "type": "list",
47
- "items": [
48
- { "value": "css", "label": "CSS" },
49
- {
50
- "value": "scss",
51
- "label": "SASS(.scss) [ http://sass-lang.com ]"
52
- },
53
- {
54
- "value": "styl",
55
- "label": "Stylus(.styl) [ http://stylus-lang.com ]"
56
- },
57
- {
58
- "value": "less",
59
- "label": "LESS [ http://lesscss.org ]"
60
- },
61
- {
62
- "value": "styled-components",
63
- "label": "styled-components [ https://styled-components.com ]"
64
- },
65
- {
66
- "value": "@emotion/styled",
67
- "label": "emotion [ https://emotion.sh ]"
68
- },
69
- {
70
- "value": "styled-jsx",
71
- "label": "styled-jsx [ https://www.npmjs.com/package/styled-jsx ]"
72
- },
73
- {
74
- "value": "none",
75
- "label": "None"
76
- }
77
- ]
78
- }
79
- },
80
- "js": {
81
- "type": "boolean",
82
- "description": "Generate JavaScript files rather than TypeScript files.",
83
- "default": false
84
- },
85
- "skipTests": {
86
- "type": "boolean",
87
- "description": "When true, does not create `spec.ts` test files for the new component.",
88
- "default": false,
89
- "x-priority": "internal"
90
- },
91
- "directory": {
92
- "type": "string",
93
- "description": "Create the component under this directory (can be nested).",
94
- "alias": "dir",
95
- "x-priority": "important"
96
- },
97
- "flat": {
98
- "type": "boolean",
99
- "description": "Create component at the source root rather than its own directory.",
100
- "default": false
101
- },
102
- "export": {
103
- "type": "boolean",
104
- "description": "When true, the component is exported from the project `index.ts` (if it exists).",
105
- "alias": "e",
106
- "default": false,
107
- "x-prompt": "Should this component be exported in the project?"
108
- },
109
- "pascalCaseFiles": {
110
- "type": "boolean",
111
- "description": "Use pascal case component file name (e.g. `App.tsx`).",
112
- "alias": "P",
113
- "default": false
114
- },
115
- "pascalCaseDirectory": {
116
- "type": "boolean",
117
- "description": "Use pascal case directory name (e.g. `App/App.tsx`).",
118
- "alias": "R",
119
- "default": false
120
- },
121
- "classComponent": {
122
- "type": "boolean",
123
- "alias": "C",
124
- "description": "Use class components instead of functional component.",
125
- "default": false
126
- },
127
- "routing": {
128
- "type": "boolean",
129
- "description": "Generate a library with routes."
130
- },
131
- "globalCss": {
132
- "type": "boolean",
133
- "description": "Default is `false`. When `true`, the component is generated with `*.css`/`*.scss` instead of `*.module.css`/`*.module.scss`.",
134
- "default": false
135
- },
136
- "fileName": {
137
- "type": "string",
138
- "description": "Create a component with this file name."
139
- },
140
- "inSourceTests": {
141
- "type": "boolean",
142
- "default": false,
143
- "description": "When using Vitest, separate spec files will not be generated and instead will be included within the source files. Read more on the Vitest docs site: https://vitest.dev/guide/in-source.html"
144
- },
145
- "skipFormat": {
146
- "description": "Skip formatting files.",
147
- "type": "boolean",
148
- "default": false,
149
- "x-priority": "internal"
150
- }
151
- },
152
- "required": ["name", "project"]
153
- }
@@ -1,14 +0,0 @@
1
- import { Tree } from '@nrwl/devkit';
2
- import type * as ts from 'typescript';
3
- export interface CreateComponentSpecFileSchema {
4
- project: string;
5
- componentPath: string;
6
- js?: boolean;
7
- cypressProject?: string;
8
- skipFormat?: boolean;
9
- }
10
- export declare function componentCypressGenerator(host: Tree, schema: CreateComponentSpecFileSchema): Promise<void>;
11
- export declare function getArgsDefaultValue(property: ts.SyntaxKind): string;
12
- export declare function createComponentSpecFile(tree: Tree, { project, componentPath, js, cypressProject }: CreateComponentSpecFileSchema): void;
13
- export default componentCypressGenerator;
14
- export declare const componentCypressSchematic: (generatorOptions: CreateComponentSpecFileSchema) => (tree: any, context: any) => Promise<any>;
@@ -1,105 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.componentCypressSchematic = exports.createComponentSpecFile = exports.getArgsDefaultValue = exports.componentCypressGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const path_1 = require("path");
7
- const ast_utils_1 = require("../../utils/ast-utils");
8
- const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
9
- let tsModule;
10
- function componentCypressGenerator(host, schema) {
11
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
12
- createComponentSpecFile(host, schema);
13
- if (!schema.skipFormat) {
14
- yield (0, devkit_1.formatFiles)(host);
15
- }
16
- });
17
- }
18
- exports.componentCypressGenerator = componentCypressGenerator;
19
- // TODO: candidate to refactor with the angular component story
20
- function getArgsDefaultValue(property) {
21
- if (!tsModule) {
22
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
23
- }
24
- const typeNameToDefault = {
25
- [tsModule.SyntaxKind.StringKeyword]: '',
26
- [tsModule.SyntaxKind.NumberKeyword]: 0,
27
- [tsModule.SyntaxKind.BooleanKeyword]: false,
28
- };
29
- const resolvedValue = typeNameToDefault[property];
30
- if (typeof resolvedValue === undefined) {
31
- return '';
32
- }
33
- else if (typeof resolvedValue === 'string') {
34
- return resolvedValue.replace(/\s/g, '+');
35
- }
36
- else {
37
- return resolvedValue;
38
- }
39
- }
40
- exports.getArgsDefaultValue = getArgsDefaultValue;
41
- function createComponentSpecFile(tree, { project, componentPath, js, cypressProject }) {
42
- if (!tsModule) {
43
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
44
- }
45
- const e2eProjectName = cypressProject || `${project}-e2e`;
46
- const projects = (0, devkit_1.getProjects)(tree);
47
- const e2eProject = projects.get(e2eProjectName);
48
- // cypress >= v10 will have a cypress.config.ts < v10 will have a cypress.json
49
- const isCypressV10 = tree.exists((0, path_1.join)(e2eProject.root, 'cypress.config.ts'));
50
- const e2eLibIntegrationFolderPath = (0, path_1.join)(e2eProject.sourceRoot, isCypressV10 ? 'e2e' : 'integration');
51
- const proj = projects.get(project);
52
- const componentFilePath = (0, devkit_1.joinPathFragments)(proj.sourceRoot, componentPath);
53
- const componentName = componentFilePath
54
- .slice(componentFilePath.lastIndexOf('/') + 1)
55
- .replace('.tsx', '')
56
- .replace('.jsx', '')
57
- .replace('.js', '');
58
- const contents = tree.read(componentFilePath, 'utf-8');
59
- if (contents === null) {
60
- throw new Error(`Failed to read ${componentFilePath}`);
61
- }
62
- const sourceFile = tsModule.createSourceFile(componentFilePath, contents, tsModule.ScriptTarget.Latest, true);
63
- const cmpDeclaration = (0, ast_utils_1.getComponentNode)(sourceFile);
64
- if (!cmpDeclaration) {
65
- const componentNodes = (0, ast_utils_1.findExportDeclarationsForJsx)(sourceFile);
66
- if (componentNodes === null || componentNodes === void 0 ? void 0 : componentNodes.length) {
67
- componentNodes.forEach((declaration) => {
68
- findPropsAndGenerateFileForCypress(tree, sourceFile, declaration, e2eLibIntegrationFolderPath, componentName, project, js, true);
69
- });
70
- }
71
- else {
72
- throw new Error(`Could not find any React component in file ${componentFilePath}`);
73
- }
74
- }
75
- else {
76
- findPropsAndGenerateFileForCypress(tree, sourceFile, cmpDeclaration, e2eLibIntegrationFolderPath, componentName, project, js);
77
- }
78
- }
79
- exports.createComponentSpecFile = createComponentSpecFile;
80
- function findPropsAndGenerateFileForCypress(tree, sourceFile, cmpDeclaration, e2eLibIntegrationFolderPath, componentName, project, js, fromNodeArray) {
81
- const propsInterface = (0, ast_utils_1.getComponentPropsInterface)(sourceFile, cmpDeclaration);
82
- let props = [];
83
- if (propsInterface) {
84
- props = propsInterface.members.map((member) => {
85
- return {
86
- name: member.name.text,
87
- defaultValue: getArgsDefaultValue(member.type.kind),
88
- };
89
- });
90
- }
91
- const isCypressV10 = (0, path_1.basename)(e2eLibIntegrationFolderPath) === 'e2e';
92
- const cyFilePrefix = isCypressV10 ? 'cy' : 'spec';
93
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, './files'), `${e2eLibIntegrationFolderPath}/${fromNodeArray
94
- ? componentName + '--' + cmpDeclaration.name.text
95
- : componentName}`, {
96
- projectName: project,
97
- componentName,
98
- componentSelector: cmpDeclaration.name.text,
99
- props,
100
- fileExt: js ? `${cyFilePrefix}.js` : `${cyFilePrefix}.ts`,
101
- });
102
- }
103
- exports.default = componentCypressGenerator;
104
- exports.componentCypressSchematic = (0, devkit_1.convertNxGenerator)(componentCypressGenerator);
105
- //# sourceMappingURL=component-cypress-spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-cypress-spec.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-cypress-spec/component-cypress-spec.ts"],"names":[],"mappings":";;;;AAAA,yCAOsB;AACtB,+BAAsC;AAEtC,qDAI+B;AAC/B,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAU1C,SAAsB,yBAAyB,CAC7C,IAAU,EACV,MAAqC;;QAErC,uBAAuB,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEtC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AATD,8DASC;AAED,+DAA+D;AAC/D,SAAgB,mBAAmB,CAAC,QAAuB;IACzD,IAAI,CAAC,QAAQ,EAAE;QACb,QAAQ,GAAG,IAAA,oCAAgB,GAAE,CAAC;KAC/B;IACD,MAAM,iBAAiB,GAAwB;QAC7C,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,EAAE;QACvC,CAAC,QAAQ,CAAC,UAAU,CAAC,aAAa,CAAC,EAAE,CAAC;QACtC,CAAC,QAAQ,CAAC,UAAU,CAAC,cAAc,CAAC,EAAE,KAAK;KAC5C,CAAC;IAEF,MAAM,aAAa,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,OAAO,aAAa,KAAK,SAAS,EAAE;QACtC,OAAO,EAAE,CAAC;KACX;SAAM,IAAI,OAAO,aAAa,KAAK,QAAQ,EAAE;QAC5C,OAAO,aAAa,CAAC,OAAO,CAAC,KAAK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M,CAAC,IAAsB,CAAC,IAAI;gBACzC,YAAY,EAAE,mBAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC;aACpD,CAAC;QACJ,CAAC,CAAC,CAAC;KACJ;IAED,MAAM,YAAY,GAAG,IAAA,eAAQ,EAAC,2BAA2B,CAAC,KAAK,KAAK,CAAC;IACrE,MAAM,YAAY,GAAG,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC;IAElD,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,SAAS,CAAC,EACvC,GAAG,2BAA2B,IAC5B,aAAa;QACX,CAAC,CAAC,aAAa,GAAG,IAAI,GAAI,cAAsB,CAAC,IAAI,CAAC,IAAI;QAC1D,CAAC,CAAC,aACN,EAAE,EACF;QACE,WAAW,EAAE,OAAO;QACpB,aAAa;QACb,iBAAiB,EAAG,cAAsB,CAAC,IAAI,CAAC,IAAI;QACpD,KAAK;QACL,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK;KAC1D,CACF,CAAC;AACJ,CAAC;AAED,kBAAe,yBAAyB,CAAC;AAC5B,QAAA,yBAAyB,GAAG,IAAA,2BAAkB,EACzD,yBAAyB,CAC1B,CAAC"}
@@ -1,13 +0,0 @@
1
- describe('<%=projectName%>: <%= componentSelector %> component', () => {
2
- beforeEach(() => cy.visit('/iframe.html?id=<%= componentSelector.toLowerCase() %>--primary<% if ( props && props.length > 0 ) { %>&args=<% } %><%
3
- for(let prop of props) {
4
- %><%=prop.name%><%
5
- if(prop.defaultValue !== undefined && (prop.defaultValue || prop.defaultValue === false)) {
6
- %>:<%=prop.defaultValue%><%
7
- } %>;<%
8
- }%>'));
9
-
10
- it('should render the component', () => {
11
- cy.get('h1').should('contain', 'Welcome to <%=componentSelector%>!');
12
- });
13
- });
@@ -1,44 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactComponentCypressSpec",
5
- "title": "Create component Cypress spec",
6
- "description": "Create a Cypress spec for a UI component that has a story.",
7
- "type": "object",
8
- "properties": {
9
- "project": {
10
- "type": "string",
11
- "description": "The project name for which to generate tests.",
12
- "examples": ["shared-ui-component"],
13
- "$default": {
14
- "$source": "projectName",
15
- "index": 0
16
- },
17
- "x-prompt": "What's name of the project for which to generate tests?",
18
- "x-priority": "important"
19
- },
20
- "componentPath": {
21
- "type": "string",
22
- "description": "Relative path to the component file from the library root?",
23
- "examples": ["lib/components"],
24
- "x-prompt": "What's path of the component relative to the project's lib root for which to generate a test?",
25
- "x-priority": "important"
26
- },
27
- "js": {
28
- "type": "boolean",
29
- "description": "Generate JavaScript files rather than TypeScript files.",
30
- "default": false
31
- },
32
- "cypressProject": {
33
- "type": "string",
34
- "description": "The Cypress project to generate the stories under. By default, inferred from `project`."
35
- },
36
- "skipFormat": {
37
- "description": "Skip formatting files.",
38
- "type": "boolean",
39
- "default": false,
40
- "x-priority": "internal"
41
- }
42
- },
43
- "required": ["project", "componentPath"]
44
- }
@@ -1,12 +0,0 @@
1
- import { Tree } from '@nrwl/devkit';
2
- import type * as ts from 'typescript';
3
- export interface CreateComponentStoriesFileSchema {
4
- project: string;
5
- componentPath: string;
6
- skipFormat?: boolean;
7
- }
8
- export declare function createComponentStoriesFile(host: Tree, { project, componentPath }: CreateComponentStoriesFileSchema): void;
9
- export declare function findPropsAndGenerateFile(host: Tree, sourceFile: ts.SourceFile, cmpDeclaration: ts.Node, componentDirectory: string, name: string, isPlainJs: boolean, fileExt: string, fromNodeArray?: boolean): void;
10
- export declare function componentStoryGenerator(host: Tree, schema: CreateComponentStoriesFileSchema): Promise<void>;
11
- export default componentStoryGenerator;
12
- export declare const componentStorySchematic: (generatorOptions: CreateComponentStoriesFileSchema) => (tree: any, context: any) => Promise<any>;
@@ -1,81 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.componentStorySchematic = exports.componentStoryGenerator = exports.findPropsAndGenerateFile = exports.createComponentStoriesFile = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const ast_utils_1 = require("../../utils/ast-utils");
7
- const component_props_1 = require("../../utils/component-props");
8
- const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
9
- let tsModule;
10
- function createComponentStoriesFile(host, { project, componentPath }) {
11
- if (!tsModule) {
12
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
13
- }
14
- const proj = (0, devkit_1.getProjects)(host).get(project);
15
- const sourceRoot = proj.sourceRoot;
16
- const componentFilePath = (0, devkit_1.joinPathFragments)(sourceRoot, componentPath);
17
- const componentDirectory = componentFilePath.replace(componentFilePath.slice(componentFilePath.lastIndexOf('/')), '');
18
- const isPlainJs = componentFilePath.endsWith('.jsx') || componentFilePath.endsWith('.js');
19
- let fileExt = 'tsx';
20
- if (componentFilePath.endsWith('.jsx')) {
21
- fileExt = 'jsx';
22
- }
23
- else if (componentFilePath.endsWith('.js')) {
24
- fileExt = 'js';
25
- }
26
- const componentFileName = componentFilePath
27
- .slice(componentFilePath.lastIndexOf('/') + 1)
28
- .replace('.tsx', '')
29
- .replace('.jsx', '')
30
- .replace('.js', '');
31
- const name = componentFileName;
32
- const contents = host.read(componentFilePath, 'utf-8');
33
- if (contents === null) {
34
- throw new Error(`Failed to read ${componentFilePath}`);
35
- }
36
- const sourceFile = tsModule.createSourceFile(componentFilePath, contents, tsModule.ScriptTarget.Latest, true);
37
- const cmpDeclaration = (0, ast_utils_1.getComponentNode)(sourceFile);
38
- if (!cmpDeclaration) {
39
- const componentNodes = (0, ast_utils_1.findExportDeclarationsForJsx)(sourceFile);
40
- if (componentNodes === null || componentNodes === void 0 ? void 0 : componentNodes.length) {
41
- componentNodes.forEach((declaration) => {
42
- findPropsAndGenerateFile(host, sourceFile, declaration, componentDirectory, name, isPlainJs, fileExt, componentNodes.length > 1);
43
- });
44
- }
45
- else {
46
- throw new Error(`Could not find any React component in file ${componentFilePath}`);
47
- }
48
- }
49
- else {
50
- findPropsAndGenerateFile(host, sourceFile, cmpDeclaration, componentDirectory, name, isPlainJs, fileExt);
51
- }
52
- }
53
- exports.createComponentStoriesFile = createComponentStoriesFile;
54
- function findPropsAndGenerateFile(host, sourceFile, cmpDeclaration, componentDirectory, name, isPlainJs, fileExt, fromNodeArray) {
55
- const { propsTypeName, props, argTypes } = (0, component_props_1.getDefaultsForComponent)(sourceFile, cmpDeclaration);
56
- (0, devkit_1.generateFiles)(host, (0, devkit_1.joinPathFragments)(__dirname, './files'), (0, devkit_1.normalizePath)(componentDirectory), {
57
- componentFileName: fromNodeArray
58
- ? `${name}--${cmpDeclaration.name.text}`
59
- : name,
60
- componentImportFileName: name,
61
- propsTypeName,
62
- props,
63
- argTypes,
64
- componentName: cmpDeclaration.name.text,
65
- isPlainJs,
66
- fileExt,
67
- });
68
- }
69
- exports.findPropsAndGenerateFile = findPropsAndGenerateFile;
70
- function componentStoryGenerator(host, schema) {
71
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
72
- createComponentStoriesFile(host, schema);
73
- if (!schema.skipFormat) {
74
- yield (0, devkit_1.formatFiles)(host);
75
- }
76
- });
77
- }
78
- exports.componentStoryGenerator = componentStoryGenerator;
79
- exports.default = componentStoryGenerator;
80
- exports.componentStorySchematic = (0, devkit_1.convertNxGenerator)(componentStoryGenerator);
81
- //# sourceMappingURL=component-story.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-story.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-story/component-story.ts"],"names":[],"mappings":";;;;AAAA,yCAQsB;AAEtB,qDAG+B;AAC/B,iEAAsE;AACtE,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAQ1C,SAAgB,0BAA0B,CACxC,IAAU,EACV,EAAE,OAAO,EAAE,aAAa,EAAoC;IAE5D,IAAI,CAAC,QAAQ,EAAE;Q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B,CAAC,IAAI,CAAC,IAAI,EAAE;YACjD,CAAC,CAAC,IAAI;QACR,uBAAuB,EAAE,IAAI;QAC7B,aAAa;QACb,KAAK;QACL,QAAQ;QACR,aAAa,EAAG,cAAsB,CAAC,IAAI,CAAC,IAAI;QAChD,SAAS;QACT,OAAO;KACR,CACF,CAAC;AACJ,CAAC;AAhCD,4DAgCC;AAED,SAAsB,uBAAuB,CAC3C,IAAU,EACV,MAAwC;;QAExC,0BAA0B,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;QAEzC,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE;YACtB,MAAM,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;SACzB;IACH,CAAC;CAAA;AATD,0DASC;AAED,kBAAe,uBAAuB,CAAC;AAC1B,QAAA,uBAAuB,GAAG,IAAA,2BAAkB,EACvD,uBAAuB,CACxB,CAAC"}
@@ -1,32 +0,0 @@
1
- <% if ( !isPlainJs ) { %>import type { Meta } from '@storybook/react';<% } %>
2
- import<% if ( !isPlainJs ) { %> { <% } %> <%= componentName %> <% if ( !isPlainJs ) { %> } <% } %> from './<%= componentImportFileName %>';
3
-
4
- <% if ( isPlainJs ) { %>
5
- export default {
6
- component: <%= componentName %>,
7
- title: '<%= componentName %>',<% if ( argTypes && argTypes.length > 0 ) { %>
8
- argTypes: {<% for (let argType of argTypes) { %>
9
- <%= argType.name %>: { <%- argType.type %> : "<%- argType.actionText %>" },<% } %>
10
- }
11
- <% } %>
12
- };
13
- <% } %>
14
-
15
-
16
- <% if ( !isPlainJs ) { %>
17
- const Story: Meta<typeof <%= componentName %>> = {
18
- component: <%= componentName %>,
19
- title: '<%= componentName %>',<% if ( argTypes && argTypes.length > 0 ) { %>
20
- argTypes: {<% for (let argType of argTypes) { %>
21
- <%= argType.name %>: { <%- argType.type %> : "<%- argType.actionText %>" },<% } %>
22
- }
23
- <% } %>
24
- };
25
- export default Story;
26
- <% } %>
27
-
28
- export const Primary = {
29
- args: {<% for (let prop of props) { %>
30
- <%= prop.name %>: <%- prop.defaultValue %>,<% } %>
31
- },
32
- };
@@ -1,36 +0,0 @@
1
- {
2
- "$schema": "http://json-schema.org/schema",
3
- "cli": "nx",
4
- "$id": "NxReactComponentStory",
5
- "title": "Create component story",
6
- "description": "Generate storybook story for a react component.",
7
- "type": "object",
8
- "properties": {
9
- "project": {
10
- "type": "string",
11
- "aliases": ["name", "projectName"],
12
- "description": "The project where to add the components.",
13
- "examples": ["shared-ui-component"],
14
- "$default": {
15
- "$source": "projectName",
16
- "index": 0
17
- },
18
- "x-prompt": "What's name of the project where the component lives?",
19
- "x-priority": "important"
20
- },
21
- "componentPath": {
22
- "type": "string",
23
- "description": "Relative path to the component file from the library root.",
24
- "examples": ["lib/components"],
25
- "x-prompt": "What's path of the component relative to the project's lib root?",
26
- "x-priority": "important"
27
- },
28
- "skipFormat": {
29
- "description": "Skip formatting files.",
30
- "type": "boolean",
31
- "default": false,
32
- "x-priority": "internal"
33
- }
34
- },
35
- "required": ["project", "componentPath"]
36
- }
@@ -1,4 +0,0 @@
1
- import { Tree } from '@nrwl/devkit';
2
- import { ComponentTestSchema } from './schema';
3
- export declare function componentTestGenerator(tree: Tree, options: ComponentTestSchema): Promise<void>;
4
- export default componentTestGenerator;
@@ -1,78 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.componentTestGenerator = void 0;
4
- const tslib_1 = require("tslib");
5
- const devkit_1 = require("@nrwl/devkit");
6
- const path_1 = require("path");
7
- const ast_utils_1 = require("../../utils/ast-utils");
8
- const component_props_1 = require("../../utils/component-props");
9
- const versions_1 = require("../../utils/versions");
10
- const ensure_typescript_1 = require("@nrwl/js/src/utils/typescript/ensure-typescript");
11
- let tsModule;
12
- function componentTestGenerator(tree, options) {
13
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
14
- (0, devkit_1.ensurePackage)('@nrwl/cypress', versions_1.nxVersion);
15
- const { assertMinimumCypressVersion } = yield Promise.resolve().then(() => require('@nrwl/cypress/src/utils/cypress-version'));
16
- assertMinimumCypressVersion(10);
17
- const projectConfig = (0, devkit_1.readProjectConfiguration)(tree, options.project);
18
- const normalizedPath = options.componentPath.startsWith(projectConfig.sourceRoot)
19
- ? (0, path_1.relative)(projectConfig.sourceRoot, options.componentPath)
20
- : options.componentPath;
21
- const componentPath = (0, devkit_1.joinPathFragments)(projectConfig.sourceRoot, normalizedPath);
22
- if (tree.exists(componentPath)) {
23
- generateSpecsForComponents(tree, componentPath);
24
- }
25
- });
26
- }
27
- exports.componentTestGenerator = componentTestGenerator;
28
- function generateSpecsForComponents(tree, filePath) {
29
- if (!tsModule) {
30
- tsModule = (0, ensure_typescript_1.ensureTypescript)();
31
- }
32
- const sourceFile = tsModule.createSourceFile(filePath, tree.read(filePath, 'utf-8'), tsModule.ScriptTarget.Latest, true);
33
- const cmpNodes = (0, ast_utils_1.findExportDeclarationsForJsx)(sourceFile);
34
- const componentDir = (0, path_1.dirname)(filePath);
35
- const ext = (0, path_1.extname)(filePath);
36
- const fileName = (0, path_1.basename)(filePath, ext);
37
- if (tree.exists((0, devkit_1.joinPathFragments)(componentDir, `${fileName}.cy${ext}`))) {
38
- return;
39
- }
40
- const defaultExport = (0, ast_utils_1.getComponentNode)(sourceFile);
41
- if (cmpNodes === null || cmpNodes === void 0 ? void 0 : cmpNodes.length) {
42
- const components = cmpNodes.map((cmp) => {
43
- const defaults = (0, component_props_1.getDefaultsForComponent)(sourceFile, cmp);
44
- const isDefaultExport = defaultExport
45
- ? defaultExport.name.text === cmp.name.text
46
- : false;
47
- return {
48
- isDefaultExport,
49
- props: [...defaults.props, ...defaults.argTypes],
50
- name: cmp.name.text,
51
- typeName: defaults.propsTypeName,
52
- };
53
- });
54
- const namedImports = components
55
- .reduce((imports, cmp) => {
56
- if (cmp.typeName) {
57
- imports.push(cmp.typeName);
58
- }
59
- if (cmp.isDefaultExport) {
60
- return imports;
61
- }
62
- imports.push(cmp.name);
63
- return imports;
64
- }, [])
65
- .join(', ');
66
- const namedImportStatement = namedImports.length > 0 ? `, { ${namedImports} }` : '';
67
- (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, 'files'), componentDir, {
68
- fileName,
69
- components,
70
- importStatement: defaultExport
71
- ? `import ${defaultExport.name.text}${namedImportStatement} from './${fileName}'`
72
- : `import { ${namedImports} } from './${fileName}'`,
73
- ext,
74
- });
75
- }
76
- }
77
- exports.default = componentTestGenerator;
78
- //# sourceMappingURL=component-test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"component-test.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-test/component-test.ts"],"names":[],"mappings":";;;;AAAA,yCAMsB;AACtB,+BAA4D;AAC5D,qDAG+B;AAC/B,iEAAsE;AACtE,mDAAiD;AAEjD,uFAAmF;AAEnF,IAAI,QAAqC,CAAC;AAE1C,SAAsB,sBAAsB,CAC1C,IAAU,EACV,OAA4B;;QAE5B,IAAA,sBAAa,EAAC,eAAe,EAAE,oBAAS,CAAC,CAAC;QAC1C,MAAM,EAAE,2BAA2B,EAAE,GAAG,2CACtC,yCAAyC,EAC1C,CAAC;QACF,2BAA2B,CAAC,EAAE,CAAC,CAAC;QAEhC,MAAM,aAAa,GAAG,IAAA,iCAAwB,EAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;QAEtE,MAAM,cAAc,GAAG,OAAO,CAAC,aAAa,CAAC,UAAU,CACrD,aAAa,CAAC,UAAU,CACzB;YACC,CAAC,CAAC,IAAA,eAAQ,EAAC,aAAa,CAAC,UAAU,EAAE,OAAO,CAAC,aAAa,CAAC;YAC3D,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC;QAE1B,MAAM,aAAa,GAAG,IAAA,0BAAiB,EACrC,aAAa,CAAC,UAAU,EACxB,cAAc,CACf,CAAC;QAEF,IAAI,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,EAAE;YAC9B,0BAA0B,CAAC,IAAI,EAAE,aAAa,CAA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QAAQ,CAAC,KAAK,EAAE,GAAG,QAAQ,CAAC,QAAQ,CAAC;gBAChD,IAAI,EAAG,GAAW,CAAC,IAAI,CAAC,IAAc;gBACtC,QAAQ,EAAE,QAAQ,CAAC,aAAa;aACjC,CAAC;QACJ,CAAC,CAAC,CAAC;QACH,MAAM,YAAY,GAAG,UAAU;aAC5B,MAAM,CAAC,CAAC,OAAO,EAAE,GAAG,EAAE,EAAE;YACvB,IAAI,GAAG,CAAC,QAAQ,EAAE;gBAChB,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;aAC5B;YACD,IAAI,GAAG,CAAC,eAAe,EAAE;gBACvB,OAAO,OAAO,CAAC;aAChB;YAED,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;YACvB,OAAO,OAAO,CAAC;QACjB,CAAC,EAAE,EAAE,CAAC;aACL,IAAI,CAAC,IAAI,CAAC,CAAC;QAEd,MAAM,oBAAoB,GACxB,YAAY,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,YAAY,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;QAEzD,IAAA,sBAAa,EAAC,IAAI,EAAE,IAAA,0BAAiB,EAAC,SAAS,EAAE,OAAO,CAAC,EAAE,YAAY,EAAE;YACvE,QAAQ;YACR,UAAU;YACV,eAAe,EAAE,aAAa;gBAC5B,CAAC,CAAC,UACG,aAAqB,CAAC,IAAI,CAAC,IAC9B,GAAG,oBAAoB,YAAY,QAAQ,GAAG;gBAChD,CAAC,CAAC,YAAY,YAAY,cAAc,QAAQ,GAAG;YACrD,GAAG;SACJ,CAAC,CAAC;KACJ;AACH,CAAC;AAED,kBAAe,sBAAsB,CAAC"}
@@ -1,21 +0,0 @@
1
- import * as React from 'react'
2
- <%- importStatement %>
3
-
4
- <% for (let cmp of components) { %>
5
- describe(<%= cmp.name %>.name, () => {<% if (cmp.typeName) { %>
6
- let props: <%= cmp.typeName%>;
7
-
8
- beforeEach(() => {
9
- props = {<% for (let prop of cmp.props) { %>
10
- <%- prop.name %>: <% if(prop.type === 'action') { %>undefined<% } else { %><%- prop.defaultValue %>,<% } %><% }%>
11
- }
12
- })
13
-
14
- it('renders', () => {
15
- cy.mount(<<%= cmp.name %> {...props}/>)
16
- })<% } else { %>
17
- it('renders', () => {
18
- cy.mount(<<%= cmp.name %> />)
19
- })<% } %>
20
- })
21
- <% } %>
@@ -1,4 +0,0 @@
1
- export interface ComponentTestSchema {
2
- project: string;
3
- componentPath: string;
4
- }
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=schema.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.js","sourceRoot":"","sources":["../../../../../../packages/react/src/generators/component-test/schema.ts"],"names":[],"mappings":""}