@griddo/ax 12.3.0-beta.0 → 12.4.0

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 (298) hide show
  1. package/config/__tests__/webpack5-migration.test.js +442 -0
  2. package/config/{jest/componentsMock.js → tests/componentsMock.cjs} +4 -1
  3. package/config/tests/reactEasyCropMock.js +15 -0
  4. package/config/tests/reactTimezoneMock.js +14 -0
  5. package/config/tests/setup.ts +41 -0
  6. package/config/webpack.config.js +183 -189
  7. package/config/webpackDevServer.config.js +63 -93
  8. package/config/webpackSchemas.config.js +6 -1
  9. package/package.json +33 -53
  10. package/public/img/icons/markdown.svg +6 -0
  11. package/scripts/build.js +4 -0
  12. package/scripts/start.js +38 -9
  13. package/src/__tests__/components/ActionMenu/ActionMenu.test.tsx +12 -12
  14. package/src/__tests__/components/Breadcrumb/Breadcrumb.test.tsx +2 -2
  15. package/src/__tests__/components/Browser/Browser.test.tsx +17 -25
  16. package/src/__tests__/components/BulkSelectionOptions/BulkSelectionOptions.test.tsx +3 -3
  17. package/src/__tests__/components/CategoryCell/CategoryCell.test.tsx +3 -2
  18. package/src/__tests__/components/ConfigPanel/ConfigPanel.test.tsx +4 -4
  19. package/src/__tests__/components/ConfigPanel/Form/ConnectedField/ConnectedField.test.tsx +2 -2
  20. package/src/__tests__/components/ConfigPanel/Form/ConnectedField/NavConnectedField/NavConnectedField.test.tsx +2 -2
  21. package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/Field/Field.test.tsx +3 -3
  22. package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/PageConnectedField.test.tsx +17 -14
  23. package/src/__tests__/components/ConfigPanel/Form/ConnectedField/PageConnectedField/TemplateManager/TemplateManager.test.tsx +4 -4
  24. package/src/__tests__/components/ConfigPanel/Form/Form.test.tsx +7 -6
  25. package/src/__tests__/components/ConfigPanel/GlobalPageForm/GlobalPageForm.test.tsx +11 -11
  26. package/src/__tests__/components/ConfigPanel/Header/Header.test.tsx +11 -10
  27. package/src/__tests__/components/ConfigPanel/NavigationForm/Field/Field.test.tsx +2 -2
  28. package/src/__tests__/components/ConfigPanel/NavigationForm/NavigationForm.test.tsx +2 -2
  29. package/src/__tests__/components/ConfigPanel/PreviewForm/PreviewForm.test.tsx +4 -3
  30. package/src/__tests__/components/ContextMenu/ContextMenu.test.tsx +24 -24
  31. package/src/__tests__/components/DragAndDrop/DragAndDrop.test.tsx +6 -5
  32. package/src/__tests__/components/ElementsTooltip/ElementsTooltip.test.tsx +1 -1
  33. package/src/__tests__/components/EmptyState/EmptyState.test.tsx +2 -2
  34. package/src/__tests__/components/ErrorCenter/ErrorCenter.test.tsx +11 -11
  35. package/src/__tests__/components/FieldContainer/FieldContainer.test.tsx +4 -4
  36. package/src/__tests__/components/Fields/AnalyticsField/AnalyticsField.test.tsx +3 -3
  37. package/src/__tests__/components/Fields/AnalyticsField/PageAnalytics/PageAnalytics.test.tsx +4 -4
  38. package/src/__tests__/components/Fields/AnalyticsField/StructuredDataAnalytics/StructuredDataAnalytics.test.tsx +3 -3
  39. package/src/__tests__/components/Fields/ArrayFieldGroup/ArrayFieldGroup.test.tsx +6 -5
  40. package/src/__tests__/components/Fields/AsyncCheckGroup/AsyncCheckGroup.test.tsx +19 -18
  41. package/src/__tests__/components/Fields/AsyncSelect/AsyncSelect.test.tsx +4 -3
  42. package/src/__tests__/components/Fields/Button/Button.test.tsx +4 -3
  43. package/src/__tests__/components/Fields/CheckField/CheckField.test.tsx +5 -5
  44. package/src/__tests__/components/Fields/CheckGroup/CheckGroup.test.tsx +10 -10
  45. package/src/__tests__/components/Fields/ColorPicker/ColorPicker.test.tsx +7 -6
  46. package/src/__tests__/components/Fields/ComponentArray/ComponentArray.test.tsx +3 -3
  47. package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/MixableComponentArray.test.tsx +45 -45
  48. package/src/__tests__/components/Fields/ComponentArray/MixableComponentArray/PasteModuleButton/PasteModuleButton.test.tsx +7 -6
  49. package/src/__tests__/components/Fields/ComponentArray/SameComponentArray/SameComponentArray.test.tsx +7 -7
  50. package/src/__tests__/components/Fields/ComponentContainer/ComponentContainer.test.tsx +55 -55
  51. package/src/__tests__/components/Fields/ConditionalField/ConditionalField.test.tsx +1 -1
  52. package/src/__tests__/components/Fields/DateField/DateField.test.tsx +6 -5
  53. package/src/__tests__/components/Fields/FieldGroup/FieldGroup.test.tsx +2 -2
  54. package/src/__tests__/components/Fields/FileField/FileField.test.tsx +4 -4
  55. package/src/__tests__/components/Fields/HeadingField/HeadingField.test.tsx +2 -2
  56. package/src/__tests__/components/Fields/HiddenField/HiddenField.test.tsx +3 -3
  57. package/src/__tests__/components/Fields/ImageField/ImageField.test.tsx +8 -7
  58. package/src/__tests__/components/Fields/IntegrationsField/IntegrationsField.test.tsx +9 -8
  59. package/src/__tests__/components/Fields/MultiCheckSelect/MultiCheckSelect.test.tsx +1 -1
  60. package/src/__tests__/components/Fields/MultiCheckSelectGroup/MultiCheckSelectGroup.test.tsx +7 -6
  61. package/src/__tests__/components/Fields/NoteField/NoteField.test.tsx +1 -1
  62. package/src/__tests__/components/Fields/NumberField/NumberField.test.tsx +8 -8
  63. package/src/__tests__/components/Fields/RadioField/RadioField.test.tsx +2 -2
  64. package/src/__tests__/components/Fields/ReferenceField/ReferenceField.test.tsx +17 -16
  65. package/src/__tests__/components/Fields/RichText/RichText.test.tsx +1 -1
  66. package/src/__tests__/components/Fields/Select/Select.test.tsx +1 -1
  67. package/src/__tests__/components/Fields/SliderField/SliderField.test.tsx +5 -4
  68. package/src/__tests__/components/Fields/SummaryButton/SummaryButton.test.tsx +2 -2
  69. package/src/__tests__/components/Fields/TagField/TagField.test.tsx +9 -9
  70. package/src/__tests__/components/Fields/TextArea/TextArea.test.tsx +13 -9
  71. package/src/__tests__/components/Fields/TextField/TextField.test.tsx +8 -8
  72. package/src/__tests__/components/Fields/TimeField/HourInput/HourInput.test.tsx +7 -6
  73. package/src/__tests__/components/Fields/TimeField/TimeField.test.tsx +4 -3
  74. package/src/__tests__/components/Fields/ToggleField/ToggleField.test.tsx +2 -2
  75. package/src/__tests__/components/Fields/Tooltip/Tooltip.test.tsx +6 -6
  76. package/src/__tests__/components/Fields/TranslateButton/TranslateButton.test.tsx +13 -13
  77. package/src/__tests__/components/Fields/UniqueCheck/UniqueCheck.test.tsx +1 -1
  78. package/src/__tests__/components/Fields/UrlField/UrlField.test.tsx +20 -19
  79. package/src/__tests__/components/Fields/VisualUniqueSelection/ImageSelection/ImageSelection.test.tsx +3 -2
  80. package/src/__tests__/components/Fields/VisualUniqueSelection/ScrollableSelection/ScrollableSelection.test.tsx +4 -3
  81. package/src/__tests__/components/Fields/VisualUniqueSelection/VisualUniqueSelection.test.tsx +1 -1
  82. package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.atoms.test.tsx +11 -11
  83. package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.helpers.test.tsx +13 -14
  84. package/src/__tests__/components/Fields/Wysiwyg/Wysiwyg.test.tsx +28 -28
  85. package/src/__tests__/components/FieldsBehavior/FieldsBehavior.test.tsx +15 -14
  86. package/src/__tests__/components/FloatingMenu/FloatingMenu.test.tsx +36 -35
  87. package/src/__tests__/components/FloatingPanel/FloatingPanel.test.tsx +10 -10
  88. package/src/__tests__/components/GuardModal/GuardModal.test.tsx +1 -1
  89. package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorItem/ErrorItem.test.tsx +11 -11
  90. package/src/__tests__/components/HeadingsPreviewModal/ErrorsBanner/ErrorsBanner.test.tsx +4 -4
  91. package/src/__tests__/components/HeadingsPreviewModal/HeadingsPreviewModal.test.tsx +15 -14
  92. package/src/__tests__/components/IconAction/IconAction.test.tsx +2 -2
  93. package/src/__tests__/components/ImageDragAndDrop/CropStep/CropStep.test.tsx +3 -3
  94. package/src/__tests__/components/ImageDragAndDrop/ImageDragAndDrop.test.tsx +7 -7
  95. package/src/__tests__/components/KeywordsPreviewModal/KeywordItem/KeywordItem.test.tsx +5 -5
  96. package/src/__tests__/components/KeywordsPreviewModal/KeywordsPreviewModal.test.tsx +14 -13
  97. package/src/__tests__/components/KeywordsPreviewModal/atoms.test.tsx +13 -13
  98. package/src/__tests__/components/LanguageMenu/LanguageMenu.test.tsx +6 -6
  99. package/src/__tests__/components/Lists/Lists.test.tsx +1 -1
  100. package/src/__tests__/components/Loader/Loader.test.tsx +1 -1
  101. package/src/__tests__/components/Login/Login.test.tsx +32 -32
  102. package/src/__tests__/components/Login/RecoveryModal/RecoveryModal.test.tsx +10 -9
  103. package/src/__tests__/components/MainWrapper/AppBar/AppBar.test.tsx +21 -21
  104. package/src/__tests__/components/MenuItem/MenuItem.test.tsx +5 -5
  105. package/src/__tests__/components/Modal/Modal.test.tsx +20 -20
  106. package/src/__tests__/components/Nav/Nav.test.tsx +2 -2
  107. package/src/__tests__/components/Notification/Notification.test.tsx +2 -2
  108. package/src/__tests__/components/Pagination/Pagination.test.tsx +13 -14
  109. package/src/__tests__/components/ProfileImage/ProfileImage.test.tsx +6 -7
  110. package/src/__tests__/components/ReorderArrows/ReorderArrows.test.tsx +4 -3
  111. package/src/__tests__/components/ResizePanel/ResizePanel.test.tsx +10 -11
  112. package/src/__tests__/components/RestrictionsModal/CurrentAccessList/CurrentAccessList.test.tsx +7 -6
  113. package/src/__tests__/components/RestrictionsModal/OptionsStep/OptionsStep.test.tsx +12 -11
  114. package/src/__tests__/components/RestrictionsModal/RestrictionsModal.test.tsx +11 -10
  115. package/src/__tests__/components/RestrictionsModal/RolesList/RolesList.test.tsx +8 -8
  116. package/src/__tests__/components/RestrictionsModal/UsersList/UsersList.test.tsx +16 -15
  117. package/src/__tests__/components/SearchField/SearchField.test.tsx +13 -13
  118. package/src/__tests__/components/SideModal/SideModal.test.tsx +25 -23
  119. package/src/__tests__/components/SubNav/SubNav.test.tsx +1 -1
  120. package/src/__tests__/components/TableFilters/CategoryFilter/CategoryFilter.test.tsx +9 -8
  121. package/src/__tests__/components/TableFilters/CustomizeFilters/CustomizeFilters.test.tsx +5 -5
  122. package/src/__tests__/components/TableFilters/DateFilter/DateFilter.test.tsx +8 -8
  123. package/src/__tests__/components/TableFilters/LiveFilter/LiveFilter.test.tsx +11 -10
  124. package/src/__tests__/components/TableFilters/NameFilter/NameFilter.test.tsx +10 -10
  125. package/src/__tests__/components/TableFilters/RoleFilter/RoleFilter.test.tsx +5 -5
  126. package/src/__tests__/components/TableFilters/SiteFilter/SiteFilter.test.tsx +10 -9
  127. package/src/__tests__/components/TableFilters/StatusFilter/StatusFilter.test.tsx +9 -9
  128. package/src/__tests__/components/TableFilters/TranslationsFilter/TranslationsFilter.test.tsx +8 -8
  129. package/src/__tests__/components/TableFilters/TypeFilter/TypeFilter.test.tsx +5 -5
  130. package/src/__tests__/components/TableFilters/UsersFilter/UsersFilter.test.tsx +8 -8
  131. package/src/__tests__/components/TableList/TableList.test.tsx +4 -4
  132. package/src/__tests__/components/Tabs/Tabs.test.tsx +8 -9
  133. package/src/__tests__/components/Tag/Tag.test.tsx +3 -3
  134. package/src/__tests__/components/Toast/Toast.test.tsx +6 -6
  135. package/src/__tests__/gainup-trace.test.ts +67 -0
  136. package/src/__tests__/hooks/modals.test.tsx +4 -4
  137. package/src/__tests__/hooks/users.test.tsx +6 -5
  138. package/src/__tests__/modules/FileDrive/MarkdownFormat.test.tsx +58 -0
  139. package/src/__tests__/modules/FramePreview/FramePreview.test.tsx +40 -39
  140. package/src/__tests__/modules/FramePreview/HeadingsOverlay/HeadingsOverlay.test.tsx +11 -11
  141. package/src/__tests__/modules/Settings/Integrations/Integrations.test.tsx +2 -2
  142. package/src/__tests__/modules/Settings/Social/Social.test.tsx +4 -3
  143. package/src/__tests__/modules/Sites/Sites.test.tsx +5 -4
  144. package/src/__tests__/modules/Sites/SitesList/ListView/BulkHeader/BulkHeader.test.tsx +2 -2
  145. package/src/__tests__/modules/Sites/SitesList/SitesList.test.tsx +7 -6
  146. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/DataStep/DataStep.test.tsx +6 -6
  147. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/FinalStep/FinalStep.test.tsx +4 -4
  148. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/CropView/CropView.test.tsx +3 -3
  149. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/ImageStep.test.tsx +9 -5
  150. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/ImageStep/UploadView/UploadView.test.tsx +8 -6
  151. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/TimezoneStep/TimezoneStep.test.tsx +7 -7
  152. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/WelcomeModal.test.tsx +1 -1
  153. package/src/__tests__/modules/Sites/SitesList/WelcomeModal/WelcomeStep/WelcomeStep.test.tsx +3 -3
  154. package/src/__tests__/modules/Users/Roles/BulkHeader/BulkHeader.test.tsx +3 -3
  155. package/src/__tests__/modules/Users/Roles/Roles.test.tsx +11 -10
  156. package/src/__tests__/modules/Users/UserCreate/SiteItem/RolesModal/RoleItem/RoleItem.test.tsx +3 -3
  157. package/src/__tests__/modules/Users/UserCreate/SiteItem/RolesModal/RolesModal.test.tsx +3 -3
  158. package/src/__tests__/modules/Users/UserCreate/SiteItem/SiteItem.test.tsx +3 -3
  159. package/src/__tests__/modules/Users/UserCreate/UserCreate.test.tsx +6 -5
  160. package/src/__tests__/modules/Users/UserList/UserItem/UserItem.test.tsx +9 -9
  161. package/src/__tests__/modules/Users/UserList/UserList.test.tsx +4 -4
  162. package/src/components/Flag/components/index.ts +30 -0
  163. package/src/components/Flag/index.tsx +3 -5
  164. package/src/components/Icon/components/index.ts +229 -0
  165. package/src/components/Icon/index.tsx +3 -7
  166. package/src/constants/index.ts +1 -1
  167. package/src/helpers/files.tsx +2 -0
  168. package/src/modules/App/Routing/NavMenu/index.tsx +4 -2
  169. package/src/modules/FileDrive/FileFilters/Type/index.tsx +1 -0
  170. package/tsconfig.json +1 -1
  171. package/config/jest/cssTransform.js +0 -14
  172. package/config/jest/fileMock.js +0 -1
  173. package/config/jest/fileTransform.js +0 -40
  174. package/config/jest/reactEasyCropMock.js +0 -15
  175. package/config/jest/reactTimezoneMock.js +0 -13
  176. package/config/jest/setup.js +0 -31
  177. package/config/jest/styleMock.js +0 -1
  178. package/config/pnpTs.js +0 -15
  179. package/src/__tests__/aiup-trace.test.ts +0 -23
  180. /package/config/{jest/test-utils.js → tests/test-utils.jsx} +0 -0
  181. /package/src/components/Flag/components/{Ca_ES.js → Ca_ES.jsx} +0 -0
  182. /package/src/components/Flag/components/{De_DE.js → De_DE.jsx} +0 -0
  183. /package/src/components/Flag/components/{En_GB.js → En_GB.jsx} +0 -0
  184. /package/src/components/Flag/components/{Es_ES.js → Es_ES.jsx} +0 -0
  185. /package/src/components/Flag/components/{Eu_ES.js → Eu_ES.jsx} +0 -0
  186. /package/src/components/Flag/components/{Fr_FR.js → Fr_FR.jsx} +0 -0
  187. /package/src/components/Flag/components/{It_IT.js → It_IT.jsx} +0 -0
  188. /package/src/components/Flag/components/{Pt_PT.js → Pt_PT.jsx} +0 -0
  189. /package/src/components/Icon/components/{Active.js → Active.jsx} +0 -0
  190. /package/src/components/Icon/components/{Add.js → Add.jsx} +0 -0
  191. /package/src/components/Icon/components/{AddCircle.js → AddCircle.jsx} +0 -0
  192. /package/src/components/Icon/components/{Alert.js → Alert.jsx} +0 -0
  193. /package/src/components/Icon/components/{AlignLeft.js → AlignLeft.jsx} +0 -0
  194. /package/src/components/Icon/components/{Back.js → Back.jsx} +0 -0
  195. /package/src/components/Icon/components/{BulletList.js → BulletList.jsx} +0 -0
  196. /package/src/components/Icon/components/{Button.js → Button.jsx} +0 -0
  197. /package/src/components/Icon/components/{Calendar.js → Calendar.jsx} +0 -0
  198. /package/src/components/Icon/components/{CancelEvent.js → CancelEvent.jsx} +0 -0
  199. /package/src/components/Icon/components/{Category.js → Category.jsx} +0 -0
  200. /package/src/components/Icon/components/{Change.js → Change.jsx} +0 -0
  201. /package/src/components/Icon/components/{Close.js → Close.jsx} +0 -0
  202. /package/src/components/Icon/components/{ClosePanel.js → ClosePanel.jsx} +0 -0
  203. /package/src/components/Icon/components/{CodeBody.js → CodeBody.jsx} +0 -0
  204. /package/src/components/Icon/components/{CodeHead.js → CodeHead.jsx} +0 -0
  205. /package/src/components/Icon/components/{CodeHeadBody.js → CodeHeadBody.jsx} +0 -0
  206. /package/src/components/Icon/components/{Collapsed.js → Collapsed.jsx} +0 -0
  207. /package/src/components/Icon/components/{ColorPicker.js → ColorPicker.jsx} +0 -0
  208. /package/src/components/Icon/components/{Compose.js → Compose.jsx} +0 -0
  209. /package/src/components/Icon/components/{Copy.js → Copy.jsx} +0 -0
  210. /package/src/components/Icon/components/{Copy2.js → Copy2.jsx} +0 -0
  211. /package/src/components/Icon/components/{Data.js → Data.jsx} +0 -0
  212. /package/src/components/Icon/components/{DataAdd.js → DataAdd.jsx} +0 -0
  213. /package/src/components/Icon/components/{Deactivate.js → Deactivate.jsx} +0 -0
  214. /package/src/components/Icon/components/{Delete.js → Delete.jsx} +0 -0
  215. /package/src/components/Icon/components/{Desktop.js → Desktop.jsx} +0 -0
  216. /package/src/components/Icon/components/{Disabled.js → Disabled.jsx} +0 -0
  217. /package/src/components/Icon/components/{Done.js → Done.jsx} +0 -0
  218. /package/src/components/Icon/components/{DownArrow.js → DownArrow.jsx} +0 -0
  219. /package/src/components/Icon/components/{Download.js → Download.jsx} +0 -0
  220. /package/src/components/Icon/components/{Drag.js → Drag.jsx} +0 -0
  221. /package/src/components/Icon/components/{Duplicate.js → Duplicate.jsx} +0 -0
  222. /package/src/components/Icon/components/{Edit.js → Edit.jsx} +0 -0
  223. /package/src/components/Icon/components/{Empty.js → Empty.jsx} +0 -0
  224. /package/src/components/Icon/components/{EmptyCheck.js → EmptyCheck.jsx} +0 -0
  225. /package/src/components/Icon/components/{Extend.js → Extend.jsx} +0 -0
  226. /package/src/components/Icon/components/{File.js → File.jsx} +0 -0
  227. /package/src/components/Icon/components/{Filter.js → Filter.jsx} +0 -0
  228. /package/src/components/Icon/components/{Form.js → Form.jsx} +0 -0
  229. /package/src/components/Icon/components/{FullArrowDown.js → FullArrowDown.jsx} +0 -0
  230. /package/src/components/Icon/components/{FullArrowLeft.js → FullArrowLeft.jsx} +0 -0
  231. /package/src/components/Icon/components/{FullArrowRight.js → FullArrowRight.jsx} +0 -0
  232. /package/src/components/Icon/components/{FullArrowUp.js → FullArrowUp.jsx} +0 -0
  233. /package/src/components/Icon/components/{Grid.js → Grid.jsx} +0 -0
  234. /package/src/components/Icon/components/{Grid2.js → Grid2.jsx} +0 -0
  235. /package/src/components/Icon/components/{GriddoLogo.js → GriddoLogo.jsx} +0 -0
  236. /package/src/components/Icon/components/{HeroCard.js → HeroCard.jsx} +0 -0
  237. /package/src/components/Icon/components/{Hide.js → Hide.jsx} +0 -0
  238. /package/src/components/Icon/components/{History.js → History.jsx} +0 -0
  239. /package/src/components/Icon/components/{Home.js → Home.jsx} +0 -0
  240. /package/src/components/Icon/components/{Ia.js → Ia.jsx} +0 -0
  241. /package/src/components/Icon/components/{Image.js → Image.jsx} +0 -0
  242. /package/src/components/Icon/components/{Info.js → Info.jsx} +0 -0
  243. /package/src/components/Icon/components/{Laptop.js → Laptop.jsx} +0 -0
  244. /package/src/components/Icon/components/{LeftArrow.js → LeftArrow.jsx} +0 -0
  245. /package/src/components/Icon/components/{Link.js → Link.jsx} +0 -0
  246. /package/src/components/Icon/components/{Lock.js → Lock.jsx} +0 -0
  247. /package/src/components/Icon/components/{Log.js → Log.jsx} +0 -0
  248. /package/src/components/Icon/components/{Map.js → Map.jsx} +0 -0
  249. /package/src/components/Icon/components/{Menu.js → Menu.jsx} +0 -0
  250. /package/src/components/Icon/components/{Microsoft.js → Microsoft.jsx} +0 -0
  251. /package/src/components/Icon/components/{Modified.js → Modified.jsx} +0 -0
  252. /package/src/components/Icon/components/{Modules.js → Modules.jsx} +0 -0
  253. /package/src/components/Icon/components/{More.js → More.jsx} +0 -0
  254. /package/src/components/Icon/components/{NewFolder.js → NewFolder.jsx} +0 -0
  255. /package/src/components/Icon/components/{Offline.js → Offline.jsx} +0 -0
  256. /package/src/components/Icon/components/{OfflinePending.js → OfflinePending.jsx} +0 -0
  257. /package/src/components/Icon/components/{OpenOutside.js → OpenOutside.jsx} +0 -0
  258. /package/src/components/Icon/components/{OpenPanel.js → OpenPanel.jsx} +0 -0
  259. /package/src/components/Icon/components/{OutOfSection.js → OutOfSection.jsx} +0 -0
  260. /package/src/components/Icon/components/{Page.js → Page.jsx} +0 -0
  261. /package/src/components/Icon/components/{Party.js → Party.jsx} +0 -0
  262. /package/src/components/Icon/components/{Paste.js → Paste.jsx} +0 -0
  263. /package/src/components/Icon/components/{Phone.js → Phone.jsx} +0 -0
  264. /package/src/components/Icon/components/{PhotoLibrary.js → PhotoLibrary.jsx} +0 -0
  265. /package/src/components/Icon/components/{Power.js → Power.jsx} +0 -0
  266. /package/src/components/Icon/components/{Preview.js → Preview.jsx} +0 -0
  267. /package/src/components/Icon/components/{Project.js → Project.jsx} +0 -0
  268. /package/src/components/Icon/components/{QrCode.js → QrCode.jsx} +0 -0
  269. /package/src/components/Icon/components/{Question.js → Question.jsx} +0 -0
  270. /package/src/components/Icon/components/{Refresh.js → Refresh.jsx} +0 -0
  271. /package/src/components/Icon/components/{Republish.js → Republish.jsx} +0 -0
  272. /package/src/components/Icon/components/{RightArrow.js → RightArrow.jsx} +0 -0
  273. /package/src/components/Icon/components/{Scheduled.js → Scheduled.jsx} +0 -0
  274. /package/src/components/Icon/components/{Search.js → Search.jsx} +0 -0
  275. /package/src/components/Icon/components/{SendEmail.js → SendEmail.jsx} +0 -0
  276. /package/src/components/Icon/components/{Settings.js → Settings.jsx} +0 -0
  277. /package/src/components/Icon/components/{Share.js → Share.jsx} +0 -0
  278. /package/src/components/Icon/components/{Subsection.js → Subsection.jsx} +0 -0
  279. /package/src/components/Icon/components/{Success.js → Success.jsx} +0 -0
  280. /package/src/components/Icon/components/{SuccessSolid.js → SuccessSolid.jsx} +0 -0
  281. /package/src/components/Icon/components/{Sync.js → Sync.jsx} +0 -0
  282. /package/src/components/Icon/components/{Tablet.js → Tablet.jsx} +0 -0
  283. /package/src/components/Icon/components/{Translate.js → Translate.jsx} +0 -0
  284. /package/src/components/Icon/components/{Unlink.js → Unlink.jsx} +0 -0
  285. /package/src/components/Icon/components/{UpArrow.js → UpArrow.jsx} +0 -0
  286. /package/src/components/Icon/components/{UploadFile.js → UploadFile.jsx} +0 -0
  287. /package/src/components/Icon/components/{UploadPending.js → UploadPending.jsx} +0 -0
  288. /package/src/components/Icon/components/{UrlLink.js → UrlLink.jsx} +0 -0
  289. /package/src/components/Icon/components/{User.js → User.jsx} +0 -0
  290. /package/src/components/Icon/components/{Users.js → Users.jsx} +0 -0
  291. /package/src/components/Icon/components/{Video.js → Video.jsx} +0 -0
  292. /package/src/components/Icon/components/{View.js → View.jsx} +0 -0
  293. /package/src/components/Icon/components/{Warning.js → Warning.jsx} +0 -0
  294. /package/src/components/Icon/components/{Web.js → Web.jsx} +0 -0
  295. /package/src/components/Icon/components/{Working.js → Working.jsx} +0 -0
  296. /package/src/components/Loader/components/{Circle.js → Circle.jsx} +0 -0
  297. /package/src/components/Loader/components/{Dots.js → Dots.jsx} +0 -0
  298. /package/src/components/Loader/components/{SmallCircle.js → SmallCircle.jsx} +0 -0
@@ -0,0 +1,442 @@
1
+ /**
2
+ * Regression guard for the webpack 4 -> 5 migration.
3
+ *
4
+ * These tests read the build config/scripts as text and assert the webpack 5
5
+ * patterns are present and the webpack 4 remnants are gone. They are intentionally
6
+ * coarse (string/regex checks) so they stay cheap and don't need to boot webpack.
7
+ *
8
+ * Scope decisions encoded here (see docs): PostCSS stays minimal
9
+ * (postcss-preset-env 6.x + postcss-normalize kept, only the loader API migrated),
10
+ * TypeScript stays 4.9.x, and workbox is removed (no service-worker source).
11
+ */
12
+ const fs = require("fs");
13
+ const path = require("path");
14
+
15
+ const configDir = path.resolve(__dirname, "..");
16
+ const scriptsDir = path.resolve(__dirname, "../../scripts");
17
+ const pkgJsonPath = path.resolve(__dirname, "../../package.json");
18
+
19
+ const read = (filePath) => fs.readFileSync(filePath, "utf-8");
20
+
21
+ const webpackConfig = read(path.join(configDir, "webpack.config.js"));
22
+ const devServerConfig = read(path.join(configDir, "webpackDevServer.config.js"));
23
+ const startScript = read(path.join(scriptsDir, "start.js"));
24
+ const buildScript = read(path.join(scriptsDir, "build.js"));
25
+ const schemasConfig = read(path.join(configDir, "webpackSchemas.config.js"));
26
+ const syncSchemasScript = read(path.join(scriptsDir, "griddo-sync-schemas.js"));
27
+ const pkgJson = JSON.parse(read(pkgJsonPath));
28
+
29
+ // ---------------------------------------------------------------------------
30
+ // 1. webpack.config.js — webpack 5 patterns present
31
+ // ---------------------------------------------------------------------------
32
+ describe("webpack.config.js — wp5 patterns", () => {
33
+ test("uses xxhash64 hash function (Node 17+ OpenSSL 3 compat)", () => {
34
+ expect(webpackConfig).toContain('hashFunction: "xxhash64"');
35
+ });
36
+
37
+ test("uses chunkLoadingGlobal instead of jsonpFunction", () => {
38
+ expect(webpackConfig).toContain("chunkLoadingGlobal");
39
+ expect(webpackConfig).not.toContain("jsonpFunction");
40
+ });
41
+
42
+ test("defines assetModuleFilename for asset modules", () => {
43
+ expect(webpackConfig).toContain("assetModuleFilename");
44
+ });
45
+
46
+ test("dev output filename uses [name].js (not bundle.js)", () => {
47
+ expect(webpackConfig).toContain("[name].js");
48
+ expect(webpackConfig).not.toMatch(/filename.*bundle\.js/);
49
+ });
50
+
51
+ test("has filesystem cache block", () => {
52
+ expect(webpackConfig).toContain('type: "filesystem"');
53
+ expect(webpackConfig).toContain("cacheDirectory");
54
+ expect(webpackConfig).toContain("createEnvironmentHash");
55
+ });
56
+
57
+ test("skips the filesystem cache and caps Terser workers on CI", () => {
58
+ // A resource-capped runner can't absorb a cache pack it never reuses, nor one
59
+ // Terser worker per host core (os.cpus() ignores the container's CPU quota).
60
+ expect(webpackConfig).toContain("cache: isCI");
61
+ expect(webpackConfig).toContain("parallel: isCI");
62
+ });
63
+
64
+ test("uses CssMinimizerPlugin (not OptimizeCSSAssetsPlugin)", () => {
65
+ expect(webpackConfig).toContain("CssMinimizerPlugin");
66
+ expect(webpackConfig).not.toContain("OptimizeCSSAssetsPlugin");
67
+ });
68
+
69
+ test("TerserPlugin does not set top-level sourceMap option", () => {
70
+ // In wp4 TerserPlugin had a `sourceMap` option at the top level.
71
+ // wp5 uses `devtool` instead. The word "sourceMap" may still appear
72
+ // inside terserOptions sub-objects — that's fine.
73
+ expect(webpackConfig).not.toMatch(/new TerserPlugin\(\{[^}]*sourceMap\s*:/);
74
+ });
75
+
76
+ test("splitChunks does not use deprecated name option", () => {
77
+ const splitChunksBlock = webpackConfig.match(/splitChunks:\s*\{[\s\S]*?\},/);
78
+ expect(splitChunksBlock).not.toBeNull();
79
+ expect(splitChunksBlock[0]).not.toMatch(/name\s*:/);
80
+ });
81
+
82
+ test("uses asset modules instead of url-loader and file-loader", () => {
83
+ expect(webpackConfig).toContain('type: "asset"');
84
+ expect(webpackConfig).toContain('type: "asset/resource"');
85
+ // Ensure no require/resolve references to the old loaders (comments are OK)
86
+ expect(webpackConfig).not.toMatch(/require\.resolve\(["']url-loader["']\)/);
87
+ expect(webpackConfig).not.toMatch(/require\.resolve\(["']file-loader["']\)/);
88
+ });
89
+
90
+ test("css-loader does not set esModule: false (breaks import * as styles)", () => {
91
+ // css-loader v6 with esModule: false + webpack 5 ESM namespace interop
92
+ // causes `import * as styles` to put the class map under .default, making
93
+ // styles.className === undefined. Instead, use namedExport: true.
94
+ expect(webpackConfig).not.toMatch(/css-loader[\s\S]*?esModule:\s*false/);
95
+ });
96
+
97
+ test("CSS modules use namedExport: true for import * as compat", () => {
98
+ // griddo-components uses `import * as styles from "./x.module.css"` extensively
99
+ // and is compiled by this webpack config.
100
+ expect(webpackConfig).toContain("namedExport: true");
101
+ });
102
+
103
+ test("CSS modules use exportLocalsConvention asIs (webpack 4 class names)", () => {
104
+ // asIs keeps the names as written in the CSS, so client projects keep
105
+ // reading `styles["heading-sm"]` exactly like they did under webpack 4.
106
+ // css-loader derives `useExportsAs` from this value (its own option is not
107
+ // user-settable) and emits `export { _1 as "heading-sm" }`, so hyphenated
108
+ // classes are valid named exports. The convention to avoid is camelCaseOnly:
109
+ // it turns @keyframes _in into `export var in` (reserved word).
110
+ expect(webpackConfig).toContain('exportLocalsConvention: "asIs"');
111
+ });
112
+
113
+ test("postcss-loader uses postcssOptions (not ident + plugins fn)", () => {
114
+ expect(webpackConfig).toContain("postcssOptions");
115
+ expect(webpackConfig).not.toMatch(/ident\s*:\s*["']postcss["']/);
116
+ });
117
+
118
+ test("keeps postcssNormalize (postcss-preset-env 6 does not bundle normalize)", () => {
119
+ // Minimal PostCSS scope: preset-env stays at 6.x, which unlike 9 does not
120
+ // include normalize, so we keep calling postcssNormalize() explicitly.
121
+ expect(webpackConfig).toContain("postcssNormalize");
122
+ });
123
+
124
+ test("does not use WorkboxWebpackPlugin (dead: no src/service-worker)", () => {
125
+ expect(webpackConfig).not.toContain("WorkboxWebpackPlugin");
126
+ expect(webpackConfig).not.toContain("workbox-webpack-plugin");
127
+ });
128
+
129
+ test("resolve.fallback stubs server-only Node builtins (no browser equivalent)", () => {
130
+ expect(webpackConfig).toContain("fallback");
131
+ expect(webpackConfig).toMatch(/fs:\s*false/);
132
+ expect(webpackConfig).toMatch(/net:\s*false/);
133
+ expect(webpackConfig).toMatch(/tls:\s*false/);
134
+ expect(webpackConfig).toMatch(/child_process:\s*false/);
135
+ });
136
+
137
+ test("uses NodePolyfillPlugin to restore webpack 4 browser polyfills for client builds", () => {
138
+ expect(webpackConfig).toContain("NodePolyfillPlugin");
139
+ expect(webpackConfig).toContain("node-polyfill-webpack-plugin");
140
+ });
141
+
142
+ test("uses WebpackManifestPlugin (not bare ManifestPlugin)", () => {
143
+ expect(webpackConfig).toContain("WebpackManifestPlugin");
144
+ // Ensure there's no wp4-style `ManifestPlugin = require(...)` import
145
+ expect(webpackConfig).not.toMatch(/\bManifestPlugin\b(?!.*Webpack)/);
146
+ });
147
+
148
+ test("IgnorePlugin uses object syntax", () => {
149
+ expect(webpackConfig).toContain("resourceRegExp");
150
+ expect(webpackConfig).toContain("contextRegExp");
151
+ });
152
+
153
+ test("ForkTsCheckerWebpackPlugin uses v6+ API", () => {
154
+ // v6+ API uses `typescript` object with `typescriptPath`
155
+ expect(webpackConfig).toContain("typescriptPath");
156
+ expect(webpackConfig).toContain("diagnosticOptions");
157
+ // v4 API keys should be gone
158
+ expect(webpackConfig).not.toContain("checkSyntacticErrors");
159
+ expect(webpackConfig).not.toContain("resolveModuleNameModule");
160
+ expect(webpackConfig).not.toContain("resolveTypeReferenceDirectiveModule");
161
+ expect(webpackConfig).not.toContain("reportFiles");
162
+ });
163
+ });
164
+
165
+ // ---------------------------------------------------------------------------
166
+ // 2. webpack.config.js — wp4 remnants must be absent
167
+ // ---------------------------------------------------------------------------
168
+ describe("webpack.config.js — no wp4 remnants", () => {
169
+ test("does not import pnp-webpack-plugin", () => {
170
+ expect(webpackConfig).not.toContain("pnp-webpack-plugin");
171
+ expect(webpackConfig).not.toContain("PnpWebpackPlugin");
172
+ });
173
+
174
+ test("does not use futureEmitAssets (default in wp5)", () => {
175
+ expect(webpackConfig).not.toContain("futureEmitAssets");
176
+ });
177
+
178
+ test("does not have requireEnsure parser rule", () => {
179
+ expect(webpackConfig).not.toContain("requireEnsure");
180
+ });
181
+
182
+ test("does not use WatchMissingNodeModulesPlugin", () => {
183
+ expect(webpackConfig).not.toContain("WatchMissingNodeModulesPlugin");
184
+ });
185
+
186
+ test("does not have node polyfills block", () => {
187
+ // wp4 had: node: { module: "empty", dgram: "empty", ... }
188
+ expect(webpackConfig).not.toMatch(/node\s*:\s*\{[\s\S]*?dgram/);
189
+ expect(webpackConfig).not.toMatch(/node\s*:\s*\{[\s\S]*?module.*empty/);
190
+ });
191
+
192
+ test("does not have resolveLoader PnP block", () => {
193
+ expect(webpackConfig).not.toContain("resolveLoader");
194
+ });
195
+
196
+ test("does not import safePostCssParser", () => {
197
+ expect(webpackConfig).not.toContain("safePostCssParser");
198
+ expect(webpackConfig).not.toContain("postcss-safe-parser");
199
+ });
200
+ });
201
+
202
+ // ---------------------------------------------------------------------------
203
+ // 3. webpackDevServer.config.js — WDS4 API
204
+ // ---------------------------------------------------------------------------
205
+ describe("webpackDevServer.config.js — WDS4 API", () => {
206
+ test("uses allowedHosts (not disableHostCheck)", () => {
207
+ expect(devServerConfig).toContain("allowedHosts");
208
+ expect(devServerConfig).not.toContain("disableHostCheck");
209
+ });
210
+
211
+ test("uses WDS4 native client with a compile-error overlay", () => {
212
+ // The freeze bug came from CRA's react-error-overlay (now removed), not from
213
+ // WDS4's native overlay. We keep the compile-error overlay and disable the
214
+ // runtime-error one to avoid blocking the preview iframe.
215
+ expect(devServerConfig).toMatch(/client\s*:\s*\{/);
216
+ expect(devServerConfig).toMatch(/overlay\s*:\s*\{/);
217
+ expect(devServerConfig).toMatch(/errors\s*:\s*true/);
218
+ expect(devServerConfig).toMatch(/runtimeErrors\s*:\s*false/);
219
+ expect(devServerConfig).not.toContain("clientLogLevel");
220
+ });
221
+
222
+ test("wires WDS_SOCKET_* into client.webSocketURL (HMR behind a proxy)", () => {
223
+ // WDS3 read these via CRA's webpackHotDevClient (removed); WDS4 reads them
224
+ // from client.webSocketURL instead.
225
+ expect(devServerConfig).toContain("webSocketURL");
226
+ expect(devServerConfig).toContain("WDS_SOCKET_HOST");
227
+ });
228
+
229
+ test("uses static (not contentBase)", () => {
230
+ expect(devServerConfig).toMatch(/static\s*:\s*\{/);
231
+ expect(devServerConfig).not.toMatch(/contentBase\s*:/);
232
+ expect(devServerConfig).not.toContain("watchContentBase");
233
+ });
234
+
235
+ test("uses webSocketServer: ws (not transportMode)", () => {
236
+ expect(devServerConfig).toMatch(/webSocketServer\s*:\s*["']ws["']/);
237
+ expect(devServerConfig).not.toContain("transportMode");
238
+ });
239
+
240
+ test("uses setupMiddlewares (not before/after)", () => {
241
+ expect(devServerConfig).toContain("setupMiddlewares");
242
+ // Ensure no WDS3-style before(app, server) or after(app) callbacks
243
+ expect(devServerConfig).not.toMatch(/\bbefore\s*\(\s*app/);
244
+ expect(devServerConfig).not.toMatch(/\bafter\s*\(\s*app/);
245
+ });
246
+
247
+ test("uses devMiddleware (not publicPath at top level)", () => {
248
+ expect(devServerConfig).toMatch(/devMiddleware\s*:\s*\{/);
249
+ });
250
+
251
+ test("setupMiddlewares uses unshift for pre-middlewares", () => {
252
+ expect(devServerConfig).toContain("middlewares.unshift");
253
+ });
254
+
255
+ test("setupMiddlewares uses push for post-middlewares", () => {
256
+ expect(devServerConfig).toContain("middlewares.push");
257
+ });
258
+
259
+ test("does not use devServer.app.use for post-middlewares", () => {
260
+ // devServer.app.use() runs BEFORE historyApiFallback — must not be used
261
+ // for redirectServedPath or noopServiceWorkerMiddleware
262
+ const setupBlock = devServerConfig.match(/setupMiddlewares[\s\S]*?return middlewares/);
263
+ expect(setupBlock).not.toBeNull();
264
+ expect(setupBlock[0]).not.toMatch(/devServer\.app\.use\([\s\S]*?redirectServedPath/);
265
+ expect(setupBlock[0]).not.toMatch(/devServer\.app\.use\([\s\S]*?noopServiceWorkerMiddleware/);
266
+ });
267
+
268
+ test("does not use errorOverlayMiddleware (handled by the WDS4/Fast Refresh overlay)", () => {
269
+ expect(devServerConfig).not.toContain("errorOverlayMiddleware");
270
+ });
271
+
272
+ test("does not use quiet or injectClient options", () => {
273
+ expect(devServerConfig).not.toMatch(/quiet\s*:/);
274
+ expect(devServerConfig).not.toMatch(/injectClient\s*:/);
275
+ });
276
+
277
+ test("hot is true (WDS4 manages HMR)", () => {
278
+ expect(devServerConfig).toMatch(/hot\s*:\s*true/);
279
+ });
280
+ });
281
+
282
+ // ---------------------------------------------------------------------------
283
+ // 4. scripts/start.js — WDS4 constructor + startup API
284
+ // ---------------------------------------------------------------------------
285
+ describe("scripts/start.js — WDS4 API", () => {
286
+ test("WebpackDevServer constructor: config first, compiler second", () => {
287
+ // WDS4: new WebpackDevServer(config, compiler)
288
+ expect(startScript).toMatch(/new\s+WebpackDevServer\(\s*serverConfig\s*,\s*compiler\s*\)/);
289
+ });
290
+
291
+ test("uses startCallback (not listen)", () => {
292
+ expect(startScript).toContain("startCallback");
293
+ expect(startScript).not.toMatch(/devServer\.listen\s*\(/);
294
+ });
295
+
296
+ test("does not use devSocket (removed in WDS4)", () => {
297
+ expect(startScript).not.toContain("devSocket");
298
+ });
299
+
300
+ test("does not pass devSocket to createCompiler", () => {
301
+ const createCompilerBlock = startScript.match(/createCompiler\(\{[\s\S]*?\}\)/);
302
+ expect(createCompilerBlock).not.toBeNull();
303
+ expect(createCompilerBlock[0]).not.toContain("devSocket");
304
+ });
305
+ });
306
+
307
+ // ---------------------------------------------------------------------------
308
+ // 5. scripts/build.js — compiler.close()
309
+ // ---------------------------------------------------------------------------
310
+ describe("scripts/build.js — wp5 best practices", () => {
311
+ test("calls compiler.close() after compiler.run()", () => {
312
+ expect(buildScript).toContain("compiler.close(");
313
+ });
314
+ });
315
+
316
+ // ---------------------------------------------------------------------------
317
+ // 6. config/webpackSchemas.config.js — compiler.close()
318
+ // ---------------------------------------------------------------------------
319
+ describe("config/webpackSchemas.config.js — wp5 best practices", () => {
320
+ test("calls compiler.close() after compiler.run()", () => {
321
+ expect(schemasConfig).toContain("compiler.close(");
322
+ });
323
+
324
+ // wp4 ignored output.library for commonjs2; wp5 appends it to the prefix, so a name
325
+ // would move the parsed config to module.exports.griddo and break the consumer below.
326
+ test("sets no library name, so the bundle stays module.exports = <exports>", () => {
327
+ expect(schemasConfig).toContain('libraryTarget: "commonjs2"');
328
+ expect(schemasConfig).not.toMatch(/library:\s*"/);
329
+ });
330
+
331
+ test("scripts/griddo-sync-schemas.js reads the bundle default export", () => {
332
+ expect(syncSchemasScript).toContain("_griddoConfig.default");
333
+ });
334
+ });
335
+
336
+ // ---------------------------------------------------------------------------
337
+ // 7. package.json — dependencies
338
+ // ---------------------------------------------------------------------------
339
+ describe("package.json — wp5 dependencies", () => {
340
+ const allDeps = {
341
+ ...pkgJson.dependencies,
342
+ ...pkgJson.devDependencies,
343
+ };
344
+
345
+ test("webpack is ^5.x", () => {
346
+ expect(allDeps.webpack).toMatch(/^\^?5/);
347
+ });
348
+
349
+ test("webpack-dev-server is ^4.x", () => {
350
+ expect(allDeps["webpack-dev-server"]).toMatch(/^\^?4/);
351
+ });
352
+
353
+ test("html-webpack-plugin is ^5.x", () => {
354
+ expect(allDeps["html-webpack-plugin"]).toMatch(/^\^?5/);
355
+ });
356
+
357
+ test("mini-css-extract-plugin is ^2.x", () => {
358
+ expect(allDeps["mini-css-extract-plugin"]).toMatch(/^\^?2/);
359
+ });
360
+
361
+ test("terser-webpack-plugin is ^5.x", () => {
362
+ expect(allDeps["terser-webpack-plugin"]).toMatch(/^\^?5/);
363
+ });
364
+
365
+ test("css-minimizer-webpack-plugin is ^5.x", () => {
366
+ expect(allDeps["css-minimizer-webpack-plugin"]).toMatch(/^\^?5/);
367
+ });
368
+
369
+ test("webpack-manifest-plugin is ^5.x", () => {
370
+ expect(allDeps["webpack-manifest-plugin"]).toMatch(/^\^?5/);
371
+ });
372
+
373
+ test("react-dev-utils is ^12.x", () => {
374
+ expect(allDeps["react-dev-utils"]).toMatch(/^\^?12/);
375
+ });
376
+
377
+ test("css-loader is ^6.11.x (asIs + namedExport needs useExportsAs)", () => {
378
+ // Earlier 6.x rejected `exportLocalsConvention: "asIs"` alongside
379
+ // `namedExport: true`, so the floor is not just ^6.
380
+ expect(allDeps["css-loader"]).toMatch(/^\^?6\.(1[1-9]|[2-9]\d)/);
381
+ });
382
+
383
+ test("babel-loader is ^9.x", () => {
384
+ expect(allDeps["babel-loader"]).toMatch(/^\^?9/);
385
+ });
386
+
387
+ test("node-polyfill-webpack-plugin is present (client build polyfills)", () => {
388
+ expect(allDeps).toHaveProperty("node-polyfill-webpack-plugin");
389
+ });
390
+
391
+ test("postcss-loader is ^7.x", () => {
392
+ expect(allDeps["postcss-loader"]).toMatch(/^\^?7/);
393
+ });
394
+
395
+ test("keeps postcss-preset-env at 6.x (minimal PostCSS scope)", () => {
396
+ expect(allDeps["postcss-preset-env"]).toMatch(/^\^?6/);
397
+ });
398
+
399
+ test("keeps postcss-normalize (minimal PostCSS scope)", () => {
400
+ expect(allDeps).toHaveProperty("postcss-normalize");
401
+ });
402
+
403
+ test("keeps typescript at 4.9.x (TS bump is out of scope)", () => {
404
+ expect(allDeps.typescript).toMatch(/^\^?4\.9/);
405
+ });
406
+
407
+ test("removed wp4-only dependencies are not present", () => {
408
+ const removed = [
409
+ "optimize-css-assets-webpack-plugin",
410
+ "pnp-webpack-plugin",
411
+ "ts-pnp",
412
+ "url-loader",
413
+ "file-loader",
414
+ "postcss-safe-parser",
415
+ "workbox-webpack-plugin",
416
+ ];
417
+ for (const dep of removed) {
418
+ expect(allDeps).not.toHaveProperty(dep);
419
+ }
420
+ });
421
+ });
422
+
423
+ // ---------------------------------------------------------------------------
424
+ // 8. package.json — no --openssl-legacy-provider in scripts
425
+ // ---------------------------------------------------------------------------
426
+ describe("package.json — no openssl legacy provider", () => {
427
+ test("no script uses --openssl-legacy-provider", () => {
428
+ const scripts = Object.values(pkgJson.scripts || {});
429
+ for (const script of scripts) {
430
+ expect(script).not.toContain("--openssl-legacy-provider");
431
+ }
432
+ });
433
+ });
434
+
435
+ // ---------------------------------------------------------------------------
436
+ // 9. Deleted files must not exist
437
+ // ---------------------------------------------------------------------------
438
+ describe("deleted wp4-only files", () => {
439
+ test("config/pnpTs.js does not exist", () => {
440
+ expect(fs.existsSync(path.join(configDir, "pnpTs.js"))).toBe(false);
441
+ });
442
+ });
@@ -1,5 +1,8 @@
1
+ // vitest exposes `vi` as a global (test.globals).
2
+ const mockFn = vi.fn;
3
+
1
4
  module.exports = {
2
- SiteProvider: jest.fn(),
5
+ SiteProvider: mockFn(),
3
6
  config: {
4
7
  schemas: {
5
8
  config: {
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+
3
+ // ESM on purpose: vite treats an aliased file as source, so it does not apply
4
+ // the CommonJS interop. With `module.exports` the default import reached the
5
+ // consumer as a plain object instead of the component.
6
+ const Cropper = ({ onCropComplete }) => {
7
+ React.useEffect(() => {
8
+ if (onCropComplete) {
9
+ onCropComplete({}, { x: 0, y: 0, width: 100, height: 100 });
10
+ }
11
+ }, []);
12
+ return React.createElement("div", { "data-testid": "cropper-mock" });
13
+ };
14
+
15
+ export default Cropper;
@@ -0,0 +1,14 @@
1
+ import React from "react";
2
+
3
+ // vitest exposes `vi` as a global (test.globals).
4
+ const mockFn = vi.fn;
5
+
6
+ // ESM on purpose: vite treats an aliased file as source, so it does not apply
7
+ // the CommonJS interop. With `module.exports` the default import reached the
8
+ // consumer as a plain object instead of the component.
9
+ export const WorldMap = () => React.createElement("div", { "data-testid": "world-map-mock" });
10
+ export const TimeZoneSelectDialog = () => React.createElement("div", { "data-testid": "timezone-dialog-mock" });
11
+ export const findTimeZone = mockFn((tz) => tz);
12
+ export const convertOffsetInMinutesToString = mockFn((offset) => String(offset));
13
+
14
+ export default WorldMap;
@@ -0,0 +1,41 @@
1
+ import "@testing-library/jest-dom";
2
+ import { buildToHaveStyleRule, resetStyleSheet } from "vitest-styled-components";
3
+
4
+ // Unlike jest-styled-components, this package does not register itself on
5
+ // import: it exports the matcher factory and leaves the wiring to us.
6
+ expect.extend({ toHaveStyleRule: buildToHaveStyleRule(expect) });
7
+ beforeEach(resetStyleSheet);
8
+
9
+ // Port of config/jest/setup.js. Two things are deliberately not carried over:
10
+ // - the `babel-plugin-require-context-hook` registration: nothing in src uses
11
+ // `require.context`.
12
+ // - `module.exports = () => { global.IS_REACT_ACT_ENVIRONMENT = true }`: jest
13
+ // only required that file, it never called the exported function, so the
14
+ // flag was never actually set. Dropping it preserves the behaviour.
15
+
16
+ // styled-components warns when a component is first imported during a React render.
17
+ // In tests, modules are loaded lazily (on first use), so they get evaluated inside
18
+ // a render cycle — a false positive. The components themselves are correctly defined
19
+ // at module level; this suppressor avoids ~1800 spurious warnings per test run.
20
+ const originalWarn = console.warn.bind(console);
21
+ console.warn = (...args: unknown[]) => {
22
+ if (typeof args[0] === "string" && args[0].includes("has been created dynamically")) return;
23
+ originalWarn(...args);
24
+ };
25
+
26
+ window.matchMedia =
27
+ window.matchMedia ||
28
+ ((): MediaQueryList =>
29
+ ({
30
+ matches: false,
31
+ addListener: () => {},
32
+ removeListener: () => {},
33
+ }) as unknown as MediaQueryList);
34
+
35
+ class ResizeObserverMock {
36
+ observe() {}
37
+ unobserve() {}
38
+ disconnect() {}
39
+ }
40
+
41
+ globalThis.ResizeObserver = ResizeObserverMock as unknown as typeof ResizeObserver;