From 92a24243e616de353b49cfcf389f811230d0cb5a Mon Sep 17 00:00:00 2001 From: David Sancho Moreno Date: Tue, 27 Jun 2023 12:32:04 +0200 Subject: [PATCH] Re-organise the entire folder structure --- dune | 2 +- lib/melange-fetch | 1 - lib/melange-runtime | 1 - {lib => packages}/belt/dune | 0 .../belt/src/_deprecated/belt_HashMapInt.ml | 0 .../src/_deprecated/belt_HashMapString.ml | 0 .../belt/src/_deprecated/belt_HashSetInt.ml | 0 .../src/_deprecated/belt_HashSetString.ml | 0 .../belt/src/_deprecated/belt_MapInt.ml | 0 .../belt/src/_deprecated/belt_MapString.ml | 0 .../src/_deprecated/belt_MutableMapInt.ml | 0 .../src/_deprecated/belt_MutableMapString.ml | 0 .../src/_deprecated/belt_MutableSetInt.ml | 0 .../src/_deprecated/belt_MutableSetString.ml | 0 .../belt/src/_deprecated/belt_SetInt.ml | 0 .../belt/src/_deprecated/belt_SetString.ml | 0 .../belt/src/_deprecated/belt_SortArrayInt.ml | 0 .../src/_deprecated/belt_SortArrayString.ml | 0 .../src/_deprecated/belt_internalMapInt.ml | 0 .../src/_deprecated/belt_internalMapString.ml | 0 .../src/_deprecated/belt_internalSetInt.ml | 0 .../src/_deprecated/belt_internalSetString.ml | 0 {lib => packages}/belt/src/belt.ml | 0 {lib => packages}/belt/src/belt_Array.ml | 0 {lib => packages}/belt/src/belt_Array.mli | 0 {lib => packages}/belt/src/belt_Float.ml | 0 {lib => packages}/belt/src/belt_Float.mli | 0 {lib => packages}/belt/src/belt_HashMap.ml | 0 {lib => packages}/belt/src/belt_HashMap.mli | 0 {lib => packages}/belt/src/belt_HashSet.ml | 0 {lib => packages}/belt/src/belt_HashSet.mli | 0 {lib => packages}/belt/src/belt_Id.ml | 0 {lib => packages}/belt/src/belt_Id.mli | 0 {lib => packages}/belt/src/belt_Int.ml | 0 {lib => packages}/belt/src/belt_Int.mli | 0 {lib => packages}/belt/src/belt_List.ml | 0 {lib => packages}/belt/src/belt_List.mli | 0 {lib => packages}/belt/src/belt_Map.ml | 0 {lib => packages}/belt/src/belt_Map.mli | 0 {lib => packages}/belt/src/belt_MapDict.ml | 0 {lib => packages}/belt/src/belt_MapDict.mli | 0 {lib => packages}/belt/src/belt_MutableMap.ml | 0 .../belt/src/belt_MutableMap.mli | 0 .../belt/src/belt_MutableQueue.ml | 0 .../belt/src/belt_MutableQueue.mli | 0 {lib => packages}/belt/src/belt_MutableSet.ml | 0 .../belt/src/belt_MutableSet.mli | 0 .../belt/src/belt_MutableStack.ml | 0 .../belt/src/belt_MutableStack.mli | 0 {lib => packages}/belt/src/belt_Option.ml | 0 {lib => packages}/belt/src/belt_Option.mli | 0 {lib => packages}/belt/src/belt_Range.ml | 0 {lib => packages}/belt/src/belt_Range.mli | 0 {lib => packages}/belt/src/belt_Result.ml | 0 {lib => packages}/belt/src/belt_Result.mli | 0 {lib => packages}/belt/src/belt_SortArray.ml | 0 {lib => packages}/belt/src/belt_SortArray.mli | 0 .../belt/src/belt_internalAVLset.ml | 0 .../belt/src/belt_internalAVLset.mli | 0 .../belt/src/belt_internalAVLtree.ml | 0 .../belt/src/belt_internalAVLtree.mli | 0 .../belt/src/belt_internalBuckets.ml | 0 .../belt/src/belt_internalBuckets.mli | 0 .../belt/src/belt_internalBucketsType.ml | 0 .../belt/src/belt_internalBucketsType.mli | 0 .../belt/src/belt_internalSetBuckets.ml | 0 .../belt/src/belt_internalSetBuckets.mli | 0 {lib => packages}/belt/src/caml_hash.ml | 0 {lib => packages}/belt/src/stubs.c | 0 {lib => packages}/belt/test/test.ml | 2 +- {lib/css => packages/css/src}/autoprefixer.ml | 0 {lib/css => packages/css/src}/colors.re | 0 {lib/css => packages/css/src}/converter.re | 0 {lib/css => packages/css/src}/css.ml | 0 {lib/css => packages/css/src}/dune | 0 {lib/css => packages/css/src}/hash.ml | 0 {lib/css => packages/css/src}/hash.mli | 0 {lib/css => packages/css/src}/properties.re | 0 {lib/css => packages/css/src}/rule.re | 0 {lib/css => packages/css/src}/values.re | 0 {test => packages/css/test}/_e2e/dune | 0 .../test}/_e2e/emotion.t/package-lock.json | 0 .../css/test}/_e2e/emotion.t/package.json | 0 .../css/test}/_e2e/emotion.t/run.t | 0 .../test}/_e2e/emotion.t/test_hasher_js.js | 0 .../css/test}/_e2e/test_hasher_ml.ml | 0 {test => packages/css/test}/dune | 0 packages/css/test/test.ml | 3 + .../css/test}/test_css_autoprefixer.ml | 0 {test => packages/css/test}/test_css_hash.ml | 0 .../css/test}/test_css_styles.ml | 0 {lib => packages}/html/dune | 0 {lib => packages}/html/html.ml | 0 {lib => packages}/intf_of_sign/dune | 0 .../intf_of_sign/intf_of_sign.ml | 0 packages/melange-fetch/src/Fetch.ml | 483 ++++++++++++++++++ packages/melange-fetch/src/Fetch.mli | 311 +++++++++++ packages/melange-fetch/src/dune | 6 + packages/melange-fetch/src/iterator.ml | 20 + packages/melange-fetch/src/iterator.mli | 19 + {lib => packages}/melange-js/dune | 0 {lib => packages}/melange-js/js.ml | 0 {lib => packages}/melange-js/js.mli | 0 {lib => packages}/melange-js/test.ml | 0 packages/melange-runtime/dom.ml | 296 +++++++++++ packages/melange-runtime/dom_storage.ml | 19 + packages/melange-runtime/dom_storage2.ml | 19 + packages/melange-runtime/dune | 6 + .../melange-webapi/src/Webapi.re | 0 .../Webapi/Canvas/Webapi__Canvas__Canvas2d.re | 0 .../Webapi/Canvas/Webapi__Canvas__WebGl.re | 0 .../Webapi/Dom/Webapi__Dom__AnimationEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Attr.re | 0 .../Dom/Webapi__Dom__BeforeUnloadEvent.re | 0 .../Webapi/Dom/Webapi__Dom__CdataSection.re | 0 .../Webapi/Dom/Webapi__Dom__CharacterData.re | 0 .../src/Webapi/Dom/Webapi__Dom__ChildNode.re | 0 .../Webapi/Dom/Webapi__Dom__ClipboardEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__CloseEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Comment.re | 0 .../Dom/Webapi__Dom__CompositionEvent.re | 0 .../Dom/Webapi__Dom__CssStyleDeclaration.re | 0 .../Webapi/Dom/Webapi__Dom__CustomEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Document.re | 0 .../Dom/Webapi__Dom__DocumentFragment.re | 0 .../Dom/Webapi__Dom__DocumentOrShadowRoot.re | 0 .../Webapi/Dom/Webapi__Dom__DocumentType.re | 0 .../Dom/Webapi__Dom__DomImplementation.re | 0 .../src/Webapi/Dom/Webapi__Dom__DomRect.re | 0 .../Webapi/Dom/Webapi__Dom__DomStringMap.re | 0 .../Webapi/Dom/Webapi__Dom__DomTokenList.re | 0 .../src/Webapi/Dom/Webapi__Dom__DragEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Element.re | 0 .../src/Webapi/Dom/Webapi__Dom__ErrorEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Event.re | 0 .../Webapi/Dom/Webapi__Dom__EventTarget.re | 0 .../src/Webapi/Dom/Webapi__Dom__FocusEvent.re | 0 .../Dom/Webapi__Dom__GlobalEventHandlers.re | 0 .../src/Webapi/Dom/Webapi__Dom__History.re | 0 .../Webapi/Dom/Webapi__Dom__HtmlCollection.re | 0 .../Webapi/Dom/Webapi__Dom__HtmlDocument.re | 0 .../Webapi/Dom/Webapi__Dom__HtmlElement.re | 0 .../Dom/Webapi__Dom__HtmlFormElement.re | 0 .../Dom/Webapi__Dom__HtmlImageElement.re | 0 .../Dom/Webapi__Dom__HtmlInputElement.re | 0 .../Dom/Webapi__Dom__IdbVersionChangeEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Image.re | 0 .../src/Webapi/Dom/Webapi__Dom__InputEvent.re | 0 .../Webapi/Dom/Webapi__Dom__KeyboardEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Location.re | 0 .../src/Webapi/Dom/Webapi__Dom__MouseEvent.re | 0 .../Dom/Webapi__Dom__MutationObserver.re | 0 .../Webapi/Dom/Webapi__Dom__MutationRecord.re | 0 .../Webapi/Dom/Webapi__Dom__NamedNodeMap.re | 0 .../src/Webapi/Dom/Webapi__Dom__Node.re | 0 .../src/Webapi/Dom/Webapi__Dom__NodeFilter.re | 0 .../Webapi/Dom/Webapi__Dom__NodeIterator.re | 0 .../src/Webapi/Dom/Webapi__Dom__NodeList.re | 0 .../Webapi__Dom__NonDocumentTypeChildNode.re | 0 .../Dom/Webapi__Dom__NonElementParentNode.re | 0 .../Dom/Webapi__Dom__PageTransitionEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__ParentNode.re | 0 .../Webapi/Dom/Webapi__Dom__PointerEvent.re | 0 .../Webapi/Dom/Webapi__Dom__PopStateEvent.re | 0 .../Dom/Webapi__Dom__ProcessingInstruction.re | 0 .../Webapi/Dom/Webapi__Dom__ProgressEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Range.re | 0 .../Webapi/Dom/Webapi__Dom__RelatedEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Selection.re | 0 .../src/Webapi/Dom/Webapi__Dom__ShadowRoot.re | 0 .../src/Webapi/Dom/Webapi__Dom__Slotable.re | 0 .../Webapi/Dom/Webapi__Dom__StorageEvent.re | 0 .../Webapi/Dom/Webapi__Dom__SvgZoomEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Text.re | 0 .../src/Webapi/Dom/Webapi__Dom__TimeEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__TouchEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__TrackEvent.re | 0 .../Dom/Webapi__Dom__TransitionEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__TreeWalker.re | 0 .../src/Webapi/Dom/Webapi__Dom__Types.re | 0 .../src/Webapi/Dom/Webapi__Dom__UiEvent.re | 0 .../Webapi/Dom/Webapi__Dom__ValidityState.re | 0 .../Dom/Webapi__Dom__WebGlContextEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__WheelEvent.re | 0 .../src/Webapi/Dom/Webapi__Dom__Window.re | 0 ...pi__ResizeObserver__ResizeObserverEntry.re | 0 .../src/Webapi/Webapi__Base64.re | 0 .../melange-webapi/src/Webapi/Webapi__Blob.re | 0 .../src/Webapi/Webapi__Canvas.re | 0 .../melange-webapi/src/Webapi/Webapi__Dom.re | 0 .../melange-webapi/src/Webapi/Webapi__File.re | 0 .../src/Webapi/Webapi__Performance.re | 0 .../src/Webapi/Webapi__ReadableStream.re | 0 .../src/Webapi/Webapi__ResizeObserver.re | 0 .../melange-webapi/src/Webapi/Webapi__Url.re | 0 {lib => packages}/melange-webapi/src/dune | 0 .../Canvas/Webapi__Canvas__Canvas2d__test.re | 0 .../Dom/Webapi__Dom__AnimationEvent__test.re | 0 .../Webapi__Dom__BeforeUnloadEvent__test.re | 0 .../Dom/Webapi__Dom__ClipboardEvent__test.re | 0 .../Dom/Webapi__Dom__CloseEvent__test.re | 0 .../Webapi__Dom__CompositionEvent__test.re | 0 .../Dom/Webapi__Dom__CustomEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Document__test.re | 0 .../Dom/Webapi__Dom__DomStringMap__test.re | 0 .../Dom/Webapi__Dom__DomTokenList__test.re | 0 .../Dom/Webapi__Dom__DragEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Element__test.re | 0 .../Dom/Webapi__Dom__ErrorEvent__test.re | 0 .../Dom/Webapi__Dom__EventTarget__test.re | 0 .../Webapi/Dom/Webapi__Dom__Event__test.re | 0 .../Dom/Webapi__Dom__FocusEvent__test.re | 0 .../Webapi__Dom__GlobalEventHandlers__test.re | 0 .../Webapi/Dom/Webapi__Dom__History__test.re | 0 .../Dom/Webapi__Dom__HtmlDocument__test.re | 0 .../Dom/Webapi__Dom__HtmlElement__test.re | 0 .../Dom/Webapi__Dom__HtmlFormElement__test.re | 0 ...ebapi__Dom__IdbVersionChangeEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Image__test.re | 0 .../Dom/Webapi__Dom__InputEvent__test.re | 0 .../Dom/Webapi__Dom__KeyboardEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Location__test.re | 0 .../Dom/Webapi__Dom__MouseEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__NodeList__test.re | 0 .../Webapi/Dom/Webapi__Dom__Node__test.re | 0 .../Webapi__Dom__PageTransitionEvent__test.re | 0 .../Dom/Webapi__Dom__PointerEvent__test.re | 0 .../Dom/Webapi__Dom__PopStateEvent__test.re | 0 .../Dom/Webapi__Dom__ProgressEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Range__test.re | 0 .../Dom/Webapi__Dom__RelatedEvent__test.re | 0 .../Dom/Webapi__Dom__Selection__test.re | 0 .../Dom/Webapi__Dom__StorageEvent__test.re | 0 .../Dom/Webapi__Dom__SvgZoomEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Text__test.re | 0 .../Dom/Webapi__Dom__TimeEvent__test.re | 0 .../Dom/Webapi__Dom__TouchEvent__test.re | 0 .../Dom/Webapi__Dom__TrackEvent__test.re | 0 .../Dom/Webapi__Dom__TransitionEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__UiEvent__test.re | 0 .../Webapi__Dom__WebGlContextEvent__test.re | 0 .../Dom/Webapi__Dom__WheelEvent__test.re | 0 .../Webapi/Dom/Webapi__Dom__Window__test.re | 0 .../tests/Webapi/Webapi__Base64__test.re | 0 .../tests/Webapi/Webapi__Blob__test.re | 0 .../tests/Webapi/Webapi__File__test.re | 0 .../tests/Webapi/Webapi__Performace__test.re | 0 .../Webapi/Webapi__ReadableStream__test.re | 0 .../Webapi/Webapi__ResizeObserver__test.re | 0 .../tests/Webapi/Webapi__Url__test.re | 0 {lib => packages}/melange-webapi/tests/_dune | 0 .../melange-webapi/tests/testHelpers.re | 0 {lib => packages}/ppx/double_hash.ml | 0 {lib => packages}/ppx/dune | 0 {lib => packages}/ppx/pipe_first.ml | 0 {lib => packages}/ppx/regex.ml | 0 {lib => packages}/ppx/test_snapshot/dune | 0 {lib => packages}/ppx/test_snapshot/input.ml | 0 {lib => packages}/ppx/test_snapshot/main.ml | 0 .../ppx/test_snapshot/output.expected | 0 {lib/react => packages/react/src}/domProps.ml | 0 .../react => packages/react/src}/domProps.mli | 0 {lib/react => packages/react/src}/dune | 0 {lib/react => packages/react/src}/react.ml | 0 {lib/react => packages/react/src}/react.mli | 0 .../react/src}/reactEvent.ml | 0 packages/react/test/dune | 10 + packages/react/test/test.ml | 1 + .../react/test}/test_cloneElement.ml | 2 +- {lib/reactDom => packages/reactDom/src}/dune | 0 .../reactDom/src}/props.ml | 0 .../reactDom/src}/reactDOM.ml | 0 .../reactDom/src}/reactDOMStyle.ml | 0 .../reactDom/src}/reactDOMStyle.mli | 0 packages/reactDom/test/dune | 10 + packages/reactDom/test/test.ml | 7 + .../reactDom/test}/test_reactDOMStyle.ml | 0 .../test}/test_renderToStaticMarkup.ml | 0 .../reactDom/test}/test_renderToString.ml | 0 .../reasonReactRouter/ReasonReactRouter.ml | 0 .../reasonReactRouter/ReasonReactRouter.mli | 0 {lib => packages}/reasonReactRouter/dune | 0 .../server-reason-react-ppx}/dune | 0 .../server-reason-react-ppx}/ppx.ml | 0 .../server-reason-react-ppx}/test/dune | 0 .../server-reason-react-ppx}/test/test.re | 38 +- .../test_snapshot/dune | 0 .../test_snapshot/input_reason.re | 0 .../test_snapshot/main.ml | 0 .../test_snapshot/reason.expected | 0 test/test.ml | 12 - test/test_react.re | 50 -- 292 files changed, 1250 insertions(+), 68 deletions(-) delete mode 160000 lib/melange-fetch delete mode 160000 lib/melange-runtime rename {lib => packages}/belt/dune (100%) rename {lib => packages}/belt/src/_deprecated/belt_HashMapInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_HashMapString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_HashSetInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_HashSetString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_MapInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_MapString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_MutableMapInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_MutableMapString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_MutableSetInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_MutableSetString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_SetInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_SetString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_SortArrayInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_SortArrayString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_internalMapInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_internalMapString.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_internalSetInt.ml (100%) rename {lib => packages}/belt/src/_deprecated/belt_internalSetString.ml (100%) rename {lib => packages}/belt/src/belt.ml (100%) rename {lib => packages}/belt/src/belt_Array.ml (100%) rename {lib => packages}/belt/src/belt_Array.mli (100%) rename {lib => packages}/belt/src/belt_Float.ml (100%) rename {lib => packages}/belt/src/belt_Float.mli (100%) rename {lib => packages}/belt/src/belt_HashMap.ml (100%) rename {lib => packages}/belt/src/belt_HashMap.mli (100%) rename {lib => packages}/belt/src/belt_HashSet.ml (100%) rename {lib => packages}/belt/src/belt_HashSet.mli (100%) rename {lib => packages}/belt/src/belt_Id.ml (100%) rename {lib => packages}/belt/src/belt_Id.mli (100%) rename {lib => packages}/belt/src/belt_Int.ml (100%) rename {lib => packages}/belt/src/belt_Int.mli (100%) rename {lib => packages}/belt/src/belt_List.ml (100%) rename {lib => packages}/belt/src/belt_List.mli (100%) rename {lib => packages}/belt/src/belt_Map.ml (100%) rename {lib => packages}/belt/src/belt_Map.mli (100%) rename {lib => packages}/belt/src/belt_MapDict.ml (100%) rename {lib => packages}/belt/src/belt_MapDict.mli (100%) rename {lib => packages}/belt/src/belt_MutableMap.ml (100%) rename {lib => packages}/belt/src/belt_MutableMap.mli (100%) rename {lib => packages}/belt/src/belt_MutableQueue.ml (100%) rename {lib => packages}/belt/src/belt_MutableQueue.mli (100%) rename {lib => packages}/belt/src/belt_MutableSet.ml (100%) rename {lib => packages}/belt/src/belt_MutableSet.mli (100%) rename {lib => packages}/belt/src/belt_MutableStack.ml (100%) rename {lib => packages}/belt/src/belt_MutableStack.mli (100%) rename {lib => packages}/belt/src/belt_Option.ml (100%) rename {lib => packages}/belt/src/belt_Option.mli (100%) rename {lib => packages}/belt/src/belt_Range.ml (100%) rename {lib => packages}/belt/src/belt_Range.mli (100%) rename {lib => packages}/belt/src/belt_Result.ml (100%) rename {lib => packages}/belt/src/belt_Result.mli (100%) rename {lib => packages}/belt/src/belt_SortArray.ml (100%) rename {lib => packages}/belt/src/belt_SortArray.mli (100%) rename {lib => packages}/belt/src/belt_internalAVLset.ml (100%) rename {lib => packages}/belt/src/belt_internalAVLset.mli (100%) rename {lib => packages}/belt/src/belt_internalAVLtree.ml (100%) rename {lib => packages}/belt/src/belt_internalAVLtree.mli (100%) rename {lib => packages}/belt/src/belt_internalBuckets.ml (100%) rename {lib => packages}/belt/src/belt_internalBuckets.mli (100%) rename {lib => packages}/belt/src/belt_internalBucketsType.ml (100%) rename {lib => packages}/belt/src/belt_internalBucketsType.mli (100%) rename {lib => packages}/belt/src/belt_internalSetBuckets.ml (100%) rename {lib => packages}/belt/src/belt_internalSetBuckets.mli (100%) rename {lib => packages}/belt/src/caml_hash.ml (100%) rename {lib => packages}/belt/src/stubs.c (100%) rename {lib => packages}/belt/test/test.ml (98%) rename {lib/css => packages/css/src}/autoprefixer.ml (100%) rename {lib/css => packages/css/src}/colors.re (100%) rename {lib/css => packages/css/src}/converter.re (100%) rename {lib/css => packages/css/src}/css.ml (100%) rename {lib/css => packages/css/src}/dune (100%) rename {lib/css => packages/css/src}/hash.ml (100%) rename {lib/css => packages/css/src}/hash.mli (100%) rename {lib/css => packages/css/src}/properties.re (100%) rename {lib/css => packages/css/src}/rule.re (100%) rename {lib/css => packages/css/src}/values.re (100%) rename {test => packages/css/test}/_e2e/dune (100%) rename {test => packages/css/test}/_e2e/emotion.t/package-lock.json (100%) rename {test => packages/css/test}/_e2e/emotion.t/package.json (100%) rename {test => packages/css/test}/_e2e/emotion.t/run.t (100%) rename {test => packages/css/test}/_e2e/emotion.t/test_hasher_js.js (100%) rename {test => packages/css/test}/_e2e/test_hasher_ml.ml (100%) rename {test => packages/css/test}/dune (100%) create mode 100644 packages/css/test/test.ml rename {test => packages/css/test}/test_css_autoprefixer.ml (100%) rename {test => packages/css/test}/test_css_hash.ml (100%) rename {test => packages/css/test}/test_css_styles.ml (100%) rename {lib => packages}/html/dune (100%) rename {lib => packages}/html/html.ml (100%) rename {lib => packages}/intf_of_sign/dune (100%) rename {lib => packages}/intf_of_sign/intf_of_sign.ml (100%) create mode 100644 packages/melange-fetch/src/Fetch.ml create mode 100644 packages/melange-fetch/src/Fetch.mli create mode 100644 packages/melange-fetch/src/dune create mode 100644 packages/melange-fetch/src/iterator.ml create mode 100644 packages/melange-fetch/src/iterator.mli rename {lib => packages}/melange-js/dune (100%) rename {lib => packages}/melange-js/js.ml (100%) rename {lib => packages}/melange-js/js.mli (100%) rename {lib => packages}/melange-js/test.ml (100%) create mode 100644 packages/melange-runtime/dom.ml create mode 100644 packages/melange-runtime/dom_storage.ml create mode 100644 packages/melange-runtime/dom_storage2.ml create mode 100644 packages/melange-runtime/dune rename {lib => packages}/melange-webapi/src/Webapi.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__Canvas2d.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__WebGl.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__AnimationEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Attr.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__CdataSection.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__CharacterData.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ChildNode.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ClipboardEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__CloseEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Comment.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__CompositionEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__CssStyleDeclaration.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__CustomEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Document.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentFragment.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentOrShadowRoot.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentType.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomImplementation.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomRect.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomStringMap.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomTokenList.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__DragEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Element.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ErrorEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Event.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__EventTarget.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__FocusEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__GlobalEventHandlers.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__History.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlCollection.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlDocument.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlElement.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlImageElement.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Image.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__InputEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__KeyboardEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Location.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__MouseEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationObserver.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationRecord.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__NamedNodeMap.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Node.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeFilter.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeIterator.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeList.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonDocumentTypeChildNode.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonElementParentNode.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__PageTransitionEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ParentNode.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__PointerEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__PopStateEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProcessingInstruction.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProgressEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Range.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__RelatedEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Selection.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ShadowRoot.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Slotable.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__StorageEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__SvgZoomEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Text.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__TimeEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__TouchEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__TrackEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__TransitionEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__TreeWalker.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Types.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__UiEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__ValidityState.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__WebGlContextEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__WheelEvent.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Dom/Webapi__Dom__Window.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/ResizeObserver/Webapi__ResizeObserver__ResizeObserverEntry.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__Base64.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__Blob.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__Canvas.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__Dom.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__File.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__Performance.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__ReadableStream.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__ResizeObserver.re (100%) rename {lib => packages}/melange-webapi/src/Webapi/Webapi__Url.re (100%) rename {lib => packages}/melange-webapi/src/dune (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Canvas/Webapi__Canvas__Canvas2d__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__AnimationEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ClipboardEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CloseEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CompositionEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CustomEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Document__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomStringMap__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DragEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Element__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ErrorEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__EventTarget__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Event__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__FocusEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__GlobalEventHandlers__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__History__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlDocument__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlElement__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlFormElement__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Image__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__InputEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__KeyboardEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Location__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__MouseEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__NodeList__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Node__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PageTransitionEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PointerEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PopStateEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ProgressEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Range__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__RelatedEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Selection__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__StorageEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__SvgZoomEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Text__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TimeEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TouchEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TrackEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TransitionEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__UiEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WebGlContextEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WheelEvent__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Window__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__Base64__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__Blob__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__File__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__Performace__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__ReadableStream__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__ResizeObserver__test.re (100%) rename {lib => packages}/melange-webapi/tests/Webapi/Webapi__Url__test.re (100%) rename {lib => packages}/melange-webapi/tests/_dune (100%) rename {lib => packages}/melange-webapi/tests/testHelpers.re (100%) rename {lib => packages}/ppx/double_hash.ml (100%) rename {lib => packages}/ppx/dune (100%) rename {lib => packages}/ppx/pipe_first.ml (100%) rename {lib => packages}/ppx/regex.ml (100%) rename {lib => packages}/ppx/test_snapshot/dune (100%) rename {lib => packages}/ppx/test_snapshot/input.ml (100%) rename {lib => packages}/ppx/test_snapshot/main.ml (100%) rename {lib => packages}/ppx/test_snapshot/output.expected (100%) rename {lib/react => packages/react/src}/domProps.ml (100%) rename {lib/react => packages/react/src}/domProps.mli (100%) rename {lib/react => packages/react/src}/dune (100%) rename {lib/react => packages/react/src}/react.ml (100%) rename {lib/react => packages/react/src}/react.mli (100%) rename {lib/react => packages/react/src}/reactEvent.ml (100%) create mode 100644 packages/react/test/dune create mode 100644 packages/react/test/test.ml rename {test => packages/react/test}/test_cloneElement.ml (99%) rename {lib/reactDom => packages/reactDom/src}/dune (100%) rename {lib/reactDom => packages/reactDom/src}/props.ml (100%) rename {lib/reactDom => packages/reactDom/src}/reactDOM.ml (100%) rename {lib/reactDom => packages/reactDom/src}/reactDOMStyle.ml (100%) rename {lib/reactDom => packages/reactDom/src}/reactDOMStyle.mli (100%) create mode 100644 packages/reactDom/test/dune create mode 100644 packages/reactDom/test/test.ml rename {test => packages/reactDom/test}/test_reactDOMStyle.ml (100%) rename {test => packages/reactDom/test}/test_renderToStaticMarkup.ml (100%) rename {test => packages/reactDom/test}/test_renderToString.ml (100%) rename lib/reasonReactRouter/reasonReactRouter.ml => packages/reasonReactRouter/ReasonReactRouter.ml (100%) rename lib/reasonReactRouter/reasonReactRouter.mli => packages/reasonReactRouter/ReasonReactRouter.mli (100%) rename {lib => packages}/reasonReactRouter/dune (100%) rename {ppx => packages/server-reason-react-ppx}/dune (100%) rename {ppx => packages/server-reason-react-ppx}/ppx.ml (100%) rename {ppx => packages/server-reason-react-ppx}/test/dune (100%) rename {ppx => packages/server-reason-react-ppx}/test/test.re (90%) rename {ppx => packages/server-reason-react-ppx}/test_snapshot/dune (100%) rename {ppx => packages/server-reason-react-ppx}/test_snapshot/input_reason.re (100%) rename {ppx => packages/server-reason-react-ppx}/test_snapshot/main.ml (100%) rename {ppx => packages/server-reason-react-ppx}/test_snapshot/reason.expected (100%) delete mode 100644 test/test.ml delete mode 100644 test/test_react.re diff --git a/dune b/dune index ed9be5934..168c980ca 100644 --- a/dune +++ b/dune @@ -1 +1 @@ -(dirs lib ppx test demo mocked-hash-js) +(dirs packages demo mocked-hash-js) diff --git a/lib/melange-fetch b/lib/melange-fetch deleted file mode 160000 index bb426ed52..000000000 --- a/lib/melange-fetch +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bb426ed525f144b43706dc2a9a19d545e8a7616e diff --git a/lib/melange-runtime b/lib/melange-runtime deleted file mode 160000 index bb426ed52..000000000 --- a/lib/melange-runtime +++ /dev/null @@ -1 +0,0 @@ -Subproject commit bb426ed525f144b43706dc2a9a19d545e8a7616e diff --git a/lib/belt/dune b/packages/belt/dune similarity index 100% rename from lib/belt/dune rename to packages/belt/dune diff --git a/lib/belt/src/_deprecated/belt_HashMapInt.ml b/packages/belt/src/_deprecated/belt_HashMapInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_HashMapInt.ml rename to packages/belt/src/_deprecated/belt_HashMapInt.ml diff --git a/lib/belt/src/_deprecated/belt_HashMapString.ml b/packages/belt/src/_deprecated/belt_HashMapString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_HashMapString.ml rename to packages/belt/src/_deprecated/belt_HashMapString.ml diff --git a/lib/belt/src/_deprecated/belt_HashSetInt.ml b/packages/belt/src/_deprecated/belt_HashSetInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_HashSetInt.ml rename to packages/belt/src/_deprecated/belt_HashSetInt.ml diff --git a/lib/belt/src/_deprecated/belt_HashSetString.ml b/packages/belt/src/_deprecated/belt_HashSetString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_HashSetString.ml rename to packages/belt/src/_deprecated/belt_HashSetString.ml diff --git a/lib/belt/src/_deprecated/belt_MapInt.ml b/packages/belt/src/_deprecated/belt_MapInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_MapInt.ml rename to packages/belt/src/_deprecated/belt_MapInt.ml diff --git a/lib/belt/src/_deprecated/belt_MapString.ml b/packages/belt/src/_deprecated/belt_MapString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_MapString.ml rename to packages/belt/src/_deprecated/belt_MapString.ml diff --git a/lib/belt/src/_deprecated/belt_MutableMapInt.ml b/packages/belt/src/_deprecated/belt_MutableMapInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_MutableMapInt.ml rename to packages/belt/src/_deprecated/belt_MutableMapInt.ml diff --git a/lib/belt/src/_deprecated/belt_MutableMapString.ml b/packages/belt/src/_deprecated/belt_MutableMapString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_MutableMapString.ml rename to packages/belt/src/_deprecated/belt_MutableMapString.ml diff --git a/lib/belt/src/_deprecated/belt_MutableSetInt.ml b/packages/belt/src/_deprecated/belt_MutableSetInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_MutableSetInt.ml rename to packages/belt/src/_deprecated/belt_MutableSetInt.ml diff --git a/lib/belt/src/_deprecated/belt_MutableSetString.ml b/packages/belt/src/_deprecated/belt_MutableSetString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_MutableSetString.ml rename to packages/belt/src/_deprecated/belt_MutableSetString.ml diff --git a/lib/belt/src/_deprecated/belt_SetInt.ml b/packages/belt/src/_deprecated/belt_SetInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_SetInt.ml rename to packages/belt/src/_deprecated/belt_SetInt.ml diff --git a/lib/belt/src/_deprecated/belt_SetString.ml b/packages/belt/src/_deprecated/belt_SetString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_SetString.ml rename to packages/belt/src/_deprecated/belt_SetString.ml diff --git a/lib/belt/src/_deprecated/belt_SortArrayInt.ml b/packages/belt/src/_deprecated/belt_SortArrayInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_SortArrayInt.ml rename to packages/belt/src/_deprecated/belt_SortArrayInt.ml diff --git a/lib/belt/src/_deprecated/belt_SortArrayString.ml b/packages/belt/src/_deprecated/belt_SortArrayString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_SortArrayString.ml rename to packages/belt/src/_deprecated/belt_SortArrayString.ml diff --git a/lib/belt/src/_deprecated/belt_internalMapInt.ml b/packages/belt/src/_deprecated/belt_internalMapInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_internalMapInt.ml rename to packages/belt/src/_deprecated/belt_internalMapInt.ml diff --git a/lib/belt/src/_deprecated/belt_internalMapString.ml b/packages/belt/src/_deprecated/belt_internalMapString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_internalMapString.ml rename to packages/belt/src/_deprecated/belt_internalMapString.ml diff --git a/lib/belt/src/_deprecated/belt_internalSetInt.ml b/packages/belt/src/_deprecated/belt_internalSetInt.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_internalSetInt.ml rename to packages/belt/src/_deprecated/belt_internalSetInt.ml diff --git a/lib/belt/src/_deprecated/belt_internalSetString.ml b/packages/belt/src/_deprecated/belt_internalSetString.ml similarity index 100% rename from lib/belt/src/_deprecated/belt_internalSetString.ml rename to packages/belt/src/_deprecated/belt_internalSetString.ml diff --git a/lib/belt/src/belt.ml b/packages/belt/src/belt.ml similarity index 100% rename from lib/belt/src/belt.ml rename to packages/belt/src/belt.ml diff --git a/lib/belt/src/belt_Array.ml b/packages/belt/src/belt_Array.ml similarity index 100% rename from lib/belt/src/belt_Array.ml rename to packages/belt/src/belt_Array.ml diff --git a/lib/belt/src/belt_Array.mli b/packages/belt/src/belt_Array.mli similarity index 100% rename from lib/belt/src/belt_Array.mli rename to packages/belt/src/belt_Array.mli diff --git a/lib/belt/src/belt_Float.ml b/packages/belt/src/belt_Float.ml similarity index 100% rename from lib/belt/src/belt_Float.ml rename to packages/belt/src/belt_Float.ml diff --git a/lib/belt/src/belt_Float.mli b/packages/belt/src/belt_Float.mli similarity index 100% rename from lib/belt/src/belt_Float.mli rename to packages/belt/src/belt_Float.mli diff --git a/lib/belt/src/belt_HashMap.ml b/packages/belt/src/belt_HashMap.ml similarity index 100% rename from lib/belt/src/belt_HashMap.ml rename to packages/belt/src/belt_HashMap.ml diff --git a/lib/belt/src/belt_HashMap.mli b/packages/belt/src/belt_HashMap.mli similarity index 100% rename from lib/belt/src/belt_HashMap.mli rename to packages/belt/src/belt_HashMap.mli diff --git a/lib/belt/src/belt_HashSet.ml b/packages/belt/src/belt_HashSet.ml similarity index 100% rename from lib/belt/src/belt_HashSet.ml rename to packages/belt/src/belt_HashSet.ml diff --git a/lib/belt/src/belt_HashSet.mli b/packages/belt/src/belt_HashSet.mli similarity index 100% rename from lib/belt/src/belt_HashSet.mli rename to packages/belt/src/belt_HashSet.mli diff --git a/lib/belt/src/belt_Id.ml b/packages/belt/src/belt_Id.ml similarity index 100% rename from lib/belt/src/belt_Id.ml rename to packages/belt/src/belt_Id.ml diff --git a/lib/belt/src/belt_Id.mli b/packages/belt/src/belt_Id.mli similarity index 100% rename from lib/belt/src/belt_Id.mli rename to packages/belt/src/belt_Id.mli diff --git a/lib/belt/src/belt_Int.ml b/packages/belt/src/belt_Int.ml similarity index 100% rename from lib/belt/src/belt_Int.ml rename to packages/belt/src/belt_Int.ml diff --git a/lib/belt/src/belt_Int.mli b/packages/belt/src/belt_Int.mli similarity index 100% rename from lib/belt/src/belt_Int.mli rename to packages/belt/src/belt_Int.mli diff --git a/lib/belt/src/belt_List.ml b/packages/belt/src/belt_List.ml similarity index 100% rename from lib/belt/src/belt_List.ml rename to packages/belt/src/belt_List.ml diff --git a/lib/belt/src/belt_List.mli b/packages/belt/src/belt_List.mli similarity index 100% rename from lib/belt/src/belt_List.mli rename to packages/belt/src/belt_List.mli diff --git a/lib/belt/src/belt_Map.ml b/packages/belt/src/belt_Map.ml similarity index 100% rename from lib/belt/src/belt_Map.ml rename to packages/belt/src/belt_Map.ml diff --git a/lib/belt/src/belt_Map.mli b/packages/belt/src/belt_Map.mli similarity index 100% rename from lib/belt/src/belt_Map.mli rename to packages/belt/src/belt_Map.mli diff --git a/lib/belt/src/belt_MapDict.ml b/packages/belt/src/belt_MapDict.ml similarity index 100% rename from lib/belt/src/belt_MapDict.ml rename to packages/belt/src/belt_MapDict.ml diff --git a/lib/belt/src/belt_MapDict.mli b/packages/belt/src/belt_MapDict.mli similarity index 100% rename from lib/belt/src/belt_MapDict.mli rename to packages/belt/src/belt_MapDict.mli diff --git a/lib/belt/src/belt_MutableMap.ml b/packages/belt/src/belt_MutableMap.ml similarity index 100% rename from lib/belt/src/belt_MutableMap.ml rename to packages/belt/src/belt_MutableMap.ml diff --git a/lib/belt/src/belt_MutableMap.mli b/packages/belt/src/belt_MutableMap.mli similarity index 100% rename from lib/belt/src/belt_MutableMap.mli rename to packages/belt/src/belt_MutableMap.mli diff --git a/lib/belt/src/belt_MutableQueue.ml b/packages/belt/src/belt_MutableQueue.ml similarity index 100% rename from lib/belt/src/belt_MutableQueue.ml rename to packages/belt/src/belt_MutableQueue.ml diff --git a/lib/belt/src/belt_MutableQueue.mli b/packages/belt/src/belt_MutableQueue.mli similarity index 100% rename from lib/belt/src/belt_MutableQueue.mli rename to packages/belt/src/belt_MutableQueue.mli diff --git a/lib/belt/src/belt_MutableSet.ml b/packages/belt/src/belt_MutableSet.ml similarity index 100% rename from lib/belt/src/belt_MutableSet.ml rename to packages/belt/src/belt_MutableSet.ml diff --git a/lib/belt/src/belt_MutableSet.mli b/packages/belt/src/belt_MutableSet.mli similarity index 100% rename from lib/belt/src/belt_MutableSet.mli rename to packages/belt/src/belt_MutableSet.mli diff --git a/lib/belt/src/belt_MutableStack.ml b/packages/belt/src/belt_MutableStack.ml similarity index 100% rename from lib/belt/src/belt_MutableStack.ml rename to packages/belt/src/belt_MutableStack.ml diff --git a/lib/belt/src/belt_MutableStack.mli b/packages/belt/src/belt_MutableStack.mli similarity index 100% rename from lib/belt/src/belt_MutableStack.mli rename to packages/belt/src/belt_MutableStack.mli diff --git a/lib/belt/src/belt_Option.ml b/packages/belt/src/belt_Option.ml similarity index 100% rename from lib/belt/src/belt_Option.ml rename to packages/belt/src/belt_Option.ml diff --git a/lib/belt/src/belt_Option.mli b/packages/belt/src/belt_Option.mli similarity index 100% rename from lib/belt/src/belt_Option.mli rename to packages/belt/src/belt_Option.mli diff --git a/lib/belt/src/belt_Range.ml b/packages/belt/src/belt_Range.ml similarity index 100% rename from lib/belt/src/belt_Range.ml rename to packages/belt/src/belt_Range.ml diff --git a/lib/belt/src/belt_Range.mli b/packages/belt/src/belt_Range.mli similarity index 100% rename from lib/belt/src/belt_Range.mli rename to packages/belt/src/belt_Range.mli diff --git a/lib/belt/src/belt_Result.ml b/packages/belt/src/belt_Result.ml similarity index 100% rename from lib/belt/src/belt_Result.ml rename to packages/belt/src/belt_Result.ml diff --git a/lib/belt/src/belt_Result.mli b/packages/belt/src/belt_Result.mli similarity index 100% rename from lib/belt/src/belt_Result.mli rename to packages/belt/src/belt_Result.mli diff --git a/lib/belt/src/belt_SortArray.ml b/packages/belt/src/belt_SortArray.ml similarity index 100% rename from lib/belt/src/belt_SortArray.ml rename to packages/belt/src/belt_SortArray.ml diff --git a/lib/belt/src/belt_SortArray.mli b/packages/belt/src/belt_SortArray.mli similarity index 100% rename from lib/belt/src/belt_SortArray.mli rename to packages/belt/src/belt_SortArray.mli diff --git a/lib/belt/src/belt_internalAVLset.ml b/packages/belt/src/belt_internalAVLset.ml similarity index 100% rename from lib/belt/src/belt_internalAVLset.ml rename to packages/belt/src/belt_internalAVLset.ml diff --git a/lib/belt/src/belt_internalAVLset.mli b/packages/belt/src/belt_internalAVLset.mli similarity index 100% rename from lib/belt/src/belt_internalAVLset.mli rename to packages/belt/src/belt_internalAVLset.mli diff --git a/lib/belt/src/belt_internalAVLtree.ml b/packages/belt/src/belt_internalAVLtree.ml similarity index 100% rename from lib/belt/src/belt_internalAVLtree.ml rename to packages/belt/src/belt_internalAVLtree.ml diff --git a/lib/belt/src/belt_internalAVLtree.mli b/packages/belt/src/belt_internalAVLtree.mli similarity index 100% rename from lib/belt/src/belt_internalAVLtree.mli rename to packages/belt/src/belt_internalAVLtree.mli diff --git a/lib/belt/src/belt_internalBuckets.ml b/packages/belt/src/belt_internalBuckets.ml similarity index 100% rename from lib/belt/src/belt_internalBuckets.ml rename to packages/belt/src/belt_internalBuckets.ml diff --git a/lib/belt/src/belt_internalBuckets.mli b/packages/belt/src/belt_internalBuckets.mli similarity index 100% rename from lib/belt/src/belt_internalBuckets.mli rename to packages/belt/src/belt_internalBuckets.mli diff --git a/lib/belt/src/belt_internalBucketsType.ml b/packages/belt/src/belt_internalBucketsType.ml similarity index 100% rename from lib/belt/src/belt_internalBucketsType.ml rename to packages/belt/src/belt_internalBucketsType.ml diff --git a/lib/belt/src/belt_internalBucketsType.mli b/packages/belt/src/belt_internalBucketsType.mli similarity index 100% rename from lib/belt/src/belt_internalBucketsType.mli rename to packages/belt/src/belt_internalBucketsType.mli diff --git a/lib/belt/src/belt_internalSetBuckets.ml b/packages/belt/src/belt_internalSetBuckets.ml similarity index 100% rename from lib/belt/src/belt_internalSetBuckets.ml rename to packages/belt/src/belt_internalSetBuckets.ml diff --git a/lib/belt/src/belt_internalSetBuckets.mli b/packages/belt/src/belt_internalSetBuckets.mli similarity index 100% rename from lib/belt/src/belt_internalSetBuckets.mli rename to packages/belt/src/belt_internalSetBuckets.mli diff --git a/lib/belt/src/caml_hash.ml b/packages/belt/src/caml_hash.ml similarity index 100% rename from lib/belt/src/caml_hash.ml rename to packages/belt/src/caml_hash.ml diff --git a/lib/belt/src/stubs.c b/packages/belt/src/stubs.c similarity index 100% rename from lib/belt/src/stubs.c rename to packages/belt/src/stubs.c diff --git a/lib/belt/test/test.ml b/packages/belt/test/test.ml similarity index 98% rename from lib/belt/test/test.ml rename to packages/belt/test/test.ml index 3b6745d08..44398d774 100644 --- a/lib/belt/test/test.ml +++ b/packages/belt/test/test.ml @@ -29,7 +29,7 @@ let _ = Belt.Array.forEachU aa (fun x -> match Js.Undefined.toOption x with | None -> print_endline "YUP" - | ((Some x) [@explicit_arity]) -> assert false) + | Some x -> assert false) let aa = Belt.Array.mapWithIndex aa (fun i _ -> i) let aaa = Belt.List.concat [ 1.0; 2.0 ] [ 3.0; 4.0 ] diff --git a/lib/css/autoprefixer.ml b/packages/css/src/autoprefixer.ml similarity index 100% rename from lib/css/autoprefixer.ml rename to packages/css/src/autoprefixer.ml diff --git a/lib/css/colors.re b/packages/css/src/colors.re similarity index 100% rename from lib/css/colors.re rename to packages/css/src/colors.re diff --git a/lib/css/converter.re b/packages/css/src/converter.re similarity index 100% rename from lib/css/converter.re rename to packages/css/src/converter.re diff --git a/lib/css/css.ml b/packages/css/src/css.ml similarity index 100% rename from lib/css/css.ml rename to packages/css/src/css.ml diff --git a/lib/css/dune b/packages/css/src/dune similarity index 100% rename from lib/css/dune rename to packages/css/src/dune diff --git a/lib/css/hash.ml b/packages/css/src/hash.ml similarity index 100% rename from lib/css/hash.ml rename to packages/css/src/hash.ml diff --git a/lib/css/hash.mli b/packages/css/src/hash.mli similarity index 100% rename from lib/css/hash.mli rename to packages/css/src/hash.mli diff --git a/lib/css/properties.re b/packages/css/src/properties.re similarity index 100% rename from lib/css/properties.re rename to packages/css/src/properties.re diff --git a/lib/css/rule.re b/packages/css/src/rule.re similarity index 100% rename from lib/css/rule.re rename to packages/css/src/rule.re diff --git a/lib/css/values.re b/packages/css/src/values.re similarity index 100% rename from lib/css/values.re rename to packages/css/src/values.re diff --git a/test/_e2e/dune b/packages/css/test/_e2e/dune similarity index 100% rename from test/_e2e/dune rename to packages/css/test/_e2e/dune diff --git a/test/_e2e/emotion.t/package-lock.json b/packages/css/test/_e2e/emotion.t/package-lock.json similarity index 100% rename from test/_e2e/emotion.t/package-lock.json rename to packages/css/test/_e2e/emotion.t/package-lock.json diff --git a/test/_e2e/emotion.t/package.json b/packages/css/test/_e2e/emotion.t/package.json similarity index 100% rename from test/_e2e/emotion.t/package.json rename to packages/css/test/_e2e/emotion.t/package.json diff --git a/test/_e2e/emotion.t/run.t b/packages/css/test/_e2e/emotion.t/run.t similarity index 100% rename from test/_e2e/emotion.t/run.t rename to packages/css/test/_e2e/emotion.t/run.t diff --git a/test/_e2e/emotion.t/test_hasher_js.js b/packages/css/test/_e2e/emotion.t/test_hasher_js.js similarity index 100% rename from test/_e2e/emotion.t/test_hasher_js.js rename to packages/css/test/_e2e/emotion.t/test_hasher_js.js diff --git a/test/_e2e/test_hasher_ml.ml b/packages/css/test/_e2e/test_hasher_ml.ml similarity index 100% rename from test/_e2e/test_hasher_ml.ml rename to packages/css/test/_e2e/test_hasher_ml.ml diff --git a/test/dune b/packages/css/test/dune similarity index 100% rename from test/dune rename to packages/css/test/dune diff --git a/packages/css/test/test.ml b/packages/css/test/test.ml new file mode 100644 index 000000000..f8c830c6d --- /dev/null +++ b/packages/css/test/test.ml @@ -0,0 +1,3 @@ +let () = + Alcotest.run "Css" + [ Test_css_styles.tests; Test_css_autoprefixer.tests; Test_css_hash.tests ] diff --git a/test/test_css_autoprefixer.ml b/packages/css/test/test_css_autoprefixer.ml similarity index 100% rename from test/test_css_autoprefixer.ml rename to packages/css/test/test_css_autoprefixer.ml diff --git a/test/test_css_hash.ml b/packages/css/test/test_css_hash.ml similarity index 100% rename from test/test_css_hash.ml rename to packages/css/test/test_css_hash.ml diff --git a/test/test_css_styles.ml b/packages/css/test/test_css_styles.ml similarity index 100% rename from test/test_css_styles.ml rename to packages/css/test/test_css_styles.ml diff --git a/lib/html/dune b/packages/html/dune similarity index 100% rename from lib/html/dune rename to packages/html/dune diff --git a/lib/html/html.ml b/packages/html/html.ml similarity index 100% rename from lib/html/html.ml rename to packages/html/html.ml diff --git a/lib/intf_of_sign/dune b/packages/intf_of_sign/dune similarity index 100% rename from lib/intf_of_sign/dune rename to packages/intf_of_sign/dune diff --git a/lib/intf_of_sign/intf_of_sign.ml b/packages/intf_of_sign/intf_of_sign.ml similarity index 100% rename from lib/intf_of_sign/intf_of_sign.ml rename to packages/intf_of_sign/intf_of_sign.ml diff --git a/packages/melange-fetch/src/Fetch.ml b/packages/melange-fetch/src/Fetch.ml new file mode 100644 index 000000000..e5e8cf6de --- /dev/null +++ b/packages/melange-fetch/src/Fetch.ml @@ -0,0 +1,483 @@ +type body +type bodyInit +type headers +type headersInit +type response +type request +type requestInit +type abortController +type signal + +(* external *) +type arrayBuffer (* TypedArray *) +type bufferSource (* Web IDL, either an arrayBuffer or arrayBufferView *) +type formData (* XMLHttpRequest *) +type readableStream (* Streams *) +type urlSearchParams (* URL *) +type blob +type file + +module AbortController = struct + type t = abortController + + external signal : t -> signal = "signal" [@@bs.get] + external abort : unit = "abort" [@@bs.send.pipe: t] + external make : unit -> t = "AbortController" [@@bs.new] +end + +type requestMethod = + | Get + | Head + | Post + | Put + | Delete + | Connect + | Options + | Trace + | Patch + | Other of string + +let encodeRequestMethod = (* internal *) + function + | Get -> "GET" + | Head -> "HEAD" + | Post -> "POST" + | Put -> "PUT" + | Delete -> "DELETE" + | Connect -> "CONNECT" + | Options -> "OPTIONS" + | Trace -> "TRACE" + | Patch -> "PATCH" + | Other method_ -> method_ + +let decodeRequestMethod = (* internal *) + function + | "GET" -> Get + | "HEAD" -> Head + | "POST" -> Post + | "PUT" -> Put + | "DELETE" -> Delete + | "CONNECT" -> Connect + | "OPTIONS" -> Options + | "TRACE" -> Trace + | "PATCH" -> Patch + | method_ -> Other method_ + +type referrerPolicy = + | None + | NoReferrer + | NoReferrerWhenDowngrade + | SameOrigin + | Origin + | StrictOrigin + | OriginWhenCrossOrigin + | StrictOriginWhenCrossOrigin + | UnsafeUrl + +let encodeReferrerPolicy = (* internal *) + function + | NoReferrer -> "no-referrer" + | None -> "" + | NoReferrerWhenDowngrade -> "no-referrer-when-downgrade" + | SameOrigin -> "same-origin" + | Origin -> "origin" + | StrictOrigin -> "strict-origin" + | OriginWhenCrossOrigin -> "origin-when-cross-origin" + | StrictOriginWhenCrossOrigin -> "strict-origin-when-cross-origin" + | UnsafeUrl -> "unsafe-url" + +let decodeReferrerPolicy = (* internal *) + function + | "no-referrer" -> NoReferrer + | "" -> None + | "no-referrer-when-downgrade" -> NoReferrerWhenDowngrade + | "same-origin" -> SameOrigin + | "origin" -> Origin + | "strict-origin" -> StrictOrigin + | "origin-when-cross-origin" -> OriginWhenCrossOrigin + | "strict-origin-when-cross-origin" -> StrictOriginWhenCrossOrigin + | "unsafe-url" -> UnsafeUrl + | e -> raise (Failure ("Unknown referrerPolicy: " ^ e)) + +type requestType = + | None (* default? unknown? just empty string in spec *) + | Audio + | Font + | Image + | Script + | Style + | Track + | Video + +let decodeRequestType = (* internal *) + function + | "audio" -> Audio + | "" -> None + | "font" -> Font + | "image" -> Image + | "script" -> Script + | "style" -> Style + | "track" -> Track + | "video" -> Video + | e -> raise (Failure ("Unknown requestType: " ^ e)) + +type requestDestination = + | None (* default? unknown? just empty string in spec *) + | Document + | Embed + | Font + | Image + | Manifest + | Media + | Object + | Report + | Script + | ServiceWorker + | SharedWorker + | Style + | Worker + | Xslt + +let decodeRequestDestination = (* internal *) + function + | "document" -> Document + | "" -> None + | "embed" -> Embed + | "font" -> Font + | "image" -> Image + | "manifest" -> Manifest + | "media" -> Media + | "object" -> Object + | "report" -> Report + | "script" -> Script + | "serviceworker" -> ServiceWorker + | "sharedworder" -> SharedWorker + | "style" -> Style + | "worker" -> Worker + | "xslt" -> Xslt + | e -> raise (Failure ("Unknown requestDestination: " ^ e)) + +type requestMode = Navigate | SameOrigin | NoCORS | CORS + +let encodeRequestMode = (* internal *) + function + | Navigate -> "navigate" + | SameOrigin -> "same-origin" + | NoCORS -> "no-cors" + | CORS -> "cors" + +let decodeRequestMode = (* internal *) + function + | "navigate" -> Navigate + | "same-origin" -> SameOrigin + | "no-cors" -> NoCORS + | "cors" -> CORS + | e -> raise (Failure ("Unknown requestMode: " ^ e)) + +type requestCredentials = Omit | SameOrigin | Include + +let encodeRequestCredentials = (* internal *) + function + | Omit -> "omit" + | SameOrigin -> "same-origin" + | Include -> "include" + +let decodeRequestCredentials = (* internal *) + function + | "omit" -> Omit + | "same-origin" -> SameOrigin + | "include" -> Include + | e -> raise (Failure ("Unknown requestCredentials: " ^ e)) + +type requestCache = + | Default + | NoStore + | Reload + | NoCache + | ForceCache + | OnlyIfCached + +let encodeRequestCache = (* internal *) + function + | Default -> "default" + | NoStore -> "no-store" + | Reload -> "reload" + | NoCache -> "no-cache" + | ForceCache -> "force-cache" + | OnlyIfCached -> "only-if-cached" + +let decodeRequestCache = (* internal *) + function + | "default" -> Default + | "no-store" -> NoStore + | "reload" -> Reload + | "no-cache" -> NoCache + | "force-cache" -> ForceCache + | "only-if-cached" -> OnlyIfCached + | e -> raise (Failure ("Unknown requestCache: " ^ e)) + +type requestRedirect = Follow | Error | Manual + +let encodeRequestRedirect = (* internal *) + function + | Follow -> "follow" + | Error -> "error" + | Manual -> "manual" + +let decodeRequestRedirect = (* internal *) + function + | "follow" -> Follow + | "error" -> Error + | "manual" -> Manual + | e -> raise (Failure ("Unknown requestRedirect: " ^ e)) + +module HeadersInit = struct + type t = headersInit + + external make : < .. > Js.t -> t = "%identity" + external makeWithDict : string Js.Dict.t -> t = "%identity" + external makeWithArray : (string * string) array -> t = "%identity" +end + +module Headers = struct + type t = headers + + (* external make : t = "Headers" [@@bs.new] *) + external makeWithInit : headersInit -> t = "Headers" [@@bs.new] + external append : string -> string -> unit = "append" [@@bs.send.pipe: t] + external delete : string -> unit = "delete" [@@bs.send.pipe: t] + (* entries *) + (* very experimental *) + + external get : string -> string option = "get" + [@@bs.send.pipe: t] [@@bs.return { null_to_opt }] + + external has : string -> bool = "has" [@@bs.send.pipe: t] + (* keys *) + (* very experimental *) + + external set : string -> string -> unit = "set" [@@bs.send.pipe: t] + (* values *) + (* very experimental *) +end + +module BodyInit = struct + type t = bodyInit + + external make : string -> t = "%identity" + external makeWithBlob : blob -> t = "%identity" + external makeWithBufferSource : bufferSource -> t = "%identity" + external makeWithFormData : formData -> t = "%identity" + external makeWithUrlSearchParams : urlSearchParams -> t = "%identity" +end + +module Body = struct + module Impl (T : sig + type t + end) = + struct + external body : T.t -> readableStream = "body" [@@bs.get] + external bodyUsed : T.t -> bool = "bodyUsed" [@@bs.get] + + (* Unsure why Js.Promise is unbound module *) + (* external arrayBuffer : arrayBuffer Js.Promise.t = "arrayBuffer" + [@@bs.send.pipe: T.t] *) + + (* external blob : blob Js.Promise.t = "blob" [@@bs.send.pipe: T.t] *) + (* external formData : formData Js.Promise.t = "formData" [@@bs.send.pipe: T.t] *) + (* external json : Js.Json.t Js.Promise.t = "json" [@@bs.send.pipe: T.t] *) + (* external text : string Js.Promise.t = "text" [@@bs.send.pipe: T.t] *) + end + + type t = body + + include Impl (struct + type nonrec t = t + end) +end + +module RequestInit = struct + type t = requestInit + + let map f = function (* internal *) + | Some v -> Some (f v) | None -> None + + external make : + ?_method:string -> + ?headers:headersInit -> + ?body:bodyInit -> + ?referrer:string -> + ?referrerPolicy:string -> + ?mode:string -> + ?credentials:string -> + ?cache:string -> + ?redirect:string -> + ?integrity:string -> + ?keepalive:bool -> + ?signal:signal -> + unit -> + requestInit = "" + [@@bs.obj] + + let make ?(method_ : requestMethod option) ?(headers : headersInit option) + ?(body : bodyInit option) ?(referrer : string option) + ?(referrerPolicy : referrerPolicy = None) ?(mode : requestMode option) + ?(credentials : requestCredentials option) ?(cache : requestCache option) + ?(redirect : requestRedirect option) ?(integrity : string = "") + ?(keepalive : bool option) ?(signal : signal option) = + make + ?_method:(map encodeRequestMethod method_) + ?headers ?body ?referrer + ~referrerPolicy:(encodeReferrerPolicy referrerPolicy) + ?mode:(map encodeRequestMode mode) + ?credentials:(map encodeRequestCredentials credentials) + ?cache:(map encodeRequestCache cache) + ?redirect:(map encodeRequestRedirect redirect) + ~integrity ?keepalive ?signal +end + +module Request = struct + type t = request + + include Body.Impl (struct + type nonrec t = t + end) + + external make : string -> t = "Request" [@@bs.new] + external makeWithInit : string -> requestInit -> t = "Request" [@@bs.new] + external makeWithRequest : t -> t = "Request" [@@bs.new] + external makeWithRequestInit : t -> requestInit -> t = "Request" [@@bs.new] + external method_ : t -> string = "method" [@@bs.get] + + let method_ : t -> requestMethod = + fun self -> decodeRequestMethod (method_ self) + + external url : t -> string = "url" [@@bs.get] + external headers : t -> headers = "headers" [@@bs.get] + external type_ : t -> string = "type" [@@bs.get] + + let type_ : t -> requestType = fun self -> decodeRequestType (type_ self) + + external destination : t -> string = "destination" [@@bs.get] + + let destination : t -> requestDestination = + fun self -> decodeRequestDestination (destination self) + + external referrer : t -> string = "referrer" [@@bs.get] + external referrerPolicy : t -> string = "referrerPolicy" [@@bs.get] + + let referrerPolicy : t -> referrerPolicy = + fun self -> decodeReferrerPolicy (referrerPolicy self) + + external mode : t -> string = "mode" [@@bs.get] + + let mode : t -> requestMode = fun self -> decodeRequestMode (mode self) + + external credentials : t -> string = "credentials" [@@bs.get] + + let credentials : t -> requestCredentials = + fun self -> decodeRequestCredentials (credentials self) + + external cache : t -> string = "cache" [@@bs.get] + + let cache : t -> requestCache = fun self -> decodeRequestCache (cache self) + + external redirect : t -> string = "redirect" [@@bs.get] + + let redirect : t -> requestRedirect = + fun self -> decodeRequestRedirect (redirect self) + + external integrity : t -> string = "integrity" [@@bs.get] + external keepalive : t -> bool = "keepalive" [@@bs.get] + external signal : t -> signal = "signal" [@@bs.get] +end + +module Response = struct + type t = response + + include Body.Impl (struct + type nonrec t = t + end) + + external error : unit -> t = "error" [@@bs.val] + external redirect : string -> t = "redirect" [@@bs.val] + + external redirectWithStatus : string -> int (* enum-ish *) -> t = "redirect" + [@@bs.val] + + external headers : t -> headers = "headers" [@@bs.get] + external ok : t -> bool = "ok" [@@bs.get] + external redirected : t -> bool = "redirected" [@@bs.get] + external status : t -> int = "status" [@@bs.get] + external statusText : t -> string = "statusText" [@@bs.get] + external type_ : t -> string = "type" [@@bs.get] + external url : t -> string = "url" [@@bs.get] + external clone : t = "clone" [@@bs.send.pipe: t] +end + +module FormData = struct + module EntryValue = struct + type t + + let classify : t -> [> `String of string | `File of file ] = + fun t -> + if Js.typeof t = "string" then `String (Obj.magic t) + else `File (Obj.magic t) + end + + module Iterator = Iterator + + type t = formData + + external make : unit -> t = "FormData" [@@bs.new] + external append : string -> string -> unit = "append" [@@bs.send.pipe: t] + external delete : string -> unit = "delete" [@@bs.send.pipe: t] + external get : string -> EntryValue.t option = "get" [@@bs.send.pipe: t] + external getAll : string -> EntryValue.t array = "getAll" [@@bs.send.pipe: t] + external set : string -> string -> unit = "set" [@@bs.send.pipe: t] + external has : string -> bool = "has" [@@bs.send.pipe: t] + external keys : t -> string Iterator.t = "keys" [@@bs.send] + external values : t -> EntryValue.t Iterator.t = "values" [@@bs.send] + + external appendObject : string -> < .. > Js.t -> ?filename:string -> unit + = "append" + [@@bs.send.pipe: t] + + external appendBlob : string -> blob -> ?filename:string -> unit = "append" + [@@bs.send.pipe: t] + + external appendFile : string -> file -> ?filename:string -> unit = "append" + [@@bs.send.pipe: t] + + external setObject : string -> < .. > Js.t -> ?filename:string -> unit = "set" + [@@bs.send.pipe: t] + + external setBlob : string -> blob -> ?filename:string -> unit = "set" + [@@bs.send.pipe: t] + + external setFile : string -> file -> ?filename:string -> unit = "set" + [@@bs.send.pipe: t] + + external entries : t -> (string * EntryValue.t) Iterator.t = "entries" + [@@bs.send] +end + +(* external fetch : string -> response Js.Promise.t = "fetch" [@@bs.val] + + external fetchWithInit : + string + -> requestInit + -> response Js.Promise.t + = "fetch" + [@@bs.val] + + external fetchWithRequest : request -> response Js.Promise.t = "fetch" + [@@bs.val] + + external fetchWithRequestInit : + request + -> requestInit + -> response Js.Promise.t + = "fetch" + [@@bs.val] +*) diff --git a/packages/melange-fetch/src/Fetch.mli b/packages/melange-fetch/src/Fetch.mli new file mode 100644 index 000000000..025298b43 --- /dev/null +++ b/packages/melange-fetch/src/Fetch.mli @@ -0,0 +1,311 @@ +type body +type bodyInit +type headers +type headersInit +type response +type request +type requestInit + +(* external *) +type arrayBuffer (* TypedArray *) +type bufferSource (* Web IDL, either an arrayBuffer or arrayBufferView *) +type formData (* XMLHttpRequest *) +type readableStream (* Streams *) +type urlSearchParams (* URL *) +type abortController +type signal + +(** File API *) + +type blob +type file + +type requestMethod = + | Get + | Head + | Post + | Put + | Delete + | Connect + | Options + | Trace + | Patch + | Other of string + +module AbortController : sig + (* Experimental API *) + type t = abortController + + (* Experimental API *) + external signal : t -> signal = "signal" [@@bs.get] + + (* Experimental API *) + external abort : unit = "abort" [@@bs.send.pipe: t] + + (* Experimental API *) + external make : unit -> t = "AbortController" [@@bs.new] +end + +type referrerPolicy = + | None + | NoReferrer + | NoReferrerWhenDowngrade + | SameOrigin + | Origin + | StrictOrigin + | OriginWhenCrossOrigin + | StrictOriginWhenCrossOrigin + | UnsafeUrl + +type requestType = + | None (* default? unknown? just empty string in spec *) + | Audio + | Font + | Image + | Script + | Style + | Track + | Video + +type requestDestination = + | None (* default? unknown? just empty string in spec *) + | Document + | Embed + | Font + | Image + | Manifest + | Media + | Object + | Report + | Script + | ServiceWorker + | SharedWorker + | Style + | Worker + | Xslt + +type requestMode = Navigate | SameOrigin | NoCORS | CORS +type requestCredentials = Omit | SameOrigin | Include + +type requestCache = + | Default + | NoStore + | Reload + | NoCache + | ForceCache + | OnlyIfCached + +type requestRedirect = Follow | Error | Manual + +module HeadersInit : sig + type t = headersInit + + external make : < .. > Js.t -> t = "%identity" + external makeWithDict : string Js.Dict.t -> t = "%identity" + external makeWithArray : (string * string) array -> t = "%identity" +end + +module Headers : sig + type t = headers + + (* external make : t = "Headers" [@@bs.new] *) + external makeWithInit : headersInit -> t = "Headers" [@@bs.new] + external append : string -> string -> unit = "append" [@@bs.send.pipe: t] + external delete : string -> unit = "delete" [@@bs.send.pipe: t] + (* entries *) + (* very experimental *) + + external get : string -> string option = "get" + [@@bs.send.pipe: t] [@@bs.return { null_to_opt }] + + external has : string -> bool = "has" [@@bs.send.pipe: t] + (* keys *) + (* very experimental *) + + external set : string -> string -> unit = "set" [@@bs.send.pipe: t] + (* values *) + (* very experimental *) +end + +module BodyInit : sig + type t = bodyInit + + external make : string -> t = "%identity" + external makeWithBlob : blob -> t = "%identity" + external makeWithBufferSource : bufferSource -> t = "%identity" + external makeWithFormData : formData -> t = "%identity" + external makeWithUrlSearchParams : urlSearchParams -> t = "%identity" +end + +module Body : sig + type t = body + + external body : t -> readableStream = "body" [@@bs.get] + external bodyUsed : t -> bool = "bodyUsed" [@@bs.get] + + (* Unsure why Js.Promise is unbound module *) + (* external arrayBuffer : arrayBuffer Js.Promise.t = "arrayBuffer" + [@@bs.send.pipe: t] *) + + (* external blob : blob Js.Promise.t = "blob" [@@bs.send.pipe: t] *) + (* external formData : formData Js.Promise.t = "formData" [@@bs.send.pipe: t] *) + (* external json : Js.Json.t Js.Promise.t = "json" [@@bs.send.pipe: t] *) + (* external text : string Js.Promise.t = "text" [@@bs.send.pipe: t] *) +end + +module RequestInit : sig + type t = requestInit + + val make : + ?method_:requestMethod -> + ?headers:headersInit -> + ?body:bodyInit -> + ?referrer:string -> + ?referrerPolicy:referrerPolicy -> + ?mode:requestMode -> + ?credentials:requestCredentials -> + ?cache:requestCache -> + ?redirect:requestRedirect -> + ?integrity:string -> + ?keepalive:bool -> + ?signal:signal -> + unit -> + t +end + +module Request : sig + type t = request + + external make : string -> t = "Request" [@@bs.new] + external makeWithInit : string -> requestInit -> t = "Request" [@@bs.new] + external makeWithRequest : t -> t = "Request" [@@bs.new] + external makeWithRequestInit : t -> requestInit -> t = "Request" [@@bs.new] + val method_ : t -> requestMethod + external url : t -> string = "url" [@@bs.get] + external headers : t -> headers = "headers" [@@bs.get] + val type_ : t -> requestType + val destination : t -> requestDestination + external referrer : t -> string = "referrer" [@@bs.get] + val referrerPolicy : t -> referrerPolicy + val mode : t -> requestMode + val credentials : t -> requestCredentials + val cache : t -> requestCache + val redirect : t -> requestRedirect + external integrity : t -> string = "integrity" [@@bs.get] + external keepalive : t -> bool = "keepalive" [@@bs.get] + external signal : t -> signal = "signal" [@@bs.get] + + (* Body Impl *) + external body : t -> readableStream = "body" [@@bs.get] + external bodyUsed : t -> bool = "bodyUsed" [@@bs.get] + + (* Unsure why Js.Promise is unbound module *) + (* external arrayBuffer : arrayBuffer Js.Promise.t = "arrayBuffer" *) + (* [@@bs.send.pipe: t] *) + (* external blob : blob Js.Promise.t = "blob" [@@bs.send.pipe: t] *) + (* external formData : formData Js.Promise.t = "formData" [@@bs.send.pipe: t] *) + (* external json : Js.Json.t Js.Promise.t = "json" [@@bs.send.pipe: t] *) + (* external text : string Js.Promise.t = "text" [@@bs.send.pipe: t] *) +end + +module Response : sig + type t = response + + external error : unit -> t = "error" [@@bs.val] + external redirect : string -> t = "redirect" [@@bs.val] + + external redirectWithStatus : string -> int (* enum-ish *) -> t = "redirect" + [@@bs.val] + + external headers : t -> headers = "headers" [@@bs.get] + external ok : t -> bool = "ok" [@@bs.get] + external redirected : t -> bool = "redirected" [@@bs.get] + external status : t -> int = "status" [@@bs.get] + external statusText : t -> string = "statusText" [@@bs.get] + external type_ : t -> string = "type" [@@bs.get] + external url : t -> string = "url" [@@bs.get] + external clone : t = "clone" [@@bs.send.pipe: t] + + (* Body.Impl *) + external body : t -> readableStream = "body" [@@bs.get] + external bodyUsed : t -> bool = "bodyUsed" [@@bs.get] + + (* Unsure why Js.Promise is unbound module *) + (* external arrayBuffer : arrayBuffer Js.Promise.t = "arrayBuffer" [@@bs.send.pipe: t] *) + (* external blob : blob Js.Promise.t = "blob" [@@bs.send.pipe: t] *) + (* external formData : formData Js.Promise.t = "formData" [@@bs.send.pipe: t] *) + (* external json : Js.Json.t Js.Promise.t = "json" [@@bs.send.pipe: t] *) + (* external text : string Js.Promise.t = "text" [@@bs.send.pipe: t] *) +end + +module FormData : sig + module EntryValue : sig + type t + (** This represents a + {{:https://developer.mozilla.org/en-US/docs/Web/API/FormDataEntryValue} + FormDataEntryValue}. *) + + val classify : t -> [> `String of string | `File of file ] + (** [classify entryValue] safely casts the [entryValue] to its correct + runtime type. *) + end + + module Iterator = Iterator + + type t = formData + + external make : unit -> t = "FormData" [@@bs.new] + external append : string -> string -> unit = "append" [@@bs.send.pipe: t] + external delete : string -> unit = "delete" [@@bs.send.pipe: t] + external get : string -> EntryValue.t option = "get" [@@bs.send.pipe: t] + external getAll : string -> EntryValue.t array = "getAll" [@@bs.send.pipe: t] + external set : string -> string -> unit = "set" [@@bs.send.pipe: t] + external has : string -> bool = "has" [@@bs.send.pipe: t] + external keys : t -> string Iterator.t = "keys" [@@bs.send] + external values : t -> EntryValue.t Iterator.t = "values" [@@bs.send] + + external appendObject : string -> < .. > Js.t -> ?filename:string -> unit + = "append" + [@@bs.send.pipe: t] + (** This is for React Native compatibility purposes *) + + external appendBlob : string -> blob -> ?filename:string -> unit = "append" + [@@bs.send.pipe: t] + + external appendFile : string -> file -> ?filename:string -> unit = "append" + [@@bs.send.pipe: t] + + external setObject : string -> < .. > Js.t -> ?filename:string -> unit = "set" + [@@bs.send.pipe: t] + (** This is for React Native compatibility purposes *) + + external setBlob : string -> blob -> ?filename:string -> unit = "set" + [@@bs.send.pipe: t] + + external setFile : string -> file -> ?filename:string -> unit = "set" + [@@bs.send.pipe: t] + + external entries : t -> (string * EntryValue.t) Iterator.t = "entries" + [@@bs.send] +end + +(* Unsure why Js.Promise is unbound module *) +(* external fetch : string -> response Js.Promise.t = "fetch" [@@bs.val] *) + +(* external fetchWithInit : + string + -> requestInit + -> response Js.Promise.t + = "fetch" + [@@bs.val] *) + +(* external fetchWithRequest : request -> response Js.Promise.t = "fetch" + [@@bs.val] *) + +(* external fetchWithRequestInit : + request + -> requestInit + -> response Js.Promise.t + = "fetch" + [@@bs.val] +*) diff --git a/packages/melange-fetch/src/dune b/packages/melange-fetch/src/dune new file mode 100644 index 000000000..4e63668f8 --- /dev/null +++ b/packages/melange-fetch/src/dune @@ -0,0 +1,6 @@ +(library + (name fetch) + (public_name server-reason-react.melange-fetch) + (libraries server-reason-react.js server-reason-react.melange-runtime) + (preprocess + (pps melange.ppx))) diff --git a/packages/melange-fetch/src/iterator.ml b/packages/melange-fetch/src/iterator.ml new file mode 100644 index 000000000..a4fab199f --- /dev/null +++ b/packages/melange-fetch/src/iterator.ml @@ -0,0 +1,20 @@ +module Next = struct + type 'a t + + external done_ : _ t -> bool option = "done" [@@bs.get] + external value : 'a t -> 'a option = "value" [@@bs.get] [@@bs.return nullable] +end + +type 'a t + +external next : 'a t -> 'a Next.t = "next" [@@bs.send] + +let rec forEach ~f t = + let item = next t in + match Next.(done_ item, value item) with + | Some true, Some value -> f value + | Some true, None -> () + | (Some false | None), Some value -> + f value; + forEach ~f t + | (Some false | None), None -> forEach ~f t diff --git a/packages/melange-fetch/src/iterator.mli b/packages/melange-fetch/src/iterator.mli new file mode 100644 index 000000000..e9bbd507b --- /dev/null +++ b/packages/melange-fetch/src/iterator.mli @@ -0,0 +1,19 @@ +(** We need to bind to JavaScript Iterators for FormData functionality. + But ideally this binding should be moved into BuckleScript itself. + + @see {{: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols}} *) + +module Next : sig + type 'a t + + external done_ : _ t -> bool option = "done" [@@bs.get] + external value : 'a t -> 'a option = "value" [@@bs.get] [@@bs.return nullable] +end + +type 'a t + +val forEach : f:('a -> unit) -> 'a t -> unit +(** [forEach ~f iterator] runs [f] on each item returned by the [iterator]. This + is not defined by the platform but a convenience function. *) + +external next : 'a t -> 'a Next.t = "next" [@@bs.send] diff --git a/lib/melange-js/dune b/packages/melange-js/dune similarity index 100% rename from lib/melange-js/dune rename to packages/melange-js/dune diff --git a/lib/melange-js/js.ml b/packages/melange-js/js.ml similarity index 100% rename from lib/melange-js/js.ml rename to packages/melange-js/js.ml diff --git a/lib/melange-js/js.mli b/packages/melange-js/js.mli similarity index 100% rename from lib/melange-js/js.mli rename to packages/melange-js/js.mli diff --git a/lib/melange-js/test.ml b/packages/melange-js/test.ml similarity index 100% rename from lib/melange-js/test.ml rename to packages/melange-js/test.ml diff --git a/packages/melange-runtime/dom.ml b/packages/melange-runtime/dom.ml new file mode 100644 index 000000000..73cf52ec8 --- /dev/null +++ b/packages/melange-runtime/dom.ml @@ -0,0 +1,296 @@ +type _baseClass +type animation (* Web Animations API *) + +(* TODO: Should we bother with this indirection? + (* core *) + type domString = string + type domTimestamp = float +*) + +(* css *) +type cssStyleDeclaration +type cssStyleSheet + +(* events (early) *) +type 'a eventTarget_like +type eventTarget = _baseClass eventTarget_like + +(* nodes *) +type 'a _node +type 'a node_like = 'a _node eventTarget_like +type node = _baseClass node_like +type _attr +type attr = _attr node_like +type 'a _characterData +type 'a characterData_like = 'a _characterData node_like +type characterData = _baseClass characterData_like +type _cdataSection +type cdataSection = _cdataSection characterData_like +type _comment +type comment = _comment characterData_like +type 'a _document +type 'a document_like = 'a _document node_like +type document = _baseClass document_like +type _documentFragment +type documentFragment = _documentFragment node_like +type _documentType +type documentType = _documentType node_like +type domImplementation +type 'a _element +type 'a element_like = 'a _element node_like +type element = _baseClass element_like +type htmlCollection +type htmlFormControlsCollection +type htmlOptionsCollection +type intersectionObserver +type intersectionObserverEntry +type mutationObserver +type mutationRecord +type performanceObserver +type performanceObserverEntryList +type reportingObserver +type reportingObserverOptions +type resizeObserver +type resizeObserverEntry +type namedNodeMap +type nodeList +type radioNodeList +type processingInstruction +type _shadowRoot +type shadowRoot = _shadowRoot node_like +type _text +type text = _text characterData_like + +(* geometry *) +type domRect + +(* html *) +type dataTransfer (* Drag and Drop API *) +type domStringMap +type history +type _htmlDocument +type htmlDocument = _htmlDocument document_like +type 'a _htmlElement +type 'a htmlElement_like = 'a _htmlElement element_like +type htmlElement = _baseClass htmlElement_like +type _htmlAnchorElement +type htmlAnchorElement = _htmlAnchorElement htmlElement_like +type _htmlAreaElement +type htmlAreaElement = _htmlAreaElement htmlElement_like +type _htmlAudioElement +type htmlAudioElement = _htmlAudioElement htmlElement_like +type _htmlBaseElement +type htmlBaseElement = _htmlBaseElement htmlElement_like +type _htmlBodyElement +type htmlBodyElement = _htmlBodyElement htmlElement_like +type _htmlBrElement +type htmlBrElement = _htmlBrElement htmlElement_like +type _htmlButtonElement +type htmlButtonElement = _htmlButtonElement htmlElement_like +type _htmlCanvasElement +type htmlCanvasElement = _htmlCanvasElement htmlElement_like +type _htmlDataElement +type htmlDataElement = _htmlDataElement htmlElement_like +type _htmlDataListElement +type htmlDataListElement = _htmlDataListElement htmlElement_like +type _htmlDialogElement +type htmlDialogElement = _htmlDialogElement htmlElement_like +type _htmlDivElement +type htmlDivElement = _htmlDivElement htmlElement_like +type _htmlDlistElement +type htmlDlistElement = _htmlDlistElement htmlElement_like +type _htmlEmbedElement +type htmlEmbedElement = _htmlEmbedElement htmlElement_like +type _htmlFieldSetElement +type htmlFieldSetElement = _htmlFieldSetElement htmlElement_like +type _htmlFormElement +type htmlFormElement = _htmlFormElement htmlElement_like +type _htmlHeadElement +type htmlHeadElement = _htmlHeadElement htmlElement_like +type _htmlHeadingElement +type htmlHeadingElement = _htmlHeadingElement htmlElement_like +type _htmlHrElement +type htmlHrElement = _htmlHrElement htmlElement_like +type _htmlHtmlElement +type htmlHtmlElement = _htmlHtmlElement htmlElement_like +type _htmlIframeElement +type htmlIframeElement = _htmlIframeElement htmlElement_like +type _htmlImageElement +type htmlImageElement = _htmlImageElement htmlElement_like +type _htmlInputElement +type htmlInputElement = _htmlInputElement htmlElement_like +type _htmlLabelElement +type htmlLabelElement = _htmlLabelElement htmlElement_like +type _htmlLegendElement +type htmlLegendElement = _htmlLegendElement htmlElement_like +type _htmlLiElement +type htmlLiElement = _htmlLiElement htmlElement_like +type _htmlLinkElement +type htmlLinkElement = _htmlLinkElement htmlElement_like +type _htmlMapElement +type htmlMapElement = _htmlMapElement htmlElement_like +type _htmlMediaElement +type htmlMediaElement = _htmlMediaElement htmlElement_like +type _htmlMenuElement +type htmlMenuElement = _htmlMenuElement htmlElement_like +type _htmlMetaElement +type htmlMetaElement = _htmlMetaElement htmlElement_like +type _htmlMeterElement +type htmlMeterElement = _htmlMeterElement htmlElement_like +type _htmlModElement +type htmlModElement = _htmlModElement htmlElement_like +type _htmlOListElement +type htmlOListElement = _htmlOListElement htmlElement_like +type _htmlObjectElement +type htmlObjectElement = _htmlObjectElement htmlElement_like +type _htmlOptGroupElement +type htmlOptGroupElement = _htmlOptGroupElement htmlElement_like +type _htmlOptionElement +type htmlOptionElement = _htmlOptionElement htmlElement_like +type _htmlOutputElement +type htmlOutputElement = _htmlOutputElement htmlElement_like +type _htmlParagraphElement +type htmlParagraphElement = _htmlParagraphElement htmlElement_like +type _htmlParamElement +type htmlParamElement = _htmlParamElement htmlElement_like +type _htmlPreElement +type htmlPreElement = _htmlPreElement htmlElement_like +type _htmlProgressElement +type htmlProgressElement = _htmlProgressElement htmlElement_like +type _htmlQuoteElement +type htmlQuoteElement = _htmlQuoteElement htmlElement_like +type _htmlScriptElement +type htmlScriptElement = _htmlScriptElement htmlElement_like +type _htmlSelectElement +type htmlSelectElement = _htmlSelectElement htmlElement_like +type _htmlSlotElement +type htmlSlotElement = _htmlSlotElement htmlElement_like +type _htmlSourceElement +type htmlSourceElement = _htmlSourceElement htmlElement_like +type _htmlSpanElement +type htmlSpanElement = _htmlSpanElement htmlElement_like +type _htmlStyleElement +type htmlStyleElement = _htmlStyleElement htmlElement_like +type _htmlTableCaptionElement +type htmlTableCaptionElement = _htmlTableCaptionElement htmlElement_like +type _htmlTableCellElement +type htmlTableCellElement = _htmlTableCellElement htmlElement_like +type _htmlTableColElement +type htmlTableColElement = _htmlTableColElement htmlElement_like +type _htmlTableDataCellElement +type htmlTableDataCellElement = _htmlTableDataCellElement htmlElement_like +type _htmlTableElement +type htmlTableElement = _htmlTableElement htmlElement_like +type _htmlTableHeaderCellElement +type htmlTableHeaderCellElement = _htmlTableHeaderCellElement htmlElement_like +type _htmlTableRowElement +type htmlTableRowElement = _htmlTableRowElement htmlElement_like +type _htmlTableSectionElement +type htmlTableSectionElement = _htmlTableSectionElement htmlElement_like +type _htmlTextAreaElement +type htmlTextAreaElement = _htmlTextAreaElement htmlElement_like +type _htmlTimeElement +type htmlTimeElement = _htmlTimeElement htmlElement_like +type _htmlTitleElement +type htmlTitleElement = _htmlTitleElement htmlElement_like +type _htmlTrackElement +type htmlTrackElement = _htmlTrackElement htmlElement_like +type _htmlUlistElement +type htmlUlistElement = _htmlUlistElement htmlElement_like +type _htmlUnknownElement +type htmlUnknownElement = _htmlUnknownElement htmlElement_like +type _htmlVideoElement +type htmlVideoElement = _htmlVideoElement htmlElement_like +type location +type window +type _xmlDocument +type xmlDocument = _xmlDocument document_like + +(* events *) +type 'a event_like +type event = _baseClass event_like +type 'a _uiEvent +type 'a uiEvent_like = 'a _uiEvent event_like +type uiEvent = _baseClass uiEvent_like +type _animationEvent +type animationEvent = _animationEvent event_like +type _beforeUnloadEvent +type beforeUnloadEvent = _beforeUnloadEvent event_like +type _clipboardEvent +type clipboardEvent = _clipboardEvent event_like +type _closeEvent +type closeEvent = _closeEvent event_like +type _compositionEvent +type compositionEvent = _compositionEvent uiEvent_like +type _customEvent +type customEvent = _customEvent event_like +type _dragEvent +type dragEvent = _dragEvent event_like +type _errorEvent +type errorEvent = _errorEvent event_like +type _focusEvent +type focusEvent = _focusEvent uiEvent_like +type _idbVersionChangeEvent +type idbVersionChangeEvent = _idbVersionChangeEvent event_like +type _inputEvent +type inputEvent = _inputEvent uiEvent_like +type _keyboardEvent +type keyboardEvent = _keyboardEvent uiEvent_like +type 'a _mouseEvent +type 'a mouseEvent_like = 'a _mouseEvent uiEvent_like +type mouseEvent = _baseClass mouseEvent_like +type _pageTransitionEvent +type pageTransitionEvent = _pageTransitionEvent event_like +type _pointerEvent +type pointerEvent = _pointerEvent mouseEvent_like +type _popStateEvent +type popStateEvent = _popStateEvent event_like +type _progressEvent +type progressEvent = _progressEvent event_like +type _relatedEvent +type relatedEvent = _relatedEvent event_like +type _storageEvent +type storageEvent = _storageEvent event_like +type _svgZoomEvent +type svgZoomEvent = _svgZoomEvent event_like +type _timeEvent +type timeEvent = _timeEvent event_like +type _touchEvent +type touchEvent = _touchEvent uiEvent_like +type _trackEvent +type trackEvent = _trackEvent event_like +type _transitionEvent +type transitionEvent = _transitionEvent event_like +type _webGlContextEvent +type webGlContextEvent = _webGlContextEvent event_like +type _wheelEvent +type wheelEvent = _wheelEvent uiEvent_like + +(* ranges *) +type range + +(* selection (TODO: move out of dom?) *) +type selection + +(* sets *) +type domTokenList +type domSettableTokenList + +(* traversal *) +type nodeFilter = { + acceptNode : element -> int; + (* return type should be NodeFilter.action, but that would create a cycle *) +} + +type nodeIterator +type treeWalker + +(* SVG *) +type svgRect +type svgPoint + +(* special *) +type eventPointerId + +module Storage = Dom_storage +module Storage2 = Dom_storage2 diff --git a/packages/melange-runtime/dom_storage.ml b/packages/melange-runtime/dom_storage.ml new file mode 100644 index 000000000..ad3b850cd --- /dev/null +++ b/packages/melange-runtime/dom_storage.ml @@ -0,0 +1,19 @@ +type t = Dom_storage2.t + +external getItem : string -> string option = "getItem" + [@@bs.send.pipe: t] [@@bs.return null_to_opt] + +external setItem : string -> string -> unit = "setItem" [@@bs.send.pipe: t] +external removeItem : string -> unit = "removeItem" [@@bs.send.pipe: t] +external clear : unit = "clear" [@@bs.send.pipe: t] + +external key : int -> string option = "key" + [@@bs.send.pipe: t] [@@bs.return null_to_opt] + +external length : t -> int = "length" [@@bs.get] + +(* external localStorage : t = "localStorage" [@@bs.val] *) +let localStorage = assert false + +(* external sessionStorage : t = "sessionStorage" [@@bs.val] *) +let sessionStorage = assert false diff --git a/packages/melange-runtime/dom_storage2.ml b/packages/melange-runtime/dom_storage2.ml new file mode 100644 index 000000000..305eb9755 --- /dev/null +++ b/packages/melange-runtime/dom_storage2.ml @@ -0,0 +1,19 @@ +type t + +external getItem : t -> string -> string option = "getItem" + [@@bs.send] [@@bs.return null_to_opt] + +external setItem : t -> string -> string -> unit = "setItem" [@@bs.send] +external removeItem : t -> string -> unit = "removeItem" [@@bs.send] +external clear : t -> unit = "clear" [@@bs.send] + +external key : t -> int -> string option = "key" + [@@bs.send] [@@bs.return null_to_opt] + +external length : t -> int = "length" [@@bs.get] + +(* external localStorage : t = "localStorage" [@@bs.val] *) +let localStorage = assert false + +(* external sessionStorage : t = "sessionStorage" [@@bs.val] *) +let sessionStorage = assert false diff --git a/packages/melange-runtime/dune b/packages/melange-runtime/dune new file mode 100644 index 000000000..c6d3afa71 --- /dev/null +++ b/packages/melange-runtime/dune @@ -0,0 +1,6 @@ +(library + (name runtime) + (public_name server-reason-react.melange-runtime) + (wrapped false) + (preprocess + (pps melange.ppx))) diff --git a/lib/melange-webapi/src/Webapi.re b/packages/melange-webapi/src/Webapi.re similarity index 100% rename from lib/melange-webapi/src/Webapi.re rename to packages/melange-webapi/src/Webapi.re diff --git a/lib/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__Canvas2d.re b/packages/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__Canvas2d.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__Canvas2d.re rename to packages/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__Canvas2d.re diff --git a/lib/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__WebGl.re b/packages/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__WebGl.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__WebGl.re rename to packages/melange-webapi/src/Webapi/Canvas/Webapi__Canvas__WebGl.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__AnimationEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__AnimationEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__AnimationEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__AnimationEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Attr.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Attr.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Attr.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Attr.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CdataSection.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CdataSection.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CdataSection.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CdataSection.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CharacterData.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CharacterData.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CharacterData.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CharacterData.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ChildNode.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ChildNode.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ChildNode.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ChildNode.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ClipboardEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ClipboardEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ClipboardEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ClipboardEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CloseEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CloseEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CloseEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CloseEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Comment.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Comment.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Comment.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Comment.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CompositionEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CompositionEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CompositionEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CompositionEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CssStyleDeclaration.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CssStyleDeclaration.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CssStyleDeclaration.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CssStyleDeclaration.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CustomEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CustomEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__CustomEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__CustomEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Document.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Document.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Document.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Document.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentFragment.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentFragment.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentFragment.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentFragment.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentOrShadowRoot.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentOrShadowRoot.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentOrShadowRoot.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentOrShadowRoot.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentType.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentType.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentType.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DocumentType.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomImplementation.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomImplementation.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomImplementation.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomImplementation.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomRect.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomRect.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomRect.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomRect.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomStringMap.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomStringMap.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomStringMap.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomStringMap.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomTokenList.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomTokenList.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomTokenList.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DomTokenList.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DragEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DragEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__DragEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__DragEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Element.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Element.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Element.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Element.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ErrorEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ErrorEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ErrorEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ErrorEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Event.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Event.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Event.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Event.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__EventTarget.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__EventTarget.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__EventTarget.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__EventTarget.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__FocusEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__FocusEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__FocusEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__FocusEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__GlobalEventHandlers.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__GlobalEventHandlers.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__GlobalEventHandlers.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__GlobalEventHandlers.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__History.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__History.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__History.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__History.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlCollection.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlCollection.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlCollection.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlCollection.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlDocument.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlDocument.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlDocument.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlDocument.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlElement.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlElement.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlElement.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlElement.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlFormElement.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlImageElement.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlImageElement.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlImageElement.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlImageElement.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__HtmlInputElement.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Image.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Image.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Image.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Image.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__InputEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__InputEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__InputEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__InputEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__KeyboardEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__KeyboardEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__KeyboardEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__KeyboardEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Location.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Location.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Location.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Location.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__MouseEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__MouseEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__MouseEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__MouseEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationObserver.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationObserver.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationObserver.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationObserver.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationRecord.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationRecord.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationRecord.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__MutationRecord.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NamedNodeMap.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NamedNodeMap.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NamedNodeMap.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NamedNodeMap.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Node.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Node.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Node.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Node.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeFilter.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeFilter.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeFilter.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeFilter.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeIterator.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeIterator.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeIterator.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeIterator.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeList.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeList.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeList.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NodeList.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonDocumentTypeChildNode.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonDocumentTypeChildNode.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonDocumentTypeChildNode.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonDocumentTypeChildNode.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonElementParentNode.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonElementParentNode.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonElementParentNode.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__NonElementParentNode.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__PageTransitionEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__PageTransitionEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__PageTransitionEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__PageTransitionEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ParentNode.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ParentNode.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ParentNode.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ParentNode.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__PointerEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__PointerEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__PointerEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__PointerEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__PopStateEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__PopStateEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__PopStateEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__PopStateEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProcessingInstruction.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProcessingInstruction.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProcessingInstruction.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProcessingInstruction.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProgressEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProgressEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProgressEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ProgressEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Range.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Range.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Range.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Range.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__RelatedEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__RelatedEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__RelatedEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__RelatedEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Selection.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Selection.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Selection.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Selection.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ShadowRoot.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ShadowRoot.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ShadowRoot.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ShadowRoot.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Slotable.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Slotable.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Slotable.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Slotable.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__StorageEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__StorageEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__StorageEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__StorageEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__SvgZoomEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__SvgZoomEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__SvgZoomEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__SvgZoomEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Text.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Text.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Text.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Text.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TimeEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TimeEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TimeEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TimeEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TouchEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TouchEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TouchEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TouchEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TrackEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TrackEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TrackEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TrackEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TransitionEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TransitionEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TransitionEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TransitionEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TreeWalker.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TreeWalker.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__TreeWalker.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__TreeWalker.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Types.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Types.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Types.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Types.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__UiEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__UiEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__UiEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__UiEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ValidityState.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ValidityState.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__ValidityState.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__ValidityState.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__WebGlContextEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__WebGlContextEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__WebGlContextEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__WebGlContextEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__WheelEvent.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__WheelEvent.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__WheelEvent.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__WheelEvent.re diff --git a/lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Window.re b/packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Window.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Dom/Webapi__Dom__Window.re rename to packages/melange-webapi/src/Webapi/Dom/Webapi__Dom__Window.re diff --git a/lib/melange-webapi/src/Webapi/ResizeObserver/Webapi__ResizeObserver__ResizeObserverEntry.re b/packages/melange-webapi/src/Webapi/ResizeObserver/Webapi__ResizeObserver__ResizeObserverEntry.re similarity index 100% rename from lib/melange-webapi/src/Webapi/ResizeObserver/Webapi__ResizeObserver__ResizeObserverEntry.re rename to packages/melange-webapi/src/Webapi/ResizeObserver/Webapi__ResizeObserver__ResizeObserverEntry.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__Base64.re b/packages/melange-webapi/src/Webapi/Webapi__Base64.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__Base64.re rename to packages/melange-webapi/src/Webapi/Webapi__Base64.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__Blob.re b/packages/melange-webapi/src/Webapi/Webapi__Blob.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__Blob.re rename to packages/melange-webapi/src/Webapi/Webapi__Blob.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__Canvas.re b/packages/melange-webapi/src/Webapi/Webapi__Canvas.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__Canvas.re rename to packages/melange-webapi/src/Webapi/Webapi__Canvas.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__Dom.re b/packages/melange-webapi/src/Webapi/Webapi__Dom.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__Dom.re rename to packages/melange-webapi/src/Webapi/Webapi__Dom.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__File.re b/packages/melange-webapi/src/Webapi/Webapi__File.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__File.re rename to packages/melange-webapi/src/Webapi/Webapi__File.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__Performance.re b/packages/melange-webapi/src/Webapi/Webapi__Performance.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__Performance.re rename to packages/melange-webapi/src/Webapi/Webapi__Performance.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__ReadableStream.re b/packages/melange-webapi/src/Webapi/Webapi__ReadableStream.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__ReadableStream.re rename to packages/melange-webapi/src/Webapi/Webapi__ReadableStream.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__ResizeObserver.re b/packages/melange-webapi/src/Webapi/Webapi__ResizeObserver.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__ResizeObserver.re rename to packages/melange-webapi/src/Webapi/Webapi__ResizeObserver.re diff --git a/lib/melange-webapi/src/Webapi/Webapi__Url.re b/packages/melange-webapi/src/Webapi/Webapi__Url.re similarity index 100% rename from lib/melange-webapi/src/Webapi/Webapi__Url.re rename to packages/melange-webapi/src/Webapi/Webapi__Url.re diff --git a/lib/melange-webapi/src/dune b/packages/melange-webapi/src/dune similarity index 100% rename from lib/melange-webapi/src/dune rename to packages/melange-webapi/src/dune diff --git a/lib/melange-webapi/tests/Webapi/Canvas/Webapi__Canvas__Canvas2d__test.re b/packages/melange-webapi/tests/Webapi/Canvas/Webapi__Canvas__Canvas2d__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Canvas/Webapi__Canvas__Canvas2d__test.re rename to packages/melange-webapi/tests/Webapi/Canvas/Webapi__Canvas__Canvas2d__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__AnimationEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__AnimationEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__AnimationEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__AnimationEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__BeforeUnloadEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ClipboardEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ClipboardEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ClipboardEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ClipboardEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CloseEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CloseEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CloseEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CloseEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CompositionEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CompositionEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CompositionEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CompositionEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CustomEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CustomEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CustomEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__CustomEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Document__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Document__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Document__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Document__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomStringMap__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomStringMap__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomStringMap__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomStringMap__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DomTokenList__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DragEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DragEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DragEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__DragEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Element__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Element__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Element__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Element__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ErrorEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ErrorEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ErrorEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ErrorEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__EventTarget__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__EventTarget__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__EventTarget__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__EventTarget__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Event__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Event__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Event__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Event__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__FocusEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__FocusEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__FocusEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__FocusEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__GlobalEventHandlers__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__GlobalEventHandlers__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__GlobalEventHandlers__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__GlobalEventHandlers__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__History__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__History__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__History__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__History__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlDocument__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlDocument__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlDocument__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlDocument__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlElement__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlElement__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlElement__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlElement__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlFormElement__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlFormElement__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlFormElement__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__HtmlFormElement__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__IdbVersionChangeEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Image__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Image__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Image__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Image__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__InputEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__InputEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__InputEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__InputEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__KeyboardEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__KeyboardEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__KeyboardEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__KeyboardEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Location__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Location__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Location__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Location__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__MouseEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__MouseEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__MouseEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__MouseEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__NodeList__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__NodeList__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__NodeList__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__NodeList__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Node__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Node__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Node__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Node__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PageTransitionEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PageTransitionEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PageTransitionEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PageTransitionEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PointerEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PointerEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PointerEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PointerEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PopStateEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PopStateEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PopStateEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__PopStateEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ProgressEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ProgressEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ProgressEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__ProgressEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Range__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Range__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Range__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Range__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__RelatedEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__RelatedEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__RelatedEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__RelatedEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Selection__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Selection__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Selection__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Selection__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__StorageEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__StorageEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__StorageEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__StorageEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__SvgZoomEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__SvgZoomEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__SvgZoomEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__SvgZoomEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Text__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Text__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Text__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Text__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TimeEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TimeEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TimeEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TimeEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TouchEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TouchEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TouchEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TouchEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TrackEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TrackEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TrackEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TrackEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TransitionEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TransitionEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TransitionEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__TransitionEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__UiEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__UiEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__UiEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__UiEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WebGlContextEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WebGlContextEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WebGlContextEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WebGlContextEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WheelEvent__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WheelEvent__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WheelEvent__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__WheelEvent__test.re diff --git a/lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Window__test.re b/packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Window__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Window__test.re rename to packages/melange-webapi/tests/Webapi/Dom/Webapi__Dom__Window__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__Base64__test.re b/packages/melange-webapi/tests/Webapi/Webapi__Base64__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__Base64__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__Base64__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__Blob__test.re b/packages/melange-webapi/tests/Webapi/Webapi__Blob__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__Blob__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__Blob__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__File__test.re b/packages/melange-webapi/tests/Webapi/Webapi__File__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__File__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__File__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__Performace__test.re b/packages/melange-webapi/tests/Webapi/Webapi__Performace__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__Performace__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__Performace__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__ReadableStream__test.re b/packages/melange-webapi/tests/Webapi/Webapi__ReadableStream__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__ReadableStream__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__ReadableStream__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__ResizeObserver__test.re b/packages/melange-webapi/tests/Webapi/Webapi__ResizeObserver__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__ResizeObserver__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__ResizeObserver__test.re diff --git a/lib/melange-webapi/tests/Webapi/Webapi__Url__test.re b/packages/melange-webapi/tests/Webapi/Webapi__Url__test.re similarity index 100% rename from lib/melange-webapi/tests/Webapi/Webapi__Url__test.re rename to packages/melange-webapi/tests/Webapi/Webapi__Url__test.re diff --git a/lib/melange-webapi/tests/_dune b/packages/melange-webapi/tests/_dune similarity index 100% rename from lib/melange-webapi/tests/_dune rename to packages/melange-webapi/tests/_dune diff --git a/lib/melange-webapi/tests/testHelpers.re b/packages/melange-webapi/tests/testHelpers.re similarity index 100% rename from lib/melange-webapi/tests/testHelpers.re rename to packages/melange-webapi/tests/testHelpers.re diff --git a/lib/ppx/double_hash.ml b/packages/ppx/double_hash.ml similarity index 100% rename from lib/ppx/double_hash.ml rename to packages/ppx/double_hash.ml diff --git a/lib/ppx/dune b/packages/ppx/dune similarity index 100% rename from lib/ppx/dune rename to packages/ppx/dune diff --git a/lib/ppx/pipe_first.ml b/packages/ppx/pipe_first.ml similarity index 100% rename from lib/ppx/pipe_first.ml rename to packages/ppx/pipe_first.ml diff --git a/lib/ppx/regex.ml b/packages/ppx/regex.ml similarity index 100% rename from lib/ppx/regex.ml rename to packages/ppx/regex.ml diff --git a/lib/ppx/test_snapshot/dune b/packages/ppx/test_snapshot/dune similarity index 100% rename from lib/ppx/test_snapshot/dune rename to packages/ppx/test_snapshot/dune diff --git a/lib/ppx/test_snapshot/input.ml b/packages/ppx/test_snapshot/input.ml similarity index 100% rename from lib/ppx/test_snapshot/input.ml rename to packages/ppx/test_snapshot/input.ml diff --git a/lib/ppx/test_snapshot/main.ml b/packages/ppx/test_snapshot/main.ml similarity index 100% rename from lib/ppx/test_snapshot/main.ml rename to packages/ppx/test_snapshot/main.ml diff --git a/lib/ppx/test_snapshot/output.expected b/packages/ppx/test_snapshot/output.expected similarity index 100% rename from lib/ppx/test_snapshot/output.expected rename to packages/ppx/test_snapshot/output.expected diff --git a/lib/react/domProps.ml b/packages/react/src/domProps.ml similarity index 100% rename from lib/react/domProps.ml rename to packages/react/src/domProps.ml diff --git a/lib/react/domProps.mli b/packages/react/src/domProps.mli similarity index 100% rename from lib/react/domProps.mli rename to packages/react/src/domProps.mli diff --git a/lib/react/dune b/packages/react/src/dune similarity index 100% rename from lib/react/dune rename to packages/react/src/dune diff --git a/lib/react/react.ml b/packages/react/src/react.ml similarity index 100% rename from lib/react/react.ml rename to packages/react/src/react.ml diff --git a/lib/react/react.mli b/packages/react/src/react.mli similarity index 100% rename from lib/react/react.mli rename to packages/react/src/react.mli diff --git a/lib/react/reactEvent.ml b/packages/react/src/reactEvent.ml similarity index 100% rename from lib/react/reactEvent.ml rename to packages/react/src/reactEvent.ml diff --git a/packages/react/test/dune b/packages/react/test/dune new file mode 100644 index 000000000..b0473d223 --- /dev/null +++ b/packages/react/test/dune @@ -0,0 +1,10 @@ +(test + (name test) + (modules :standard) + (libraries + alcotest + fmt + server-reason-react.react + server-reason-react.reactDom) + (preprocess + (pps server-reason-react.ppx))) diff --git a/packages/react/test/test.ml b/packages/react/test/test.ml new file mode 100644 index 000000000..ed564dd06 --- /dev/null +++ b/packages/react/test/test.ml @@ -0,0 +1 @@ +let () = Alcotest.run "React" [ Test_cloneElement.tests ] diff --git a/test/test_cloneElement.ml b/packages/react/test/test_cloneElement.ml similarity index 99% rename from test/test_cloneElement.ml rename to packages/react/test/test_cloneElement.ml index 0e6f77ed5..5cf37bb49 100644 --- a/test/test_cloneElement.ml +++ b/packages/react/test/test_cloneElement.ml @@ -83,7 +83,7 @@ let case title fn = Alcotest.test_case title `Quick fn let tests = ( (* FIXME: those test shouldn't rely on renderToStaticMarkup, make an alcotest TESTABLE component *) - "React.cloneElement", + "cloneElement", [ case "empty component" clone_empty; case "attributes component" clone_attributes; diff --git a/lib/reactDom/dune b/packages/reactDom/src/dune similarity index 100% rename from lib/reactDom/dune rename to packages/reactDom/src/dune diff --git a/lib/reactDom/props.ml b/packages/reactDom/src/props.ml similarity index 100% rename from lib/reactDom/props.ml rename to packages/reactDom/src/props.ml diff --git a/lib/reactDom/reactDOM.ml b/packages/reactDom/src/reactDOM.ml similarity index 100% rename from lib/reactDom/reactDOM.ml rename to packages/reactDom/src/reactDOM.ml diff --git a/lib/reactDom/reactDOMStyle.ml b/packages/reactDom/src/reactDOMStyle.ml similarity index 100% rename from lib/reactDom/reactDOMStyle.ml rename to packages/reactDom/src/reactDOMStyle.ml diff --git a/lib/reactDom/reactDOMStyle.mli b/packages/reactDom/src/reactDOMStyle.mli similarity index 100% rename from lib/reactDom/reactDOMStyle.mli rename to packages/reactDom/src/reactDOMStyle.mli diff --git a/packages/reactDom/test/dune b/packages/reactDom/test/dune new file mode 100644 index 000000000..b0473d223 --- /dev/null +++ b/packages/reactDom/test/dune @@ -0,0 +1,10 @@ +(test + (name test) + (modules :standard) + (libraries + alcotest + fmt + server-reason-react.react + server-reason-react.reactDom) + (preprocess + (pps server-reason-react.ppx))) diff --git a/packages/reactDom/test/test.ml b/packages/reactDom/test/test.ml new file mode 100644 index 000000000..5e9ee55f5 --- /dev/null +++ b/packages/reactDom/test/test.ml @@ -0,0 +1,7 @@ +let () = + Alcotest.run "ReactDOM" + [ + Test_renderToStaticMarkup.tests; + Test_renderToString.tests; + Test_reactDOMStyle.tests; + ] diff --git a/test/test_reactDOMStyle.ml b/packages/reactDom/test/test_reactDOMStyle.ml similarity index 100% rename from test/test_reactDOMStyle.ml rename to packages/reactDom/test/test_reactDOMStyle.ml diff --git a/test/test_renderToStaticMarkup.ml b/packages/reactDom/test/test_renderToStaticMarkup.ml similarity index 100% rename from test/test_renderToStaticMarkup.ml rename to packages/reactDom/test/test_renderToStaticMarkup.ml diff --git a/test/test_renderToString.ml b/packages/reactDom/test/test_renderToString.ml similarity index 100% rename from test/test_renderToString.ml rename to packages/reactDom/test/test_renderToString.ml diff --git a/lib/reasonReactRouter/reasonReactRouter.ml b/packages/reasonReactRouter/ReasonReactRouter.ml similarity index 100% rename from lib/reasonReactRouter/reasonReactRouter.ml rename to packages/reasonReactRouter/ReasonReactRouter.ml diff --git a/lib/reasonReactRouter/reasonReactRouter.mli b/packages/reasonReactRouter/ReasonReactRouter.mli similarity index 100% rename from lib/reasonReactRouter/reasonReactRouter.mli rename to packages/reasonReactRouter/ReasonReactRouter.mli diff --git a/lib/reasonReactRouter/dune b/packages/reasonReactRouter/dune similarity index 100% rename from lib/reasonReactRouter/dune rename to packages/reasonReactRouter/dune diff --git a/ppx/dune b/packages/server-reason-react-ppx/dune similarity index 100% rename from ppx/dune rename to packages/server-reason-react-ppx/dune diff --git a/ppx/ppx.ml b/packages/server-reason-react-ppx/ppx.ml similarity index 100% rename from ppx/ppx.ml rename to packages/server-reason-react-ppx/ppx.ml diff --git a/ppx/test/dune b/packages/server-reason-react-ppx/test/dune similarity index 100% rename from ppx/test/dune rename to packages/server-reason-react-ppx/test/dune diff --git a/ppx/test/test.re b/packages/server-reason-react-ppx/test/test.re similarity index 90% rename from ppx/test/test.re rename to packages/server-reason-react-ppx/test/test.re index 48526cbfa..4c17ce7ba 100644 --- a/ppx/test/test.re +++ b/packages/server-reason-react-ppx/test/test.re @@ -238,9 +238,44 @@ let children_flattening_multiple_elements = () => { let case = (title, fn) => Alcotest.test_case(title, `Quick, fn); +let assert_string = (left, right) => + Alcotest.check(Alcotest.string, "should be equal", right, left); + +module Text = { + module Tag = { + type t = + | H1; + + let unwrap = + fun + | H1 => "h1"; + }; + + [@react.component] + let make = (~tagType, ~children: React.element) => { + ReactDOM.createDOMElementVariadic( + tagType |> Tag.unwrap, + ReactDOM.domProps( + ~className="foo", + ~style=ReactDOM.Style.make(~display="none", ()), + (), + ), + React.Children.toArray(children), + ); + }; +}; + +let create_element_variadic = () => { + let component = {React.string("Hello")} ; + assert_string( + ReactDOM.renderToStaticMarkup(component), + "

Hello

", + ); +}; + let _ = Alcotest.run( - "Tests", + "server-reason-react-ppx", [ ( "renderToStaticMarkup", @@ -280,6 +315,7 @@ let _ = "children_flattening_multiple_elements", children_flattening_multiple_elements, ), + case("createElementVariadic", create_element_variadic), ], ), ], diff --git a/ppx/test_snapshot/dune b/packages/server-reason-react-ppx/test_snapshot/dune similarity index 100% rename from ppx/test_snapshot/dune rename to packages/server-reason-react-ppx/test_snapshot/dune diff --git a/ppx/test_snapshot/input_reason.re b/packages/server-reason-react-ppx/test_snapshot/input_reason.re similarity index 100% rename from ppx/test_snapshot/input_reason.re rename to packages/server-reason-react-ppx/test_snapshot/input_reason.re diff --git a/ppx/test_snapshot/main.ml b/packages/server-reason-react-ppx/test_snapshot/main.ml similarity index 100% rename from ppx/test_snapshot/main.ml rename to packages/server-reason-react-ppx/test_snapshot/main.ml diff --git a/ppx/test_snapshot/reason.expected b/packages/server-reason-react-ppx/test_snapshot/reason.expected similarity index 100% rename from ppx/test_snapshot/reason.expected rename to packages/server-reason-react-ppx/test_snapshot/reason.expected diff --git a/test/test.ml b/test/test.ml deleted file mode 100644 index 022c51506..000000000 --- a/test/test.ml +++ /dev/null @@ -1,12 +0,0 @@ -let () = - Alcotest.run "Tests" - [ - Test_renderToStaticMarkup.tests; - Test_renderToString.tests; - Test_cloneElement.tests; - Test_react.tests; - Test_reactDOMStyle.tests; - Test_css_styles.tests; - Test_css_autoprefixer.tests; - Test_css_hash.tests; - ] diff --git a/test/test_react.re b/test/test_react.re deleted file mode 100644 index ca8a0465c..000000000 --- a/test/test_react.re +++ /dev/null @@ -1,50 +0,0 @@ -let assert_string = (left, right) => - Alcotest.check(Alcotest.string, "should be equal", right, left); - -module Text = { - module Tag = { - type t = - | H1 - | H2 - | H3 - | H4 - | P - | Span - | Div; - - let unwrap = - fun - | H1 => "h1" - | H2 => "h2" - | H3 => "h3" - | H4 => "h4" - | P => "p" - | Span => "span" - | Div => "div"; - }; - - [@react.component] - let make = (~tagType, ~children: React.element) => { - ReactDOM.createDOMElementVariadic( - tagType |> Tag.unwrap, - ReactDOM.domProps( - ~className="foo", - ~style=ReactDOM.Style.make(~display="none", ()), - (), - ), - React.Children.toArray(children), - ); - }; -}; - -let full_case = () => { - let component = {React.string("Hello")} ; - assert_string( - ReactDOM.renderToStaticMarkup(component), - "

Hello

", - ); -}; - -let case = (title, fn) => Alcotest.test_case(title, `Quick, fn); - -let tests = ("React", [case("createElementVariadic", full_case)]);