isometrik-chat 1.0.2 → 1.0.4

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 (264) hide show
  1. package/.babelrc +6 -0
  2. package/README.md +74 -74
  3. package/babel.config.js +5 -5
  4. package/config/env.js +104 -0
  5. package/config/getHttpsConfig.js +66 -0
  6. package/config/jest/babelTransform.js +29 -0
  7. package/config/jest/cssTransform.js +14 -0
  8. package/config/jest/fileTransform.js +40 -0
  9. package/config/modules.js +134 -0
  10. package/config/paths.js +77 -0
  11. package/config/webpack/persistentCache/createEnvironmentHash.js +9 -0
  12. package/config/webpack.config.js +755 -0
  13. package/config/webpackDevServer.config.js +127 -0
  14. package/isometrik-chat-1.0.3.tgz +0 -0
  15. package/package.json +167 -66
  16. package/public/icons/audio_play.svg +6 -6
  17. package/public/icons/back.svg +3 -3
  18. package/public/icons/camera.svg +4 -4
  19. package/public/icons/close.svg +5 -5
  20. package/public/icons/crossCarousel.svg +3 -3
  21. package/public/icons/delete.svg +3 -3
  22. package/public/icons/disappear.svg +24 -24
  23. package/public/icons/downloadCarousel.svg +6 -6
  24. package/public/icons/edit-pencil.svg +6 -6
  25. package/public/icons/emoji.svg +8 -8
  26. package/public/icons/emojiCarousel.svg +3 -3
  27. package/public/icons/forwardCarousel.svg +3 -3
  28. package/public/icons/goToMessageCarousel.svg +3 -3
  29. package/public/icons/leftArrowCarousel.svg +6 -6
  30. package/public/icons/light-mode.svg +14 -14
  31. package/public/icons/menu .svg +5 -5
  32. package/public/icons/menuCarousel.svg +5 -5
  33. package/public/icons/message.svg +3 -3
  34. package/public/icons/right.svg +3 -3
  35. package/public/icons/search.svg +3 -3
  36. package/public/icons/send.svg +10 -10
  37. package/public/icons/starCarousel.svg +3 -3
  38. package/public/index.html +37 -37
  39. package/public/manifest.json +25 -25
  40. package/public/offline.html +11 -11
  41. package/public/robots.txt +3 -3
  42. package/public/service-worker.js +81 -81
  43. package/scripts/build.js +217 -0
  44. package/scripts/start.js +154 -0
  45. package/scripts/test.js +52 -0
  46. package/src/App.js +15 -15
  47. package/src/App.test.js +8 -8
  48. package/src/Authpage.js +16 -16
  49. package/src/ChatContext.js +171 -171
  50. package/src/assets/icons.js +49 -49
  51. package/src/assets/images/WhatsApp.html +257 -257
  52. package/src/assets/images/WhatsApp_files/app-bf223f825866ee433b07.css +242 -242
  53. package/src/assets/images/WhatsApp_files/app.77ee8aa7a4c593101105.js +77 -77
  54. package/src/assets/images/WhatsApp_files/lazy_loaded_high_priority_components.85a06e74a0a4ade1640b.css +16 -16
  55. package/src/assets/images/WhatsApp_files/lazy_loaded_low_priority_components.8621270bc215a9298a97.css +47 -47
  56. package/src/assets/images/WhatsApp_files/libsignal-protocol-ee5b8ba.min.js +20 -20
  57. package/src/assets/images/WhatsApp_files/main.48b845d68e066fb27a75.css +161 -161
  58. package/src/assets/images/WhatsApp_files/runtime.e6018f3c1e255e8f4dc7.js +2 -2
  59. package/src/assets/images/WhatsApp_files/stylex-d50abd61e6cf7eab2afd855adccf14e5.css +2840 -2840
  60. package/src/assets/images/WhatsApp_files/vendor1_app.58a51d93a250f83ab555.js +79 -79
  61. package/src/components/ChatBox/AudioBubble.js +161 -161
  62. package/src/components/ChatBox/ChatBubble.js +232 -232
  63. package/src/components/ChatBox/DocumentBubble.js +86 -86
  64. package/src/components/ChatBox/MessagesBox.js +533 -533
  65. package/src/components/CustomModal.js +59 -59
  66. package/src/components/Icon.js +10 -10
  67. package/src/components/ImageComponent.js +24 -24
  68. package/src/components/MediaDocs.js +155 -155
  69. package/src/components/MediaDocumentContainer.js +54 -54
  70. package/src/components/MessageInfoDropdown.js +124 -124
  71. package/src/components/Modal/AllowMicPermissionModal.js +62 -62
  72. package/src/components/Modal/BlockUnblockChatModal.js +77 -77
  73. package/src/components/Modal/CameraPermissionBlockedModal.js +60 -60
  74. package/src/components/Modal/CameraPermissionRequestModal.js +59 -59
  75. package/src/components/Modal/ClearChatModal.js +77 -77
  76. package/src/components/Modal/DeleteChatModal.js +78 -78
  77. package/src/components/Modal/MicPermissionDisableModal.js +62 -62
  78. package/src/components/Modal/Modal.js +102 -102
  79. package/src/components/Modal/ModalDialog.js +102 -102
  80. package/src/components/Modal/ProfilePictureUploadPreview.js +159 -159
  81. package/src/components/OutsideAlerter/OutsideAlerter.js +37 -37
  82. package/src/components/ProfilePicture/ProfilePicture.js +126 -126
  83. package/src/components/Registration/Login.js +265 -265
  84. package/src/components/Registration/SignUp.js +322 -322
  85. package/src/components/SnackBar.js +42 -42
  86. package/src/components/common/Modal/useDetectOutsideClick.js +23 -23
  87. package/src/components/common/styled/PageWrapper.js +25 -25
  88. package/src/components/formcontrol/CustomButton.js +38 -38
  89. package/src/components/formcontrol/InputText.js +59 -59
  90. package/src/global-styles.js +42 -42
  91. package/src/hooks/useDeviceType.js +27 -27
  92. package/src/hooks/useThrottle.js +29 -29
  93. package/src/index.css +224 -224
  94. package/src/index.js +23 -23
  95. package/src/lib/constant.js +20 -20
  96. package/src/lib/functionality.js +13 -13
  97. package/src/lib/helpers.js +320 -320
  98. package/src/lib/mockData/index.js +75 -75
  99. package/src/lib/session/index.js +31 -31
  100. package/src/lib/validation.js +4 -4
  101. package/src/reportWebVitals.js +13 -13
  102. package/src/services/deliveryStatus.js +26 -26
  103. package/src/setupTests.js +5 -5
  104. package/src/utils/chatSdk.js +14 -14
  105. package/src/utils/global.js +57 -57
  106. package/src/utils/media.js +79 -79
  107. package/src/view/component/BlockedContactSlide.js +134 -134
  108. package/src/view/component/Carousle/UpperMenuBar.js +106 -106
  109. package/src/view/component/Carousle/index.js +203 -203
  110. package/src/view/component/Chatbox.js/AudioRecorder.js +311 -311
  111. package/src/view/component/Chatbox.js/ChatBubbleReply.js +26 -26
  112. package/src/view/component/Chatbox.js/TakePhoto.js +362 -362
  113. package/src/view/component/Contact/index.js +56 -56
  114. package/src/view/component/Contact/styles.css +207 -207
  115. package/src/view/component/ContactInfo/index.js +543 -543
  116. package/src/view/component/ContactInfo/styles.css +288 -288
  117. package/src/view/component/Context/index.js +2 -2
  118. package/src/view/component/DialogBox.js +15 -15
  119. package/src/view/component/ImageCropper/ImageCropper.js +127 -127
  120. package/src/view/component/Loader/Loader.js +51 -51
  121. package/src/view/component/Loader/UserPagingLoader.js +61 -61
  122. package/src/view/component/Menu/index.js +261 -261
  123. package/src/view/component/Menu/styles.css +68 -68
  124. package/src/view/component/Profile/ProfileInfoContainer.js +111 -111
  125. package/src/view/component/Profile/ProfileUpdate.js +177 -177
  126. package/src/view/component/Profile/TakeProfilePhoto.js +390 -390
  127. package/src/view/component/Profile/index.js +549 -549
  128. package/src/view/component/Profile/styles.css +369 -369
  129. package/src/view/component/ReplyChatMessage/ReplyChatMessage.js +48 -48
  130. package/src/view/component/SeachBar/index.js +106 -106
  131. package/src/view/component/SeachBar/styles.css +53 -53
  132. package/src/view/component/Toaster/Toaster.js +116 -116
  133. package/src/view/component/UserDetailsCard/UserDetailCard.js +337 -337
  134. package/src/view/component/deleteMessageMoal.js +79 -79
  135. package/src/view/component/emoji/index.js +22 -22
  136. package/src/view/component/forwardData/index.js +327 -327
  137. package/src/view/component/forwardData/styles.css +111 -111
  138. package/src/view/component/forwardPopup/index.js +55 -55
  139. package/src/view/component/forwardPopup/styles.css +143 -143
  140. package/src/view/component/mediaList/index.js +92 -92
  141. package/src/view/component/menuDialog/index.js +71 -71
  142. package/src/view/component/menuDialog/styles.css +23 -23
  143. package/src/view/component/pagination/pagination.js +51 -51
  144. package/src/view/component/pagination/paginationForMsg.js +42 -42
  145. package/webpack.config.js +74 -0
  146. package/dist/App.js +0 -16
  147. package/dist/App.test.js +0 -10
  148. package/dist/Authpage.js +0 -35
  149. package/dist/ChatContext.js +0 -244
  150. package/dist/Data/index.js +0 -89
  151. package/dist/assets/icons.js +0 -47
  152. package/dist/assets/images/WhatsApp.html +0 -258
  153. package/dist/assets/images/WhatsApp_files/301446776_522918349234681_1974693392291574064_n.jpg +0 -0
  154. package/dist/assets/images/WhatsApp_files/app-bf223f825866ee433b07.css +0 -242
  155. package/dist/assets/images/WhatsApp_files/app.77ee8aa7a4c593101105.js +0 -2
  156. package/dist/assets/images/WhatsApp_files/lazy_loaded_high_priority_components.85a06e74a0a4ade1640b.css +0 -16
  157. package/dist/assets/images/WhatsApp_files/lazy_loaded_low_priority_components.8621270bc215a9298a97.css +0 -47
  158. package/dist/assets/images/WhatsApp_files/libsignal-protocol-ee5b8ba.min.js +0 -4175
  159. package/dist/assets/images/WhatsApp_files/main.48b845d68e066fb27a75.css +0 -161
  160. package/dist/assets/images/WhatsApp_files/runtime.e6018f3c1e255e8f4dc7.js +0 -643
  161. package/dist/assets/images/WhatsApp_files/stylex-d50abd61e6cf7eab2afd855adccf14e5.css +0 -2841
  162. package/dist/assets/images/WhatsApp_files/vendor1_app.58a51d93a250f83ab555.js +0 -58
  163. package/dist/assets/images/bg.jpeg +0 -0
  164. package/dist/assets/images/drkbg.jpg +0 -0
  165. package/dist/assets/images/notFound.jpeg +0 -0
  166. package/dist/assets/images/watsapp.jpg +0 -0
  167. package/dist/assets/images/watsappbg.png +0 -0
  168. package/dist/assets/images/wb.jpg +0 -0
  169. package/dist/assets/images/whatsapp.jpeg +0 -0
  170. package/dist/components/ChatBox/AudioBubble.js +0 -137
  171. package/dist/components/ChatBox/ChatBubble.js +0 -162
  172. package/dist/components/ChatBox/DocumentBubble.js +0 -50
  173. package/dist/components/ChatBox/MessagesBox.js +0 -458
  174. package/dist/components/CustomModal.js +0 -26
  175. package/dist/components/Icon.js +0 -20
  176. package/dist/components/ImageComponent.js +0 -32
  177. package/dist/components/MediaDocs.js +0 -102
  178. package/dist/components/MediaDocumentContainer.js +0 -39
  179. package/dist/components/MessageInfoDropdown.js +0 -115
  180. package/dist/components/Modal/AllowMicPermissionModal.js +0 -27
  181. package/dist/components/Modal/BlockUnblockChatModal.js +0 -37
  182. package/dist/components/Modal/CameraPermissionBlockedModal.js +0 -31
  183. package/dist/components/Modal/CameraPermissionRequestModal.js +0 -29
  184. package/dist/components/Modal/ClearChatModal.js +0 -35
  185. package/dist/components/Modal/DeleteChatModal.js +0 -35
  186. package/dist/components/Modal/MicPermissionDisableModal.js +0 -27
  187. package/dist/components/Modal/Modal.js +0 -47
  188. package/dist/components/Modal/ModalDialog.js +0 -51
  189. package/dist/components/Modal/ProfilePictureUploadPreview.js +0 -140
  190. package/dist/components/OutsideAlerter/OutsideAlerter.js +0 -46
  191. package/dist/components/ProfilePicture/ProfilePicture.js +0 -52
  192. package/dist/components/Registration/Login.js +0 -208
  193. package/dist/components/Registration/SignUp.js +0 -267
  194. package/dist/components/SnackBar.js +0 -30
  195. package/dist/components/common/Modal/useDetectOutsideClick.js +0 -34
  196. package/dist/components/common/styled/PageWrapper.js +0 -16
  197. package/dist/components/formcontrol/CustomButton.js +0 -20
  198. package/dist/components/formcontrol/InputText.js +0 -36
  199. package/dist/global-styles.js +0 -12
  200. package/dist/hooks/useDeviceType.js +0 -36
  201. package/dist/hooks/useThrottle.js +0 -40
  202. package/dist/index.css +0 -225
  203. package/dist/index.js +0 -23
  204. package/dist/lib/constant.js +0 -48
  205. package/dist/lib/functionality.js +0 -17
  206. package/dist/lib/helpers.js +0 -614
  207. package/dist/lib/mockData/index.js +0 -70
  208. package/dist/lib/session/index.js +0 -44
  209. package/dist/lib/validation.js +0 -14
  210. package/dist/logo.svg +0 -1
  211. package/dist/pages/WhatsappMainBox/index.js +0 -684
  212. package/dist/reportWebVitals.js +0 -29
  213. package/dist/services/deliveryStatus.js +0 -73
  214. package/dist/setupTests.js +0 -3
  215. package/dist/utils/chatSdk.js +0 -20
  216. package/dist/utils/global.js +0 -116
  217. package/dist/utils/media.js +0 -61
  218. package/dist/view/component/BlockedContactSlide.js +0 -153
  219. package/dist/view/component/Carousle/UpperMenuBar.js +0 -112
  220. package/dist/view/component/Carousle/index.js +0 -140
  221. package/dist/view/component/Chatbox.js/AudioRecorder.js +0 -321
  222. package/dist/view/component/Chatbox.js/ChatBubbleReply.js +0 -22
  223. package/dist/view/component/Chatbox.js/TakePhoto.js +0 -254
  224. package/dist/view/component/Chatbox.js/index.js +0 -929
  225. package/dist/view/component/Chatbox.js/styles.css +0 -231
  226. package/dist/view/component/Contact/index.js +0 -49
  227. package/dist/view/component/Contact/styles.css +0 -208
  228. package/dist/view/component/ContactInfo/index.js +0 -399
  229. package/dist/view/component/ContactInfo/styles.css +0 -289
  230. package/dist/view/component/Context/index.js +0 -10
  231. package/dist/view/component/DialogBox.js +0 -29
  232. package/dist/view/component/ImageCropper/ImageCropper.js +0 -98
  233. package/dist/view/component/Loader/Loader.js +0 -44
  234. package/dist/view/component/Loader/UserPagingLoader.js +0 -19
  235. package/dist/view/component/MainChatBox/index.js +0 -766
  236. package/dist/view/component/MainChatBox/styles.css +0 -124
  237. package/dist/view/component/Menu/index.js +0 -226
  238. package/dist/view/component/Menu/styles.css +0 -68
  239. package/dist/view/component/Profile/ProfileInfoContainer.js +0 -119
  240. package/dist/view/component/Profile/ProfileUpdate.js +0 -226
  241. package/dist/view/component/Profile/TakeProfilePhoto.js +0 -310
  242. package/dist/view/component/Profile/index.js +0 -568
  243. package/dist/view/component/Profile/styles.css +0 -370
  244. package/dist/view/component/ReplyChatMessage/ReplyChatMessage.js +0 -44
  245. package/dist/view/component/SeachBar/index.js +0 -106
  246. package/dist/view/component/SeachBar/styles.css +0 -53
  247. package/dist/view/component/Siderbar/index.js +0 -485
  248. package/dist/view/component/Siderbar/styles.css +0 -138
  249. package/dist/view/component/Toaster/Toaster.js +0 -83
  250. package/dist/view/component/UserDetailsCard/UserDetailCard.js +0 -104
  251. package/dist/view/component/deleteMessageMoal.js +0 -39
  252. package/dist/view/component/emoji/index.js +0 -22
  253. package/dist/view/component/emoji/sstyles.css +0 -0
  254. package/dist/view/component/forwardData/index.js +0 -250
  255. package/dist/view/component/forwardData/styles.css +0 -112
  256. package/dist/view/component/forwardPopup/index.js +0 -48
  257. package/dist/view/component/forwardPopup/styles.css +0 -144
  258. package/dist/view/component/mediaList/index.js +0 -67
  259. package/dist/view/component/menuDialog/index.js +0 -118
  260. package/dist/view/component/menuDialog/styles.css +0 -24
  261. package/dist/view/component/pagination/pagination.js +0 -77
  262. package/dist/view/component/pagination/paginationForMsg.js +0 -65
  263. package/dist/view/component/sidebarChat/index.js +0 -431
  264. package/dist/view/component/sidebarChat/styles.css +0 -109
package/.babelrc ADDED
@@ -0,0 +1,6 @@
1
+ {
2
+ "presets": [
3
+ "@babel/preset-env",
4
+ ["@babel/preset-react", {"runtime": "automatic"}]
5
+ ]
6
+ }
package/README.md CHANGED
@@ -1,74 +1,74 @@
1
- # Getting Started with Create React App
2
-
3
- This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
-
5
- ## Available Scripts
6
-
7
- In the project directory, you can run:
8
-
9
- ### `npm start`
10
-
11
- Runs the app in the development mode.\
12
- Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13
-
14
- The page will reload when you make changes.\
15
- You may also see any lint errors in the console.
16
-
17
- ### `npm test`
18
-
19
- Launches the test runner in the interactive watch mode.\
20
- See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
-
22
- ### `npm run build`
23
-
24
- Builds the app for production to the `build` folder.\
25
- It correctly bundles React in production mode and optimizes the build for the best performance.
26
-
27
- The build is minified and the filenames include the hashes.\
28
- Your app is ready to be deployed!
29
-
30
- See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
-
32
- ### `npm run eject`
33
-
34
- **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35
-
36
- If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
-
38
- Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39
-
40
- You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41
-
42
- ## Learn More
43
-
44
- You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
-
46
- To learn React, check out the [React documentation](https://reactjs.org/).
47
-
48
- ### Code Splitting
49
-
50
- This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51
-
52
- ### Analyzing the Bundle Size
53
-
54
- This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55
-
56
- ### Making a Progressive Web App
57
-
58
- This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59
-
60
- ### Advanced Configuration
61
-
62
- This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63
-
64
- ### Deployment
65
-
66
- This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67
-
68
- ### `npm run build` fails to minify
69
-
70
- This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71
-
72
-
73
-
74
-
1
+ # Getting Started with Create React App
2
+
3
+ This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
4
+
5
+ ## Available Scripts
6
+
7
+ In the project directory, you can run:
8
+
9
+ ### `npm start`
10
+
11
+ Runs the app in the development mode.\
12
+ Open [http://localhost:3000](http://localhost:3000) to view it in your browser.
13
+
14
+ The page will reload when you make changes.\
15
+ You may also see any lint errors in the console.
16
+
17
+ ### `npm test`
18
+
19
+ Launches the test runner in the interactive watch mode.\
20
+ See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.
21
+
22
+ ### `npm run build`
23
+
24
+ Builds the app for production to the `build` folder.\
25
+ It correctly bundles React in production mode and optimizes the build for the best performance.
26
+
27
+ The build is minified and the filenames include the hashes.\
28
+ Your app is ready to be deployed!
29
+
30
+ See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.
31
+
32
+ ### `npm run eject`
33
+
34
+ **Note: this is a one-way operation. Once you `eject`, you can't go back!**
35
+
36
+ If you aren't satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.
37
+
38
+ Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you're on your own.
39
+
40
+ You don't have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn't feel obligated to use this feature. However we understand that this tool wouldn't be useful if you couldn't customize it when you are ready for it.
41
+
42
+ ## Learn More
43
+
44
+ You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).
45
+
46
+ To learn React, check out the [React documentation](https://reactjs.org/).
47
+
48
+ ### Code Splitting
49
+
50
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/code-splitting](https://facebook.github.io/create-react-app/docs/code-splitting)
51
+
52
+ ### Analyzing the Bundle Size
53
+
54
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size](https://facebook.github.io/create-react-app/docs/analyzing-the-bundle-size)
55
+
56
+ ### Making a Progressive Web App
57
+
58
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app](https://facebook.github.io/create-react-app/docs/making-a-progressive-web-app)
59
+
60
+ ### Advanced Configuration
61
+
62
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/advanced-configuration](https://facebook.github.io/create-react-app/docs/advanced-configuration)
63
+
64
+ ### Deployment
65
+
66
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/deployment](https://facebook.github.io/create-react-app/docs/deployment)
67
+
68
+ ### `npm run build` fails to minify
69
+
70
+ This section has moved here: [https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify](https://facebook.github.io/create-react-app/docs/troubleshooting#npm-run-build-fails-to-minify)
71
+
72
+
73
+
74
+
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
- module.exports = {
2
- presets:[
3
- "@babel/preset-env",
4
- "@babel/preset-react"
5
- ]
1
+ module.exports = {
2
+ presets: [
3
+ "@babel/preset-env",
4
+ ["@babel/preset-react", { "runtime": "automatic" }]
5
+ ]
6
6
  }
package/config/env.js ADDED
@@ -0,0 +1,104 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const paths = require('./paths');
6
+
7
+ // Make sure that including paths.js after env.js will read .env variables.
8
+ delete require.cache[require.resolve('./paths')];
9
+
10
+ const NODE_ENV = process.env.NODE_ENV;
11
+ if (!NODE_ENV) {
12
+ throw new Error(
13
+ 'The NODE_ENV environment variable is required but was not specified.'
14
+ );
15
+ }
16
+
17
+ // https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use
18
+ const dotenvFiles = [
19
+ `${paths.dotenv}.${NODE_ENV}.local`,
20
+ // Don't include `.env.local` for `test` environment
21
+ // since normally you expect tests to produce the same
22
+ // results for everyone
23
+ NODE_ENV !== 'test' && `${paths.dotenv}.local`,
24
+ `${paths.dotenv}.${NODE_ENV}`,
25
+ paths.dotenv,
26
+ ].filter(Boolean);
27
+
28
+ // Load environment variables from .env* files. Suppress warnings using silent
29
+ // if this file is missing. dotenv will never modify any environment variables
30
+ // that have already been set. Variable expansion is supported in .env files.
31
+ // https://github.com/motdotla/dotenv
32
+ // https://github.com/motdotla/dotenv-expand
33
+ dotenvFiles.forEach(dotenvFile => {
34
+ if (fs.existsSync(dotenvFile)) {
35
+ require('dotenv-expand')(
36
+ require('dotenv').config({
37
+ path: dotenvFile,
38
+ })
39
+ );
40
+ }
41
+ });
42
+
43
+ // We support resolving modules according to `NODE_PATH`.
44
+ // This lets you use absolute paths in imports inside large monorepos:
45
+ // https://github.com/facebook/create-react-app/issues/253.
46
+ // It works similar to `NODE_PATH` in Node itself:
47
+ // https://nodejs.org/api/modules.html#modules_loading_from_the_global_folders
48
+ // Note that unlike in Node, only *relative* paths from `NODE_PATH` are honored.
49
+ // Otherwise, we risk importing Node.js core modules into an app instead of webpack shims.
50
+ // https://github.com/facebook/create-react-app/issues/1023#issuecomment-265344421
51
+ // We also resolve them to make sure all tools using them work consistently.
52
+ const appDirectory = fs.realpathSync(process.cwd());
53
+ process.env.NODE_PATH = (process.env.NODE_PATH || '')
54
+ .split(path.delimiter)
55
+ .filter(folder => folder && !path.isAbsolute(folder))
56
+ .map(folder => path.resolve(appDirectory, folder))
57
+ .join(path.delimiter);
58
+
59
+ // Grab NODE_ENV and REACT_APP_* environment variables and prepare them to be
60
+ // injected into the application via DefinePlugin in webpack configuration.
61
+ const REACT_APP = /^REACT_APP_/i;
62
+
63
+ function getClientEnvironment(publicUrl) {
64
+ const raw = Object.keys(process.env)
65
+ .filter(key => REACT_APP.test(key))
66
+ .reduce(
67
+ (env, key) => {
68
+ env[key] = process.env[key];
69
+ return env;
70
+ },
71
+ {
72
+ // Useful for determining whether we’re running in production mode.
73
+ // Most importantly, it switches React into the correct mode.
74
+ NODE_ENV: process.env.NODE_ENV || 'development',
75
+ // Useful for resolving the correct path to static assets in `public`.
76
+ // For example, <img src={process.env.PUBLIC_URL + '/img/logo.png'} />.
77
+ // This should only be used as an escape hatch. Normally you would put
78
+ // images into the `src` and `import` them in code to get their paths.
79
+ PUBLIC_URL: publicUrl,
80
+ // We support configuring the sockjs pathname during development.
81
+ // These settings let a developer run multiple simultaneous projects.
82
+ // They are used as the connection `hostname`, `pathname` and `port`
83
+ // in webpackHotDevClient. They are used as the `sockHost`, `sockPath`
84
+ // and `sockPort` options in webpack-dev-server.
85
+ WDS_SOCKET_HOST: process.env.WDS_SOCKET_HOST,
86
+ WDS_SOCKET_PATH: process.env.WDS_SOCKET_PATH,
87
+ WDS_SOCKET_PORT: process.env.WDS_SOCKET_PORT,
88
+ // Whether or not react-refresh is enabled.
89
+ // It is defined here so it is available in the webpackHotDevClient.
90
+ FAST_REFRESH: process.env.FAST_REFRESH !== 'false',
91
+ }
92
+ );
93
+ // Stringify all values so we can feed into webpack DefinePlugin
94
+ const stringified = {
95
+ 'process.env': Object.keys(raw).reduce((env, key) => {
96
+ env[key] = JSON.stringify(raw[key]);
97
+ return env;
98
+ }, {}),
99
+ };
100
+
101
+ return { raw, stringified };
102
+ }
103
+
104
+ module.exports = getClientEnvironment;
@@ -0,0 +1,66 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const crypto = require('crypto');
6
+ const chalk = require('react-dev-utils/chalk');
7
+ const paths = require('./paths');
8
+
9
+ // Ensure the certificate and key provided are valid and if not
10
+ // throw an easy to debug error
11
+ function validateKeyAndCerts({ cert, key, keyFile, crtFile }) {
12
+ let encrypted;
13
+ try {
14
+ // publicEncrypt will throw an error with an invalid cert
15
+ encrypted = crypto.publicEncrypt(cert, Buffer.from('test'));
16
+ } catch (err) {
17
+ throw new Error(
18
+ `The certificate "${chalk.yellow(crtFile)}" is invalid.\n${err.message}`
19
+ );
20
+ }
21
+
22
+ try {
23
+ // privateDecrypt will throw an error with an invalid key
24
+ crypto.privateDecrypt(key, encrypted);
25
+ } catch (err) {
26
+ throw new Error(
27
+ `The certificate key "${chalk.yellow(keyFile)}" is invalid.\n${
28
+ err.message
29
+ }`
30
+ );
31
+ }
32
+ }
33
+
34
+ // Read file and throw an error if it doesn't exist
35
+ function readEnvFile(file, type) {
36
+ if (!fs.existsSync(file)) {
37
+ throw new Error(
38
+ `You specified ${chalk.cyan(
39
+ type
40
+ )} in your env, but the file "${chalk.yellow(file)}" can't be found.`
41
+ );
42
+ }
43
+ return fs.readFileSync(file);
44
+ }
45
+
46
+ // Get the https config
47
+ // Return cert files if provided in env, otherwise just true or false
48
+ function getHttpsConfig() {
49
+ const { SSL_CRT_FILE, SSL_KEY_FILE, HTTPS } = process.env;
50
+ const isHttps = HTTPS === 'true';
51
+
52
+ if (isHttps && SSL_CRT_FILE && SSL_KEY_FILE) {
53
+ const crtFile = path.resolve(paths.appPath, SSL_CRT_FILE);
54
+ const keyFile = path.resolve(paths.appPath, SSL_KEY_FILE);
55
+ const config = {
56
+ cert: readEnvFile(crtFile, 'SSL_CRT_FILE'),
57
+ key: readEnvFile(keyFile, 'SSL_KEY_FILE'),
58
+ };
59
+
60
+ validateKeyAndCerts({ ...config, keyFile, crtFile });
61
+ return config;
62
+ }
63
+ return isHttps;
64
+ }
65
+
66
+ module.exports = getHttpsConfig;
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ const babelJest = require('babel-jest').default;
4
+
5
+ const hasJsxRuntime = (() => {
6
+ if (process.env.DISABLE_NEW_JSX_TRANSFORM === 'true') {
7
+ return false;
8
+ }
9
+
10
+ try {
11
+ require.resolve('react/jsx-runtime');
12
+ return true;
13
+ } catch (e) {
14
+ return false;
15
+ }
16
+ })();
17
+
18
+ module.exports = babelJest.createTransformer({
19
+ presets: [
20
+ [
21
+ require.resolve('babel-preset-react-app'),
22
+ {
23
+ runtime: hasJsxRuntime ? 'automatic' : 'classic',
24
+ },
25
+ ],
26
+ ],
27
+ babelrc: false,
28
+ configFile: false,
29
+ });
@@ -0,0 +1,14 @@
1
+ 'use strict';
2
+
3
+ // This is a custom Jest transformer turning style imports into empty objects.
4
+ // http://facebook.github.io/jest/docs/en/webpack.html
5
+
6
+ module.exports = {
7
+ process() {
8
+ return 'module.exports = {};';
9
+ },
10
+ getCacheKey() {
11
+ // The output is always the same.
12
+ return 'cssTransform';
13
+ },
14
+ };
@@ -0,0 +1,40 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const camelcase = require('camelcase');
5
+
6
+ // This is a custom Jest transformer turning file imports into filenames.
7
+ // http://facebook.github.io/jest/docs/en/webpack.html
8
+
9
+ module.exports = {
10
+ process(src, filename) {
11
+ const assetFilename = JSON.stringify(path.basename(filename));
12
+
13
+ if (filename.match(/\.svg$/)) {
14
+ // Based on how SVGR generates a component name:
15
+ // https://github.com/smooth-code/svgr/blob/01b194cf967347d43d4cbe6b434404731b87cf27/packages/core/src/state.js#L6
16
+ const pascalCaseFilename = camelcase(path.parse(filename).name, {
17
+ pascalCase: true,
18
+ });
19
+ const componentName = `Svg${pascalCaseFilename}`;
20
+ return `const React = require('react');
21
+ module.exports = {
22
+ __esModule: true,
23
+ default: ${assetFilename},
24
+ ReactComponent: React.forwardRef(function ${componentName}(props, ref) {
25
+ return {
26
+ $$typeof: Symbol.for('react.element'),
27
+ type: 'svg',
28
+ ref: ref,
29
+ key: null,
30
+ props: Object.assign({}, props, {
31
+ children: ${assetFilename}
32
+ })
33
+ };
34
+ }),
35
+ };`;
36
+ }
37
+
38
+ return `module.exports = ${assetFilename};`;
39
+ },
40
+ };
@@ -0,0 +1,134 @@
1
+ 'use strict';
2
+
3
+ const fs = require('fs');
4
+ const path = require('path');
5
+ const paths = require('./paths');
6
+ const chalk = require('react-dev-utils/chalk');
7
+ const resolve = require('resolve');
8
+
9
+ /**
10
+ * Get additional module paths based on the baseUrl of a compilerOptions object.
11
+ *
12
+ * @param {Object} options
13
+ */
14
+ function getAdditionalModulePaths(options = {}) {
15
+ const baseUrl = options.baseUrl;
16
+
17
+ if (!baseUrl) {
18
+ return '';
19
+ }
20
+
21
+ const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
22
+
23
+ // We don't need to do anything if `baseUrl` is set to `node_modules`. This is
24
+ // the default behavior.
25
+ if (path.relative(paths.appNodeModules, baseUrlResolved) === '') {
26
+ return null;
27
+ }
28
+
29
+ // Allow the user set the `baseUrl` to `appSrc`.
30
+ if (path.relative(paths.appSrc, baseUrlResolved) === '') {
31
+ return [paths.appSrc];
32
+ }
33
+
34
+ // If the path is equal to the root directory we ignore it here.
35
+ // We don't want to allow importing from the root directly as source files are
36
+ // not transpiled outside of `src`. We do allow importing them with the
37
+ // absolute path (e.g. `src/Components/Button.js`) but we set that up with
38
+ // an alias.
39
+ if (path.relative(paths.appPath, baseUrlResolved) === '') {
40
+ return null;
41
+ }
42
+
43
+ // Otherwise, throw an error.
44
+ throw new Error(
45
+ chalk.red.bold(
46
+ "Your project's `baseUrl` can only be set to `src` or `node_modules`." +
47
+ ' Create React App does not support other values at this time.'
48
+ )
49
+ );
50
+ }
51
+
52
+ /**
53
+ * Get webpack aliases based on the baseUrl of a compilerOptions object.
54
+ *
55
+ * @param {*} options
56
+ */
57
+ function getWebpackAliases(options = {}) {
58
+ const baseUrl = options.baseUrl;
59
+
60
+ if (!baseUrl) {
61
+ return {};
62
+ }
63
+
64
+ const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
65
+
66
+ if (path.relative(paths.appPath, baseUrlResolved) === '') {
67
+ return {
68
+ src: paths.appSrc,
69
+ };
70
+ }
71
+ }
72
+
73
+ /**
74
+ * Get jest aliases based on the baseUrl of a compilerOptions object.
75
+ *
76
+ * @param {*} options
77
+ */
78
+ function getJestAliases(options = {}) {
79
+ const baseUrl = options.baseUrl;
80
+
81
+ if (!baseUrl) {
82
+ return {};
83
+ }
84
+
85
+ const baseUrlResolved = path.resolve(paths.appPath, baseUrl);
86
+
87
+ if (path.relative(paths.appPath, baseUrlResolved) === '') {
88
+ return {
89
+ '^src/(.*)$': '<rootDir>/src/$1',
90
+ };
91
+ }
92
+ }
93
+
94
+ function getModules() {
95
+ // Check if TypeScript is setup
96
+ const hasTsConfig = fs.existsSync(paths.appTsConfig);
97
+ const hasJsConfig = fs.existsSync(paths.appJsConfig);
98
+
99
+ if (hasTsConfig && hasJsConfig) {
100
+ throw new Error(
101
+ 'You have both a tsconfig.json and a jsconfig.json. If you are using TypeScript please remove your jsconfig.json file.'
102
+ );
103
+ }
104
+
105
+ let config;
106
+
107
+ // If there's a tsconfig.json we assume it's a
108
+ // TypeScript project and set up the config
109
+ // based on tsconfig.json
110
+ if (hasTsConfig) {
111
+ const ts = require(resolve.sync('typescript', {
112
+ basedir: paths.appNodeModules,
113
+ }));
114
+ config = ts.readConfigFile(paths.appTsConfig, ts.sys.readFile).config;
115
+ // Otherwise we'll check if there is jsconfig.json
116
+ // for non TS projects.
117
+ } else if (hasJsConfig) {
118
+ config = require(paths.appJsConfig);
119
+ }
120
+
121
+ config = config || {};
122
+ const options = config.compilerOptions || {};
123
+
124
+ const additionalModulePaths = getAdditionalModulePaths(options);
125
+
126
+ return {
127
+ additionalModulePaths: additionalModulePaths,
128
+ webpackAliases: getWebpackAliases(options),
129
+ jestAliases: getJestAliases(options),
130
+ hasTsConfig,
131
+ };
132
+ }
133
+
134
+ module.exports = getModules();
@@ -0,0 +1,77 @@
1
+ 'use strict';
2
+
3
+ const path = require('path');
4
+ const fs = require('fs');
5
+ const getPublicUrlOrPath = require('react-dev-utils/getPublicUrlOrPath');
6
+
7
+ // Make sure any symlinks in the project folder are resolved:
8
+ // https://github.com/facebook/create-react-app/issues/637
9
+ const appDirectory = fs.realpathSync(process.cwd());
10
+ const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
11
+
12
+ // We use `PUBLIC_URL` environment variable or "homepage" field to infer
13
+ // "public path" at which the app is served.
14
+ // webpack needs to know it to put the right <script> hrefs into HTML even in
15
+ // single-page apps that may serve index.html for nested URLs like /todos/42.
16
+ // We can't use a relative path in HTML because we don't want to load something
17
+ // like /todos/42/static/js/bundle.7289d.js. We have to know the root.
18
+ const publicUrlOrPath = getPublicUrlOrPath(
19
+ process.env.NODE_ENV === 'development',
20
+ require(resolveApp('package.json')).homepage,
21
+ process.env.PUBLIC_URL
22
+ );
23
+
24
+ const buildPath = process.env.BUILD_PATH || 'build';
25
+
26
+ const moduleFileExtensions = [
27
+ 'web.mjs',
28
+ 'mjs',
29
+ 'web.js',
30
+ 'js',
31
+ 'web.ts',
32
+ 'ts',
33
+ 'web.tsx',
34
+ 'tsx',
35
+ 'json',
36
+ 'web.jsx',
37
+ 'jsx',
38
+ ];
39
+
40
+ // Resolve file paths in the same order as webpack
41
+ const resolveModule = (resolveFn, filePath) => {
42
+ const extension = moduleFileExtensions.find(extension =>
43
+ fs.existsSync(resolveFn(`${filePath}.${extension}`))
44
+ );
45
+
46
+ if (extension) {
47
+ return resolveFn(`${filePath}.${extension}`);
48
+ }
49
+
50
+ return resolveFn(`${filePath}.js`);
51
+ };
52
+
53
+ // config after eject: we're in ./config/
54
+ module.exports = {
55
+ dotenv: resolveApp('.env'),
56
+ appPath: resolveApp('.'),
57
+ appBuild: resolveApp(buildPath),
58
+ appPublic: resolveApp('public'),
59
+ appHtml: resolveApp('public/index.html'),
60
+ appIndexJs: resolveModule(resolveApp, 'src/index'),
61
+ appPackageJson: resolveApp('package.json'),
62
+ appSrc: resolveApp('src'),
63
+ appTsConfig: resolveApp('tsconfig.json'),
64
+ appJsConfig: resolveApp('jsconfig.json'),
65
+ yarnLockFile: resolveApp('yarn.lock'),
66
+ testsSetup: resolveModule(resolveApp, 'src/setupTests'),
67
+ proxySetup: resolveApp('src/setupProxy.js'),
68
+ appNodeModules: resolveApp('node_modules'),
69
+ appWebpackCache: resolveApp('node_modules/.cache'),
70
+ appTsBuildInfoFile: resolveApp('node_modules/.cache/tsconfig.tsbuildinfo'),
71
+ swSrc: resolveModule(resolveApp, 'src/service-worker'),
72
+ publicUrlOrPath,
73
+ };
74
+
75
+
76
+
77
+ module.exports.moduleFileExtensions = moduleFileExtensions;
@@ -0,0 +1,9 @@
1
+ 'use strict';
2
+ const { createHash } = require('crypto');
3
+
4
+ module.exports = env => {
5
+ const hash = createHash('md5');
6
+ hash.update(JSON.stringify(env));
7
+
8
+ return hash.digest('hex');
9
+ };