From 61c024331b93b6daa0b12f9a87b3862e45df57d3 Mon Sep 17 00:00:00 2001 From: Antonio Nuno Monteiro Date: Sun, 17 Nov 2024 20:25:58 -0800 Subject: [PATCH] chore: move `melange.belt` out of `jscomp/others` (#1228) * chore: move `melange.belt` out of `jscomp/others` * wip * tweak test * add dep? * fix build --- {jscomp/others => belt}/belt.ml | 0 {jscomp/others => belt}/belt_Array.ml | 0 {jscomp/others => belt}/belt_Array.mli | 0 {jscomp/others => belt}/belt_Float.ml | 0 {jscomp/others => belt}/belt_Float.mli | 0 {jscomp/others => belt}/belt_HashMap.ml | 0 {jscomp/others => belt}/belt_HashMap.mli | 0 {jscomp/others => belt}/belt_HashSet.ml | 0 {jscomp/others => belt}/belt_HashSet.mli | 0 {jscomp/others => belt}/belt_Id.ml | 0 {jscomp/others => belt}/belt_Id.mli | 0 {jscomp/others => belt}/belt_Int.ml | 0 {jscomp/others => belt}/belt_Int.mli | 0 {jscomp/others => belt}/belt_List.ml | 0 {jscomp/others => belt}/belt_List.mli | 0 {jscomp/others => belt}/belt_Map.ml | 0 {jscomp/others => belt}/belt_Map.mli | 0 {jscomp/others => belt}/belt_MapDict.ml | 0 {jscomp/others => belt}/belt_MapDict.mli | 0 {jscomp/others => belt}/belt_MutableMap.ml | 0 {jscomp/others => belt}/belt_MutableMap.mli | 0 {jscomp/others => belt}/belt_MutableQueue.ml | 0 {jscomp/others => belt}/belt_MutableQueue.mli | 0 {jscomp/others => belt}/belt_MutableSet.ml | 0 {jscomp/others => belt}/belt_MutableSet.mli | 0 {jscomp/others => belt}/belt_MutableStack.ml | 0 {jscomp/others => belt}/belt_MutableStack.mli | 0 {jscomp/others => belt}/belt_Option.ml | 0 {jscomp/others => belt}/belt_Option.mli | 0 {jscomp/others => belt}/belt_Range.ml | 0 {jscomp/others => belt}/belt_Range.mli | 0 {jscomp/others => belt}/belt_Result.ml | 0 {jscomp/others => belt}/belt_Result.mli | 0 {jscomp/others => belt}/belt_Set.cppo.ml | 0 {jscomp/others => belt}/belt_Set.cppo.mli | 0 {jscomp/others => belt}/belt_Set.ml | 0 {jscomp/others => belt}/belt_Set.mli | 0 {jscomp/others => belt}/belt_SetDict.ml | 0 {jscomp/others => belt}/belt_SetDict.mli | 0 {jscomp/others => belt}/belt_SortArray.ml | 0 {jscomp/others => belt}/belt_SortArray.mli | 0 .../others => belt}/belt_internalAVLset.ml | 0 .../others => belt}/belt_internalAVLset.mli | 0 .../others => belt}/belt_internalAVLtree.ml | 0 .../others => belt}/belt_internalAVLtree.mli | 0 .../others => belt}/belt_internalBuckets.ml | 0 .../others => belt}/belt_internalBuckets.mli | 0 .../belt_internalBucketsType.ml | 0 .../belt_internalBucketsType.mli | 0 .../belt_internalSetBuckets.ml | 0 .../belt_internalSetBuckets.mli | 0 belt/dune | 204 +++++++++++++++++ {jscomp/others => belt}/hashmap.cppo.ml | 0 {jscomp/others => belt}/hashmap.cppo.mli | 0 {jscomp/others => belt}/hashset.cppo.ml | 0 {jscomp/others => belt}/hashset.cppo.mli | 0 {jscomp/others => belt}/internal_map.cppo.ml | 0 {jscomp/others => belt}/internal_set.cppo.ml | 0 {jscomp/others => belt}/map.cppo.ml | 0 {jscomp/others => belt}/map.cppo.mli | 0 {jscomp/others => belt}/mapm.cppo.ml | 0 {jscomp/others => belt}/mapm.cppo.mli | 0 {jscomp/others => belt}/setm.cppo.ml | 0 {jscomp/others => belt}/setm.cppo.mli | 0 {jscomp/others => belt}/sort.cppo.ml | 0 {jscomp/others => belt}/sort.cppo.mli | 0 jscomp/others/dune | 216 ------------------ nix/default.nix | 3 +- nix/melange-playground.nix | 8 +- playground/dune | 2 +- test/blackbox-tests/belt-and-runtime.t | 6 +- test/blackbox-tests/dune | 3 +- 72 files changed, 216 insertions(+), 226 deletions(-) rename {jscomp/others => belt}/belt.ml (100%) rename {jscomp/others => belt}/belt_Array.ml (100%) rename {jscomp/others => belt}/belt_Array.mli (100%) rename {jscomp/others => belt}/belt_Float.ml (100%) rename {jscomp/others => belt}/belt_Float.mli (100%) rename {jscomp/others => belt}/belt_HashMap.ml (100%) rename {jscomp/others => belt}/belt_HashMap.mli (100%) rename {jscomp/others => belt}/belt_HashSet.ml (100%) rename {jscomp/others => belt}/belt_HashSet.mli (100%) rename {jscomp/others => belt}/belt_Id.ml (100%) rename {jscomp/others => belt}/belt_Id.mli (100%) rename {jscomp/others => belt}/belt_Int.ml (100%) rename {jscomp/others => belt}/belt_Int.mli (100%) rename {jscomp/others => belt}/belt_List.ml (100%) rename {jscomp/others => belt}/belt_List.mli (100%) rename {jscomp/others => belt}/belt_Map.ml (100%) rename {jscomp/others => belt}/belt_Map.mli (100%) rename {jscomp/others => belt}/belt_MapDict.ml (100%) rename {jscomp/others => belt}/belt_MapDict.mli (100%) rename {jscomp/others => belt}/belt_MutableMap.ml (100%) rename {jscomp/others => belt}/belt_MutableMap.mli (100%) rename {jscomp/others => belt}/belt_MutableQueue.ml (100%) rename {jscomp/others => belt}/belt_MutableQueue.mli (100%) rename {jscomp/others => belt}/belt_MutableSet.ml (100%) rename {jscomp/others => belt}/belt_MutableSet.mli (100%) rename {jscomp/others => belt}/belt_MutableStack.ml (100%) rename {jscomp/others => belt}/belt_MutableStack.mli (100%) rename {jscomp/others => belt}/belt_Option.ml (100%) rename {jscomp/others => belt}/belt_Option.mli (100%) rename {jscomp/others => belt}/belt_Range.ml (100%) rename {jscomp/others => belt}/belt_Range.mli (100%) rename {jscomp/others => belt}/belt_Result.ml (100%) rename {jscomp/others => belt}/belt_Result.mli (100%) rename {jscomp/others => belt}/belt_Set.cppo.ml (100%) rename {jscomp/others => belt}/belt_Set.cppo.mli (100%) rename {jscomp/others => belt}/belt_Set.ml (100%) rename {jscomp/others => belt}/belt_Set.mli (100%) rename {jscomp/others => belt}/belt_SetDict.ml (100%) rename {jscomp/others => belt}/belt_SetDict.mli (100%) rename {jscomp/others => belt}/belt_SortArray.ml (100%) rename {jscomp/others => belt}/belt_SortArray.mli (100%) rename {jscomp/others => belt}/belt_internalAVLset.ml (100%) rename {jscomp/others => belt}/belt_internalAVLset.mli (100%) rename {jscomp/others => belt}/belt_internalAVLtree.ml (100%) rename {jscomp/others => belt}/belt_internalAVLtree.mli (100%) rename {jscomp/others => belt}/belt_internalBuckets.ml (100%) rename {jscomp/others => belt}/belt_internalBuckets.mli (100%) rename {jscomp/others => belt}/belt_internalBucketsType.ml (100%) rename {jscomp/others => belt}/belt_internalBucketsType.mli (100%) rename {jscomp/others => belt}/belt_internalSetBuckets.ml (100%) rename {jscomp/others => belt}/belt_internalSetBuckets.mli (100%) create mode 100644 belt/dune rename {jscomp/others => belt}/hashmap.cppo.ml (100%) rename {jscomp/others => belt}/hashmap.cppo.mli (100%) rename {jscomp/others => belt}/hashset.cppo.ml (100%) rename {jscomp/others => belt}/hashset.cppo.mli (100%) rename {jscomp/others => belt}/internal_map.cppo.ml (100%) rename {jscomp/others => belt}/internal_set.cppo.ml (100%) rename {jscomp/others => belt}/map.cppo.ml (100%) rename {jscomp/others => belt}/map.cppo.mli (100%) rename {jscomp/others => belt}/mapm.cppo.ml (100%) rename {jscomp/others => belt}/mapm.cppo.mli (100%) rename {jscomp/others => belt}/setm.cppo.ml (100%) rename {jscomp/others => belt}/setm.cppo.mli (100%) rename {jscomp/others => belt}/sort.cppo.ml (100%) rename {jscomp/others => belt}/sort.cppo.mli (100%) diff --git a/jscomp/others/belt.ml b/belt/belt.ml similarity index 100% rename from jscomp/others/belt.ml rename to belt/belt.ml diff --git a/jscomp/others/belt_Array.ml b/belt/belt_Array.ml similarity index 100% rename from jscomp/others/belt_Array.ml rename to belt/belt_Array.ml diff --git a/jscomp/others/belt_Array.mli b/belt/belt_Array.mli similarity index 100% rename from jscomp/others/belt_Array.mli rename to belt/belt_Array.mli diff --git a/jscomp/others/belt_Float.ml b/belt/belt_Float.ml similarity index 100% rename from jscomp/others/belt_Float.ml rename to belt/belt_Float.ml diff --git a/jscomp/others/belt_Float.mli b/belt/belt_Float.mli similarity index 100% rename from jscomp/others/belt_Float.mli rename to belt/belt_Float.mli diff --git a/jscomp/others/belt_HashMap.ml b/belt/belt_HashMap.ml similarity index 100% rename from jscomp/others/belt_HashMap.ml rename to belt/belt_HashMap.ml diff --git a/jscomp/others/belt_HashMap.mli b/belt/belt_HashMap.mli similarity index 100% rename from jscomp/others/belt_HashMap.mli rename to belt/belt_HashMap.mli diff --git a/jscomp/others/belt_HashSet.ml b/belt/belt_HashSet.ml similarity index 100% rename from jscomp/others/belt_HashSet.ml rename to belt/belt_HashSet.ml diff --git a/jscomp/others/belt_HashSet.mli b/belt/belt_HashSet.mli similarity index 100% rename from jscomp/others/belt_HashSet.mli rename to belt/belt_HashSet.mli diff --git a/jscomp/others/belt_Id.ml b/belt/belt_Id.ml similarity index 100% rename from jscomp/others/belt_Id.ml rename to belt/belt_Id.ml diff --git a/jscomp/others/belt_Id.mli b/belt/belt_Id.mli similarity index 100% rename from jscomp/others/belt_Id.mli rename to belt/belt_Id.mli diff --git a/jscomp/others/belt_Int.ml b/belt/belt_Int.ml similarity index 100% rename from jscomp/others/belt_Int.ml rename to belt/belt_Int.ml diff --git a/jscomp/others/belt_Int.mli b/belt/belt_Int.mli similarity index 100% rename from jscomp/others/belt_Int.mli rename to belt/belt_Int.mli diff --git a/jscomp/others/belt_List.ml b/belt/belt_List.ml similarity index 100% rename from jscomp/others/belt_List.ml rename to belt/belt_List.ml diff --git a/jscomp/others/belt_List.mli b/belt/belt_List.mli similarity index 100% rename from jscomp/others/belt_List.mli rename to belt/belt_List.mli diff --git a/jscomp/others/belt_Map.ml b/belt/belt_Map.ml similarity index 100% rename from jscomp/others/belt_Map.ml rename to belt/belt_Map.ml diff --git a/jscomp/others/belt_Map.mli b/belt/belt_Map.mli similarity index 100% rename from jscomp/others/belt_Map.mli rename to belt/belt_Map.mli diff --git a/jscomp/others/belt_MapDict.ml b/belt/belt_MapDict.ml similarity index 100% rename from jscomp/others/belt_MapDict.ml rename to belt/belt_MapDict.ml diff --git a/jscomp/others/belt_MapDict.mli b/belt/belt_MapDict.mli similarity index 100% rename from jscomp/others/belt_MapDict.mli rename to belt/belt_MapDict.mli diff --git a/jscomp/others/belt_MutableMap.ml b/belt/belt_MutableMap.ml similarity index 100% rename from jscomp/others/belt_MutableMap.ml rename to belt/belt_MutableMap.ml diff --git a/jscomp/others/belt_MutableMap.mli b/belt/belt_MutableMap.mli similarity index 100% rename from jscomp/others/belt_MutableMap.mli rename to belt/belt_MutableMap.mli diff --git a/jscomp/others/belt_MutableQueue.ml b/belt/belt_MutableQueue.ml similarity index 100% rename from jscomp/others/belt_MutableQueue.ml rename to belt/belt_MutableQueue.ml diff --git a/jscomp/others/belt_MutableQueue.mli b/belt/belt_MutableQueue.mli similarity index 100% rename from jscomp/others/belt_MutableQueue.mli rename to belt/belt_MutableQueue.mli diff --git a/jscomp/others/belt_MutableSet.ml b/belt/belt_MutableSet.ml similarity index 100% rename from jscomp/others/belt_MutableSet.ml rename to belt/belt_MutableSet.ml diff --git a/jscomp/others/belt_MutableSet.mli b/belt/belt_MutableSet.mli similarity index 100% rename from jscomp/others/belt_MutableSet.mli rename to belt/belt_MutableSet.mli diff --git a/jscomp/others/belt_MutableStack.ml b/belt/belt_MutableStack.ml similarity index 100% rename from jscomp/others/belt_MutableStack.ml rename to belt/belt_MutableStack.ml diff --git a/jscomp/others/belt_MutableStack.mli b/belt/belt_MutableStack.mli similarity index 100% rename from jscomp/others/belt_MutableStack.mli rename to belt/belt_MutableStack.mli diff --git a/jscomp/others/belt_Option.ml b/belt/belt_Option.ml similarity index 100% rename from jscomp/others/belt_Option.ml rename to belt/belt_Option.ml diff --git a/jscomp/others/belt_Option.mli b/belt/belt_Option.mli similarity index 100% rename from jscomp/others/belt_Option.mli rename to belt/belt_Option.mli diff --git a/jscomp/others/belt_Range.ml b/belt/belt_Range.ml similarity index 100% rename from jscomp/others/belt_Range.ml rename to belt/belt_Range.ml diff --git a/jscomp/others/belt_Range.mli b/belt/belt_Range.mli similarity index 100% rename from jscomp/others/belt_Range.mli rename to belt/belt_Range.mli diff --git a/jscomp/others/belt_Result.ml b/belt/belt_Result.ml similarity index 100% rename from jscomp/others/belt_Result.ml rename to belt/belt_Result.ml diff --git a/jscomp/others/belt_Result.mli b/belt/belt_Result.mli similarity index 100% rename from jscomp/others/belt_Result.mli rename to belt/belt_Result.mli diff --git a/jscomp/others/belt_Set.cppo.ml b/belt/belt_Set.cppo.ml similarity index 100% rename from jscomp/others/belt_Set.cppo.ml rename to belt/belt_Set.cppo.ml diff --git a/jscomp/others/belt_Set.cppo.mli b/belt/belt_Set.cppo.mli similarity index 100% rename from jscomp/others/belt_Set.cppo.mli rename to belt/belt_Set.cppo.mli diff --git a/jscomp/others/belt_Set.ml b/belt/belt_Set.ml similarity index 100% rename from jscomp/others/belt_Set.ml rename to belt/belt_Set.ml diff --git a/jscomp/others/belt_Set.mli b/belt/belt_Set.mli similarity index 100% rename from jscomp/others/belt_Set.mli rename to belt/belt_Set.mli diff --git a/jscomp/others/belt_SetDict.ml b/belt/belt_SetDict.ml similarity index 100% rename from jscomp/others/belt_SetDict.ml rename to belt/belt_SetDict.ml diff --git a/jscomp/others/belt_SetDict.mli b/belt/belt_SetDict.mli similarity index 100% rename from jscomp/others/belt_SetDict.mli rename to belt/belt_SetDict.mli diff --git a/jscomp/others/belt_SortArray.ml b/belt/belt_SortArray.ml similarity index 100% rename from jscomp/others/belt_SortArray.ml rename to belt/belt_SortArray.ml diff --git a/jscomp/others/belt_SortArray.mli b/belt/belt_SortArray.mli similarity index 100% rename from jscomp/others/belt_SortArray.mli rename to belt/belt_SortArray.mli diff --git a/jscomp/others/belt_internalAVLset.ml b/belt/belt_internalAVLset.ml similarity index 100% rename from jscomp/others/belt_internalAVLset.ml rename to belt/belt_internalAVLset.ml diff --git a/jscomp/others/belt_internalAVLset.mli b/belt/belt_internalAVLset.mli similarity index 100% rename from jscomp/others/belt_internalAVLset.mli rename to belt/belt_internalAVLset.mli diff --git a/jscomp/others/belt_internalAVLtree.ml b/belt/belt_internalAVLtree.ml similarity index 100% rename from jscomp/others/belt_internalAVLtree.ml rename to belt/belt_internalAVLtree.ml diff --git a/jscomp/others/belt_internalAVLtree.mli b/belt/belt_internalAVLtree.mli similarity index 100% rename from jscomp/others/belt_internalAVLtree.mli rename to belt/belt_internalAVLtree.mli diff --git a/jscomp/others/belt_internalBuckets.ml b/belt/belt_internalBuckets.ml similarity index 100% rename from jscomp/others/belt_internalBuckets.ml rename to belt/belt_internalBuckets.ml diff --git a/jscomp/others/belt_internalBuckets.mli b/belt/belt_internalBuckets.mli similarity index 100% rename from jscomp/others/belt_internalBuckets.mli rename to belt/belt_internalBuckets.mli diff --git a/jscomp/others/belt_internalBucketsType.ml b/belt/belt_internalBucketsType.ml similarity index 100% rename from jscomp/others/belt_internalBucketsType.ml rename to belt/belt_internalBucketsType.ml diff --git a/jscomp/others/belt_internalBucketsType.mli b/belt/belt_internalBucketsType.mli similarity index 100% rename from jscomp/others/belt_internalBucketsType.mli rename to belt/belt_internalBucketsType.mli diff --git a/jscomp/others/belt_internalSetBuckets.ml b/belt/belt_internalSetBuckets.ml similarity index 100% rename from jscomp/others/belt_internalSetBuckets.ml rename to belt/belt_internalSetBuckets.ml diff --git a/jscomp/others/belt_internalSetBuckets.mli b/belt/belt_internalSetBuckets.mli similarity index 100% rename from jscomp/others/belt_internalSetBuckets.mli rename to belt/belt_internalSetBuckets.mli diff --git a/belt/dune b/belt/dune new file mode 100644 index 0000000000..cba55233ff --- /dev/null +++ b/belt/dune @@ -0,0 +1,204 @@ +(library + (name belt) + (public_name melange.belt) + (modes melange) + (preprocess + (pps melange.ppx -unsafe)) + (libraries melange) + (melange.compile_flags + -mel-no-check-div-by-zero + -mel-cross-module-opt + -unsafe)) + +(rule + (target belt_HashSetString.ml) + (deps hashset.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_HashSetString.mli) + (deps hashset.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_HashSetInt.ml) + (deps hashset.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_HashSetInt.mli) + (deps hashset.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_HashMapString.ml) + (deps hashmap.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_HashMapString.mli) + (deps hashmap.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_HashMapInt.ml) + (deps hashmap.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_HashMapInt.mli) + (deps hashmap.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_MapString.ml) + (deps map.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_MapString.mli) + (deps map.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_MapInt.ml) + (deps map.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_MapInt.mli) + (deps map.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_SetString.ml) + (deps belt_Set.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_SetString.mli) + (deps belt_Set.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_SetInt.ml) + (deps belt_Set.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_SetInt.mli) + (deps belt_Set.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_MutableMapString.ml) + (deps mapm.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_MutableMapString.mli) + (deps mapm.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_MutableMapInt.ml) + (deps mapm.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_MutableMapInt.mli) + (deps mapm.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_MutableSetString.ml) + (deps setm.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_MutableSetString.mli) + (deps setm.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_MutableSetInt.ml) + (deps setm.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_MutableSetInt.mli) + (deps setm.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_SortArrayString.ml) + (deps sort.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_SortArrayString.mli) + (deps sort.cppo.mli) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_SortArrayInt.ml) + (deps sort.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_SortArrayInt.mli) + (deps sort.cppo.mli) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_internalMapString.ml) + (deps internal_map.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_internalMapInt.ml) + (deps internal_map.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + +(rule + (target belt_internalSetString.ml) + (deps internal_set.cppo.ml) + (action + (run cppo -D TYPE_STRING %{deps} -o %{target}))) + +(rule + (target belt_internalSetInt.ml) + (deps internal_set.cppo.ml) + (action + (run cppo -D TYPE_INT %{deps} -o %{target}))) + diff --git a/jscomp/others/hashmap.cppo.ml b/belt/hashmap.cppo.ml similarity index 100% rename from jscomp/others/hashmap.cppo.ml rename to belt/hashmap.cppo.ml diff --git a/jscomp/others/hashmap.cppo.mli b/belt/hashmap.cppo.mli similarity index 100% rename from jscomp/others/hashmap.cppo.mli rename to belt/hashmap.cppo.mli diff --git a/jscomp/others/hashset.cppo.ml b/belt/hashset.cppo.ml similarity index 100% rename from jscomp/others/hashset.cppo.ml rename to belt/hashset.cppo.ml diff --git a/jscomp/others/hashset.cppo.mli b/belt/hashset.cppo.mli similarity index 100% rename from jscomp/others/hashset.cppo.mli rename to belt/hashset.cppo.mli diff --git a/jscomp/others/internal_map.cppo.ml b/belt/internal_map.cppo.ml similarity index 100% rename from jscomp/others/internal_map.cppo.ml rename to belt/internal_map.cppo.ml diff --git a/jscomp/others/internal_set.cppo.ml b/belt/internal_set.cppo.ml similarity index 100% rename from jscomp/others/internal_set.cppo.ml rename to belt/internal_set.cppo.ml diff --git a/jscomp/others/map.cppo.ml b/belt/map.cppo.ml similarity index 100% rename from jscomp/others/map.cppo.ml rename to belt/map.cppo.ml diff --git a/jscomp/others/map.cppo.mli b/belt/map.cppo.mli similarity index 100% rename from jscomp/others/map.cppo.mli rename to belt/map.cppo.mli diff --git a/jscomp/others/mapm.cppo.ml b/belt/mapm.cppo.ml similarity index 100% rename from jscomp/others/mapm.cppo.ml rename to belt/mapm.cppo.ml diff --git a/jscomp/others/mapm.cppo.mli b/belt/mapm.cppo.mli similarity index 100% rename from jscomp/others/mapm.cppo.mli rename to belt/mapm.cppo.mli diff --git a/jscomp/others/setm.cppo.ml b/belt/setm.cppo.ml similarity index 100% rename from jscomp/others/setm.cppo.ml rename to belt/setm.cppo.ml diff --git a/jscomp/others/setm.cppo.mli b/belt/setm.cppo.mli similarity index 100% rename from jscomp/others/setm.cppo.mli rename to belt/setm.cppo.mli diff --git a/jscomp/others/sort.cppo.ml b/belt/sort.cppo.ml similarity index 100% rename from jscomp/others/sort.cppo.ml rename to belt/sort.cppo.ml diff --git a/jscomp/others/sort.cppo.mli b/belt/sort.cppo.mli similarity index 100% rename from jscomp/others/sort.cppo.mli rename to belt/sort.cppo.mli diff --git a/jscomp/others/dune b/jscomp/others/dune index 98936b921b..986680da83 100644 --- a/jscomp/others/dune +++ b/jscomp/others/dune @@ -1,28 +1,3 @@ -(library - (modes melange) - (name belt) - (public_name melange.belt) - (preprocess - (pps melange.ppx -unsafe)) - (libraries melange) - (modules - :standard - \ - node - node_buffer - node_child_process - node_fs - node_module - node_path - node_process - node_process - dom - dom_storage) - (melange.compile_flags - -mel-no-check-div-by-zero - -mel-cross-module-opt - -unsafe)) - (library (modes melange) (name dom) @@ -70,194 +45,3 @@ -open Melange_mini_stdlib)) -(rule - (target belt_HashSetString.ml) - (deps hashset.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_HashSetString.mli) - (deps hashset.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_HashSetInt.ml) - (deps hashset.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_HashSetInt.mli) - (deps hashset.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_HashMapString.ml) - (deps hashmap.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_HashMapString.mli) - (deps hashmap.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_HashMapInt.ml) - (deps hashmap.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_HashMapInt.mli) - (deps hashmap.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_MapString.ml) - (deps map.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_MapString.mli) - (deps map.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_MapInt.ml) - (deps map.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_MapInt.mli) - (deps map.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_SetString.ml) - (deps belt_Set.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_SetString.mli) - (deps belt_Set.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_SetInt.ml) - (deps belt_Set.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_SetInt.mli) - (deps belt_Set.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_MutableMapString.ml) - (deps mapm.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_MutableMapString.mli) - (deps mapm.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_MutableMapInt.ml) - (deps mapm.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_MutableMapInt.mli) - (deps mapm.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_MutableSetString.ml) - (deps setm.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_MutableSetString.mli) - (deps setm.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_MutableSetInt.ml) - (deps setm.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_MutableSetInt.mli) - (deps setm.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_SortArrayString.ml) - (deps sort.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_SortArrayString.mli) - (deps sort.cppo.mli) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_SortArrayInt.ml) - (deps sort.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_SortArrayInt.mli) - (deps sort.cppo.mli) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_internalMapString.ml) - (deps internal_map.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_internalMapInt.ml) - (deps internal_map.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) - -(rule - (target belt_internalSetString.ml) - (deps internal_set.cppo.ml) - (action - (run cppo -D TYPE_STRING %{deps} -o %{target}))) - -(rule - (target belt_internalSetInt.ml) - (deps internal_set.cppo.ml) - (action - (run cppo -D TYPE_INT %{deps} -o %{target}))) diff --git a/nix/default.nix b/nix/default.nix index 38ab501ea3..eefa5ab5e3 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -21,6 +21,7 @@ buildDunePackage { src = with nix-filter; filter { root = ./..; include = [ + "belt" "bin" "dune-project" "dune" @@ -28,8 +29,8 @@ buildDunePackage { "lib" "melange.opam" "ppx" - "test" "scripts" + "test" "vendor" ]; exclude = [ "jscomp/test" ]; diff --git a/nix/melange-playground.nix b/nix/melange-playground.nix index 82f3a232e4..c5afe3b108 100644 --- a/nix/melange-playground.nix +++ b/nix/melange-playground.nix @@ -19,13 +19,15 @@ buildDunePackage { src = with nix-filter; filter { root = ./..; include = [ + "belt" + "bin" "dune-project" "dune" - "melange-playground.opam" - "bin" "jscomp" - "vendor" + "melange-playground.opam" + "playground" "test/blackbox-tests/melange-playground" + "vendor" ]; }; postPatch = '' diff --git a/playground/dune b/playground/dune index 3e1728cb06..fbee6d5d59 100644 --- a/playground/dune +++ b/playground/dune @@ -45,7 +45,7 @@ %{bin:js_of_ocaml} (:some-js-cmi %{lib:melange:js/melange/js.cmi}) (:some-stdlib-cmi %{lib:melange:melange/stdlib.cmi}) - (:some-belt-cmi %{lib:melange:belt/melange/belt.cmi}) + (:some-belt-cmi %{lib:melange.belt:melange/belt.cmi}) (:some-dom-cmi %{lib:melange:dom/melange/dom.cmi})) (target cmi-files.txt) (action diff --git a/test/blackbox-tests/belt-and-runtime.t b/test/blackbox-tests/belt-and-runtime.t index c40d273962..62c809d4b5 100644 --- a/test/blackbox-tests/belt-and-runtime.t +++ b/test/blackbox-tests/belt-and-runtime.t @@ -17,8 +17,7 @@ Try commonjs first > (melange.emit > (target melange) > (alias melange) - > (libraries melange melange.belt) - > (emit_stdlib false) + > (libraries melange.belt) > (module_systems commonjs)) > EOF @@ -35,8 +34,7 @@ Now es6 > (melange.emit > (target melange) > (alias melange) - > (libraries melange melange.belt) - > (emit_stdlib false) + > (libraries melange.belt) > (module_systems es6)) > EOF diff --git a/test/blackbox-tests/dune b/test/blackbox-tests/dune index 76fe40b1e3..32b0d533b3 100644 --- a/test/blackbox-tests/dune +++ b/test/blackbox-tests/dune @@ -5,4 +5,5 @@ setup.sh (package melange) %{bin:jq} - %{bin:ocamlmerlin})) + %{bin:ocamlmerlin} + %{lib:melange.belt:melange/belt.cmj}))