@nuraly/runtime 0.1.6 → 0.1.8

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 (349) hide show
  1. package/README.md +83 -765
  2. package/components/ui/components/Event/EventValue/EventValue.ts +13 -8
  3. package/components/ui/components/ToastContainer/ToastContainer.ts +1 -1
  4. package/components/ui/components/advanced/AIChat/AIChat.ts +1 -2
  5. package/components/ui/components/advanced/Collapse/Collapse.ts +5 -2
  6. package/components/ui/components/advanced/Collections/Collections.ts +2 -2
  7. package/components/ui/components/advanced/MicroApp/MicroApp.ts +3 -11
  8. package/components/ui/components/advanced/RefComponent/RefComponent.ts +2 -2
  9. package/components/ui/components/advanced/RichText/RichText.ts +5 -4
  10. package/components/ui/components/advanced/RichText/RichTextEditor.ts +0 -167
  11. package/components/ui/components/base/BaseElement/base-change-detection.ts +1 -5
  12. package/components/ui/components/base/BaseElement.ts +229 -610
  13. package/components/ui/components/base/FormRegisterable.ts +83 -0
  14. package/components/ui/components/base/controllers/DragDropController.ts +175 -0
  15. package/components/ui/components/base/controllers/ErrorController.ts +180 -0
  16. package/components/ui/components/base/controllers/EventController.ts +112 -0
  17. package/components/ui/components/base/controllers/InputHandlerController.ts +298 -0
  18. package/components/ui/components/base/controllers/SelectionController.ts +323 -0
  19. package/components/ui/components/base/controllers/StyleHandlerController.ts +286 -0
  20. package/components/ui/components/base/controllers/index.ts +11 -0
  21. package/components/ui/components/base/mixins/EditorModeMixin.ts +185 -0
  22. package/components/ui/components/base/mixins/index.ts +6 -0
  23. package/components/ui/components/base/types/base-element.types.ts +138 -0
  24. package/components/ui/components/base/types/index.ts +21 -0
  25. package/components/ui/components/base/utils/event-debouncer.ts +209 -0
  26. package/components/ui/components/base/utils/index.ts +11 -0
  27. package/components/ui/components/base/utils/style-cache.ts +94 -0
  28. package/components/ui/components/display/BoxModel/BoxModel.ts +177 -116
  29. package/components/ui/components/display/Code/Code.ts +40 -26
  30. package/components/ui/components/display/Divider/Divider.ts +2 -2
  31. package/components/ui/components/display/Icon/Icon.ts +2 -3
  32. package/components/ui/components/display/Image/Image.ts +72 -46
  33. package/components/ui/components/display/Tag/Tag.ts +2 -3
  34. package/components/ui/components/display/Video/Video.ts +91 -31
  35. package/components/ui/components/inputs/Button/Button.ts +2 -2
  36. package/components/ui/components/inputs/Checkbox/Checkbox.ts +14 -40
  37. package/components/ui/components/inputs/ColorPicker/colorpicker.ts +3 -4
  38. package/components/ui/components/inputs/DatePicker/DatePicker.ts +47 -25
  39. package/components/ui/components/inputs/Dropdown/Dropdown.ts +2 -2
  40. package/components/ui/components/inputs/Form/Form.style.ts +26 -0
  41. package/components/ui/components/inputs/Form/Form.ts +352 -0
  42. package/components/ui/components/inputs/IconPicker/IconPicker.ts +22 -18
  43. package/components/ui/components/inputs/InsertDropdown/InsertDropdown.ts +0 -20
  44. package/components/ui/components/inputs/NumberInput/NumberInput.ts +0 -4
  45. package/components/ui/components/inputs/RadioButton/Radio-button.ts +11 -13
  46. package/components/ui/components/inputs/Select/Select.ts +38 -24
  47. package/components/ui/components/inputs/TextInput/TextInput.ts +15 -9
  48. package/components/ui/components/inputs/Textarea/Textarea.ts +30 -30
  49. package/components/ui/components/inputs/UsersDropdown/UsersDropdown.ts +1 -1
  50. package/components/ui/components/layout/Card/Card.ts +112 -10
  51. package/components/ui/components/layout/Containers/Container.style.ts +18 -0
  52. package/components/ui/components/layout/Containers/Container.ts +11 -5
  53. package/components/ui/components/layout/Grid/Col.style.ts +27 -0
  54. package/components/ui/components/layout/Grid/Col.ts +209 -0
  55. package/components/ui/components/layout/Grid/Row.style.ts +73 -0
  56. package/components/ui/components/layout/Grid/Row.ts +166 -0
  57. package/components/ui/components/layout/Grid/index.ts +7 -0
  58. package/components/ui/components/layout/Panel/Panel.ts +2 -2
  59. package/components/ui/components/layout/Tabs/Tabs.ts +0 -1
  60. package/components/ui/components/navigation/EmbedURL/EmbedURL.ts +62 -26
  61. package/components/ui/components/navigation/Link/Link.ts +27 -16
  62. package/components/ui/components/navigation/Menu/Menu.ts +26 -48
  63. package/components/ui/components/runtime/MicroApp/MicroApp.ts +2 -4
  64. package/components/ui/components/runtime/MicroApp/MicroAppDataLoader.ts +6 -2
  65. package/components/ui/components/studio/FunctionsPanel/FunctionsPanel.ts +472 -0
  66. package/components/ui/components/studio/FunctionsPanel/index.ts +1 -0
  67. package/components/ui/components/utility/AccessRoles/AccessRoles.style.ts +242 -0
  68. package/components/ui/components/utility/AccessRoles/AccessRoles.ts +476 -0
  69. package/components/ui/components/utility/Border/Border.ts +0 -14
  70. package/components/ui/components/utility/BorderManager/BorderManager.style.ts +237 -0
  71. package/components/ui/components/utility/BorderManager/BorderManager.ts +503 -0
  72. package/components/ui/components/utility/BoxShadow/BoxShadow.ts +0 -16
  73. package/components/ui/components/utility/Document/Document.ts +54 -25
  74. package/components/ui/components/utility/Export-Import/Export-Import.ts +8 -7
  75. package/components/ui/components/utility/Handlers/Handlers.ts +14 -17
  76. package/components/ui/components/utility/ValidationRules/ValidationRules.ts +440 -0
  77. package/components/ui/components/wrappers/GenerikWrapper/DragWrapper/DragWrapper.ts +1 -0
  78. package/components/ui/components/wrappers/GenerikWrapper/GenerikWrapper.ts +1 -24
  79. package/components/ui/nuraly-ui/src/components/badge/badge.style.ts +4 -3
  80. package/components/ui/nuraly-ui/src/components/datepicker/datepicker.component.ts +2 -0
  81. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.component.ts +12 -6
  82. package/components/ui/nuraly-ui/src/components/radio-group/radio-group.style.ts +23 -0
  83. package/dist/{index-B4yIOSMd.js → BaseElement-BNBn_IJk.js} +2920 -267
  84. package/dist/{CodeEditor-0GwD2UDB.js → CodeEditor-Bf4L2rO_.js} +84127 -76319
  85. package/dist/{CodeEditor-BiNku87K.js → CodeEditor-Cpph-xRc.js} +7 -7
  86. package/dist/{abap-B2diVmjb.js → abap-D0Neqhq6.js} +91 -1
  87. package/dist/{apex-3NuJ-nsI.js → apex-B5LhxkeG.js} +18 -1
  88. package/dist/assets/editor.worker-DcwbJ0PV.js +12 -0
  89. package/dist/assets/html.worker-BTMxskjR.js +461 -0
  90. package/dist/assets/json.worker-D3vTGdf_.js +49 -0
  91. package/dist/assets/ts.worker-BsM1BXac.js +51334 -0
  92. package/dist/{azcli-XGXuUsMB.js → azcli-BrBH0QTU.js} +1 -1
  93. package/dist/{bat-B8Vhm634.js → bat-BfzAov64.js} +12 -1
  94. package/dist/{bicep-Cc8X5S_k.js → bicep-C3bCSWel.js} +1 -1
  95. package/dist/{cameligo-Bo3wBh9T.js → cameligo-sFL5plcd.js} +13 -1
  96. package/dist/{clojure-CPoQlpIK.js → clojure-CfeExRz0.js} +14 -1
  97. package/dist/{coffee-BxvTGz39.js → coffee-Xws5K0WL.js} +11 -1
  98. package/dist/{cpp-5RpEV7vC.js → cpp-CqOUEpxN.js} +28 -23
  99. package/dist/{csharp-slXXP3fo.js → csharp-DVLiBOZb.js} +13 -1
  100. package/dist/{csp-B98p6-gH.js → csp-DVFp9bw5.js} +3 -1
  101. package/dist/{css-BDsDSAin.js → css-DwARn2R6.js} +8 -1
  102. package/dist/cssMode-DMsdy1N0.js +1577 -0
  103. package/dist/{cypher-Dc4IMouD.js → cypher-uY0Mffat.js} +8 -1
  104. package/dist/{dart-LhvE3yD2.js → dart-D27H-mX_.js} +18 -1
  105. package/dist/{dockerfile-CwzplJeZ.js → dockerfile-CmV85WZK.js} +5 -1
  106. package/dist/{ecl-DxW3FiJi.js → ecl--fKn7yzB.js} +9 -1
  107. package/dist/{elixir-BI40g7TU.js → elixir-DUhH17ON.js} +87 -1
  108. package/dist/{flow9-tR2v0bGz.js → flow9-B3Dx2LLe.js} +8 -1
  109. package/dist/{freemarker2-XzXhMwTc.js → freemarker2-D51H9HYi.js} +359 -7
  110. package/dist/{fsharp-BLAma0OT.js → fsharp-SyqBfUAR.js} +14 -1
  111. package/dist/{go-nYcD3y4Z.js → go-BbMR2tdT.js} +17 -1
  112. package/dist/{graphql-Dp1cHWmP.js → graphql-DDJE6tIl.js} +17 -1
  113. package/dist/{handlebars-CmrcNfkM.js → handlebars-CF6gdAX4.js} +38 -4
  114. package/dist/{hcl-6NT8Kbna.js → hcl-YBvpaUqf.js} +13 -1
  115. package/dist/{html-BsvlsNx5.js → html-c2n_zkM3.js} +37 -4
  116. package/dist/htmlMode-9IJTuZUh.js +1587 -0
  117. package/dist/{ini-BZCOLrEc.js → ini-Ct73dBtM.js} +10 -1
  118. package/dist/{java-DAMcfJbX.js → java-C_jlkwoG.js} +18 -1
  119. package/dist/{javascript-D-M-tA-x.js → javascript-DhEEBMxD.js} +3 -2
  120. package/dist/jsonMode-CB6k-4rp.js +2002 -0
  121. package/dist/{julia-CQ46G71H.js → julia-D8WE5U1e.js} +22 -1
  122. package/dist/{kotlin-CEjVo_6E.js → kotlin-Zy9aq5yB.js} +15 -1
  123. package/dist/{less-DreV99nP.js → less-sZ0iHtE8.js} +1 -1
  124. package/dist/{lexon-DBVJhqLb.js → lexon-CsdNL29A.js} +13 -1
  125. package/dist/{liquid-_8i5JYO-.js → liquid-CwtPiwnW.js} +12 -4
  126. package/dist/{lua-Dcc_j6L-.js → lua-C2YJo0zw.js} +12 -1
  127. package/dist/{m3-B9SlZL4n.js → m3-CPLP40SG.js} +7 -1
  128. package/dist/{markdown-CuGw9_MP.js → markdown-B1mf5e0R.js} +34 -1
  129. package/dist/{mdx-CiSJOftS.js → mdx-LewPRYF8.js} +2 -2
  130. package/dist/{micro-app-entry-BT6Pk6bn.js → micro-app-entry-C3RDIukG.js} +7621 -9067
  131. package/dist/micro-app.bundle.js +3 -3
  132. package/dist/micro-app.js +3575 -6621
  133. package/dist/{mips-BUWqP-OH.js → mips-DA33BZX1.js} +11 -1
  134. package/dist/{msdax-DtkouYCg.js → msdax-CCYFIQsP.js} +5 -1
  135. package/dist/{mysql-IkAsWSmF.js → mysql-hjmIjL-D.js} +11 -3
  136. package/dist/{objective-c-B2-ronfg.js → objective-c-RRCpEmqC.js} +2 -1
  137. package/dist/{pascal-Bsnz2eJA.js → pascal-CeV8XfxB.js} +13 -1
  138. package/dist/{pascaligo-D_sMUn0Q.js → pascaligo-IEEGVJAJ.js} +13 -1
  139. package/dist/{perl-BPzHt9SS.js → perl-B5-QbHq_.js} +34 -1
  140. package/dist/{pgsql-DlTJB0PD.js → pgsql-s6kqEJmi.js} +14 -4
  141. package/dist/{php-Dmq5OjwK.js → php-CWWqzOo8.js} +36 -1
  142. package/dist/{pla-HJcccrBy.js → pla-FSvb_YP_.js} +13 -1
  143. package/dist/{postiats-OQn6DKv-.js → postiats-DQdscQXO.js} +370 -1
  144. package/dist/{powerquery-DKaMYC8w.js → powerquery-CtA5JA1I.js} +7 -1
  145. package/dist/{powershell-DWeJHik1.js → powershell-DglEq96N.js} +13 -1
  146. package/dist/{protobuf-CBn_IseU.js → protobuf-BSepub3e.js} +5 -1
  147. package/dist/{pug-BoRpCINl.js → pug-B1847F4G.js} +16 -1
  148. package/dist/{python-DNxbUiJS.js → python-h5Z2g-yl.js} +59 -11
  149. package/dist/{qsharp-4rGyVZOw.js → qsharp-D4i0Nqg9.js} +28 -3
  150. package/dist/{r-DsgLhBOb.js → r-cdRigKxa.js} +5 -1
  151. package/dist/{razor-BFH0wq9s.js → razor-D5ep1Doy.js} +48 -4
  152. package/dist/{redis-B2fdL4Bg.js → redis-D9MFxvE8.js} +16 -6
  153. package/dist/{redshift-DoaeyCkH.js → redshift-CmCnsvL-.js} +13 -4
  154. package/dist/{restructuredtext-D-6OFBY9.js → restructuredtext-CWy8J51t.js} +19 -1
  155. package/dist/{ruby-D1DD6baV.js → ruby-WP-c36m5.js} +76 -3
  156. package/dist/runtime.js +34 -45
  157. package/dist/{rust-DssUV39M.js → rust-Q9FLdYpu.js} +13 -1
  158. package/dist/{sb-Dmb6tAdv.js → sb-C54-JBGT.js} +12 -1
  159. package/dist/{scala-Co3ETaym.js → scala-CzbFImc5.js} +24 -1
  160. package/dist/{scheme-CMrqXTty.js → scheme-BhfDmYN3.js} +1 -1
  161. package/dist/{scss-DkGudv8Q.js → scss-CEmiBXpS.js} +25 -1
  162. package/dist/{shell-BHN2BI4L.js → shell-Bmc1VhG0.js} +4 -1
  163. package/dist/{solidity-b-R-raGB.js → solidity-C9Q2I8Hh.js} +23 -1
  164. package/dist/{sophia-Y4GjyxNB.js → sophia-jWa1UyKz.js} +16 -1
  165. package/dist/{sparql-CDAPZb88.js → sparql-CM7jctbc.js} +15 -1
  166. package/dist/{sql-DkkpPiUq.js → sql-WzihTkbg.js} +42 -1
  167. package/dist/{st-CSPV91Ej.js → st-6y7_3aup.js} +8 -1
  168. package/dist/style.css +1 -1
  169. package/dist/{swift-DdSC5O48.js → swift-k-0zxG_D.js} +4 -1
  170. package/dist/{systemverilog-CI03XpAv.js → systemverilog-Pnr5_rIP.js} +29 -3
  171. package/dist/{tcl-B8DayMSI.js → tcl-fNPXval8.js} +7 -1
  172. package/dist/tsMode-B_6LiBE1.js +976 -0
  173. package/dist/{twig-B1AUPVB_.js → twig-L2MkztkV.js} +76 -1
  174. package/dist/{typescript-DFCDgKOy.js → typescript-BBG0jH4p.js} +23 -2
  175. package/dist/typespec-Cqqo-3Pt.js +123 -0
  176. package/dist/{vb-BIC7ccdG.js → vb-B5YC2xN9.js} +15 -1
  177. package/dist/{wgsl-C9yjop46.js → wgsl-D9BRtftY.js} +26 -1
  178. package/dist/{xml-axhHDYch.js → xml-DgLB7rE6.js} +8 -2
  179. package/dist/{yaml-fWSpoHsZ.js → yaml-DiI4HpSv.js} +30 -2
  180. package/handlers/compiler.ts +196 -16
  181. package/handlers/context-setup.ts +10 -5
  182. package/handlers/handler-api-factory.ts +358 -0
  183. package/handlers/handler-api.ts +379 -0
  184. package/handlers/handler-executor.ts +25 -5
  185. package/handlers/handler-scope.ts +398 -0
  186. package/handlers/index.ts +34 -2
  187. package/handlers/runtime-api/component-properties.ts +0 -8
  188. package/handlers/runtime-api/index.ts +1 -1
  189. package/handlers/runtime-api/toast.ts +1 -1
  190. package/index.ts +14 -115
  191. package/micro-app/README.md +10 -10
  192. package/micro-app/state/MicroAppRuntimeContext.ts +1 -28
  193. package/micro-app-entry.ts +0 -5
  194. package/package.json +19 -1
  195. package/redux/actions/application/index.ts +0 -1
  196. package/redux/actions/component/addComponentAction.ts +15 -4
  197. package/redux/actions/component/moveDraggedComponent.ts +1 -2
  198. package/redux/actions/component/update-component-name.ts +1 -1
  199. package/redux/actions/component/updateComponentAttributes.ts +7 -2
  200. package/redux/handlers/functions/build-function-handler.ts +11 -3
  201. package/redux/handlers/functions/deploy-function-handler.ts +11 -3
  202. package/redux/handlers/functions/invoke-function-handler.ts +11 -3
  203. package/redux/handlers/functions/load-functions-handler.ts +2 -1
  204. package/redux/handlers/functions/update-function-handler.ts +2 -1
  205. package/redux/store/component/component.interface.ts +8 -2
  206. package/redux/store/component/store.ts +1 -4
  207. package/state/runtime-context.ts +1 -23
  208. package/utils/RuntimeContextHelpers.ts +221 -90
  209. package/utils/change-detection.ts +125 -1
  210. package/utils/clipboard-utils.ts +18 -8
  211. package/utils/component-registry.ts +118 -0
  212. package/utils/index.ts +14 -1
  213. package/utils/naming-generator.ts +3 -1
  214. package/utils/randomness.ts +3 -1
  215. package/utils/register-components.ts +21 -29
  216. package/utils/render-util.ts +27 -48
  217. package/utils/toast.ts +97 -0
  218. package/vite.config.ts +29 -12
  219. package/components/ui/components/Event/EventAttribute/EventAttribute.style.ts +0 -11
  220. package/components/ui/components/Event/EventAttribute/EventAttribute.ts +0 -28
  221. package/components/ui/components/base/BaseElement/calculateStyles.ts +0 -31
  222. package/components/ui/components/base/BaseElement/drag-events.helpers.ts +0 -71
  223. package/components/ui/components/base/BaseElement/execute-event.helpers.ts +0 -45
  224. package/components/ui/components/base/BaseElement/interactions.helpers.ts +0 -14
  225. package/components/ui/components/wrappers/ComponentTitle/ComponentTitle.ts +0 -95
  226. package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.style.ts +0 -102
  227. package/components/ui/components/wrappers/GenerikWrapper/ResizeWrapper/ResizeWrapper.ts +0 -258
  228. package/components/ui/components/wrappers/PreviewWrapper.ts +0 -28
  229. package/components/ui/components/wrappers/RectangleSelection/RectangleSelection.ts +0 -154
  230. package/components/ui/nuraly-ui/packages/common/dist/constants/index.d.ts +0 -2
  231. package/components/ui/nuraly-ui/packages/common/dist/constants/index.js +0 -2
  232. package/components/ui/nuraly-ui/packages/common/dist/constants.d.ts +0 -17
  233. package/components/ui/nuraly-ui/packages/common/dist/constants.js +0 -7
  234. package/components/ui/nuraly-ui/packages/common/dist/controllers/index.d.ts +0 -2
  235. package/components/ui/nuraly-ui/packages/common/dist/controllers/index.js +0 -2
  236. package/components/ui/nuraly-ui/packages/common/dist/controllers.d.ts +0 -21
  237. package/components/ui/nuraly-ui/packages/common/dist/controllers.js +0 -22
  238. package/components/ui/nuraly-ui/packages/common/dist/index.d.ts +0 -25
  239. package/components/ui/nuraly-ui/packages/common/dist/index.js +0 -27
  240. package/components/ui/nuraly-ui/packages/common/dist/mixins/index.d.ts +0 -2
  241. package/components/ui/nuraly-ui/packages/common/dist/mixins/index.js +0 -3
  242. package/components/ui/nuraly-ui/packages/common/dist/mixins.d.ts +0 -26
  243. package/components/ui/nuraly-ui/packages/common/dist/mixins.js +0 -29
  244. package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.d.ts +0 -42
  245. package/components/ui/nuraly-ui/packages/common/dist/shared/base-mixin.js +0 -38
  246. package/components/ui/nuraly-ui/packages/common/dist/shared/constants.d.ts +0 -1
  247. package/components/ui/nuraly-ui/packages/common/dist/shared/constants.js +0 -2
  248. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.d.ts +0 -77
  249. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.controller.js +0 -341
  250. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.d.ts +0 -37
  251. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/dropdown.interface.js +0 -2
  252. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.d.ts +0 -4
  253. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/index.js +0 -4
  254. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.d.ts +0 -48
  255. package/components/ui/nuraly-ui/packages/common/dist/shared/controllers/theme.controller.js +0 -133
  256. package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.d.ts +0 -37
  257. package/components/ui/nuraly-ui/packages/common/dist/shared/dependency-mixin.js +0 -141
  258. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.d.ts +0 -64
  259. package/components/ui/nuraly-ui/packages/common/dist/shared/event-handler-mixin.js +0 -95
  260. package/components/ui/nuraly-ui/packages/common/dist/shared/index.d.ts +0 -13
  261. package/components/ui/nuraly-ui/packages/common/dist/shared/index.js +0 -17
  262. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.d.ts +0 -78
  263. package/components/ui/nuraly-ui/packages/common/dist/shared/theme-mixin.js +0 -194
  264. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.d.ts +0 -44
  265. package/components/ui/nuraly-ui/packages/common/dist/shared/themes.js +0 -85
  266. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.d.ts +0 -60
  267. package/components/ui/nuraly-ui/packages/common/dist/shared/utils.js +0 -85
  268. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.d.ts +0 -108
  269. package/components/ui/nuraly-ui/packages/common/dist/shared/validation.types.js +0 -17
  270. package/components/ui/nuraly-ui/packages/common/dist/themes/index.d.ts +0 -2
  271. package/components/ui/nuraly-ui/packages/common/dist/themes/index.js +0 -2
  272. package/components/ui/nuraly-ui/packages/common/dist/themes.d.ts +0 -22
  273. package/components/ui/nuraly-ui/packages/common/dist/themes.js +0 -23
  274. package/components/ui/nuraly-ui/packages/common/dist/utils/index.d.ts +0 -2
  275. package/components/ui/nuraly-ui/packages/common/dist/utils/index.js +0 -2
  276. package/components/ui/nuraly-ui/packages/common/dist/utils.d.ts +0 -21
  277. package/components/ui/nuraly-ui/packages/common/dist/utils.js +0 -22
  278. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/LICENSE +0 -15
  279. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/README.md +0 -294
  280. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
  281. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/copy.js +0 -175
  282. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/copy/index.js +0 -7
  283. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/empty/index.js +0 -39
  284. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/file.js +0 -66
  285. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/index.js +0 -23
  286. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/link.js +0 -64
  287. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
  288. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
  289. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
  290. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/fs/index.js +0 -146
  291. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/index.js +0 -16
  292. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/index.js +0 -16
  293. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
  294. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
  295. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/json/output-json.js +0 -12
  296. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
  297. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
  298. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
  299. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/index.js +0 -7
  300. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move-sync.js +0 -55
  301. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/move/move.js +0 -59
  302. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/output-file/index.js +0 -31
  303. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/path-exists/index.js +0 -12
  304. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/remove/index.js +0 -17
  305. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/async.js +0 -29
  306. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/stat.js +0 -159
  307. package/components/ui/nuraly-ui/packages/forms/node_modules/fs-extra/lib/util/utimes.js +0 -36
  308. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/LICENSE +0 -15
  309. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/README.md +0 -294
  310. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy-sync.js +0 -171
  311. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/copy.js +0 -175
  312. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/copy/index.js +0 -7
  313. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/empty/index.js +0 -39
  314. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/file.js +0 -66
  315. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/index.js +0 -23
  316. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/link.js +0 -64
  317. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-paths.js +0 -101
  318. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink-type.js +0 -34
  319. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/ensure/symlink.js +0 -67
  320. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/fs/index.js +0 -146
  321. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/index.js +0 -16
  322. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/index.js +0 -16
  323. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/jsonfile.js +0 -11
  324. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json-sync.js +0 -12
  325. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/json/output-json.js +0 -12
  326. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/index.js +0 -14
  327. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/make-dir.js +0 -27
  328. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/mkdirs/utils.js +0 -21
  329. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/index.js +0 -7
  330. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move-sync.js +0 -55
  331. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/move/move.js +0 -59
  332. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/output-file/index.js +0 -31
  333. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/path-exists/index.js +0 -12
  334. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/remove/index.js +0 -17
  335. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/async.js +0 -29
  336. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/stat.js +0 -159
  337. package/components/ui/nuraly-ui/packages/layout/node_modules/fs-extra/lib/util/utimes.js +0 -36
  338. package/dist/SmartAttributeHandler-B1UJKlqJ.js +0 -153
  339. package/dist/SmartAttributeHandler-u-ZHGueR.js +0 -193
  340. package/dist/assets/editor.worker-C_S4Avdt.js +0 -11
  341. package/dist/assets/html.worker-DfuQASUV.js +0 -458
  342. package/dist/assets/json.worker-Cucz4wxY.js +0 -42
  343. package/dist/assets/ts.worker-Dme6S0YK.js +0 -37021
  344. package/dist/cssMode-BzqArQ52.js +0 -1443
  345. package/dist/htmlMode-CmNePjzn.js +0 -1453
  346. package/dist/jsonMode-CKj6yF-8.js +0 -1863
  347. package/dist/tsMode-DfXg_Y5Y.js +0 -800
  348. package/redux/actions/application/loadApplicationPermissionAction.ts +0 -10
  349. package/utils/styleUtil.ts +0 -7
@@ -1,294 +0,0 @@
1
- Node.js: fs-extra
2
- =================
3
-
4
- `fs-extra` adds file system methods that aren't included in the native `fs` module and adds promise support to the `fs` methods. It also uses [`graceful-fs`](https://github.com/isaacs/node-graceful-fs) to prevent `EMFILE` errors. It should be a drop in replacement for `fs`.
5
-
6
- [![npm Package](https://img.shields.io/npm/v/fs-extra.svg)](https://www.npmjs.org/package/fs-extra)
7
- [![License](https://img.shields.io/npm/l/fs-extra.svg)](https://github.com/jprichardson/node-fs-extra/blob/master/LICENSE)
8
- [![build status](https://img.shields.io/github/actions/workflow/status/jprichardson/node-fs-extra/ci.yml?branch=master)](https://github.com/jprichardson/node-fs-extra/actions/workflows/ci.yml?query=branch%3Amaster)
9
- [![downloads per month](http://img.shields.io/npm/dm/fs-extra.svg)](https://www.npmjs.org/package/fs-extra)
10
- [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
11
-
12
- Why?
13
- ----
14
-
15
- I got tired of including `mkdirp`, `rimraf`, and `ncp` in most of my projects.
16
-
17
-
18
-
19
-
20
- Installation
21
- ------------
22
-
23
- npm install fs-extra
24
-
25
-
26
-
27
- Usage
28
- -----
29
-
30
- ### CommonJS
31
-
32
- `fs-extra` is a drop in replacement for native `fs`. All methods in `fs` are attached to `fs-extra`. All `fs` methods return promises if the callback isn't passed.
33
-
34
- You don't ever need to include the original `fs` module again:
35
-
36
- ```js
37
- const fs = require('fs') // this is no longer necessary
38
- ```
39
-
40
- you can now do this:
41
-
42
- ```js
43
- const fs = require('fs-extra')
44
- ```
45
-
46
- or if you prefer to make it clear that you're using `fs-extra` and not `fs`, you may want
47
- to name your `fs` variable `fse` like so:
48
-
49
- ```js
50
- const fse = require('fs-extra')
51
- ```
52
-
53
- you can also keep both, but it's redundant:
54
-
55
- ```js
56
- const fs = require('fs')
57
- const fse = require('fs-extra')
58
- ```
59
-
60
- **NOTE:** The deprecated constants `fs.F_OK`, `fs.R_OK`, `fs.W_OK`, & `fs.X_OK` are not exported on Node.js v24.0.0+; please use their `fs.constants` equivalents.
61
-
62
- ### ESM
63
-
64
- There is also an `fs-extra/esm` import, that supports both default and named exports. However, note that `fs` methods are not included in `fs-extra/esm`; you still need to import `fs` and/or `fs/promises` seperately:
65
-
66
- ```js
67
- import { readFileSync } from 'fs'
68
- import { readFile } from 'fs/promises'
69
- import { outputFile, outputFileSync } from 'fs-extra/esm'
70
- ```
71
-
72
- Default exports are supported:
73
-
74
- ```js
75
- import fs from 'fs'
76
- import fse from 'fs-extra/esm'
77
- // fse.readFileSync is not a function; must use fs.readFileSync
78
- ```
79
-
80
- but you probably want to just use regular `fs-extra` instead of `fs-extra/esm` for default exports:
81
-
82
- ```js
83
- import fs from 'fs-extra'
84
- // both fs and fs-extra methods are defined
85
- ```
86
-
87
- Sync vs Async vs Async/Await
88
- -------------
89
- Most methods are async by default. All async methods will return a promise if the callback isn't passed.
90
-
91
- Sync methods on the other hand will throw if an error occurs.
92
-
93
- Also Async/Await will throw an error if one occurs.
94
-
95
- Example:
96
-
97
- ```js
98
- const fs = require('fs-extra')
99
-
100
- // Async with promises:
101
- fs.copy('/tmp/myfile', '/tmp/mynewfile')
102
- .then(() => console.log('success!'))
103
- .catch(err => console.error(err))
104
-
105
- // Async with callbacks:
106
- fs.copy('/tmp/myfile', '/tmp/mynewfile', err => {
107
- if (err) return console.error(err)
108
- console.log('success!')
109
- })
110
-
111
- // Sync:
112
- try {
113
- fs.copySync('/tmp/myfile', '/tmp/mynewfile')
114
- console.log('success!')
115
- } catch (err) {
116
- console.error(err)
117
- }
118
-
119
- // Async/Await:
120
- async function copyFiles () {
121
- try {
122
- await fs.copy('/tmp/myfile', '/tmp/mynewfile')
123
- console.log('success!')
124
- } catch (err) {
125
- console.error(err)
126
- }
127
- }
128
-
129
- copyFiles()
130
- ```
131
-
132
-
133
- Methods
134
- -------
135
-
136
- ### Async
137
-
138
- - [copy](docs/copy.md)
139
- - [emptyDir](docs/emptyDir.md)
140
- - [ensureFile](docs/ensureFile.md)
141
- - [ensureDir](docs/ensureDir.md)
142
- - [ensureLink](docs/ensureLink.md)
143
- - [ensureSymlink](docs/ensureSymlink.md)
144
- - [mkdirp](docs/ensureDir.md)
145
- - [mkdirs](docs/ensureDir.md)
146
- - [move](docs/move.md)
147
- - [outputFile](docs/outputFile.md)
148
- - [outputJson](docs/outputJson.md)
149
- - [pathExists](docs/pathExists.md)
150
- - [readJson](docs/readJson.md)
151
- - [remove](docs/remove.md)
152
- - [writeJson](docs/writeJson.md)
153
-
154
- ### Sync
155
-
156
- - [copySync](docs/copy-sync.md)
157
- - [emptyDirSync](docs/emptyDir-sync.md)
158
- - [ensureFileSync](docs/ensureFile-sync.md)
159
- - [ensureDirSync](docs/ensureDir-sync.md)
160
- - [ensureLinkSync](docs/ensureLink-sync.md)
161
- - [ensureSymlinkSync](docs/ensureSymlink-sync.md)
162
- - [mkdirpSync](docs/ensureDir-sync.md)
163
- - [mkdirsSync](docs/ensureDir-sync.md)
164
- - [moveSync](docs/move-sync.md)
165
- - [outputFileSync](docs/outputFile-sync.md)
166
- - [outputJsonSync](docs/outputJson-sync.md)
167
- - [pathExistsSync](docs/pathExists-sync.md)
168
- - [readJsonSync](docs/readJson-sync.md)
169
- - [removeSync](docs/remove-sync.md)
170
- - [writeJsonSync](docs/writeJson-sync.md)
171
-
172
-
173
- **NOTE:** You can still use the native Node.js methods. They are promisified and copied over to `fs-extra`. See [notes on `fs.read()`, `fs.write()`, & `fs.writev()`](docs/fs-read-write-writev.md)
174
-
175
- ### What happened to `walk()` and `walkSync()`?
176
-
177
- They were removed from `fs-extra` in v2.0.0. If you need the functionality, `walk` and `walkSync` are available as separate packages, [`klaw`](https://github.com/jprichardson/node-klaw) and [`klaw-sync`](https://github.com/manidlou/node-klaw-sync).
178
-
179
-
180
- Third Party
181
- -----------
182
-
183
- ### CLI
184
-
185
- [fse-cli](https://www.npmjs.com/package/@atao60/fse-cli) allows you to run `fs-extra` from a console or from [npm](https://www.npmjs.com) scripts.
186
-
187
- ### TypeScript
188
-
189
- If you like TypeScript, you can use `fs-extra` with it: https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/fs-extra
190
-
191
-
192
- ### File / Directory Watching
193
-
194
- If you want to watch for changes to files or directories, then you should use [chokidar](https://github.com/paulmillr/chokidar).
195
-
196
- ### Obtain Filesystem (Devices, Partitions) Information
197
-
198
- [fs-filesystem](https://github.com/arthurintelligence/node-fs-filesystem) allows you to read the state of the filesystem of the host on which it is run. It returns information about both the devices and the partitions (volumes) of the system.
199
-
200
- ### Misc.
201
-
202
- - [fs-extra-debug](https://github.com/jdxcode/fs-extra-debug) - Send your fs-extra calls to [debug](https://npmjs.org/package/debug).
203
- - [mfs](https://github.com/cadorn/mfs) - Monitor your fs-extra calls.
204
-
205
-
206
-
207
- Hacking on fs-extra
208
- -------------------
209
-
210
- Wanna hack on `fs-extra`? Great! Your help is needed! [fs-extra is one of the most depended upon Node.js packages](http://nodei.co/npm/fs-extra.png?downloads=true&downloadRank=true&stars=true). This project
211
- uses [JavaScript Standard Style](https://github.com/feross/standard) - if the name or style choices bother you,
212
- you're gonna have to get over it :) If `standard` is good enough for `npm`, it's good enough for `fs-extra`.
213
-
214
- [![js-standard-style](https://cdn.rawgit.com/feross/standard/master/badge.svg)](https://github.com/feross/standard)
215
-
216
- What's needed?
217
- - First, take a look at existing issues. Those are probably going to be where the priority lies.
218
- - More tests for edge cases. Specifically on different platforms. There can never be enough tests.
219
- - Improve test coverage.
220
-
221
- Note: If you make any big changes, **you should definitely file an issue for discussion first.**
222
-
223
- ### Running the Test Suite
224
-
225
- fs-extra contains hundreds of tests.
226
-
227
- - `npm run lint`: runs the linter ([standard](http://standardjs.com/))
228
- - `npm run unit`: runs the unit tests
229
- - `npm run unit-esm`: runs tests for `fs-extra/esm` exports
230
- - `npm test`: runs the linter and all tests
231
-
232
- When running unit tests, set the environment variable `CROSS_DEVICE_PATH` to the absolute path of an empty directory on another device (like a thumb drive) to enable cross-device move tests.
233
-
234
-
235
- ### Windows
236
-
237
- If you run the tests on the Windows and receive a lot of symbolic link `EPERM` permission errors, it's
238
- because on Windows you need elevated privilege to create symbolic links. You can add this to your Windows's
239
- account by following the instructions here: http://superuser.com/questions/104845/permission-to-make-symbolic-links-in-windows-7
240
- However, I didn't have much luck doing this.
241
-
242
- Since I develop on Mac OS X, I use VMWare Fusion for Windows testing. I create a shared folder that I map to a drive on Windows.
243
- I open the `Node.js command prompt` and run as `Administrator`. I then map the network drive running the following command:
244
-
245
- net use z: "\\vmware-host\Shared Folders"
246
-
247
- I can then navigate to my `fs-extra` directory and run the tests.
248
-
249
-
250
- Naming
251
- ------
252
-
253
- I put a lot of thought into the naming of these functions. Inspired by @coolaj86's request. So he deserves much of the credit for raising the issue. See discussion(s) here:
254
-
255
- * https://github.com/jprichardson/node-fs-extra/issues/2
256
- * https://github.com/flatiron/utile/issues/11
257
- * https://github.com/ryanmcgrath/wrench-js/issues/29
258
- * https://github.com/substack/node-mkdirp/issues/17
259
-
260
- First, I believe that in as many cases as possible, the [Node.js naming schemes](http://nodejs.org/api/fs.html) should be chosen. However, there are problems with the Node.js own naming schemes.
261
-
262
- For example, `fs.readFile()` and `fs.readdir()`: the **F** is capitalized in *File* and the **d** is not capitalized in *dir*. Perhaps a bit pedantic, but they should still be consistent. Also, Node.js has chosen a lot of POSIX naming schemes, which I believe is great. See: `fs.mkdir()`, `fs.rmdir()`, `fs.chown()`, etc.
263
-
264
- We have a dilemma though. How do you consistently name methods that perform the following POSIX commands: `cp`, `cp -r`, `mkdir -p`, and `rm -rf`?
265
-
266
- My perspective: when in doubt, err on the side of simplicity. A directory is just a hierarchical grouping of directories and files. Consider that for a moment. So when you want to copy it or remove it, in most cases you'll want to copy or remove all of its contents. When you want to create a directory, if the directory that it's suppose to be contained in does not exist, then in most cases you'll want to create that too.
267
-
268
- So, if you want to remove a file or a directory regardless of whether it has contents, just call `fs.remove(path)`. If you want to copy a file or a directory whether it has contents, just call `fs.copy(source, destination)`. If you want to create a directory regardless of whether its parent directories exist, just call `fs.mkdirs(path)` or `fs.mkdirp(path)`.
269
-
270
-
271
- Credit
272
- ------
273
-
274
- `fs-extra` wouldn't be possible without using the modules from the following authors:
275
-
276
- - [Isaac Shlueter](https://github.com/isaacs)
277
- - [Charlie McConnel](https://github.com/avianflu)
278
- - [James Halliday](https://github.com/substack)
279
- - [Andrew Kelley](https://github.com/andrewrk)
280
-
281
-
282
-
283
-
284
- License
285
- -------
286
-
287
- Licensed under MIT
288
-
289
- Copyright (c) 2011-2024 [JP Richardson](https://github.com/jprichardson)
290
-
291
- [1]: http://nodejs.org/docs/latest/api/fs.html
292
-
293
-
294
- [jsonfile]: https://github.com/jprichardson/node-jsonfile
@@ -1,171 +0,0 @@
1
- 'use strict'
2
-
3
- const fs = require('graceful-fs')
4
- const path = require('path')
5
- const mkdirsSync = require('../mkdirs').mkdirsSync
6
- const utimesMillisSync = require('../util/utimes').utimesMillisSync
7
- const stat = require('../util/stat')
8
-
9
- function copySync (src, dest, opts) {
10
- if (typeof opts === 'function') {
11
- opts = { filter: opts }
12
- }
13
-
14
- opts = opts || {}
15
- opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
16
- opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
17
-
18
- // Warn about using preserveTimestamps on 32-bit node
19
- if (opts.preserveTimestamps && process.arch === 'ia32') {
20
- process.emitWarning(
21
- 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
22
- '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
23
- 'Warning', 'fs-extra-WARN0002'
24
- )
25
- }
26
-
27
- const { srcStat, destStat } = stat.checkPathsSync(src, dest, 'copy', opts)
28
- stat.checkParentPathsSync(src, srcStat, dest, 'copy')
29
- if (opts.filter && !opts.filter(src, dest)) return
30
- const destParent = path.dirname(dest)
31
- if (!fs.existsSync(destParent)) mkdirsSync(destParent)
32
- return getStats(destStat, src, dest, opts)
33
- }
34
-
35
- function getStats (destStat, src, dest, opts) {
36
- const statSync = opts.dereference ? fs.statSync : fs.lstatSync
37
- const srcStat = statSync(src)
38
-
39
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
40
- else if (srcStat.isFile() ||
41
- srcStat.isCharacterDevice() ||
42
- srcStat.isBlockDevice()) return onFile(srcStat, destStat, src, dest, opts)
43
- else if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
44
- else if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
45
- else if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
46
- throw new Error(`Unknown file: ${src}`)
47
- }
48
-
49
- function onFile (srcStat, destStat, src, dest, opts) {
50
- if (!destStat) return copyFile(srcStat, src, dest, opts)
51
- return mayCopyFile(srcStat, src, dest, opts)
52
- }
53
-
54
- function mayCopyFile (srcStat, src, dest, opts) {
55
- if (opts.overwrite) {
56
- fs.unlinkSync(dest)
57
- return copyFile(srcStat, src, dest, opts)
58
- } else if (opts.errorOnExist) {
59
- throw new Error(`'${dest}' already exists`)
60
- }
61
- }
62
-
63
- function copyFile (srcStat, src, dest, opts) {
64
- fs.copyFileSync(src, dest)
65
- if (opts.preserveTimestamps) handleTimestamps(srcStat.mode, src, dest)
66
- return setDestMode(dest, srcStat.mode)
67
- }
68
-
69
- function handleTimestamps (srcMode, src, dest) {
70
- // Make sure the file is writable before setting the timestamp
71
- // otherwise open fails with EPERM when invoked with 'r+'
72
- // (through utimes call)
73
- if (fileIsNotWritable(srcMode)) makeFileWritable(dest, srcMode)
74
- return setDestTimestamps(src, dest)
75
- }
76
-
77
- function fileIsNotWritable (srcMode) {
78
- return (srcMode & 0o200) === 0
79
- }
80
-
81
- function makeFileWritable (dest, srcMode) {
82
- return setDestMode(dest, srcMode | 0o200)
83
- }
84
-
85
- function setDestMode (dest, srcMode) {
86
- return fs.chmodSync(dest, srcMode)
87
- }
88
-
89
- function setDestTimestamps (src, dest) {
90
- // The initial srcStat.atime cannot be trusted
91
- // because it is modified by the read(2) system call
92
- // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
93
- const updatedSrcStat = fs.statSync(src)
94
- return utimesMillisSync(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
95
- }
96
-
97
- function onDir (srcStat, destStat, src, dest, opts) {
98
- if (!destStat) return mkDirAndCopy(srcStat.mode, src, dest, opts)
99
- return copyDir(src, dest, opts)
100
- }
101
-
102
- function mkDirAndCopy (srcMode, src, dest, opts) {
103
- fs.mkdirSync(dest)
104
- copyDir(src, dest, opts)
105
- return setDestMode(dest, srcMode)
106
- }
107
-
108
- function copyDir (src, dest, opts) {
109
- const dir = fs.opendirSync(src)
110
-
111
- try {
112
- let dirent
113
-
114
- while ((dirent = dir.readSync()) !== null) {
115
- copyDirItem(dirent.name, src, dest, opts)
116
- }
117
- } finally {
118
- dir.closeSync()
119
- }
120
- }
121
-
122
- function copyDirItem (item, src, dest, opts) {
123
- const srcItem = path.join(src, item)
124
- const destItem = path.join(dest, item)
125
- if (opts.filter && !opts.filter(srcItem, destItem)) return
126
- const { destStat } = stat.checkPathsSync(srcItem, destItem, 'copy', opts)
127
- return getStats(destStat, srcItem, destItem, opts)
128
- }
129
-
130
- function onLink (destStat, src, dest, opts) {
131
- let resolvedSrc = fs.readlinkSync(src)
132
- if (opts.dereference) {
133
- resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
134
- }
135
-
136
- if (!destStat) {
137
- return fs.symlinkSync(resolvedSrc, dest)
138
- } else {
139
- let resolvedDest
140
- try {
141
- resolvedDest = fs.readlinkSync(dest)
142
- } catch (err) {
143
- // dest exists and is a regular file or directory,
144
- // Windows may throw UNKNOWN error. If dest already exists,
145
- // fs throws error anyway, so no need to guard against it here.
146
- if (err.code === 'EINVAL' || err.code === 'UNKNOWN') return fs.symlinkSync(resolvedSrc, dest)
147
- throw err
148
- }
149
- if (opts.dereference) {
150
- resolvedDest = path.resolve(process.cwd(), resolvedDest)
151
- }
152
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
153
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
154
- }
155
-
156
- // prevent copy if src is a subdir of dest since unlinking
157
- // dest in this case would result in removing src contents
158
- // and therefore a broken symlink would be created.
159
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
160
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
161
- }
162
- return copyLink(resolvedSrc, dest)
163
- }
164
- }
165
-
166
- function copyLink (resolvedSrc, dest) {
167
- fs.unlinkSync(dest)
168
- return fs.symlinkSync(resolvedSrc, dest)
169
- }
170
-
171
- module.exports = copySync
@@ -1,175 +0,0 @@
1
- 'use strict'
2
-
3
- const fs = require('../fs')
4
- const path = require('path')
5
- const { mkdirs } = require('../mkdirs')
6
- const { pathExists } = require('../path-exists')
7
- const { utimesMillis } = require('../util/utimes')
8
- const stat = require('../util/stat')
9
- const { asyncIteratorConcurrentProcess } = require('../util/async')
10
-
11
- async function copy (src, dest, opts = {}) {
12
- if (typeof opts === 'function') {
13
- opts = { filter: opts }
14
- }
15
-
16
- opts.clobber = 'clobber' in opts ? !!opts.clobber : true // default to true for now
17
- opts.overwrite = 'overwrite' in opts ? !!opts.overwrite : opts.clobber // overwrite falls back to clobber
18
-
19
- // Warn about using preserveTimestamps on 32-bit node
20
- if (opts.preserveTimestamps && process.arch === 'ia32') {
21
- process.emitWarning(
22
- 'Using the preserveTimestamps option in 32-bit node is not recommended;\n\n' +
23
- '\tsee https://github.com/jprichardson/node-fs-extra/issues/269',
24
- 'Warning', 'fs-extra-WARN0001'
25
- )
26
- }
27
-
28
- const { srcStat, destStat } = await stat.checkPaths(src, dest, 'copy', opts)
29
-
30
- await stat.checkParentPaths(src, srcStat, dest, 'copy')
31
-
32
- const include = await runFilter(src, dest, opts)
33
-
34
- if (!include) return
35
-
36
- // check if the parent of dest exists, and create it if it doesn't exist
37
- const destParent = path.dirname(dest)
38
- const dirExists = await pathExists(destParent)
39
- if (!dirExists) {
40
- await mkdirs(destParent)
41
- }
42
-
43
- await getStatsAndPerformCopy(destStat, src, dest, opts)
44
- }
45
-
46
- async function runFilter (src, dest, opts) {
47
- if (!opts.filter) return true
48
- return opts.filter(src, dest)
49
- }
50
-
51
- async function getStatsAndPerformCopy (destStat, src, dest, opts) {
52
- const statFn = opts.dereference ? fs.stat : fs.lstat
53
- const srcStat = await statFn(src)
54
-
55
- if (srcStat.isDirectory()) return onDir(srcStat, destStat, src, dest, opts)
56
-
57
- if (
58
- srcStat.isFile() ||
59
- srcStat.isCharacterDevice() ||
60
- srcStat.isBlockDevice()
61
- ) return onFile(srcStat, destStat, src, dest, opts)
62
-
63
- if (srcStat.isSymbolicLink()) return onLink(destStat, src, dest, opts)
64
- if (srcStat.isSocket()) throw new Error(`Cannot copy a socket file: ${src}`)
65
- if (srcStat.isFIFO()) throw new Error(`Cannot copy a FIFO pipe: ${src}`)
66
- throw new Error(`Unknown file: ${src}`)
67
- }
68
-
69
- async function onFile (srcStat, destStat, src, dest, opts) {
70
- if (!destStat) return copyFile(srcStat, src, dest, opts)
71
-
72
- if (opts.overwrite) {
73
- await fs.unlink(dest)
74
- return copyFile(srcStat, src, dest, opts)
75
- }
76
- if (opts.errorOnExist) {
77
- throw new Error(`'${dest}' already exists`)
78
- }
79
- }
80
-
81
- async function copyFile (srcStat, src, dest, opts) {
82
- await fs.copyFile(src, dest)
83
- if (opts.preserveTimestamps) {
84
- // Make sure the file is writable before setting the timestamp
85
- // otherwise open fails with EPERM when invoked with 'r+'
86
- // (through utimes call)
87
- if (fileIsNotWritable(srcStat.mode)) {
88
- await makeFileWritable(dest, srcStat.mode)
89
- }
90
-
91
- // Set timestamps and mode correspondingly
92
-
93
- // Note that The initial srcStat.atime cannot be trusted
94
- // because it is modified by the read(2) system call
95
- // (See https://nodejs.org/api/fs.html#fs_stat_time_values)
96
- const updatedSrcStat = await fs.stat(src)
97
- await utimesMillis(dest, updatedSrcStat.atime, updatedSrcStat.mtime)
98
- }
99
-
100
- return fs.chmod(dest, srcStat.mode)
101
- }
102
-
103
- function fileIsNotWritable (srcMode) {
104
- return (srcMode & 0o200) === 0
105
- }
106
-
107
- function makeFileWritable (dest, srcMode) {
108
- return fs.chmod(dest, srcMode | 0o200)
109
- }
110
-
111
- async function onDir (srcStat, destStat, src, dest, opts) {
112
- // the dest directory might not exist, create it
113
- if (!destStat) {
114
- await fs.mkdir(dest)
115
- }
116
-
117
- // iterate through the files in the current directory to copy everything
118
- await asyncIteratorConcurrentProcess(await fs.opendir(src), async (item) => {
119
- const srcItem = path.join(src, item.name)
120
- const destItem = path.join(dest, item.name)
121
-
122
- const include = await runFilter(srcItem, destItem, opts)
123
- // only copy the item if it matches the filter function
124
- if (include) {
125
- const { destStat } = await stat.checkPaths(srcItem, destItem, 'copy', opts)
126
- // If the item is a copyable file, `getStatsAndPerformCopy` will copy it
127
- // If the item is a directory, `getStatsAndPerformCopy` will call `onDir` recursively
128
- await getStatsAndPerformCopy(destStat, srcItem, destItem, opts)
129
- }
130
- })
131
-
132
- if (!destStat) {
133
- await fs.chmod(dest, srcStat.mode)
134
- }
135
- }
136
-
137
- async function onLink (destStat, src, dest, opts) {
138
- let resolvedSrc = await fs.readlink(src)
139
- if (opts.dereference) {
140
- resolvedSrc = path.resolve(process.cwd(), resolvedSrc)
141
- }
142
- if (!destStat) {
143
- return fs.symlink(resolvedSrc, dest)
144
- }
145
-
146
- let resolvedDest = null
147
- try {
148
- resolvedDest = await fs.readlink(dest)
149
- } catch (e) {
150
- // dest exists and is a regular file or directory,
151
- // Windows may throw UNKNOWN error. If dest already exists,
152
- // fs throws error anyway, so no need to guard against it here.
153
- if (e.code === 'EINVAL' || e.code === 'UNKNOWN') return fs.symlink(resolvedSrc, dest)
154
- throw e
155
- }
156
- if (opts.dereference) {
157
- resolvedDest = path.resolve(process.cwd(), resolvedDest)
158
- }
159
- if (stat.isSrcSubdir(resolvedSrc, resolvedDest)) {
160
- throw new Error(`Cannot copy '${resolvedSrc}' to a subdirectory of itself, '${resolvedDest}'.`)
161
- }
162
-
163
- // do not copy if src is a subdir of dest since unlinking
164
- // dest in this case would result in removing src contents
165
- // and therefore a broken symlink would be created.
166
- if (stat.isSrcSubdir(resolvedDest, resolvedSrc)) {
167
- throw new Error(`Cannot overwrite '${resolvedDest}' with '${resolvedSrc}'.`)
168
- }
169
-
170
- // copy the link
171
- await fs.unlink(dest)
172
- return fs.symlink(resolvedSrc, dest)
173
- }
174
-
175
- module.exports = copy
@@ -1,7 +0,0 @@
1
- 'use strict'
2
-
3
- const u = require('universalify').fromPromise
4
- module.exports = {
5
- copy: u(require('./copy')),
6
- copySync: require('./copy-sync')
7
- }
@@ -1,39 +0,0 @@
1
- 'use strict'
2
-
3
- const u = require('universalify').fromPromise
4
- const fs = require('../fs')
5
- const path = require('path')
6
- const mkdir = require('../mkdirs')
7
- const remove = require('../remove')
8
-
9
- const emptyDir = u(async function emptyDir (dir) {
10
- let items
11
- try {
12
- items = await fs.readdir(dir)
13
- } catch {
14
- return mkdir.mkdirs(dir)
15
- }
16
-
17
- return Promise.all(items.map(item => remove.remove(path.join(dir, item))))
18
- })
19
-
20
- function emptyDirSync (dir) {
21
- let items
22
- try {
23
- items = fs.readdirSync(dir)
24
- } catch {
25
- return mkdir.mkdirsSync(dir)
26
- }
27
-
28
- items.forEach(item => {
29
- item = path.join(dir, item)
30
- remove.removeSync(item)
31
- })
32
- }
33
-
34
- module.exports = {
35
- emptyDirSync,
36
- emptydirSync: emptyDirSync,
37
- emptyDir,
38
- emptydir: emptyDir
39
- }