From 7793f007319e66d159834068aadcc07ddfe435ff Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 8 Aug 2026 20:48:59 +0200 Subject: [PATCH 01/14] Extract Belt into a separate @rescript/belt package Signed-off-by: Christoph Knittel --- .github/workflows/ci.yml | 38 +- CHANGELOG.md | 1 + Makefile | 12 +- packages/@rescript/belt/.gitignore | 13 + packages/@rescript/belt/README.md | 24 + .../lib/es6 => belt/lib/es6/src}/Belt.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_Array.mjs | 4 +- .../es6 => belt/lib/es6/src}/Belt_Float.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_HashMap.mjs | 2 +- .../lib/es6/src}/Belt_HashMapInt.mjs | 4 +- .../lib/es6/src}/Belt_HashMapString.mjs | 4 +- .../es6 => belt/lib/es6/src}/Belt_HashSet.mjs | 0 .../lib/es6/src}/Belt_HashSetInt.mjs | 2 +- .../lib/es6/src}/Belt_HashSetString.mjs | 2 +- .../lib/es6 => belt/lib/es6/src}/Belt_Id.mjs | 0 .../lib/es6 => belt/lib/es6/src}/Belt_Int.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_List.mjs | 2 +- .../lib/es6 => belt/lib/es6/src}/Belt_Map.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_MapDict.mjs | 2 +- .../es6 => belt/lib/es6/src}/Belt_MapInt.mjs | 2 +- .../lib/es6/src}/Belt_MapString.mjs | 2 +- .../lib/es6/src}/Belt_MutableMap.mjs | 2 +- .../lib/es6/src}/Belt_MutableMapInt.mjs | 2 +- .../lib/es6/src}/Belt_MutableMapString.mjs | 2 +- .../lib/es6/src}/Belt_MutableQueue.mjs | 2 +- .../lib/es6/src}/Belt_MutableSet.mjs | 2 +- .../lib/es6/src}/Belt_MutableSetInt.mjs | 2 +- .../lib/es6/src}/Belt_MutableSetString.mjs | 2 +- .../lib/es6/src}/Belt_MutableStack.mjs | 2 +- .../es6 => belt/lib/es6/src}/Belt_Option.mjs | 2 +- .../es6 => belt/lib/es6/src}/Belt_Range.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_Result.mjs | 0 .../lib/es6 => belt/lib/es6/src}/Belt_Set.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_SetDict.mjs | 0 .../es6 => belt/lib/es6/src}/Belt_SetInt.mjs | 0 .../lib/es6/src}/Belt_SetString.mjs | 0 .../lib/es6/src}/Belt_SortArray.mjs | 0 .../lib/es6/src}/Belt_SortArrayInt.mjs | 0 .../lib/es6/src}/Belt_SortArrayString.mjs | 0 .../lib/es6/src}/Belt_internalAVLset.mjs | 4 +- .../lib/es6/src}/Belt_internalAVLtree.mjs | 4 +- .../lib/es6/src}/Belt_internalBuckets.mjs | 4 +- .../lib/es6/src}/Belt_internalBucketsType.mjs | 0 .../lib/es6/src}/Belt_internalMapInt.mjs | 4 +- .../lib/es6/src}/Belt_internalMapString.mjs | 4 +- .../lib/es6/src}/Belt_internalSetBuckets.mjs | 2 +- .../lib/es6/src}/Belt_internalSetInt.mjs | 0 .../lib/es6/src}/Belt_internalSetString.mjs | 0 .../lib/js => belt/lib/js/src}/Belt.cjs | 0 .../lib/js => belt/lib/js/src}/Belt_Array.cjs | 4 +- .../lib/js => belt/lib/js/src}/Belt_Float.cjs | 0 .../js => belt/lib/js/src}/Belt_HashMap.cjs | 2 +- .../lib/js/src}/Belt_HashMapInt.cjs | 4 +- .../lib/js/src}/Belt_HashMapString.cjs | 4 +- .../js => belt/lib/js/src}/Belt_HashSet.cjs | 0 .../lib/js/src}/Belt_HashSetInt.cjs | 2 +- .../lib/js/src}/Belt_HashSetString.cjs | 2 +- .../lib/js => belt/lib/js/src}/Belt_Id.cjs | 0 .../lib/js => belt/lib/js/src}/Belt_Int.cjs | 0 .../lib/js => belt/lib/js/src}/Belt_List.cjs | 2 +- .../lib/js => belt/lib/js/src}/Belt_Map.cjs | 0 .../js => belt/lib/js/src}/Belt_MapDict.cjs | 2 +- .../js => belt/lib/js/src}/Belt_MapInt.cjs | 2 +- .../js => belt/lib/js/src}/Belt_MapString.cjs | 2 +- .../lib/js/src}/Belt_MutableMap.cjs | 2 +- .../lib/js/src}/Belt_MutableMapInt.cjs | 2 +- .../lib/js/src}/Belt_MutableMapString.cjs | 2 +- .../lib/js/src}/Belt_MutableQueue.cjs | 2 +- .../lib/js/src}/Belt_MutableSet.cjs | 2 +- .../lib/js/src}/Belt_MutableSetInt.cjs | 2 +- .../lib/js/src}/Belt_MutableSetString.cjs | 2 +- .../lib/js/src}/Belt_MutableStack.cjs | 2 +- .../js => belt/lib/js/src}/Belt_Option.cjs | 2 +- .../lib/js => belt/lib/js/src}/Belt_Range.cjs | 0 .../js => belt/lib/js/src}/Belt_Result.cjs | 0 .../lib/js => belt/lib/js/src}/Belt_Set.cjs | 0 .../js => belt/lib/js/src}/Belt_SetDict.cjs | 0 .../js => belt/lib/js/src}/Belt_SetInt.cjs | 0 .../js => belt/lib/js/src}/Belt_SetString.cjs | 0 .../js => belt/lib/js/src}/Belt_SortArray.cjs | 0 .../lib/js/src}/Belt_SortArrayInt.cjs | 0 .../lib/js/src}/Belt_SortArrayString.cjs | 0 .../lib/js/src}/Belt_internalAVLset.cjs | 4 +- .../lib/js/src}/Belt_internalAVLtree.cjs | 4 +- .../lib/js/src}/Belt_internalBuckets.cjs | 4 +- .../lib/js/src}/Belt_internalBucketsType.cjs | 0 .../lib/js/src}/Belt_internalMapInt.cjs | 4 +- .../lib/js/src}/Belt_internalMapString.cjs | 4 +- .../lib/js/src}/Belt_internalSetBuckets.cjs | 2 +- .../lib/js/src}/Belt_internalSetInt.cjs | 0 .../lib/js/src}/Belt_internalSetString.cjs | 0 packages/@rescript/belt/package.json | 51 +++ packages/@rescript/belt/rescript.json | 30 ++ .../@rescript/{runtime => belt/src}/Belt.res | 10 +- .../{runtime => belt/src}/Belt_Array.res | 0 .../{runtime => belt/src}/Belt_Array.resi | 0 .../{runtime => belt/src}/Belt_Float.res | 0 .../{runtime => belt/src}/Belt_Float.resi | 0 .../{runtime => belt/src}/Belt_HashMap.res | 0 .../{runtime => belt/src}/Belt_HashMap.resi | 0 .../{runtime => belt/src}/Belt_HashMapInt.res | 0 .../src}/Belt_HashMapInt.resi | 0 .../src}/Belt_HashMapString.res | 0 .../src}/Belt_HashMapString.resi | 0 .../{runtime => belt/src}/Belt_HashSet.res | 0 .../{runtime => belt/src}/Belt_HashSet.resi | 0 .../{runtime => belt/src}/Belt_HashSetInt.res | 0 .../src}/Belt_HashSetInt.resi | 0 .../src}/Belt_HashSetString.res | 0 .../src}/Belt_HashSetString.resi | 0 .../{runtime => belt/src}/Belt_Id.res | 0 .../{runtime => belt/src}/Belt_Id.resi | 0 .../{runtime => belt/src}/Belt_Int.res | 0 .../{runtime => belt/src}/Belt_Int.resi | 0 .../{runtime => belt/src}/Belt_List.res | 0 .../{runtime => belt/src}/Belt_List.resi | 0 .../{runtime => belt/src}/Belt_Map.res | 0 .../{runtime => belt/src}/Belt_Map.resi | 0 .../{runtime => belt/src}/Belt_MapDict.res | 0 .../{runtime => belt/src}/Belt_MapDict.resi | 0 .../{runtime => belt/src}/Belt_MapInt.res | 0 .../{runtime => belt/src}/Belt_MapInt.resi | 0 .../{runtime => belt/src}/Belt_MapString.res | 0 .../{runtime => belt/src}/Belt_MapString.resi | 0 .../{runtime => belt/src}/Belt_MutableMap.res | 0 .../src}/Belt_MutableMap.resi | 0 .../src}/Belt_MutableMapInt.res | 0 .../src}/Belt_MutableMapInt.resi | 0 .../src}/Belt_MutableMapString.res | 0 .../src}/Belt_MutableMapString.resi | 0 .../src}/Belt_MutableQueue.res | 0 .../src}/Belt_MutableQueue.resi | 0 .../{runtime => belt/src}/Belt_MutableSet.res | 0 .../src}/Belt_MutableSet.resi | 0 .../src}/Belt_MutableSetInt.res | 0 .../src}/Belt_MutableSetInt.resi | 0 .../src}/Belt_MutableSetString.res | 0 .../src}/Belt_MutableSetString.resi | 0 .../src}/Belt_MutableStack.res | 0 .../src}/Belt_MutableStack.resi | 0 .../{runtime => belt/src}/Belt_Option.res | 0 .../{runtime => belt/src}/Belt_Option.resi | 0 .../{runtime => belt/src}/Belt_Range.res | 0 .../{runtime => belt/src}/Belt_Range.resi | 0 .../{runtime => belt/src}/Belt_Result.res | 0 .../{runtime => belt/src}/Belt_Result.resi | 0 .../{runtime => belt/src}/Belt_Set.res | 0 .../{runtime => belt/src}/Belt_Set.resi | 0 .../{runtime => belt/src}/Belt_SetDict.res | 0 .../{runtime => belt/src}/Belt_SetDict.resi | 0 .../{runtime => belt/src}/Belt_SetInt.res | 0 .../{runtime => belt/src}/Belt_SetInt.resi | 0 .../{runtime => belt/src}/Belt_SetString.res | 0 .../{runtime => belt/src}/Belt_SetString.resi | 0 .../{runtime => belt/src}/Belt_SortArray.res | 0 .../{runtime => belt/src}/Belt_SortArray.resi | 0 .../src}/Belt_SortArrayInt.res | 0 .../src}/Belt_SortArrayInt.resi | 0 .../src}/Belt_SortArrayString.res | 0 .../src}/Belt_SortArrayString.resi | 0 .../src}/Belt_internalAVLset.res | 0 .../src}/Belt_internalAVLset.resi | 0 .../src}/Belt_internalAVLtree.res | 0 .../src}/Belt_internalAVLtree.resi | 0 .../src}/Belt_internalBuckets.res | 0 .../src}/Belt_internalBuckets.resi | 0 .../src}/Belt_internalBucketsType.res | 0 .../src}/Belt_internalBucketsType.resi | 0 .../src}/Belt_internalMapInt.res | 0 .../src}/Belt_internalMapString.res | 0 .../src}/Belt_internalSetBuckets.res | 0 .../src}/Belt_internalSetBuckets.resi | 0 .../src}/Belt_internalSetInt.res | 0 .../src}/Belt_internalSetString.res | 0 packages/artifacts.json | 420 ++++-------------- rewatch/testrepo/package.json | 1 + rewatch/testrepo/packages/dep02/rescript.json | 2 +- rewatch/testrepo/packages/dep02/src/Array.mjs | 4 +- rewatch/testrepo/packages/main/rescript.json | 2 +- rewatch/testrepo/yarn.lock | 10 + rewatch/tests/add-belt-dependencies.mjs | 26 ++ rewatch/tests/suite.sh | 1 + scripts/res/GenApiDocs.res | 18 +- scripts/res/package.json | 1 + scripts/res/rescript.json | 2 +- scripts/test.js | 4 + scripts/updateArtifactList.js | 2 +- .../deadcode-benchmark/package.json | 1 + .../deadcode-benchmark/rescript.json | 2 +- .../tests-reanalyze/deadcode/package.json | 1 + .../tests-reanalyze/deadcode/rescript.json | 2 +- tests/analysis_tests/tests/package.json | 1 + tests/analysis_tests/tests/rescript.json | 2 +- .../src/expected/CompletionAttributes.res.txt | 3 + tests/build_tests/super_errors/input.js | 14 +- tests/commonjs_tests/package.json | 6 +- tests/commonjs_tests/rescript.json | 1 + tests/commonjs_tests/src/belt_import.js | 2 +- tests/docstring_tests/package.json | 1 + tests/docstring_tests/rescript.json | 1 + .../typescript-react-example/package.json | 1 + .../typescript-react-example/rescript.json | 2 +- .../src/ImmutableArray.res.js | 2 +- .../src/Records.res.js | 6 +- .../src/TestImmutableArray.res.js | 2 +- .../src/nested/Tuples.res.js | 2 +- .../src/nested/Types.res.js | 4 +- .../installation_test/rescript-with-belt.json | 13 + .../installation_test/src/BeltTest.res.txt | 1 + tests/tests/package.json | 1 + tests/tests/rescript.json | 2 +- tests/tests/src/Import.mjs | 46 +- tests/tests/src/UntaggedVariants.mjs | 2 +- tests/tests/src/array_data_util.mjs | 2 +- tests/tests/src/async_await.mjs | 4 +- tests/tests/src/bdd.mjs | 2 +- tests/tests/src/belt_float_test.mjs | 2 +- tests/tests/src/belt_hashmap_test.mjs | 8 +- tests/tests/src/belt_hashset_int_test.mjs | 8 +- tests/tests/src/belt_int_test.mjs | 2 +- tests/tests/src/belt_list_test.mjs | 4 +- tests/tests/src/belt_mapint_test.mjs | 2 +- tests/tests/src/belt_result_alias_test.mjs | 2 +- tests/tests/src/belt_sortarray_test.mjs | 8 +- tests/tests/src/bench.mjs | 2 +- tests/tests/src/block_alias_test.mjs | 2 +- tests/tests/src/bs_array_test.mjs | 4 +- tests/tests/src/bs_map_set_dict_test.mjs | 14 +- tests/tests/src/bs_map_test.mjs | 6 +- tests/tests/src/bs_mutable_set_test.mjs | 8 +- tests/tests/src/bs_poly_map_test.mjs | 8 +- tests/tests/src/bs_poly_mutable_map_test.mjs | 8 +- tests/tests/src/bs_poly_mutable_set_test.mjs | 8 +- tests/tests/src/bs_poly_set_test.mjs | 12 +- tests/tests/src/bs_queue_test.mjs | 4 +- tests/tests/src/bs_set_int_test.mjs | 6 +- tests/tests/src/bs_stack_test.mjs | 4 +- .../tests/src/coercion_module_alias_test.mjs | 2 +- tests/tests/src/cps_test.mjs | 2 +- tests/tests/src/demo_int_map.mjs | 2 +- tests/tests/src/directives.mjs | 2 +- tests/tests/src/earger_curry_test.mjs | 2 +- tests/tests/src/event_ffi.mjs | 2 +- tests/tests/src/exception_alias.mjs | 2 +- tests/tests/src/exception_raise_test.mjs | 2 +- tests/tests/src/ext_array_test.mjs | 4 +- tests/tests/src/flexible_array_test.mjs | 2 +- tests/tests/src/for_loop_test.mjs | 4 +- tests/tests/src/global_module_alias_test.mjs | 2 +- tests/tests/src/gpr_1409_test.mjs | 2 +- tests/tests/src/gpr_1701_test.mjs | 2 +- tests/tests/src/gpr_2487.mjs | 2 +- tests/tests/src/gpr_2608_test.mjs | 2 +- tests/tests/src/gpr_3931_test.mjs | 2 +- tests/tests/src/gpr_4265_test.mjs | 2 +- tests/tests/src/gpr_4274_test.mjs | 4 +- tests/tests/src/hash_test.mjs | 2 +- tests/tests/src/hello_res.mjs | 2 +- tests/tests/src/inline_map2_test.mjs | 2 +- tests/tests/src/inline_map_demo.mjs | 2 +- tests/tests/src/inline_map_test.mjs | 2 +- tests/tests/src/inline_record_test.mjs | 2 +- tests/tests/src/int_map.mjs | 4 +- tests/tests/src/label_uncurry.mjs | 2 +- tests/tests/src/list_test.mjs | 4 +- tests/tests/src/loop_control_test.mjs | 2 +- tests/tests/src/map_find_test.mjs | 6 +- tests/tests/src/mario_game.mjs | 2 +- tests/tests/src/module_alias_test.mjs | 2 +- tests/tests/src/module_missing_conversion.mjs | 2 +- tests/tests/src/module_test.mjs | 2 +- tests/tests/src/nested_module_alias.mjs | 2 +- tests/tests/src/option_repr_test.mjs | 2 +- tests/tests/src/raw_pure_test.mjs | 2 +- tests/tests/src/rec_module_opt.mjs | 2 +- tests/tests/src/record_extension_test.mjs | 2 +- tests/tests/src/recursive_records_test.mjs | 2 +- tests/tests/src/set_gen.mjs | 2 +- tests/tests/src/side_effect2.mjs | 2 +- tests/tests/src/splice_test.mjs | 2 +- .../tests/src/stdlib/Stdlib_IteratorTests.mjs | 2 +- tests/tests/src/string_set.mjs | 4 +- tests/tests/src/tailcall_inline_test.mjs | 2 +- tests/tests/src/test_ari.mjs | 2 +- tests/tests/src/test_array.mjs | 2 +- tests/tests/src/test_array_append.mjs | 2 +- tests/tests/src/test_closure.mjs | 2 +- tests/tests/src/test_cps.mjs | 2 +- tests/tests/src/test_demo.mjs | 2 +- tests/tests/src/test_for_loop.mjs | 2 +- tests/tests/src/test_for_map.mjs | 2 +- tests/tests/src/test_for_map2.mjs | 2 +- tests/tests/src/test_for_of.mjs | 2 +- tests/tests/src/test_functor_dead_code.mjs | 2 +- tests/tests/src/test_google_closure.mjs | 2 +- tests/tests/src/test_include.mjs | 2 +- tests/tests/src/test_int_map_find.mjs | 4 +- tests/tests/src/test_list.mjs | 2 +- tests/tests/src/test_pervasive.mjs | 2 +- tests/tests/src/test_pervasives3.mjs | 2 +- tests/tests/src/test_set.mjs | 2 +- tests/tests/src/test_simple_include.mjs | 2 +- tests/tests/src/test_string_map.mjs | 2 +- tests/tests/src/test_while_closure.mjs | 2 +- tests/tests/src/ticker.mjs | 8 +- tests/tests/src/topsort_test.mjs | 4 +- tests/tests/src/uncurried_cast.mjs | 2 +- tests/tests/src/webpack_config.mjs | 2 +- yarn.lock | 20 + 309 files changed, 638 insertions(+), 605 deletions(-) create mode 100644 packages/@rescript/belt/.gitignore create mode 100644 packages/@rescript/belt/README.md rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Array.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Float.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_HashMap.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_HashMapInt.mjs (97%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_HashMapString.mjs (97%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_HashSet.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_HashSetInt.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_HashSetString.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Id.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Int.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_List.mjs (99%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Map.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MapDict.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MapInt.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MapString.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableMap.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableMapInt.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableMapString.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableQueue.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableSet.mjs (99%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableSetInt.mjs (99%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableSetString.mjs (99%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_MutableStack.mjs (95%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Option.mjs (96%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Range.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Result.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_Set.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_SetDict.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_SetInt.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_SetString.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_SortArray.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_SortArrayInt.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_SortArrayString.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalAVLset.mjs (98%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalAVLtree.mjs (99%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalBuckets.mjs (96%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalBucketsType.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalMapInt.mjs (97%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalMapString.mjs (97%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalSetBuckets.mjs (97%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalSetInt.mjs (100%) rename packages/@rescript/{runtime/lib/es6 => belt/lib/es6/src}/Belt_internalSetString.mjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Array.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Float.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_HashMap.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_HashMapInt.cjs (97%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_HashMapString.cjs (97%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_HashSet.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_HashSetInt.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_HashSetString.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Id.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Int.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_List.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Map.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MapDict.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MapInt.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MapString.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableMap.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableMapInt.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableMapString.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableQueue.cjs (98%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableSet.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableSetInt.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableSetString.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_MutableStack.cjs (95%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Option.cjs (96%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Range.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Result.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_Set.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_SetDict.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_SetInt.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_SetString.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_SortArray.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_SortArrayInt.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_SortArrayString.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalAVLset.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalAVLtree.cjs (99%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalBuckets.cjs (96%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalBucketsType.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalMapInt.cjs (97%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalMapString.cjs (97%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalSetBuckets.cjs (97%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalSetInt.cjs (100%) rename packages/@rescript/{runtime/lib/js => belt/lib/js/src}/Belt_internalSetString.cjs (100%) create mode 100644 packages/@rescript/belt/package.json create mode 100644 packages/@rescript/belt/rescript.json rename packages/@rescript/{runtime => belt/src}/Belt.res (97%) rename packages/@rescript/{runtime => belt/src}/Belt_Array.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Array.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Float.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Float.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashMap.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashMap.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashMapInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashMapInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashMapString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashMapString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashSet.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashSet.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashSetInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashSetInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashSetString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_HashSetString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Id.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Id.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Int.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Int.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_List.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_List.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Map.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Map.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MapDict.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MapDict.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MapInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MapInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MapString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MapString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableMap.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableMap.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableMapInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableMapInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableMapString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableMapString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableQueue.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableQueue.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableSet.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableSet.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableSetInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableSetInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableSetString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableSetString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableStack.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_MutableStack.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Option.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Option.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Range.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Range.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Result.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Result.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Set.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_Set.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SetDict.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SetDict.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SetInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SetInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SetString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SetString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SortArray.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SortArray.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SortArrayInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SortArrayInt.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SortArrayString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_SortArrayString.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalAVLset.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalAVLset.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalAVLtree.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalAVLtree.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalBuckets.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalBuckets.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalBucketsType.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalBucketsType.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalMapInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalMapString.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalSetBuckets.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalSetBuckets.resi (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalSetInt.res (100%) rename packages/@rescript/{runtime => belt/src}/Belt_internalSetString.res (100%) create mode 100644 rewatch/tests/add-belt-dependencies.mjs create mode 100644 tests/package_tests/installation_test/rescript-with-belt.json create mode 100644 tests/package_tests/installation_test/src/BeltTest.res.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ea045088fe..08168eb195a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -179,6 +179,14 @@ jobs: run: git diff --exit-code lib/js lib/es6 working-directory: packages/@rescript/runtime + - name: Build @rescript/belt + run: yarn workspace @rescript/belt build + shell: bash + + - name: Check for changes in @rescript/belt/lib + run: git diff --exit-code lib/js lib/es6 + working-directory: packages/@rescript/belt + - name: Version Check run: yarn constraints @@ -493,12 +501,23 @@ jobs: run: | COMMIT_SHA="${{ needs.pkg-pr-new.outputs.commit_sha }}" npm i --no-audit \ - "https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA}" + "https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA}" \ + "https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@${COMMIT_SHA}" shell: bash working-directory: ${{ steps.tmp-dir.outputs.path }} - name: Test installation - run: npx rescript -h && npx rescript build && cat src/Test.res.js + run: | + npx rescript -h + npx rescript build + cp src/BeltTest.res.txt src/BeltTest.res + if npx rescript build; then + echo "Belt unexpectedly compiled without being listed as a dependency" >&2 + exit 1 + fi + cp rescript-with-belt.json rescript.json + npx rescript build + cat src/BeltTest.res.js shell: bash working-directory: ${{ steps.tmp-dir.outputs.path }} @@ -548,12 +567,23 @@ jobs: COMMIT_SHA="${{ needs.pkg-pr-new.outputs.commit_sha }}" # pnpm 10 blocks pkg.pr.new's URL-based platform subdependencies unless block-exotic-subdeps is disabled. pnpm --config.block-exotic-subdeps=false i \ - "https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA}" + "https://pkg.pr.new/rescript-lang/rescript@${COMMIT_SHA}" \ + "https://pkg.pr.new/rescript-lang/rescript/@rescript/belt@${COMMIT_SHA}" shell: bash working-directory: ${{ steps.tmp-dir.outputs.path }} - name: Test installation - run: pnpm rescript -h && pnpm rescript build && cat src/Test.res.js + run: | + pnpm rescript -h + pnpm rescript build + cp src/BeltTest.res.txt src/BeltTest.res + if pnpm rescript build; then + echo "Belt unexpectedly compiled without being listed as a dependency" >&2 + exit 1 + fi + cp rescript-with-belt.json rescript.json + pnpm rescript build + cat src/BeltTest.res.js shell: bash working-directory: ${{ steps.tmp-dir.outputs.path }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e29f818a89e..3e6e87c7660 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ #### :boom: Breaking Change - Remove the deprecated `Js` namespace and its runtime modules. https://github.com/rescript-lang/rescript/pull/8531 +- Move Belt into the separately installed `@rescript/belt` package. Projects using Belt must install the package and list it in their `rescript.json` dependencies. https://github.com/rescript-lang/rescript/pull/8554 #### :eyeglasses: Spec Compliance diff --git a/Makefile b/Makefile index bec611f7661..6198b497056 100644 --- a/Makefile +++ b/Makefile @@ -41,6 +41,7 @@ endef BIN_DIR := packages/@rescript/$(RESCRIPT_PLATFORM)/bin RUNTIME_DIR := packages/@rescript/runtime +BELT_DIR := packages/@rescript/belt DUNE_BIN_DIR = ./_build/install/default/bin # Build stamps @@ -56,6 +57,8 @@ COMPILER_BUILD_STAMP := _build/log # after running `yarn workspace @rescript/runtime build`, which now runs `touch` # as part of its build script. RUNTIME_BUILD_STAMP := packages/@rescript/runtime/.buildstamp +# Belt workspace touches this stamp after building against the runtime. +BELT_BUILD_STAMP := packages/@rescript/belt/.buildstamp # Default target @@ -127,15 +130,20 @@ clean-compiler: # Runtime / stdlib RUNTIME_SOURCES := $(shell find $(RUNTIME_DIR) -path '$(RUNTIME_DIR)/lib' -prune -o -type f \( -name '*.res' -o -name '*.resi' -o -name 'rescript.json' \) -print) +BELT_SOURCES := $(shell find $(BELT_DIR) -path '$(BELT_DIR)/lib' -prune -o -type f \( -name '*.res' -o -name '*.resi' -o -name 'rescript.json' \) -print) -lib: $(RUNTIME_BUILD_STAMP) +lib: $(RUNTIME_BUILD_STAMP) $(BELT_BUILD_STAMP) $(RUNTIME_BUILD_STAMP): $(RUNTIME_SOURCES) $(COMPILER_EXES) $(RESCRIPT_EXE) | $(YARN_INSTALL_STAMP) yarn workspace @rescript/runtime build +$(BELT_BUILD_STAMP): $(BELT_SOURCES) $(RUNTIME_BUILD_STAMP) $(COMPILER_EXES) $(RESCRIPT_EXE) | $(YARN_INSTALL_STAMP) + yarn workspace @rescript/belt build + clean-lib: + yarn workspace @rescript/belt rescript clean yarn workspace @rescript/runtime rescript clean - rm -f $(RUNTIME_BUILD_STAMP) + rm -f $(RUNTIME_BUILD_STAMP) $(BELT_BUILD_STAMP) # Artifact list diff --git a/packages/@rescript/belt/.gitignore b/packages/@rescript/belt/.gitignore new file mode 100644 index 00000000000..4673ed827b1 --- /dev/null +++ b/packages/@rescript/belt/.gitignore @@ -0,0 +1,13 @@ +lib/bs +lib/ocaml +*.lock +.buildstamp +bs/ +*.ast +*.iast +rescript.lock +.compiler.log +src/*.js +src/*.mjs +src/*.cjs +lib/**/*.res.js diff --git a/packages/@rescript/belt/README.md b/packages/@rescript/belt/README.md new file mode 100644 index 00000000000..8d76ace8ad3 --- /dev/null +++ b/packages/@rescript/belt/README.md @@ -0,0 +1,24 @@ +# @rescript/belt + +Belt is an extended utility and collection library for ReScript. It provides performance-oriented +collection types, with a particular emphasis on immutable collections, alongside utility modules +for common data types and operations. Belt is distributed separately from the compiler and standard +library. + +## Installation + +Install the package with your package manager: + +```sh +npm install @rescript/belt +``` + +Then add it to your `rescript.json` dependencies: + +```json +{ + "dependencies": ["@rescript/belt"] +} +``` + +Belt is not opened automatically. Use modules through names such as `Belt.Array` and `Belt.Map`, or explicitly `open Belt` in source files that should use the shorter module names. diff --git a/packages/@rescript/runtime/lib/es6/Belt.mjs b/packages/@rescript/belt/lib/es6/src/Belt.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_Array.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Array.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_Array.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Array.mjs index f693ae6d07b..bfc5abcc70d 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_Array.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_Array.mjs @@ -1,7 +1,7 @@ -import * as Primitive_int from "./Primitive_int.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function get(arr, i) { if (i >= 0 && i < arr.length) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_Float.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Float.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Float.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Float.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_HashMap.mjs b/packages/@rescript/belt/lib/es6/src/Belt_HashMap.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_HashMap.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_HashMap.mjs index 52ed52a0c4c..c45922bb7a7 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_HashMap.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_HashMap.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalBuckets from "./Belt_internalBuckets.mjs"; import * as Belt_internalBucketsType from "./Belt_internalBucketsType.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_HashMapInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_HashMapInt.mjs similarity index 97% rename from packages/@rescript/runtime/lib/es6/Belt_HashMapInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_HashMapInt.mjs index 9373d41805e..28fd20910a6 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_HashMapInt.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_HashMapInt.mjs @@ -1,7 +1,7 @@ -import * as Primitive_hash from "./Primitive_hash.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_hash from "@rescript/runtime/lib/es6/Primitive_hash.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalBuckets from "./Belt_internalBuckets.mjs"; import * as Belt_internalBucketsType from "./Belt_internalBucketsType.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_HashMapString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_HashMapString.mjs similarity index 97% rename from packages/@rescript/runtime/lib/es6/Belt_HashMapString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_HashMapString.mjs index 18a340640e8..19a9d71371f 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_HashMapString.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_HashMapString.mjs @@ -1,7 +1,7 @@ -import * as Primitive_hash from "./Primitive_hash.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_hash from "@rescript/runtime/lib/es6/Primitive_hash.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalBuckets from "./Belt_internalBuckets.mjs"; import * as Belt_internalBucketsType from "./Belt_internalBucketsType.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_HashSet.mjs b/packages/@rescript/belt/lib/es6/src/Belt_HashSet.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_HashSet.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_HashSet.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_HashSetInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_HashSetInt.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_HashSetInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_HashSetInt.mjs index aecdec398d6..79494aff019 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_HashSetInt.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_HashSetInt.mjs @@ -1,6 +1,6 @@ -import * as Primitive_hash from "./Primitive_hash.mjs"; +import * as Primitive_hash from "@rescript/runtime/lib/es6/Primitive_hash.mjs"; import * as Belt_internalSetBuckets from "./Belt_internalSetBuckets.mjs"; import * as Belt_internalBucketsType from "./Belt_internalBucketsType.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_HashSetString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_HashSetString.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_HashSetString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_HashSetString.mjs index 7c1b6b2a439..d06ccf8445e 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_HashSetString.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_HashSetString.mjs @@ -1,6 +1,6 @@ -import * as Primitive_hash from "./Primitive_hash.mjs"; +import * as Primitive_hash from "@rescript/runtime/lib/es6/Primitive_hash.mjs"; import * as Belt_internalSetBuckets from "./Belt_internalSetBuckets.mjs"; import * as Belt_internalBucketsType from "./Belt_internalBucketsType.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_Id.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Id.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Id.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Id.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_Int.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Int.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Int.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Int.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_List.mjs b/packages/@rescript/belt/lib/es6/src/Belt_List.mjs similarity index 99% rename from packages/@rescript/runtime/lib/es6/Belt_List.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_List.mjs index f1942b4b659..80cd51490a8 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_List.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_List.mjs @@ -2,7 +2,7 @@ import * as Belt_Array from "./Belt_Array.mjs"; import * as Belt_SortArray from "./Belt_SortArray.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function head(x) { if (x !== 0) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_Map.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Map.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Map.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Map.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_MapDict.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MapDict.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MapDict.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MapDict.mjs index cd6869b361e..5a226ffb174 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MapDict.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MapDict.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; function set(t, newK, newD, cmp) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_MapInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MapInt.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MapInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MapInt.mjs index 15535ae39c4..d0e96b75908 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MapInt.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MapInt.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalMapInt from "./Belt_internalMapInt.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MapString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MapString.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MapString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MapString.mjs index 4eccd3c5a21..a80f7eb6efa 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MapString.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MapString.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; import * as Belt_internalMapString from "./Belt_internalMapString.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableMap.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableMap.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MutableMap.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableMap.mjs index 6904df72a89..1946813b92c 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableMap.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableMap.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; function removeMutateAux(nt, x, cmp) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableMapInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableMapInt.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MutableMapInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableMapInt.mjs index c7a5111a0f8..a45deb1acc0 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableMapInt.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableMapInt.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalMapInt from "./Belt_internalMapInt.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableMapString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableMapString.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MutableMapString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableMapString.mjs index 12c23b010ba..7e4683ebadf 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableMapString.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableMapString.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; import * as Belt_internalMapString from "./Belt_internalMapString.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableQueue.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableQueue.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_MutableQueue.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableQueue.mjs index 2640eed1e5c..d31e683f522 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableQueue.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableQueue.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function make() { return { diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableSet.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableSet.mjs similarity index 99% rename from packages/@rescript/runtime/lib/es6/Belt_MutableSet.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableSet.mjs index 0f52938a482..157629c2fa0 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableSet.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableSet.mjs @@ -1,6 +1,6 @@ -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Belt_SortArray from "./Belt_SortArray.mjs"; import * as Belt_internalAVLset from "./Belt_internalAVLset.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableSetInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableSetInt.mjs similarity index 99% rename from packages/@rescript/runtime/lib/es6/Belt_MutableSetInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableSetInt.mjs index 659782e9189..569e1aa5f09 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableSetInt.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableSetInt.mjs @@ -1,6 +1,6 @@ -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Belt_SortArrayInt from "./Belt_SortArrayInt.mjs"; import * as Belt_internalAVLset from "./Belt_internalAVLset.mjs"; import * as Belt_internalSetInt from "./Belt_internalSetInt.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableSetString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableSetString.mjs similarity index 99% rename from packages/@rescript/runtime/lib/es6/Belt_MutableSetString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableSetString.mjs index f63cac40468..202698b5850 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableSetString.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableSetString.mjs @@ -1,6 +1,6 @@ -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Belt_internalAVLset from "./Belt_internalAVLset.mjs"; import * as Belt_SortArrayString from "./Belt_SortArrayString.mjs"; import * as Belt_internalSetString from "./Belt_internalSetString.mjs"; diff --git a/packages/@rescript/runtime/lib/es6/Belt_MutableStack.mjs b/packages/@rescript/belt/lib/es6/src/Belt_MutableStack.mjs similarity index 95% rename from packages/@rescript/runtime/lib/es6/Belt_MutableStack.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_MutableStack.mjs index 25797286152..44aa615c1b0 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_MutableStack.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_MutableStack.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function make() { return { diff --git a/packages/@rescript/runtime/lib/es6/Belt_Option.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Option.mjs similarity index 96% rename from packages/@rescript/runtime/lib/es6/Belt_Option.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Option.mjs index 313c0d158ec..7b28bdb38a1 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_Option.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_Option.mjs @@ -1,6 +1,6 @@ -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function keep(opt, p) { if (opt !== undefined && p(Primitive_option.valFromOption(opt))) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_Range.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Range.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Range.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Range.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_Result.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Result.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Result.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Result.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_Set.mjs b/packages/@rescript/belt/lib/es6/src/Belt_Set.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_Set.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_Set.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_SetDict.mjs b/packages/@rescript/belt/lib/es6/src/Belt_SetDict.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_SetDict.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_SetDict.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_SetInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_SetInt.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_SetInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_SetInt.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_SetString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_SetString.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_SetString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_SetString.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_SortArray.mjs b/packages/@rescript/belt/lib/es6/src/Belt_SortArray.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_SortArray.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_SortArray.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_SortArrayInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_SortArrayInt.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_SortArrayInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_SortArrayInt.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_SortArrayString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_SortArrayString.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_SortArrayString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_SortArrayString.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalAVLset.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalAVLset.mjs similarity index 98% rename from packages/@rescript/runtime/lib/es6/Belt_internalAVLset.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalAVLset.mjs index f679e28aaf3..835d8e243c7 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_internalAVLset.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_internalAVLset.mjs @@ -1,8 +1,8 @@ -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Belt_SortArray from "./Belt_SortArray.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function copy(n) { if (n !== undefined) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalAVLtree.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalAVLtree.mjs similarity index 99% rename from packages/@rescript/runtime/lib/es6/Belt_internalAVLtree.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalAVLtree.mjs index 6f5f86f0aee..b362de4ec2a 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_internalAVLtree.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_internalAVLtree.mjs @@ -1,8 +1,8 @@ -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Belt_SortArray from "./Belt_SortArray.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function treeHeight(n) { if (n !== undefined) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalBuckets.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalBuckets.mjs similarity index 96% rename from packages/@rescript/runtime/lib/es6/Belt_internalBuckets.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalBuckets.mjs index 0ccc15c2f18..b050532526d 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_internalBuckets.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_internalBuckets.mjs @@ -1,8 +1,8 @@ import * as Belt_Array from "./Belt_Array.mjs"; -import * as Primitive_int from "./Primitive_int.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function copyBucket(c) { if (c === undefined) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalBucketsType.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalBucketsType.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_internalBucketsType.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalBucketsType.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalMapInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalMapInt.mjs similarity index 97% rename from packages/@rescript/runtime/lib/es6/Belt_internalMapInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalMapInt.mjs index 687fca236e3..d1902be3004 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_internalMapInt.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_internalMapInt.mjs @@ -1,8 +1,8 @@ -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Belt_SortArray from "./Belt_SortArray.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; function add(t, x, data) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalMapString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalMapString.mjs similarity index 97% rename from packages/@rescript/runtime/lib/es6/Belt_internalMapString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalMapString.mjs index 8db48ead6a5..45a0f989301 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_internalMapString.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_internalMapString.mjs @@ -1,8 +1,8 @@ import * as Belt_SortArray from "./Belt_SortArray.mjs"; -import * as Primitive_option from "./Primitive_option.mjs"; -import * as Primitive_string from "./Primitive_string.mjs"; +import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; +import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.mjs"; import * as Belt_internalAVLtree from "./Belt_internalAVLtree.mjs"; function add(t, x, data) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalSetBuckets.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalSetBuckets.mjs similarity index 97% rename from packages/@rescript/runtime/lib/es6/Belt_internalSetBuckets.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalSetBuckets.mjs index d7a0b685873..9d060ba5e26 100644 --- a/packages/@rescript/runtime/lib/es6/Belt_internalSetBuckets.mjs +++ b/packages/@rescript/belt/lib/es6/src/Belt_internalSetBuckets.mjs @@ -1,7 +1,7 @@ import * as Belt_Array from "./Belt_Array.mjs"; -import * as Primitive_int from "./Primitive_int.mjs"; +import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; function copyAuxCont(_c, _prec) { while (true) { diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalSetInt.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalSetInt.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_internalSetInt.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalSetInt.mjs diff --git a/packages/@rescript/runtime/lib/es6/Belt_internalSetString.mjs b/packages/@rescript/belt/lib/es6/src/Belt_internalSetString.mjs similarity index 100% rename from packages/@rescript/runtime/lib/es6/Belt_internalSetString.mjs rename to packages/@rescript/belt/lib/es6/src/Belt_internalSetString.mjs diff --git a/packages/@rescript/runtime/lib/js/Belt.cjs b/packages/@rescript/belt/lib/js/src/Belt.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt.cjs rename to packages/@rescript/belt/lib/js/src/Belt.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_Array.cjs b/packages/@rescript/belt/lib/js/src/Belt_Array.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_Array.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Array.cjs index cbc613a08fc..e922e627206 100644 --- a/packages/@rescript/runtime/lib/js/Belt_Array.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_Array.cjs @@ -1,7 +1,7 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function get(arr, i) { if (i >= 0 && i < arr.length) { diff --git a/packages/@rescript/runtime/lib/js/Belt_Float.cjs b/packages/@rescript/belt/lib/js/src/Belt_Float.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Float.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Float.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_HashMap.cjs b/packages/@rescript/belt/lib/js/src/Belt_HashMap.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_HashMap.cjs rename to packages/@rescript/belt/lib/js/src/Belt_HashMap.cjs index 6d25fbdcaac..15e97e99393 100644 --- a/packages/@rescript/runtime/lib/js/Belt_HashMap.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_HashMap.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalBuckets = require("./Belt_internalBuckets.cjs"); let Belt_internalBucketsType = require("./Belt_internalBucketsType.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_HashMapInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_HashMapInt.cjs similarity index 97% rename from packages/@rescript/runtime/lib/js/Belt_HashMapInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_HashMapInt.cjs index c713033b200..8bea56463a1 100644 --- a/packages/@rescript/runtime/lib/js/Belt_HashMapInt.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_HashMapInt.cjs @@ -1,7 +1,7 @@ 'use strict'; -let Primitive_hash = require("./Primitive_hash.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_hash = require("@rescript/runtime/lib/js/Primitive_hash.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalBuckets = require("./Belt_internalBuckets.cjs"); let Belt_internalBucketsType = require("./Belt_internalBucketsType.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_HashMapString.cjs b/packages/@rescript/belt/lib/js/src/Belt_HashMapString.cjs similarity index 97% rename from packages/@rescript/runtime/lib/js/Belt_HashMapString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_HashMapString.cjs index 920ca94866b..89e80544db3 100644 --- a/packages/@rescript/runtime/lib/js/Belt_HashMapString.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_HashMapString.cjs @@ -1,7 +1,7 @@ 'use strict'; -let Primitive_hash = require("./Primitive_hash.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_hash = require("@rescript/runtime/lib/js/Primitive_hash.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalBuckets = require("./Belt_internalBuckets.cjs"); let Belt_internalBucketsType = require("./Belt_internalBucketsType.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_HashSet.cjs b/packages/@rescript/belt/lib/js/src/Belt_HashSet.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_HashSet.cjs rename to packages/@rescript/belt/lib/js/src/Belt_HashSet.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_HashSetInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_HashSetInt.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_HashSetInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_HashSetInt.cjs index 564029100ae..01dd05804a4 100644 --- a/packages/@rescript/runtime/lib/js/Belt_HashSetInt.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_HashSetInt.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_hash = require("./Primitive_hash.cjs"); +let Primitive_hash = require("@rescript/runtime/lib/js/Primitive_hash.cjs"); let Belt_internalSetBuckets = require("./Belt_internalSetBuckets.cjs"); let Belt_internalBucketsType = require("./Belt_internalBucketsType.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_HashSetString.cjs b/packages/@rescript/belt/lib/js/src/Belt_HashSetString.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_HashSetString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_HashSetString.cjs index 9c1c0df6948..9299a94e43c 100644 --- a/packages/@rescript/runtime/lib/js/Belt_HashSetString.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_HashSetString.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_hash = require("./Primitive_hash.cjs"); +let Primitive_hash = require("@rescript/runtime/lib/js/Primitive_hash.cjs"); let Belt_internalSetBuckets = require("./Belt_internalSetBuckets.cjs"); let Belt_internalBucketsType = require("./Belt_internalBucketsType.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_Id.cjs b/packages/@rescript/belt/lib/js/src/Belt_Id.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Id.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Id.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_Int.cjs b/packages/@rescript/belt/lib/js/src/Belt_Int.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Int.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Int.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_List.cjs b/packages/@rescript/belt/lib/js/src/Belt_List.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_List.cjs rename to packages/@rescript/belt/lib/js/src/Belt_List.cjs index 1806112a8b4..79a68924b86 100644 --- a/packages/@rescript/runtime/lib/js/Belt_List.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_List.cjs @@ -2,7 +2,7 @@ let Belt_Array = require("./Belt_Array.cjs"); let Belt_SortArray = require("./Belt_SortArray.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function head(x) { if (x !== 0) { diff --git a/packages/@rescript/runtime/lib/js/Belt_Map.cjs b/packages/@rescript/belt/lib/js/src/Belt_Map.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Map.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Map.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_MapDict.cjs b/packages/@rescript/belt/lib/js/src/Belt_MapDict.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_MapDict.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MapDict.cjs index 2da494c41ec..ef04c8d6662 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MapDict.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MapDict.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); function set(t, newK, newD, cmp) { diff --git a/packages/@rescript/runtime/lib/js/Belt_MapInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_MapInt.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_MapInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MapInt.cjs index 468f503562c..efcbb75ea35 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MapInt.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MapInt.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalMapInt = require("./Belt_internalMapInt.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MapString.cjs b/packages/@rescript/belt/lib/js/src/Belt_MapString.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_MapString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MapString.cjs index e68674e64e4..efd44ddfaf5 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MapString.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MapString.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); let Belt_internalMapString = require("./Belt_internalMapString.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableMap.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableMap.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_MutableMap.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableMap.cjs index e1c5bd40e81..ea90a5cf8d7 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableMap.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableMap.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); function removeMutateAux(nt, x, cmp) { diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableMapInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableMapInt.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_MutableMapInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableMapInt.cjs index bb296711ee2..2198e278b30 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableMapInt.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableMapInt.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalMapInt = require("./Belt_internalMapInt.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableMapString.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableMapString.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_MutableMapString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableMapString.cjs index 27dabb44a7b..5cf59381770 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableMapString.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableMapString.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); let Belt_internalMapString = require("./Belt_internalMapString.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableQueue.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableQueue.cjs similarity index 98% rename from packages/@rescript/runtime/lib/js/Belt_MutableQueue.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableQueue.cjs index 6fd919d3f1b..95842f5c257 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableQueue.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableQueue.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function make() { return { diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableSet.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableSet.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_MutableSet.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableSet.cjs index 2d44004d261..9227552a6c1 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableSet.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableSet.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); let Belt_SortArray = require("./Belt_SortArray.cjs"); let Belt_internalAVLset = require("./Belt_internalAVLset.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableSetInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableSetInt.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_MutableSetInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableSetInt.cjs index ef9d822b31e..93e86c0b314 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableSetInt.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableSetInt.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); let Belt_SortArrayInt = require("./Belt_SortArrayInt.cjs"); let Belt_internalAVLset = require("./Belt_internalAVLset.cjs"); let Belt_internalSetInt = require("./Belt_internalSetInt.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableSetString.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableSetString.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_MutableSetString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableSetString.cjs index b1abaccad1a..e2ca6a3320b 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableSetString.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableSetString.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); let Belt_internalAVLset = require("./Belt_internalAVLset.cjs"); let Belt_SortArrayString = require("./Belt_SortArrayString.cjs"); let Belt_internalSetString = require("./Belt_internalSetString.cjs"); diff --git a/packages/@rescript/runtime/lib/js/Belt_MutableStack.cjs b/packages/@rescript/belt/lib/js/src/Belt_MutableStack.cjs similarity index 95% rename from packages/@rescript/runtime/lib/js/Belt_MutableStack.cjs rename to packages/@rescript/belt/lib/js/src/Belt_MutableStack.cjs index d5899040684..79a188cf18f 100644 --- a/packages/@rescript/runtime/lib/js/Belt_MutableStack.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_MutableStack.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function make() { return { diff --git a/packages/@rescript/runtime/lib/js/Belt_Option.cjs b/packages/@rescript/belt/lib/js/src/Belt_Option.cjs similarity index 96% rename from packages/@rescript/runtime/lib/js/Belt_Option.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Option.cjs index 0e272459701..7ba158656cd 100644 --- a/packages/@rescript/runtime/lib/js/Belt_Option.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_Option.cjs @@ -1,6 +1,6 @@ 'use strict'; -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function keep(opt, p) { if (opt !== undefined && p(Primitive_option.valFromOption(opt))) { diff --git a/packages/@rescript/runtime/lib/js/Belt_Range.cjs b/packages/@rescript/belt/lib/js/src/Belt_Range.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Range.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Range.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_Result.cjs b/packages/@rescript/belt/lib/js/src/Belt_Result.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Result.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Result.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_Set.cjs b/packages/@rescript/belt/lib/js/src/Belt_Set.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_Set.cjs rename to packages/@rescript/belt/lib/js/src/Belt_Set.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_SetDict.cjs b/packages/@rescript/belt/lib/js/src/Belt_SetDict.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_SetDict.cjs rename to packages/@rescript/belt/lib/js/src/Belt_SetDict.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_SetInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_SetInt.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_SetInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_SetInt.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_SetString.cjs b/packages/@rescript/belt/lib/js/src/Belt_SetString.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_SetString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_SetString.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_SortArray.cjs b/packages/@rescript/belt/lib/js/src/Belt_SortArray.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_SortArray.cjs rename to packages/@rescript/belt/lib/js/src/Belt_SortArray.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_SortArrayInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_SortArrayInt.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_SortArrayInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_SortArrayInt.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_SortArrayString.cjs b/packages/@rescript/belt/lib/js/src/Belt_SortArrayString.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_SortArrayString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_SortArrayString.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_internalAVLset.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalAVLset.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_internalAVLset.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalAVLset.cjs index 50626ea185f..9be6177fa23 100644 --- a/packages/@rescript/runtime/lib/js/Belt_internalAVLset.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_internalAVLset.cjs @@ -1,8 +1,8 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); let Belt_SortArray = require("./Belt_SortArray.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function copy(n) { if (n !== undefined) { diff --git a/packages/@rescript/runtime/lib/js/Belt_internalAVLtree.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalAVLtree.cjs similarity index 99% rename from packages/@rescript/runtime/lib/js/Belt_internalAVLtree.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalAVLtree.cjs index 1192eb13d88..f3901301301 100644 --- a/packages/@rescript/runtime/lib/js/Belt_internalAVLtree.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_internalAVLtree.cjs @@ -1,8 +1,8 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); let Belt_SortArray = require("./Belt_SortArray.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function treeHeight(n) { if (n !== undefined) { diff --git a/packages/@rescript/runtime/lib/js/Belt_internalBuckets.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalBuckets.cjs similarity index 96% rename from packages/@rescript/runtime/lib/js/Belt_internalBuckets.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalBuckets.cjs index d257c24e91d..8f08e017521 100644 --- a/packages/@rescript/runtime/lib/js/Belt_internalBuckets.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_internalBuckets.cjs @@ -1,8 +1,8 @@ 'use strict'; let Belt_Array = require("./Belt_Array.cjs"); -let Primitive_int = require("./Primitive_int.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); function copyBucket(c) { if (c === undefined) { diff --git a/packages/@rescript/runtime/lib/js/Belt_internalBucketsType.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalBucketsType.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_internalBucketsType.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalBucketsType.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_internalMapInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalMapInt.cjs similarity index 97% rename from packages/@rescript/runtime/lib/js/Belt_internalMapInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalMapInt.cjs index 1c09a9c4e1b..44909443228 100644 --- a/packages/@rescript/runtime/lib/js/Belt_internalMapInt.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_internalMapInt.cjs @@ -1,8 +1,8 @@ 'use strict'; -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); let Belt_SortArray = require("./Belt_SortArray.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); function add(t, x, data) { diff --git a/packages/@rescript/runtime/lib/js/Belt_internalMapString.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalMapString.cjs similarity index 97% rename from packages/@rescript/runtime/lib/js/Belt_internalMapString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalMapString.cjs index 1ff5fa3cb08..0f3018d955e 100644 --- a/packages/@rescript/runtime/lib/js/Belt_internalMapString.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_internalMapString.cjs @@ -1,8 +1,8 @@ 'use strict'; let Belt_SortArray = require("./Belt_SortArray.cjs"); -let Primitive_option = require("./Primitive_option.cjs"); -let Primitive_string = require("./Primitive_string.cjs"); +let Primitive_option = require("@rescript/runtime/lib/js/Primitive_option.cjs"); +let Primitive_string = require("@rescript/runtime/lib/js/Primitive_string.cjs"); let Belt_internalAVLtree = require("./Belt_internalAVLtree.cjs"); function add(t, x, data) { diff --git a/packages/@rescript/runtime/lib/js/Belt_internalSetBuckets.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalSetBuckets.cjs similarity index 97% rename from packages/@rescript/runtime/lib/js/Belt_internalSetBuckets.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalSetBuckets.cjs index f79b21826e9..2c13e6c816a 100644 --- a/packages/@rescript/runtime/lib/js/Belt_internalSetBuckets.cjs +++ b/packages/@rescript/belt/lib/js/src/Belt_internalSetBuckets.cjs @@ -1,7 +1,7 @@ 'use strict'; let Belt_Array = require("./Belt_Array.cjs"); -let Primitive_int = require("./Primitive_int.cjs"); +let Primitive_int = require("@rescript/runtime/lib/js/Primitive_int.cjs"); function copyAuxCont(_c, _prec) { while (true) { diff --git a/packages/@rescript/runtime/lib/js/Belt_internalSetInt.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalSetInt.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_internalSetInt.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalSetInt.cjs diff --git a/packages/@rescript/runtime/lib/js/Belt_internalSetString.cjs b/packages/@rescript/belt/lib/js/src/Belt_internalSetString.cjs similarity index 100% rename from packages/@rescript/runtime/lib/js/Belt_internalSetString.cjs rename to packages/@rescript/belt/lib/js/src/Belt_internalSetString.cjs diff --git a/packages/@rescript/belt/package.json b/packages/@rescript/belt/package.json new file mode 100644 index 00000000000..c820c25c7e7 --- /dev/null +++ b/packages/@rescript/belt/package.json @@ -0,0 +1,51 @@ +{ + "name": "@rescript/belt", + "version": "13.0.0-alpha.6", + "description": "Extended utility and collection library for ReScript", + "license": "MIT", + "homepage": "https://rescript-lang.org", + "bugs": "https://github.com/rescript-lang/rescript/issues", + "repository": { + "type": "git", + "url": "git+https://github.com/rescript-lang/rescript.git" + }, + "author": { + "name": "Hongbo Zhang", + "email": "bobzhang1988@gmail.com" + }, + "maintainers": [ + "Christoph Knittel (https://github.com/cknitt)", + "Cristiano Calcagno (https://github.com/cristianoc)", + "Dmitry Zakharov (https://github.com/DZakh)", + "Florian Hammerschmidt (https://github.com/fhammerschmidt)", + "Gabriel Nordeborn (https://github.com/zth)", + "Hyeseong Kim (https://github.com/cometkim)", + "Jaap Frolich (https://github.com/jfrolich)", + "Matthias Le Brun (https://github.com/bloodyowl)", + "Patrick Ecker (https://github.com/ryyppy)", + "Paul Tsnobiladzé (https://github.com/tsnobip)", + "Shulhi Sapli (https://github.com/shulhi)", + "Woonki Moon (https://github.com/mununki)" + ], + "publishConfig": { + "access": "public", + "provenance": true + }, + "files": [ + "README.md", + "rescript.json", + "src/**/*.res", + "src/**/*.resi" + ], + "scripts": { + "clean": "rescript clean", + "build": "rescript build && touch .buildstamp" + }, + "peerDependencies": { + "rescript": "workspace:^" + }, + "devDependencies": { + "rescript": "workspace:^" + }, + "preferUnplugged": true +} diff --git a/packages/@rescript/belt/rescript.json b/packages/@rescript/belt/rescript.json new file mode 100644 index 00000000000..791e43cd349 --- /dev/null +++ b/packages/@rescript/belt/rescript.json @@ -0,0 +1,30 @@ +{ + "name": "@rescript/belt", + "sources": [ + { + "dir": "src" + } + ], + "package-specs": [ + { + "module": "commonjs", + "suffix": ".cjs", + "in-source": false + }, + { + "module": "esmodule", + "suffix": ".mjs", + "in-source": false + } + ], + "compiler-flags": [ + "-no-keep-locs", + "-no-alias-deps", + "-bs-no-version-header", + "-bs-no-check-div-by-zero", + "-bs-cross-module-opt", + "-unsafe", + "-w -3+50", + "-warn-error A" + ] +} diff --git a/packages/@rescript/runtime/Belt.res b/packages/@rescript/belt/src/Belt.res similarity index 97% rename from packages/@rescript/runtime/Belt.res rename to packages/@rescript/belt/src/Belt.res index 4b59fcb5094..4ac7fdf76da 100644 --- a/packages/@rescript/runtime/Belt.res +++ b/packages/@rescript/belt/src/Belt.res @@ -4,7 +4,7 @@ * SPDX-License-Identifier: MIT */ -/*** The ReScript standard library. +/*** Collection utilities for ReScript. Belt mostly covers collection types. Use the top-level `String` and `Date` modules for string and date functions. @@ -20,6 +20,14 @@ Belt provides: ## Usage +Install `@rescript/belt`, then add it to your project's `rescript.json`: + +```json +{ + "dependencies": ["@rescript/belt"] +} +``` + To use modules from Belt, either refer to them by their fully qualified name (`Belt.List`, `Belt.Array` etc.) or open the `Belt` module by putting ## Examples diff --git a/packages/@rescript/runtime/Belt_Array.res b/packages/@rescript/belt/src/Belt_Array.res similarity index 100% rename from packages/@rescript/runtime/Belt_Array.res rename to packages/@rescript/belt/src/Belt_Array.res diff --git a/packages/@rescript/runtime/Belt_Array.resi b/packages/@rescript/belt/src/Belt_Array.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Array.resi rename to packages/@rescript/belt/src/Belt_Array.resi diff --git a/packages/@rescript/runtime/Belt_Float.res b/packages/@rescript/belt/src/Belt_Float.res similarity index 100% rename from packages/@rescript/runtime/Belt_Float.res rename to packages/@rescript/belt/src/Belt_Float.res diff --git a/packages/@rescript/runtime/Belt_Float.resi b/packages/@rescript/belt/src/Belt_Float.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Float.resi rename to packages/@rescript/belt/src/Belt_Float.resi diff --git a/packages/@rescript/runtime/Belt_HashMap.res b/packages/@rescript/belt/src/Belt_HashMap.res similarity index 100% rename from packages/@rescript/runtime/Belt_HashMap.res rename to packages/@rescript/belt/src/Belt_HashMap.res diff --git a/packages/@rescript/runtime/Belt_HashMap.resi b/packages/@rescript/belt/src/Belt_HashMap.resi similarity index 100% rename from packages/@rescript/runtime/Belt_HashMap.resi rename to packages/@rescript/belt/src/Belt_HashMap.resi diff --git a/packages/@rescript/runtime/Belt_HashMapInt.res b/packages/@rescript/belt/src/Belt_HashMapInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_HashMapInt.res rename to packages/@rescript/belt/src/Belt_HashMapInt.res diff --git a/packages/@rescript/runtime/Belt_HashMapInt.resi b/packages/@rescript/belt/src/Belt_HashMapInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_HashMapInt.resi rename to packages/@rescript/belt/src/Belt_HashMapInt.resi diff --git a/packages/@rescript/runtime/Belt_HashMapString.res b/packages/@rescript/belt/src/Belt_HashMapString.res similarity index 100% rename from packages/@rescript/runtime/Belt_HashMapString.res rename to packages/@rescript/belt/src/Belt_HashMapString.res diff --git a/packages/@rescript/runtime/Belt_HashMapString.resi b/packages/@rescript/belt/src/Belt_HashMapString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_HashMapString.resi rename to packages/@rescript/belt/src/Belt_HashMapString.resi diff --git a/packages/@rescript/runtime/Belt_HashSet.res b/packages/@rescript/belt/src/Belt_HashSet.res similarity index 100% rename from packages/@rescript/runtime/Belt_HashSet.res rename to packages/@rescript/belt/src/Belt_HashSet.res diff --git a/packages/@rescript/runtime/Belt_HashSet.resi b/packages/@rescript/belt/src/Belt_HashSet.resi similarity index 100% rename from packages/@rescript/runtime/Belt_HashSet.resi rename to packages/@rescript/belt/src/Belt_HashSet.resi diff --git a/packages/@rescript/runtime/Belt_HashSetInt.res b/packages/@rescript/belt/src/Belt_HashSetInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_HashSetInt.res rename to packages/@rescript/belt/src/Belt_HashSetInt.res diff --git a/packages/@rescript/runtime/Belt_HashSetInt.resi b/packages/@rescript/belt/src/Belt_HashSetInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_HashSetInt.resi rename to packages/@rescript/belt/src/Belt_HashSetInt.resi diff --git a/packages/@rescript/runtime/Belt_HashSetString.res b/packages/@rescript/belt/src/Belt_HashSetString.res similarity index 100% rename from packages/@rescript/runtime/Belt_HashSetString.res rename to packages/@rescript/belt/src/Belt_HashSetString.res diff --git a/packages/@rescript/runtime/Belt_HashSetString.resi b/packages/@rescript/belt/src/Belt_HashSetString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_HashSetString.resi rename to packages/@rescript/belt/src/Belt_HashSetString.resi diff --git a/packages/@rescript/runtime/Belt_Id.res b/packages/@rescript/belt/src/Belt_Id.res similarity index 100% rename from packages/@rescript/runtime/Belt_Id.res rename to packages/@rescript/belt/src/Belt_Id.res diff --git a/packages/@rescript/runtime/Belt_Id.resi b/packages/@rescript/belt/src/Belt_Id.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Id.resi rename to packages/@rescript/belt/src/Belt_Id.resi diff --git a/packages/@rescript/runtime/Belt_Int.res b/packages/@rescript/belt/src/Belt_Int.res similarity index 100% rename from packages/@rescript/runtime/Belt_Int.res rename to packages/@rescript/belt/src/Belt_Int.res diff --git a/packages/@rescript/runtime/Belt_Int.resi b/packages/@rescript/belt/src/Belt_Int.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Int.resi rename to packages/@rescript/belt/src/Belt_Int.resi diff --git a/packages/@rescript/runtime/Belt_List.res b/packages/@rescript/belt/src/Belt_List.res similarity index 100% rename from packages/@rescript/runtime/Belt_List.res rename to packages/@rescript/belt/src/Belt_List.res diff --git a/packages/@rescript/runtime/Belt_List.resi b/packages/@rescript/belt/src/Belt_List.resi similarity index 100% rename from packages/@rescript/runtime/Belt_List.resi rename to packages/@rescript/belt/src/Belt_List.resi diff --git a/packages/@rescript/runtime/Belt_Map.res b/packages/@rescript/belt/src/Belt_Map.res similarity index 100% rename from packages/@rescript/runtime/Belt_Map.res rename to packages/@rescript/belt/src/Belt_Map.res diff --git a/packages/@rescript/runtime/Belt_Map.resi b/packages/@rescript/belt/src/Belt_Map.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Map.resi rename to packages/@rescript/belt/src/Belt_Map.resi diff --git a/packages/@rescript/runtime/Belt_MapDict.res b/packages/@rescript/belt/src/Belt_MapDict.res similarity index 100% rename from packages/@rescript/runtime/Belt_MapDict.res rename to packages/@rescript/belt/src/Belt_MapDict.res diff --git a/packages/@rescript/runtime/Belt_MapDict.resi b/packages/@rescript/belt/src/Belt_MapDict.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MapDict.resi rename to packages/@rescript/belt/src/Belt_MapDict.resi diff --git a/packages/@rescript/runtime/Belt_MapInt.res b/packages/@rescript/belt/src/Belt_MapInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_MapInt.res rename to packages/@rescript/belt/src/Belt_MapInt.res diff --git a/packages/@rescript/runtime/Belt_MapInt.resi b/packages/@rescript/belt/src/Belt_MapInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MapInt.resi rename to packages/@rescript/belt/src/Belt_MapInt.resi diff --git a/packages/@rescript/runtime/Belt_MapString.res b/packages/@rescript/belt/src/Belt_MapString.res similarity index 100% rename from packages/@rescript/runtime/Belt_MapString.res rename to packages/@rescript/belt/src/Belt_MapString.res diff --git a/packages/@rescript/runtime/Belt_MapString.resi b/packages/@rescript/belt/src/Belt_MapString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MapString.resi rename to packages/@rescript/belt/src/Belt_MapString.resi diff --git a/packages/@rescript/runtime/Belt_MutableMap.res b/packages/@rescript/belt/src/Belt_MutableMap.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableMap.res rename to packages/@rescript/belt/src/Belt_MutableMap.res diff --git a/packages/@rescript/runtime/Belt_MutableMap.resi b/packages/@rescript/belt/src/Belt_MutableMap.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableMap.resi rename to packages/@rescript/belt/src/Belt_MutableMap.resi diff --git a/packages/@rescript/runtime/Belt_MutableMapInt.res b/packages/@rescript/belt/src/Belt_MutableMapInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableMapInt.res rename to packages/@rescript/belt/src/Belt_MutableMapInt.res diff --git a/packages/@rescript/runtime/Belt_MutableMapInt.resi b/packages/@rescript/belt/src/Belt_MutableMapInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableMapInt.resi rename to packages/@rescript/belt/src/Belt_MutableMapInt.resi diff --git a/packages/@rescript/runtime/Belt_MutableMapString.res b/packages/@rescript/belt/src/Belt_MutableMapString.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableMapString.res rename to packages/@rescript/belt/src/Belt_MutableMapString.res diff --git a/packages/@rescript/runtime/Belt_MutableMapString.resi b/packages/@rescript/belt/src/Belt_MutableMapString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableMapString.resi rename to packages/@rescript/belt/src/Belt_MutableMapString.resi diff --git a/packages/@rescript/runtime/Belt_MutableQueue.res b/packages/@rescript/belt/src/Belt_MutableQueue.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableQueue.res rename to packages/@rescript/belt/src/Belt_MutableQueue.res diff --git a/packages/@rescript/runtime/Belt_MutableQueue.resi b/packages/@rescript/belt/src/Belt_MutableQueue.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableQueue.resi rename to packages/@rescript/belt/src/Belt_MutableQueue.resi diff --git a/packages/@rescript/runtime/Belt_MutableSet.res b/packages/@rescript/belt/src/Belt_MutableSet.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableSet.res rename to packages/@rescript/belt/src/Belt_MutableSet.res diff --git a/packages/@rescript/runtime/Belt_MutableSet.resi b/packages/@rescript/belt/src/Belt_MutableSet.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableSet.resi rename to packages/@rescript/belt/src/Belt_MutableSet.resi diff --git a/packages/@rescript/runtime/Belt_MutableSetInt.res b/packages/@rescript/belt/src/Belt_MutableSetInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableSetInt.res rename to packages/@rescript/belt/src/Belt_MutableSetInt.res diff --git a/packages/@rescript/runtime/Belt_MutableSetInt.resi b/packages/@rescript/belt/src/Belt_MutableSetInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableSetInt.resi rename to packages/@rescript/belt/src/Belt_MutableSetInt.resi diff --git a/packages/@rescript/runtime/Belt_MutableSetString.res b/packages/@rescript/belt/src/Belt_MutableSetString.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableSetString.res rename to packages/@rescript/belt/src/Belt_MutableSetString.res diff --git a/packages/@rescript/runtime/Belt_MutableSetString.resi b/packages/@rescript/belt/src/Belt_MutableSetString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableSetString.resi rename to packages/@rescript/belt/src/Belt_MutableSetString.resi diff --git a/packages/@rescript/runtime/Belt_MutableStack.res b/packages/@rescript/belt/src/Belt_MutableStack.res similarity index 100% rename from packages/@rescript/runtime/Belt_MutableStack.res rename to packages/@rescript/belt/src/Belt_MutableStack.res diff --git a/packages/@rescript/runtime/Belt_MutableStack.resi b/packages/@rescript/belt/src/Belt_MutableStack.resi similarity index 100% rename from packages/@rescript/runtime/Belt_MutableStack.resi rename to packages/@rescript/belt/src/Belt_MutableStack.resi diff --git a/packages/@rescript/runtime/Belt_Option.res b/packages/@rescript/belt/src/Belt_Option.res similarity index 100% rename from packages/@rescript/runtime/Belt_Option.res rename to packages/@rescript/belt/src/Belt_Option.res diff --git a/packages/@rescript/runtime/Belt_Option.resi b/packages/@rescript/belt/src/Belt_Option.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Option.resi rename to packages/@rescript/belt/src/Belt_Option.resi diff --git a/packages/@rescript/runtime/Belt_Range.res b/packages/@rescript/belt/src/Belt_Range.res similarity index 100% rename from packages/@rescript/runtime/Belt_Range.res rename to packages/@rescript/belt/src/Belt_Range.res diff --git a/packages/@rescript/runtime/Belt_Range.resi b/packages/@rescript/belt/src/Belt_Range.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Range.resi rename to packages/@rescript/belt/src/Belt_Range.resi diff --git a/packages/@rescript/runtime/Belt_Result.res b/packages/@rescript/belt/src/Belt_Result.res similarity index 100% rename from packages/@rescript/runtime/Belt_Result.res rename to packages/@rescript/belt/src/Belt_Result.res diff --git a/packages/@rescript/runtime/Belt_Result.resi b/packages/@rescript/belt/src/Belt_Result.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Result.resi rename to packages/@rescript/belt/src/Belt_Result.resi diff --git a/packages/@rescript/runtime/Belt_Set.res b/packages/@rescript/belt/src/Belt_Set.res similarity index 100% rename from packages/@rescript/runtime/Belt_Set.res rename to packages/@rescript/belt/src/Belt_Set.res diff --git a/packages/@rescript/runtime/Belt_Set.resi b/packages/@rescript/belt/src/Belt_Set.resi similarity index 100% rename from packages/@rescript/runtime/Belt_Set.resi rename to packages/@rescript/belt/src/Belt_Set.resi diff --git a/packages/@rescript/runtime/Belt_SetDict.res b/packages/@rescript/belt/src/Belt_SetDict.res similarity index 100% rename from packages/@rescript/runtime/Belt_SetDict.res rename to packages/@rescript/belt/src/Belt_SetDict.res diff --git a/packages/@rescript/runtime/Belt_SetDict.resi b/packages/@rescript/belt/src/Belt_SetDict.resi similarity index 100% rename from packages/@rescript/runtime/Belt_SetDict.resi rename to packages/@rescript/belt/src/Belt_SetDict.resi diff --git a/packages/@rescript/runtime/Belt_SetInt.res b/packages/@rescript/belt/src/Belt_SetInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_SetInt.res rename to packages/@rescript/belt/src/Belt_SetInt.res diff --git a/packages/@rescript/runtime/Belt_SetInt.resi b/packages/@rescript/belt/src/Belt_SetInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_SetInt.resi rename to packages/@rescript/belt/src/Belt_SetInt.resi diff --git a/packages/@rescript/runtime/Belt_SetString.res b/packages/@rescript/belt/src/Belt_SetString.res similarity index 100% rename from packages/@rescript/runtime/Belt_SetString.res rename to packages/@rescript/belt/src/Belt_SetString.res diff --git a/packages/@rescript/runtime/Belt_SetString.resi b/packages/@rescript/belt/src/Belt_SetString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_SetString.resi rename to packages/@rescript/belt/src/Belt_SetString.resi diff --git a/packages/@rescript/runtime/Belt_SortArray.res b/packages/@rescript/belt/src/Belt_SortArray.res similarity index 100% rename from packages/@rescript/runtime/Belt_SortArray.res rename to packages/@rescript/belt/src/Belt_SortArray.res diff --git a/packages/@rescript/runtime/Belt_SortArray.resi b/packages/@rescript/belt/src/Belt_SortArray.resi similarity index 100% rename from packages/@rescript/runtime/Belt_SortArray.resi rename to packages/@rescript/belt/src/Belt_SortArray.resi diff --git a/packages/@rescript/runtime/Belt_SortArrayInt.res b/packages/@rescript/belt/src/Belt_SortArrayInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_SortArrayInt.res rename to packages/@rescript/belt/src/Belt_SortArrayInt.res diff --git a/packages/@rescript/runtime/Belt_SortArrayInt.resi b/packages/@rescript/belt/src/Belt_SortArrayInt.resi similarity index 100% rename from packages/@rescript/runtime/Belt_SortArrayInt.resi rename to packages/@rescript/belt/src/Belt_SortArrayInt.resi diff --git a/packages/@rescript/runtime/Belt_SortArrayString.res b/packages/@rescript/belt/src/Belt_SortArrayString.res similarity index 100% rename from packages/@rescript/runtime/Belt_SortArrayString.res rename to packages/@rescript/belt/src/Belt_SortArrayString.res diff --git a/packages/@rescript/runtime/Belt_SortArrayString.resi b/packages/@rescript/belt/src/Belt_SortArrayString.resi similarity index 100% rename from packages/@rescript/runtime/Belt_SortArrayString.resi rename to packages/@rescript/belt/src/Belt_SortArrayString.resi diff --git a/packages/@rescript/runtime/Belt_internalAVLset.res b/packages/@rescript/belt/src/Belt_internalAVLset.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalAVLset.res rename to packages/@rescript/belt/src/Belt_internalAVLset.res diff --git a/packages/@rescript/runtime/Belt_internalAVLset.resi b/packages/@rescript/belt/src/Belt_internalAVLset.resi similarity index 100% rename from packages/@rescript/runtime/Belt_internalAVLset.resi rename to packages/@rescript/belt/src/Belt_internalAVLset.resi diff --git a/packages/@rescript/runtime/Belt_internalAVLtree.res b/packages/@rescript/belt/src/Belt_internalAVLtree.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalAVLtree.res rename to packages/@rescript/belt/src/Belt_internalAVLtree.res diff --git a/packages/@rescript/runtime/Belt_internalAVLtree.resi b/packages/@rescript/belt/src/Belt_internalAVLtree.resi similarity index 100% rename from packages/@rescript/runtime/Belt_internalAVLtree.resi rename to packages/@rescript/belt/src/Belt_internalAVLtree.resi diff --git a/packages/@rescript/runtime/Belt_internalBuckets.res b/packages/@rescript/belt/src/Belt_internalBuckets.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalBuckets.res rename to packages/@rescript/belt/src/Belt_internalBuckets.res diff --git a/packages/@rescript/runtime/Belt_internalBuckets.resi b/packages/@rescript/belt/src/Belt_internalBuckets.resi similarity index 100% rename from packages/@rescript/runtime/Belt_internalBuckets.resi rename to packages/@rescript/belt/src/Belt_internalBuckets.resi diff --git a/packages/@rescript/runtime/Belt_internalBucketsType.res b/packages/@rescript/belt/src/Belt_internalBucketsType.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalBucketsType.res rename to packages/@rescript/belt/src/Belt_internalBucketsType.res diff --git a/packages/@rescript/runtime/Belt_internalBucketsType.resi b/packages/@rescript/belt/src/Belt_internalBucketsType.resi similarity index 100% rename from packages/@rescript/runtime/Belt_internalBucketsType.resi rename to packages/@rescript/belt/src/Belt_internalBucketsType.resi diff --git a/packages/@rescript/runtime/Belt_internalMapInt.res b/packages/@rescript/belt/src/Belt_internalMapInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalMapInt.res rename to packages/@rescript/belt/src/Belt_internalMapInt.res diff --git a/packages/@rescript/runtime/Belt_internalMapString.res b/packages/@rescript/belt/src/Belt_internalMapString.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalMapString.res rename to packages/@rescript/belt/src/Belt_internalMapString.res diff --git a/packages/@rescript/runtime/Belt_internalSetBuckets.res b/packages/@rescript/belt/src/Belt_internalSetBuckets.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalSetBuckets.res rename to packages/@rescript/belt/src/Belt_internalSetBuckets.res diff --git a/packages/@rescript/runtime/Belt_internalSetBuckets.resi b/packages/@rescript/belt/src/Belt_internalSetBuckets.resi similarity index 100% rename from packages/@rescript/runtime/Belt_internalSetBuckets.resi rename to packages/@rescript/belt/src/Belt_internalSetBuckets.resi diff --git a/packages/@rescript/runtime/Belt_internalSetInt.res b/packages/@rescript/belt/src/Belt_internalSetInt.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalSetInt.res rename to packages/@rescript/belt/src/Belt_internalSetInt.res diff --git a/packages/@rescript/runtime/Belt_internalSetString.res b/packages/@rescript/belt/src/Belt_internalSetString.res similarity index 100% rename from packages/@rescript/runtime/Belt_internalSetString.res rename to packages/@rescript/belt/src/Belt_internalSetString.res diff --git a/packages/artifacts.json b/packages/artifacts.json index 1158b170112..84e57cd56b2 100644 --- a/packages/artifacts.json +++ b/packages/artifacts.json @@ -18,49 +18,6 @@ "package.json" ], "@rescript/runtime": [ - "lib/es6/Belt.mjs", - "lib/es6/Belt_Array.mjs", - "lib/es6/Belt_Float.mjs", - "lib/es6/Belt_HashMap.mjs", - "lib/es6/Belt_HashMapInt.mjs", - "lib/es6/Belt_HashMapString.mjs", - "lib/es6/Belt_HashSet.mjs", - "lib/es6/Belt_HashSetInt.mjs", - "lib/es6/Belt_HashSetString.mjs", - "lib/es6/Belt_Id.mjs", - "lib/es6/Belt_Int.mjs", - "lib/es6/Belt_List.mjs", - "lib/es6/Belt_Map.mjs", - "lib/es6/Belt_MapDict.mjs", - "lib/es6/Belt_MapInt.mjs", - "lib/es6/Belt_MapString.mjs", - "lib/es6/Belt_MutableMap.mjs", - "lib/es6/Belt_MutableMapInt.mjs", - "lib/es6/Belt_MutableMapString.mjs", - "lib/es6/Belt_MutableQueue.mjs", - "lib/es6/Belt_MutableSet.mjs", - "lib/es6/Belt_MutableSetInt.mjs", - "lib/es6/Belt_MutableSetString.mjs", - "lib/es6/Belt_MutableStack.mjs", - "lib/es6/Belt_Option.mjs", - "lib/es6/Belt_Range.mjs", - "lib/es6/Belt_Result.mjs", - "lib/es6/Belt_Set.mjs", - "lib/es6/Belt_SetDict.mjs", - "lib/es6/Belt_SetInt.mjs", - "lib/es6/Belt_SetString.mjs", - "lib/es6/Belt_SortArray.mjs", - "lib/es6/Belt_SortArrayInt.mjs", - "lib/es6/Belt_SortArrayString.mjs", - "lib/es6/Belt_internalAVLset.mjs", - "lib/es6/Belt_internalAVLtree.mjs", - "lib/es6/Belt_internalBuckets.mjs", - "lib/es6/Belt_internalBucketsType.mjs", - "lib/es6/Belt_internalMapInt.mjs", - "lib/es6/Belt_internalMapString.mjs", - "lib/es6/Belt_internalSetBuckets.mjs", - "lib/es6/Belt_internalSetInt.mjs", - "lib/es6/Belt_internalSetString.mjs", "lib/es6/Char.mjs", "lib/es6/Dom.mjs", "lib/es6/Dom_storage.mjs", @@ -168,49 +125,6 @@ "lib/es6/Stdlib_Uint8ClampedArray.mjs", "lib/es6/Stdlib_WeakMap.mjs", "lib/es6/Stdlib_WeakSet.mjs", - "lib/js/Belt.cjs", - "lib/js/Belt_Array.cjs", - "lib/js/Belt_Float.cjs", - "lib/js/Belt_HashMap.cjs", - "lib/js/Belt_HashMapInt.cjs", - "lib/js/Belt_HashMapString.cjs", - "lib/js/Belt_HashSet.cjs", - "lib/js/Belt_HashSetInt.cjs", - "lib/js/Belt_HashSetString.cjs", - "lib/js/Belt_Id.cjs", - "lib/js/Belt_Int.cjs", - "lib/js/Belt_List.cjs", - "lib/js/Belt_Map.cjs", - "lib/js/Belt_MapDict.cjs", - "lib/js/Belt_MapInt.cjs", - "lib/js/Belt_MapString.cjs", - "lib/js/Belt_MutableMap.cjs", - "lib/js/Belt_MutableMapInt.cjs", - "lib/js/Belt_MutableMapString.cjs", - "lib/js/Belt_MutableQueue.cjs", - "lib/js/Belt_MutableSet.cjs", - "lib/js/Belt_MutableSetInt.cjs", - "lib/js/Belt_MutableSetString.cjs", - "lib/js/Belt_MutableStack.cjs", - "lib/js/Belt_Option.cjs", - "lib/js/Belt_Range.cjs", - "lib/js/Belt_Result.cjs", - "lib/js/Belt_Set.cjs", - "lib/js/Belt_SetDict.cjs", - "lib/js/Belt_SetInt.cjs", - "lib/js/Belt_SetString.cjs", - "lib/js/Belt_SortArray.cjs", - "lib/js/Belt_SortArrayInt.cjs", - "lib/js/Belt_SortArrayString.cjs", - "lib/js/Belt_internalAVLset.cjs", - "lib/js/Belt_internalAVLtree.cjs", - "lib/js/Belt_internalBuckets.cjs", - "lib/js/Belt_internalBucketsType.cjs", - "lib/js/Belt_internalMapInt.cjs", - "lib/js/Belt_internalMapString.cjs", - "lib/js/Belt_internalSetBuckets.cjs", - "lib/js/Belt_internalSetInt.cjs", - "lib/js/Belt_internalSetString.cjs", "lib/js/Char.cjs", "lib/js/Dom.cjs", "lib/js/Dom_storage.cjs", @@ -318,254 +232,6 @@ "lib/js/Stdlib_Uint8ClampedArray.cjs", "lib/js/Stdlib_WeakMap.cjs", "lib/js/Stdlib_WeakSet.cjs", - "lib/ocaml/Belt.cmi", - "lib/ocaml/Belt.cmj", - "lib/ocaml/Belt.cmt", - "lib/ocaml/Belt.res", - "lib/ocaml/Belt_Array.cmi", - "lib/ocaml/Belt_Array.cmj", - "lib/ocaml/Belt_Array.cmt", - "lib/ocaml/Belt_Array.cmti", - "lib/ocaml/Belt_Array.res", - "lib/ocaml/Belt_Array.resi", - "lib/ocaml/Belt_Float.cmi", - "lib/ocaml/Belt_Float.cmj", - "lib/ocaml/Belt_Float.cmt", - "lib/ocaml/Belt_Float.cmti", - "lib/ocaml/Belt_Float.res", - "lib/ocaml/Belt_Float.resi", - "lib/ocaml/Belt_HashMap.cmi", - "lib/ocaml/Belt_HashMap.cmj", - "lib/ocaml/Belt_HashMap.cmt", - "lib/ocaml/Belt_HashMap.cmti", - "lib/ocaml/Belt_HashMap.res", - "lib/ocaml/Belt_HashMap.resi", - "lib/ocaml/Belt_HashMapInt.cmi", - "lib/ocaml/Belt_HashMapInt.cmj", - "lib/ocaml/Belt_HashMapInt.cmt", - "lib/ocaml/Belt_HashMapInt.cmti", - "lib/ocaml/Belt_HashMapInt.res", - "lib/ocaml/Belt_HashMapInt.resi", - "lib/ocaml/Belt_HashMapString.cmi", - "lib/ocaml/Belt_HashMapString.cmj", - "lib/ocaml/Belt_HashMapString.cmt", - "lib/ocaml/Belt_HashMapString.cmti", - "lib/ocaml/Belt_HashMapString.res", - "lib/ocaml/Belt_HashMapString.resi", - "lib/ocaml/Belt_HashSet.cmi", - "lib/ocaml/Belt_HashSet.cmj", - "lib/ocaml/Belt_HashSet.cmt", - "lib/ocaml/Belt_HashSet.cmti", - "lib/ocaml/Belt_HashSet.res", - "lib/ocaml/Belt_HashSet.resi", - "lib/ocaml/Belt_HashSetInt.cmi", - "lib/ocaml/Belt_HashSetInt.cmj", - "lib/ocaml/Belt_HashSetInt.cmt", - "lib/ocaml/Belt_HashSetInt.cmti", - "lib/ocaml/Belt_HashSetInt.res", - "lib/ocaml/Belt_HashSetInt.resi", - "lib/ocaml/Belt_HashSetString.cmi", - "lib/ocaml/Belt_HashSetString.cmj", - "lib/ocaml/Belt_HashSetString.cmt", - "lib/ocaml/Belt_HashSetString.cmti", - "lib/ocaml/Belt_HashSetString.res", - "lib/ocaml/Belt_HashSetString.resi", - "lib/ocaml/Belt_Id.cmi", - "lib/ocaml/Belt_Id.cmj", - "lib/ocaml/Belt_Id.cmt", - "lib/ocaml/Belt_Id.cmti", - "lib/ocaml/Belt_Id.res", - "lib/ocaml/Belt_Id.resi", - "lib/ocaml/Belt_Int.cmi", - "lib/ocaml/Belt_Int.cmj", - "lib/ocaml/Belt_Int.cmt", - "lib/ocaml/Belt_Int.cmti", - "lib/ocaml/Belt_Int.res", - "lib/ocaml/Belt_Int.resi", - "lib/ocaml/Belt_List.cmi", - "lib/ocaml/Belt_List.cmj", - "lib/ocaml/Belt_List.cmt", - "lib/ocaml/Belt_List.cmti", - "lib/ocaml/Belt_List.res", - "lib/ocaml/Belt_List.resi", - "lib/ocaml/Belt_Map.cmi", - "lib/ocaml/Belt_Map.cmj", - "lib/ocaml/Belt_Map.cmt", - "lib/ocaml/Belt_Map.cmti", - "lib/ocaml/Belt_Map.res", - "lib/ocaml/Belt_Map.resi", - "lib/ocaml/Belt_MapDict.cmi", - "lib/ocaml/Belt_MapDict.cmj", - "lib/ocaml/Belt_MapDict.cmt", - "lib/ocaml/Belt_MapDict.cmti", - "lib/ocaml/Belt_MapDict.res", - "lib/ocaml/Belt_MapDict.resi", - "lib/ocaml/Belt_MapInt.cmi", - "lib/ocaml/Belt_MapInt.cmj", - "lib/ocaml/Belt_MapInt.cmt", - "lib/ocaml/Belt_MapInt.cmti", - "lib/ocaml/Belt_MapInt.res", - "lib/ocaml/Belt_MapInt.resi", - "lib/ocaml/Belt_MapString.cmi", - "lib/ocaml/Belt_MapString.cmj", - "lib/ocaml/Belt_MapString.cmt", - "lib/ocaml/Belt_MapString.cmti", - "lib/ocaml/Belt_MapString.res", - "lib/ocaml/Belt_MapString.resi", - "lib/ocaml/Belt_MutableMap.cmi", - "lib/ocaml/Belt_MutableMap.cmj", - "lib/ocaml/Belt_MutableMap.cmt", - "lib/ocaml/Belt_MutableMap.cmti", - "lib/ocaml/Belt_MutableMap.res", - "lib/ocaml/Belt_MutableMap.resi", - "lib/ocaml/Belt_MutableMapInt.cmi", - "lib/ocaml/Belt_MutableMapInt.cmj", - "lib/ocaml/Belt_MutableMapInt.cmt", - "lib/ocaml/Belt_MutableMapInt.cmti", - "lib/ocaml/Belt_MutableMapInt.res", - "lib/ocaml/Belt_MutableMapInt.resi", - "lib/ocaml/Belt_MutableMapString.cmi", - "lib/ocaml/Belt_MutableMapString.cmj", - "lib/ocaml/Belt_MutableMapString.cmt", - "lib/ocaml/Belt_MutableMapString.cmti", - "lib/ocaml/Belt_MutableMapString.res", - "lib/ocaml/Belt_MutableMapString.resi", - "lib/ocaml/Belt_MutableQueue.cmi", - "lib/ocaml/Belt_MutableQueue.cmj", - "lib/ocaml/Belt_MutableQueue.cmt", - "lib/ocaml/Belt_MutableQueue.cmti", - "lib/ocaml/Belt_MutableQueue.res", - "lib/ocaml/Belt_MutableQueue.resi", - "lib/ocaml/Belt_MutableSet.cmi", - "lib/ocaml/Belt_MutableSet.cmj", - "lib/ocaml/Belt_MutableSet.cmt", - "lib/ocaml/Belt_MutableSet.cmti", - "lib/ocaml/Belt_MutableSet.res", - "lib/ocaml/Belt_MutableSet.resi", - "lib/ocaml/Belt_MutableSetInt.cmi", - "lib/ocaml/Belt_MutableSetInt.cmj", - "lib/ocaml/Belt_MutableSetInt.cmt", - "lib/ocaml/Belt_MutableSetInt.cmti", - "lib/ocaml/Belt_MutableSetInt.res", - "lib/ocaml/Belt_MutableSetInt.resi", - "lib/ocaml/Belt_MutableSetString.cmi", - "lib/ocaml/Belt_MutableSetString.cmj", - "lib/ocaml/Belt_MutableSetString.cmt", - "lib/ocaml/Belt_MutableSetString.cmti", - "lib/ocaml/Belt_MutableSetString.res", - "lib/ocaml/Belt_MutableSetString.resi", - "lib/ocaml/Belt_MutableStack.cmi", - "lib/ocaml/Belt_MutableStack.cmj", - "lib/ocaml/Belt_MutableStack.cmt", - "lib/ocaml/Belt_MutableStack.cmti", - "lib/ocaml/Belt_MutableStack.res", - "lib/ocaml/Belt_MutableStack.resi", - "lib/ocaml/Belt_Option.cmi", - "lib/ocaml/Belt_Option.cmj", - "lib/ocaml/Belt_Option.cmt", - "lib/ocaml/Belt_Option.cmti", - "lib/ocaml/Belt_Option.res", - "lib/ocaml/Belt_Option.resi", - "lib/ocaml/Belt_Range.cmi", - "lib/ocaml/Belt_Range.cmj", - "lib/ocaml/Belt_Range.cmt", - "lib/ocaml/Belt_Range.cmti", - "lib/ocaml/Belt_Range.res", - "lib/ocaml/Belt_Range.resi", - "lib/ocaml/Belt_Result.cmi", - "lib/ocaml/Belt_Result.cmj", - "lib/ocaml/Belt_Result.cmt", - "lib/ocaml/Belt_Result.cmti", - "lib/ocaml/Belt_Result.res", - "lib/ocaml/Belt_Result.resi", - "lib/ocaml/Belt_Set.cmi", - "lib/ocaml/Belt_Set.cmj", - "lib/ocaml/Belt_Set.cmt", - "lib/ocaml/Belt_Set.cmti", - "lib/ocaml/Belt_Set.res", - "lib/ocaml/Belt_Set.resi", - "lib/ocaml/Belt_SetDict.cmi", - "lib/ocaml/Belt_SetDict.cmj", - "lib/ocaml/Belt_SetDict.cmt", - "lib/ocaml/Belt_SetDict.cmti", - "lib/ocaml/Belt_SetDict.res", - "lib/ocaml/Belt_SetDict.resi", - "lib/ocaml/Belt_SetInt.cmi", - "lib/ocaml/Belt_SetInt.cmj", - "lib/ocaml/Belt_SetInt.cmt", - "lib/ocaml/Belt_SetInt.cmti", - "lib/ocaml/Belt_SetInt.res", - "lib/ocaml/Belt_SetInt.resi", - "lib/ocaml/Belt_SetString.cmi", - "lib/ocaml/Belt_SetString.cmj", - "lib/ocaml/Belt_SetString.cmt", - "lib/ocaml/Belt_SetString.cmti", - "lib/ocaml/Belt_SetString.res", - "lib/ocaml/Belt_SetString.resi", - "lib/ocaml/Belt_SortArray.cmi", - "lib/ocaml/Belt_SortArray.cmj", - "lib/ocaml/Belt_SortArray.cmt", - "lib/ocaml/Belt_SortArray.cmti", - "lib/ocaml/Belt_SortArray.res", - "lib/ocaml/Belt_SortArray.resi", - "lib/ocaml/Belt_SortArrayInt.cmi", - "lib/ocaml/Belt_SortArrayInt.cmj", - "lib/ocaml/Belt_SortArrayInt.cmt", - "lib/ocaml/Belt_SortArrayInt.cmti", - "lib/ocaml/Belt_SortArrayInt.res", - "lib/ocaml/Belt_SortArrayInt.resi", - "lib/ocaml/Belt_SortArrayString.cmi", - "lib/ocaml/Belt_SortArrayString.cmj", - "lib/ocaml/Belt_SortArrayString.cmt", - "lib/ocaml/Belt_SortArrayString.cmti", - "lib/ocaml/Belt_SortArrayString.res", - "lib/ocaml/Belt_SortArrayString.resi", - "lib/ocaml/Belt_internalAVLset.cmi", - "lib/ocaml/Belt_internalAVLset.cmj", - "lib/ocaml/Belt_internalAVLset.cmt", - "lib/ocaml/Belt_internalAVLset.cmti", - "lib/ocaml/Belt_internalAVLset.res", - "lib/ocaml/Belt_internalAVLset.resi", - "lib/ocaml/Belt_internalAVLtree.cmi", - "lib/ocaml/Belt_internalAVLtree.cmj", - "lib/ocaml/Belt_internalAVLtree.cmt", - "lib/ocaml/Belt_internalAVLtree.cmti", - "lib/ocaml/Belt_internalAVLtree.res", - "lib/ocaml/Belt_internalAVLtree.resi", - "lib/ocaml/Belt_internalBuckets.cmi", - "lib/ocaml/Belt_internalBuckets.cmj", - "lib/ocaml/Belt_internalBuckets.cmt", - "lib/ocaml/Belt_internalBuckets.cmti", - "lib/ocaml/Belt_internalBuckets.res", - "lib/ocaml/Belt_internalBuckets.resi", - "lib/ocaml/Belt_internalBucketsType.cmi", - "lib/ocaml/Belt_internalBucketsType.cmj", - "lib/ocaml/Belt_internalBucketsType.cmt", - "lib/ocaml/Belt_internalBucketsType.cmti", - "lib/ocaml/Belt_internalBucketsType.res", - "lib/ocaml/Belt_internalBucketsType.resi", - "lib/ocaml/Belt_internalMapInt.cmi", - "lib/ocaml/Belt_internalMapInt.cmj", - "lib/ocaml/Belt_internalMapInt.cmt", - "lib/ocaml/Belt_internalMapInt.res", - "lib/ocaml/Belt_internalMapString.cmi", - "lib/ocaml/Belt_internalMapString.cmj", - "lib/ocaml/Belt_internalMapString.cmt", - "lib/ocaml/Belt_internalMapString.res", - "lib/ocaml/Belt_internalSetBuckets.cmi", - "lib/ocaml/Belt_internalSetBuckets.cmj", - "lib/ocaml/Belt_internalSetBuckets.cmt", - "lib/ocaml/Belt_internalSetBuckets.cmti", - "lib/ocaml/Belt_internalSetBuckets.res", - "lib/ocaml/Belt_internalSetBuckets.resi", - "lib/ocaml/Belt_internalSetInt.cmi", - "lib/ocaml/Belt_internalSetInt.cmj", - "lib/ocaml/Belt_internalSetInt.cmt", - "lib/ocaml/Belt_internalSetInt.res", - "lib/ocaml/Belt_internalSetString.cmi", - "lib/ocaml/Belt_internalSetString.cmj", - "lib/ocaml/Belt_internalSetString.cmt", - "lib/ocaml/Belt_internalSetString.res", "lib/ocaml/Char.cmi", "lib/ocaml/Char.cmj", "lib/ocaml/Char.cmt", @@ -1093,5 +759,91 @@ "lib/ocaml/Stdlib_WeakSet.cmt", "lib/ocaml/Stdlib_WeakSet.res", "package.json" + ], + "@rescript/belt": [ + "README.md", + "package.json", + "rescript.json", + "src/Belt.res", + "src/Belt_Array.res", + "src/Belt_Array.resi", + "src/Belt_Float.res", + "src/Belt_Float.resi", + "src/Belt_HashMap.res", + "src/Belt_HashMap.resi", + "src/Belt_HashMapInt.res", + "src/Belt_HashMapInt.resi", + "src/Belt_HashMapString.res", + "src/Belt_HashMapString.resi", + "src/Belt_HashSet.res", + "src/Belt_HashSet.resi", + "src/Belt_HashSetInt.res", + "src/Belt_HashSetInt.resi", + "src/Belt_HashSetString.res", + "src/Belt_HashSetString.resi", + "src/Belt_Id.res", + "src/Belt_Id.resi", + "src/Belt_Int.res", + "src/Belt_Int.resi", + "src/Belt_List.res", + "src/Belt_List.resi", + "src/Belt_Map.res", + "src/Belt_Map.resi", + "src/Belt_MapDict.res", + "src/Belt_MapDict.resi", + "src/Belt_MapInt.res", + "src/Belt_MapInt.resi", + "src/Belt_MapString.res", + "src/Belt_MapString.resi", + "src/Belt_MutableMap.res", + "src/Belt_MutableMap.resi", + "src/Belt_MutableMapInt.res", + "src/Belt_MutableMapInt.resi", + "src/Belt_MutableMapString.res", + "src/Belt_MutableMapString.resi", + "src/Belt_MutableQueue.res", + "src/Belt_MutableQueue.resi", + "src/Belt_MutableSet.res", + "src/Belt_MutableSet.resi", + "src/Belt_MutableSetInt.res", + "src/Belt_MutableSetInt.resi", + "src/Belt_MutableSetString.res", + "src/Belt_MutableSetString.resi", + "src/Belt_MutableStack.res", + "src/Belt_MutableStack.resi", + "src/Belt_Option.res", + "src/Belt_Option.resi", + "src/Belt_Range.res", + "src/Belt_Range.resi", + "src/Belt_Result.res", + "src/Belt_Result.resi", + "src/Belt_Set.res", + "src/Belt_Set.resi", + "src/Belt_SetDict.res", + "src/Belt_SetDict.resi", + "src/Belt_SetInt.res", + "src/Belt_SetInt.resi", + "src/Belt_SetString.res", + "src/Belt_SetString.resi", + "src/Belt_SortArray.res", + "src/Belt_SortArray.resi", + "src/Belt_SortArrayInt.res", + "src/Belt_SortArrayInt.resi", + "src/Belt_SortArrayString.res", + "src/Belt_SortArrayString.resi", + "src/Belt_internalAVLset.res", + "src/Belt_internalAVLset.resi", + "src/Belt_internalAVLtree.res", + "src/Belt_internalAVLtree.resi", + "src/Belt_internalBuckets.res", + "src/Belt_internalBuckets.resi", + "src/Belt_internalBucketsType.res", + "src/Belt_internalBucketsType.resi", + "src/Belt_internalMapInt.res", + "src/Belt_internalMapString.res", + "src/Belt_internalSetBuckets.res", + "src/Belt_internalSetBuckets.resi", + "src/Belt_internalSetInt.res", + "src/Belt_internalSetString.res" ] } \ No newline at end of file diff --git a/rewatch/testrepo/package.json b/rewatch/testrepo/package.json index ad9299b611b..54c07940792 100644 --- a/rewatch/testrepo/package.json +++ b/rewatch/testrepo/package.json @@ -24,6 +24,7 @@ ] }, "dependencies": { + "@rescript/belt": "file:../../packages/@rescript/belt", "rescript": "12.0.0" }, "scripts": { diff --git a/rewatch/testrepo/packages/dep02/rescript.json b/rewatch/testrepo/packages/dep02/rescript.json index f84064c9cf7..702d3483623 100644 --- a/rewatch/testrepo/packages/dep02/rescript.json +++ b/rewatch/testrepo/packages/dep02/rescript.json @@ -9,5 +9,5 @@ "in-source": true }, "suffix": ".bs.js", - "dependencies": ["@testrepo/new-namespace"] + "dependencies": ["@rescript/belt", "@testrepo/new-namespace"] } diff --git a/rewatch/testrepo/packages/dep02/src/Array.mjs b/rewatch/testrepo/packages/dep02/src/Array.mjs index edd4b1aa680..1d3a8c7bd31 100644 --- a/rewatch/testrepo/packages/dep02/src/Array.mjs +++ b/rewatch/testrepo/packages/dep02/src/Array.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; -import * as Belt_SortArray from "@rescript/runtime/lib/es6/Belt_SortArray.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function includes(prim0, prim1) { diff --git a/rewatch/testrepo/packages/main/rescript.json b/rewatch/testrepo/packages/main/rescript.json index b26faec2af6..e4510889c94 100644 --- a/rewatch/testrepo/packages/main/rescript.json +++ b/rewatch/testrepo/packages/main/rescript.json @@ -9,5 +9,5 @@ "in-source": true }, "suffix": ".bs.js", - "dependencies": ["@testrepo/dep01"] + "dependencies": ["@rescript/belt", "@testrepo/dep01"] } diff --git a/rewatch/testrepo/yarn.lock b/rewatch/testrepo/yarn.lock index acd7382b24b..113de630e58 100644 --- a/rewatch/testrepo/yarn.lock +++ b/rewatch/testrepo/yarn.lock @@ -5,6 +5,15 @@ __metadata: version: 8 cacheKey: 10c0 +"@rescript/belt@file:../../packages/@rescript/belt::locator=testrepo%40workspace%3A.": + version: 13.0.0-alpha.6 + resolution: "@rescript/belt@file:../../packages/@rescript/belt#../../packages/@rescript/belt::hash=c6202c&locator=testrepo%40workspace%3A." + peerDependencies: + rescript: "workspace:^" + checksum: 10c0/2b62136e0b37475dcf468bc116e5d4e81a35d7b3a95c1eecb139506528f4518fdbd4b6eedf319fcff16690a224f7522b03c94bb1352a2dedc7f220e368058893 + languageName: node + linkType: hard + "@rescript/darwin-arm64@npm:12.0.0": version: 12.0.0 resolution: "@rescript/darwin-arm64@npm:12.0.0" @@ -319,6 +328,7 @@ __metadata: version: 0.0.0-use.local resolution: "testrepo@workspace:." dependencies: + "@rescript/belt": "file:../../packages/@rescript/belt" rescript: "npm:12.0.0" languageName: unknown linkType: soft diff --git a/rewatch/tests/add-belt-dependencies.mjs b/rewatch/tests/add-belt-dependencies.mjs new file mode 100644 index 00000000000..a50502a34ab --- /dev/null +++ b/rewatch/tests/add-belt-dependencies.mjs @@ -0,0 +1,26 @@ +#!/usr/bin/env node + +import * as fs from "node:fs/promises"; +import * as path from "node:path"; + +const testrepo = path.join(import.meta.dirname, "..", "testrepo"); +const configs = [ + path.join(testrepo, "node_modules", "rescript-nodejs", "rescript.json"), + path.join( + testrepo, + "packages", + "nohoist", + "node_modules", + "rescript-bun", + "rescript.json", + ), +]; + +for (const configPath of configs) { + const config = JSON.parse(await fs.readFile(configPath, "utf8")); + const dependencies = config.dependencies ?? []; + if (!dependencies.includes("@rescript/belt")) { + config.dependencies = ["@rescript/belt", ...dependencies]; + await fs.writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`); + } +} diff --git a/rewatch/tests/suite.sh b/rewatch/tests/suite.sh index 2d73503c878..22cc77935d7 100755 --- a/rewatch/tests/suite.sh +++ b/rewatch/tests/suite.sh @@ -41,6 +41,7 @@ success "No stale rescript processes found" # the repository-built compiler and runtime. See ../testrepo/README.md. bold "Yarn install" (cd ../testrepo && yarn) +node ./add-belt-dependencies.mjs bold "Rescript version" (cd ../testrepo && ./node_modules/.bin/rescript --version) diff --git a/scripts/res/GenApiDocs.res b/scripts/res/GenApiDocs.res index 49d8323a91e..bf72d64cdf6 100644 --- a/scripts/res/GenApiDocs.res +++ b/scripts/res/GenApiDocs.res @@ -23,7 +23,11 @@ if !Fs.existsSync(dirVersion) { } -let entryPointFiles = ["Belt.res", "Dom.res", "Stdlib.res"] +let entryPointFiles = [ + ("belt", "Belt.res"), + ("runtime", "Dom.res"), + ("runtime", "Stdlib.res"), +] let hiddenModules = [] @@ -44,9 +48,17 @@ type section = { let env = Process.env -let docsDecoded = entryPointFiles->Array.map(libFile => +let docsDecoded = entryPointFiles->Array.map(((packageName, libFile)) => try { - let entryPointFile = Path.join([Node.dirname, "..", "..", "packages", "@rescript", "runtime", libFile]) + let entryPointFile = Path.join([ + Node.dirname, + "..", + "..", + "packages", + "@rescript", + packageName, + packageName == "runtime" ? libFile : Path.join(["src", libFile]), + ]) let rescriptToolsPath = Path.join([Node.dirname, "..", "..", "cli", "rescript-tools.js"]) let output = ChildProcess.execSync( diff --git a/scripts/res/package.json b/scripts/res/package.json index ed2a8a2a3a0..05e89adb508 100644 --- a/scripts/res/package.json +++ b/scripts/res/package.json @@ -9,6 +9,7 @@ "apidocs:generate": "yarn build && node GenApiDocs.res.js" }, "dependencies": { + "@rescript/belt": "workspace:^", "@tests/docstring-tests": "workspace:^", "rescript": "workspace:^" } diff --git a/scripts/res/rescript.json b/scripts/res/rescript.json index 31f7a5c6c36..cbcea617743 100644 --- a/scripts/res/rescript.json +++ b/scripts/res/rescript.json @@ -6,7 +6,7 @@ "dir": "./" } ], - "dependencies": ["@tests/docstring-tests"], + "dependencies": ["@rescript/belt", "@tests/docstring-tests"], "package-specs": { "module": "esmodule", "in-source": true diff --git a/scripts/test.js b/scripts/test.js index 1c9bf3fe752..cfbed1b2009 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -109,6 +109,10 @@ if (mochaTest) { // CommonJS tests const commonjsTestDir = path.join(projectDir, "tests/commonjs_tests"); + await execClean([], { + cwd: commonjsTestDir, + stdio: "inherit", + }); await execBuild([], { cwd: commonjsTestDir, stdio: "inherit", diff --git a/scripts/updateArtifactList.js b/scripts/updateArtifactList.js index 8d5ad1b7e6e..11dbfb10ced 100755 --- a/scripts/updateArtifactList.js +++ b/scripts/updateArtifactList.js @@ -55,7 +55,7 @@ async function getArtifacts(pkg) { /** @type {Record} */ const artifactsPerPackage = {}; -for (const pkg of ["rescript", "@rescript/runtime"]) { +for (const pkg of ["rescript", "@rescript/runtime", "@rescript/belt"]) { artifactsPerPackage[pkg] = await getArtifacts(pkg); } diff --git a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json index b0dd6bd3432..7af9ea08687 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json @@ -6,6 +6,7 @@ "clean": "rescript clean" }, "dependencies": { + "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" } diff --git a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json index a640120b97c..3dbc24ac0ce 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json @@ -7,7 +7,7 @@ }, "name": "reanalyze-benchmark", "jsx": { "version": 4 }, - "dependencies": ["@rescript/react"], + "dependencies": ["@rescript/belt", "@rescript/react"], "sources": [ { "dir": "src", diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/package.json b/tests/analysis_tests/tests-reanalyze/deadcode/package.json index bff46bce04f..b40d999bc70 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/package.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode/package.json @@ -6,6 +6,7 @@ "clean": "rescript clean" }, "dependencies": { + "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" } diff --git a/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json b/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json index 30af93d1ce8..58d3c4d4148 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode/rescript.json @@ -7,7 +7,7 @@ }, "name": "@tests/reanalyze-deadcode", "jsx": { "version": 4 }, - "dependencies": ["@rescript/react"], + "dependencies": ["@rescript/belt", "@rescript/react"], "sources": [ { "dir": "src", diff --git a/tests/analysis_tests/tests/package.json b/tests/analysis_tests/tests/package.json index cabac4a3ebc..5e367b05fee 100644 --- a/tests/analysis_tests/tests/package.json +++ b/tests/analysis_tests/tests/package.json @@ -6,6 +6,7 @@ "clean": "rescript clean" }, "dependencies": { + "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" } diff --git a/tests/analysis_tests/tests/rescript.json b/tests/analysis_tests/tests/rescript.json index f87f7d538a2..2e73a069187 100644 --- a/tests/analysis_tests/tests/rescript.json +++ b/tests/analysis_tests/tests/rescript.json @@ -10,7 +10,7 @@ } ], "compiler-flags": ["-w -33-44-8-26-27-110"], - "dependencies": ["@rescript/react"], + "dependencies": ["@rescript/belt", "@rescript/react"], "jsx": { "version": 4 }, "package-specs": [{ "module": "commonjs", "in-source": false }], "suffix": ".res.js", diff --git a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt index ee833853eec..926cde0dcc2 100644 --- a/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt +++ b/tests/analysis_tests/tests/src/expected/CompletionAttributes.res.txt @@ -24,6 +24,7 @@ Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib [ + { "detail": "Package", "kind": 4, "label": "@rescript/belt", "tags": [] }, { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } @@ -233,6 +234,7 @@ Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib [ + { "detail": "Package", "kind": 4, "label": "@rescript/belt", "tags": [] }, { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } @@ -244,6 +246,7 @@ Completable: CdecoratorPayload(module=) Package opens Stdlib.place holder Pervasives.JsxModules.place holder Resolved opens 1 Stdlib [ + { "detail": "Package", "kind": 4, "label": "@rescript/belt", "tags": [] }, { "detail": "Package", "kind": 4, "label": "@rescript/react", "tags": [] }, { "detail": "Local file", "kind": 4, "label": "./test.json", "tags": [] }, { "detail": "Local file", "kind": 4, "label": "./tst.js", "tags": [] } diff --git a/tests/build_tests/super_errors/input.js b/tests/build_tests/super_errors/input.js index 8b8385dbcbe..25f58eff42d 100644 --- a/tests/build_tests/super_errors/input.js +++ b/tests/build_tests/super_errors/input.js @@ -15,7 +15,19 @@ const fixtures = readdirSync(path.join(import.meta.dirname, "fixtures")) .filter(fileName => path.extname(fileName) === ".res") .sort(); -const prefix = ["-w", "+A", "-bs-jsx", "4"]; +const beltLib = path.join( + import.meta.dirname, + "..", + "..", + "..", + "packages", + "@rescript", + "belt", + "lib", + "ocaml", +); + +const prefix = ["-w", "+A", "-bs-jsx", "4", "-I", beltLib]; const updateTests = process.argv[2] === "update"; diff --git a/tests/commonjs_tests/package.json b/tests/commonjs_tests/package.json index 65eaa8d6ed9..69b69f4589f 100644 --- a/tests/commonjs_tests/package.json +++ b/tests/commonjs_tests/package.json @@ -1,5 +1,9 @@ { "name": "rescript-commonjs-tests", "private": true, - "type": "commonjs" + "type": "commonjs", + "dependencies": { + "@rescript/belt": "workspace:^", + "rescript": "workspace:^" + } } diff --git a/tests/commonjs_tests/rescript.json b/tests/commonjs_tests/rescript.json index 07961edebb5..99881fc3f4f 100644 --- a/tests/commonjs_tests/rescript.json +++ b/tests/commonjs_tests/rescript.json @@ -1,5 +1,6 @@ { "name": "rescript-commonjs-tests", + "dependencies": ["@rescript/belt"], "sources": [ { "dir": "src", diff --git a/tests/commonjs_tests/src/belt_import.js b/tests/commonjs_tests/src/belt_import.js index 1973f2b395a..7cf8919fd11 100644 --- a/tests/commonjs_tests/src/belt_import.js +++ b/tests/commonjs_tests/src/belt_import.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE 'use strict'; -let Belt_MapInt = require("@rescript/runtime/lib/js/Belt_MapInt.cjs"); +let Belt_MapInt = require("@rescript/belt/src/Belt_MapInt.js"); let f = Belt_MapInt.get; diff --git a/tests/docstring_tests/package.json b/tests/docstring_tests/package.json index bf66f5bc3e0..0d291141595 100644 --- a/tests/docstring_tests/package.json +++ b/tests/docstring_tests/package.json @@ -8,6 +8,7 @@ "dev": "rescript -w" }, "dependencies": { + "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" } diff --git a/tests/docstring_tests/rescript.json b/tests/docstring_tests/rescript.json index 19bad773ee7..337c4724896 100644 --- a/tests/docstring_tests/rescript.json +++ b/tests/docstring_tests/rescript.json @@ -3,6 +3,7 @@ "sources": { "dir": "." }, + "dependencies": ["@rescript/belt"], "package-specs": { "module": "esmodule", "in-source": true diff --git a/tests/gentype_tests/typescript-react-example/package.json b/tests/gentype_tests/typescript-react-example/package.json index 25429abbd85..dca99323005 100644 --- a/tests/gentype_tests/typescript-react-example/package.json +++ b/tests/gentype_tests/typescript-react-example/package.json @@ -8,6 +8,7 @@ "typecheck": "tsc" }, "dependencies": { + "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "react": "^19.2.8", "react-dom": "^19.2.8", diff --git a/tests/gentype_tests/typescript-react-example/rescript.json b/tests/gentype_tests/typescript-react-example/rescript.json index 00ecbd68bad..e1b9ea4efdb 100644 --- a/tests/gentype_tests/typescript-react-example/rescript.json +++ b/tests/gentype_tests/typescript-react-example/rescript.json @@ -18,7 +18,7 @@ "name": "@tests/gentype-react-example", "compiler-flags": [], "jsx": { "version": 4 }, - "dependencies": ["@rescript/react"], + "dependencies": ["@rescript/belt", "@rescript/react"], "sources": [ { "dir": "src", diff --git a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js index 624a05dd831..b3685b361d1 100644 --- a/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js +++ b/tests/gentype_tests/typescript-react-example/src/ImmutableArray.res.js @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.res.js"; function fromArray(a) { return a.slice(0); diff --git a/tests/gentype_tests/typescript-react-example/src/Records.res.js b/tests/gentype_tests/typescript-react-example/src/Records.res.js index fb6b21fa820..cc58487d4db 100644 --- a/tests/gentype_tests/typescript-react-example/src/Records.res.js +++ b/tests/gentype_tests/typescript-react-example/src/Records.res.js @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; -import * as Belt_Option from "@rescript/runtime/lib/es6/Belt_Option.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.res.js"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.res.js"; +import * as Belt_Option from "@rescript/belt/lib/es6/src/Belt_Option.res.js"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function computeArea(param) { diff --git a/tests/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js b/tests/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js index cc796d2b9c3..07280d49f1f 100644 --- a/tests/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js +++ b/tests/gentype_tests/typescript-react-example/src/TestImmutableArray.res.js @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.res.js"; import * as ImmutableArray from "./ImmutableArray.res.js"; function testImmutableArrayGet(arr) { diff --git a/tests/gentype_tests/typescript-react-example/src/nested/Tuples.res.js b/tests/gentype_tests/typescript-react-example/src/nested/Tuples.res.js index c26755f2520..eb4b380db0c 100644 --- a/tests/gentype_tests/typescript-react-example/src/nested/Tuples.res.js +++ b/tests/gentype_tests/typescript-react-example/src/nested/Tuples.res.js @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Option from "@rescript/runtime/lib/es6/Belt_Option.mjs"; +import * as Belt_Option from "@rescript/belt/lib/es6/src/Belt_Option.res.js"; function testTuple(param) { return param[0] + param[1] | 0; diff --git a/tests/gentype_tests/typescript-react-example/src/nested/Types.res.js b/tests/gentype_tests/typescript-react-example/src/nested/Types.res.js index 0ec0a547c38..c05d7b019d4 100644 --- a/tests/gentype_tests/typescript-react-example/src/nested/Types.res.js +++ b/tests/gentype_tests/typescript-react-example/src/nested/Types.res.js @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Option from "@rescript/runtime/lib/es6/Belt_Option.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.res.js"; +import * as Belt_Option from "@rescript/belt/lib/es6/src/Belt_Option.res.js"; function swap(tree) { return { diff --git a/tests/package_tests/installation_test/rescript-with-belt.json b/tests/package_tests/installation_test/rescript-with-belt.json new file mode 100644 index 00000000000..8577e47a728 --- /dev/null +++ b/tests/package_tests/installation_test/rescript-with-belt.json @@ -0,0 +1,13 @@ +{ + "name": "install-test", + "sources": { + "dir": "src", + "subdirs": true + }, + "package-specs": { + "module": "esmodule", + "in-source": true, + "suffix": ".res.js" + }, + "dependencies": ["@rescript/belt"] +} diff --git a/tests/package_tests/installation_test/src/BeltTest.res.txt b/tests/package_tests/installation_test/src/BeltTest.res.txt new file mode 100644 index 00000000000..ab2fb85e449 --- /dev/null +++ b/tests/package_tests/installation_test/src/BeltTest.res.txt @@ -0,0 +1 @@ +Console.log(Belt.Int.toString(42)) diff --git a/tests/tests/package.json b/tests/tests/package.json index 7b03eaa4cbd..fe64f16f0f1 100644 --- a/tests/tests/package.json +++ b/tests/tests/package.json @@ -2,6 +2,7 @@ "name": "rescript-tests", "private": true, "dependencies": { + "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" }, diff --git a/tests/tests/rescript.json b/tests/tests/rescript.json index b79f9f59b20..c0ffcc409b8 100644 --- a/tests/tests/rescript.json +++ b/tests/tests/rescript.json @@ -11,7 +11,7 @@ "in-source": true, "suffix": ".mjs" }, - "dependencies": ["@rescript/react"], + "dependencies": ["@rescript/belt", "@rescript/react"], "compiler-flags": [ "-check-lam", "-w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104", diff --git a/tests/tests/src/Import.mjs b/tests/tests/src/Import.mjs index 9107520fe8f..2300dfe17a0 100644 --- a/tests/tests/src/Import.mjs +++ b/tests/tests/src/Import.mjs @@ -2,11 +2,11 @@ async function eachIntAsync(list, f) { - return (await import("@rescript/runtime/lib/es6/Belt_List.mjs").then(m => m.forEach))(list, f); + return (await import("@rescript/belt/src/Belt_List.mjs").then(m => m.forEach))(list, f); } function eachIntLazy(list, f) { - return import("@rescript/runtime/lib/es6/Belt_List.mjs").then(m => m.forEach).then(each => Promise.resolve(each(list, f))); + return import("@rescript/belt/src/Belt_List.mjs").then(m => m.forEach).then(each => Promise.resolve(each(list, f))); } eachIntLazy({ @@ -35,13 +35,13 @@ eachIntAsync({ console.log("async", n); }); -let beltAsModule = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let beltAsModule = await import("@rescript/belt/src/Belt_List.mjs"); -let M = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let M = await import("@rescript/belt/src/Belt_List.mjs"); -let N0 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let N0 = await import("@rescript/belt/src/Belt_List.mjs"); -let O = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let O = await import("@rescript/belt/src/Belt_List.mjs"); let N1_each = O.forEach; @@ -50,7 +50,7 @@ let N1 = { each: N1_each }; -let N2 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let N2 = await import("@rescript/belt/src/Belt_List.mjs"); let N_each = N2.forEach; @@ -61,21 +61,21 @@ let N = { each: N_each }; -let M0 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let M0 = await import("@rescript/belt/src/Belt_List.mjs"); -let M1 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); +let M1 = await import("@rescript/belt/src/Belt_List.mjs"); async function f() { - return (await import("@rescript/runtime/lib/es6/Belt_List.mjs")).forEach; + return (await import("@rescript/belt/src/Belt_List.mjs")).forEach; } async function f1() { - return (await import("@rescript/runtime/lib/es6/Belt_List.mjs")).forEach; + return (await import("@rescript/belt/src/Belt_List.mjs")).forEach; } async function f2() { - let M3 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); - let M4 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); + let M3 = await import("@rescript/belt/src/Belt_List.mjs"); + let M4 = await import("@rescript/belt/src/Belt_List.mjs"); return [ M3.forEach, M4.forEach @@ -83,8 +83,8 @@ async function f2() { } async function f3() { - let M3 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); - let M4 = await import("@rescript/runtime/lib/es6/Belt_List.mjs"); + let M3 = await import("@rescript/belt/src/Belt_List.mjs"); + let M4 = await import("@rescript/belt/src/Belt_List.mjs"); return [ M3.forEach, M4.forEach @@ -92,12 +92,12 @@ async function f3() { } async function f4() { - return (await import("@rescript/runtime/lib/es6/Belt_Array.mjs")).forEach; + return (await import("@rescript/belt/src/Belt_Array.mjs")).forEach; } async function f5() { - let A = await import("@rescript/runtime/lib/es6/Belt_Array.mjs"); - let O = await import("@rescript/runtime/lib/es6/Belt_Option.mjs"); + let A = await import("@rescript/belt/src/Belt_Array.mjs"); + let O = await import("@rescript/belt/src/Belt_Option.mjs"); return [ A.forEach, O.forEach @@ -105,8 +105,8 @@ async function f5() { } async function f6() { - let MS = await import("@rescript/runtime/lib/es6/Belt_MapString.mjs"); - let A = await import("@rescript/runtime/lib/es6/Belt_Array.mjs"); + let MS = await import("@rescript/belt/src/Belt_MapString.mjs"); + let A = await import("@rescript/belt/src/Belt_Array.mjs"); return [ 0, MS.forEach, @@ -115,18 +115,18 @@ async function f6() { } async function f7() { - await import("@rescript/runtime/lib/es6/Belt_MapInt.mjs"); + await import("@rescript/belt/src/Belt_MapInt.mjs"); return 1; } async function f8() { - await import("@rescript/runtime/lib/es6/Belt_MutableQueue.mjs"); + await import("@rescript/belt/src/Belt_MutableQueue.mjs"); return 1; } async function f9(value) { if (value !== undefined) { - await import("@rescript/runtime/lib/es6/Belt_HashMapInt.mjs"); + await import("@rescript/belt/src/Belt_HashMapInt.mjs"); return; } } diff --git a/tests/tests/src/UntaggedVariants.mjs b/tests/tests/src/UntaggedVariants.mjs index ade41daad7f..1399439f905 100644 --- a/tests/tests/src/UntaggedVariants.mjs +++ b/tests/tests/src/UntaggedVariants.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function classify(x) { diff --git a/tests/tests/src/array_data_util.mjs b/tests/tests/src/array_data_util.mjs index 2e43750e14e..dc18d1d4bf5 100644 --- a/tests/tests/src/array_data_util.mjs +++ b/tests/tests/src/array_data_util.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; function range(i, j) { return Belt_Array.makeBy((j - i | 0) + 1 | 0, k => k + i | 0); diff --git a/tests/tests/src/async_await.mjs b/tests/tests/src/async_await.mjs index c8059798bad..7d6ff72f39c 100644 --- a/tests/tests/src/async_await.mjs +++ b/tests/tests/src/async_await.mjs @@ -35,11 +35,11 @@ async function f(value) { } async function f0() { - return (await import("@rescript/runtime/lib/es6/Belt_Option.mjs")).forEach; + return (await import("@rescript/belt/src/Belt_Option.mjs")).forEach; } async function f1() { - return (await import("@rescript/runtime/lib/es6/Belt_Option.mjs")).forEach; + return (await import("@rescript/belt/src/Belt_Option.mjs")).forEach; } export { diff --git a/tests/tests/src/bdd.mjs b/tests/tests/src/bdd.mjs index 7dfffc0f31e..c436388d7da 100644 --- a/tests/tests/src/bdd.mjs +++ b/tests/tests/src/bdd.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; function $$eval(_bdd, vars) { while (true) { diff --git a/tests/tests/src/belt_float_test.mjs b/tests/tests/src/belt_float_test.mjs index d424e7d5c16..7edabc0ba66 100644 --- a/tests/tests/src/belt_float_test.mjs +++ b/tests/tests/src/belt_float_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Float from "@rescript/runtime/lib/es6/Belt_Float.mjs"; +import * as Belt_Float from "@rescript/belt/src/Belt_Float.mjs"; import * as Test_utils from "./test_utils.mjs"; Mocha.describe("Belt_float_test", () => { diff --git a/tests/tests/src/belt_hashmap_test.mjs b/tests/tests/src/belt_hashmap_test.mjs index 62d33a0b7e7..0999ac84eda 100644 --- a/tests/tests/src/belt_hashmap_test.mjs +++ b/tests/tests/src/belt_hashmap_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Hash_utils from "./hash_utils.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_HashMap from "@rescript/runtime/lib/es6/Belt_HashMap.mjs"; +import * as Belt_HashMap from "@rescript/belt/src/Belt_HashMap.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; -import * as Belt_SortArray from "@rescript/runtime/lib/es6/Belt_SortArray.mjs"; +import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; import * as Array_data_util from "./array_data_util.mjs"; function intEq(x, y) { diff --git a/tests/tests/src/belt_hashset_int_test.mjs b/tests/tests/src/belt_hashset_int_test.mjs index d24f7bbae60..9583dca2530 100644 --- a/tests/tests/src/belt_hashset_int_test.mjs +++ b/tests/tests/src/belt_hashset_int_test.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SetInt from "@rescript/runtime/lib/es6/Belt_SetInt.mjs"; +import * as Belt_SetInt from "@rescript/belt/src/Belt_SetInt.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_HashSetInt from "@rescript/runtime/lib/es6/Belt_HashSetInt.mjs"; -import * as Belt_SortArrayInt from "@rescript/runtime/lib/es6/Belt_SortArrayInt.mjs"; +import * as Belt_HashSetInt from "@rescript/belt/src/Belt_HashSetInt.mjs"; +import * as Belt_SortArrayInt from "@rescript/belt/src/Belt_SortArrayInt.mjs"; function add(x, y) { return x + y | 0; diff --git a/tests/tests/src/belt_int_test.mjs b/tests/tests/src/belt_int_test.mjs index 6abc1bb12fe..d8f183e1d23 100644 --- a/tests/tests/src/belt_int_test.mjs +++ b/tests/tests/src/belt_int_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Int from "@rescript/runtime/lib/es6/Belt_Int.mjs"; +import * as Belt_Int from "@rescript/belt/src/Belt_Int.mjs"; import * as Test_utils from "./test_utils.mjs"; Mocha.describe("Belt_int_test", () => { diff --git a/tests/tests/src/belt_list_test.mjs b/tests/tests/src/belt_list_test.mjs index 3eb0243519e..4b33795ccbe 100644 --- a/tests/tests/src/belt_list_test.mjs +++ b/tests/tests/src/belt_list_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/belt_mapint_test.mjs b/tests/tests/src/belt_mapint_test.mjs index 9b7d1b9ccfc..80562534bda 100644 --- a/tests/tests/src/belt_mapint_test.mjs +++ b/tests/tests/src/belt_mapint_test.mjs @@ -2,7 +2,7 @@ import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; Mocha.describe("Belt_mapint_test", () => { Mocha.test("set", () => { diff --git a/tests/tests/src/belt_result_alias_test.mjs b/tests/tests/src/belt_result_alias_test.mjs index 4bf69e4f5fe..c2db2db3003 100644 --- a/tests/tests/src/belt_result_alias_test.mjs +++ b/tests/tests/src/belt_result_alias_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Result from "@rescript/runtime/lib/es6/Belt_Result.mjs"; +import * as Belt_Result from "@rescript/belt/src/Belt_Result.mjs"; Belt_Result.map({ TAG: "Ok", diff --git a/tests/tests/src/belt_sortarray_test.mjs b/tests/tests/src/belt_sortarray_test.mjs index 57e73eb832a..7c7950be5e6 100644 --- a/tests/tests/src/belt_sortarray_test.mjs +++ b/tests/tests/src/belt_sortarray_test.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; -import * as Belt_Range from "@rescript/runtime/lib/es6/Belt_Range.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Range from "@rescript/belt/src/Belt_Range.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SortArray from "@rescript/runtime/lib/es6/Belt_SortArray.mjs"; +import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_SortArrayInt from "@rescript/runtime/lib/es6/Belt_SortArrayInt.mjs"; +import * as Belt_SortArrayInt from "@rescript/belt/src/Belt_SortArrayInt.mjs"; function cmp(x, y) { return x - y | 0; diff --git a/tests/tests/src/bench.mjs b/tests/tests/src/bench.mjs index f86e79938d0..5c51cdba820 100644 --- a/tests/tests/src/bench.mjs +++ b/tests/tests/src/bench.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; function map(f, a) { diff --git a/tests/tests/src/block_alias_test.mjs b/tests/tests/src/block_alias_test.mjs index edb7b0b9856..0572eefab37 100644 --- a/tests/tests/src/block_alias_test.mjs +++ b/tests/tests/src/block_alias_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/bs_array_test.mjs b/tests/tests/src/bs_array_test.mjs index b0cdf6d1c4d..94d4b89a38a 100644 --- a/tests/tests/src/bs_array_test.mjs +++ b/tests/tests/src/bs_array_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; diff --git a/tests/tests/src/bs_map_set_dict_test.mjs b/tests/tests/src/bs_map_set_dict_test.mjs index 1a34072de82..3ce435a6abd 100644 --- a/tests/tests/src/bs_map_set_dict_test.mjs +++ b/tests/tests/src/bs_map_set_dict_test.mjs @@ -1,14 +1,14 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_Map from "@rescript/runtime/lib/es6/Belt_Map.mjs"; -import * as Belt_Set from "@rescript/runtime/lib/es6/Belt_Set.mjs"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Map from "@rescript/belt/src/Belt_Map.mjs"; +import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MapDict from "@rescript/runtime/lib/es6/Belt_MapDict.mjs"; -import * as Belt_SetDict from "@rescript/runtime/lib/es6/Belt_SetDict.mjs"; +import * as Belt_MapDict from "@rescript/belt/src/Belt_MapDict.mjs"; +import * as Belt_SetDict from "@rescript/belt/src/Belt_SetDict.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; diff --git a/tests/tests/src/bs_map_test.mjs b/tests/tests/src/bs_map_test.mjs index 66a034bf8d4..726b737f9fd 100644 --- a/tests/tests/src/bs_map_test.mjs +++ b/tests/tests/src/bs_map_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; -import * as Belt_SetInt from "@rescript/runtime/lib/es6/Belt_SetInt.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_SetInt from "@rescript/belt/src/Belt_SetInt.mjs"; let mapOfArray = Belt_MapInt.fromArray; diff --git a/tests/tests/src/bs_mutable_set_test.mjs b/tests/tests/src/bs_mutable_set_test.mjs index 6b9f967a068..af6f3bdad1a 100644 --- a/tests/tests/src/bs_mutable_set_test.mjs +++ b/tests/tests/src/bs_mutable_set_test.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; -import * as Belt_Range from "@rescript/runtime/lib/es6/Belt_Range.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Range from "@rescript/belt/src/Belt_Range.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_MutableSetInt from "@rescript/runtime/lib/es6/Belt_MutableSetInt.mjs"; +import * as Belt_MutableSetInt from "@rescript/belt/src/Belt_MutableSetInt.mjs"; Mocha.describe("Bs_mutable_set_test", () => { Mocha.test("mutable set basic operations", () => { diff --git a/tests/tests/src/bs_poly_map_test.mjs b/tests/tests/src/bs_poly_map_test.mjs index 4a24f1e4c10..4c065e5e8e5 100644 --- a/tests/tests/src/bs_poly_map_test.mjs +++ b/tests/tests/src/bs_poly_map_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_Map from "@rescript/runtime/lib/es6/Belt_Map.mjs"; -import * as Belt_Set from "@rescript/runtime/lib/es6/Belt_Set.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Map from "@rescript/belt/src/Belt_Map.mjs"; +import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; diff --git a/tests/tests/src/bs_poly_mutable_map_test.mjs b/tests/tests/src/bs_poly_mutable_map_test.mjs index 67a795d0e91..0393977a567 100644 --- a/tests/tests/src/bs_poly_mutable_map_test.mjs +++ b/tests/tests/src/bs_poly_mutable_map_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_Set from "@rescript/runtime/lib/es6/Belt_Set.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_MutableMap from "@rescript/runtime/lib/es6/Belt_MutableMap.mjs"; +import * as Belt_MutableMap from "@rescript/belt/src/Belt_MutableMap.mjs"; let Icmp = Belt_Id.comparable(Primitive_int.compare); diff --git a/tests/tests/src/bs_poly_mutable_set_test.mjs b/tests/tests/src/bs_poly_mutable_set_test.mjs index 40c03e50675..e36de3f4267 100644 --- a/tests/tests/src/bs_poly_mutable_set_test.mjs +++ b/tests/tests/src/bs_poly_mutable_set_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_MutableSet from "@rescript/runtime/lib/es6/Belt_MutableSet.mjs"; +import * as Belt_MutableSet from "@rescript/belt/src/Belt_MutableSet.mjs"; let IntCmp = Belt_Id.comparable(Primitive_int.compare); diff --git a/tests/tests/src/bs_poly_set_test.mjs b/tests/tests/src/bs_poly_set_test.mjs index 764f7b0fe0c..c8e65e300a5 100644 --- a/tests/tests/src/bs_poly_set_test.mjs +++ b/tests/tests/src/bs_poly_set_test.mjs @@ -1,14 +1,14 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_Set from "@rescript/runtime/lib/es6/Belt_Set.mjs"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SetDict from "@rescript/runtime/lib/es6/Belt_SetDict.mjs"; +import * as Belt_SetDict from "@rescript/belt/src/Belt_SetDict.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; -import * as Belt_SortArray from "@rescript/runtime/lib/es6/Belt_SortArray.mjs"; +import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; import * as Array_data_util from "./array_data_util.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/bs_queue_test.mjs b/tests/tests/src/bs_queue_test.mjs index b1551d86463..757a57e52a5 100644 --- a/tests/tests/src/bs_queue_test.mjs +++ b/tests/tests/src/bs_queue_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; -import * as Belt_MutableQueue from "@rescript/runtime/lib/es6/Belt_MutableQueue.mjs"; +import * as Belt_MutableQueue from "@rescript/belt/src/Belt_MutableQueue.mjs"; function does_raise(f, q) { try { diff --git a/tests/tests/src/bs_set_int_test.mjs b/tests/tests/src/bs_set_int_test.mjs index 2bf1b07cc64..1bf0f312905 100644 --- a/tests/tests/src/bs_set_int_test.mjs +++ b/tests/tests/src/bs_set_int_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SetInt from "@rescript/runtime/lib/es6/Belt_SetInt.mjs"; +import * as Belt_SetInt from "@rescript/belt/src/Belt_SetInt.mjs"; import * as Array_data_util from "./array_data_util.mjs"; function setEqArray(s, i) { diff --git a/tests/tests/src/bs_stack_test.mjs b/tests/tests/src/bs_stack_test.mjs index 12061f0c85e..59595748018 100644 --- a/tests/tests/src/bs_stack_test.mjs +++ b/tests/tests/src/bs_stack_test.mjs @@ -4,8 +4,8 @@ import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; -import * as Belt_MutableQueue from "@rescript/runtime/lib/es6/Belt_MutableQueue.mjs"; -import * as Belt_MutableStack from "@rescript/runtime/lib/es6/Belt_MutableStack.mjs"; +import * as Belt_MutableQueue from "@rescript/belt/src/Belt_MutableQueue.mjs"; +import * as Belt_MutableStack from "@rescript/belt/src/Belt_MutableStack.mjs"; function inOrder(v) { let current = v; diff --git a/tests/tests/src/coercion_module_alias_test.mjs b/tests/tests/src/coercion_module_alias_test.mjs index 4aa1ae841ee..05bba81c084 100644 --- a/tests/tests/src/coercion_module_alias_test.mjs +++ b/tests/tests/src/coercion_module_alias_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Char from "@rescript/runtime/lib/es6/Char.mjs"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; function l(prim) { console.log(prim); diff --git a/tests/tests/src/cps_test.mjs b/tests/tests/src/cps_test.mjs index 0f44629e98a..1c0ca5a82d9 100644 --- a/tests/tests/src/cps_test.mjs +++ b/tests/tests/src/cps_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; function test_sum() { diff --git a/tests/tests/src/demo_int_map.mjs b/tests/tests/src/demo_int_map.mjs index e4af74e1f0a..2856a500377 100644 --- a/tests/tests/src/demo_int_map.mjs +++ b/tests/tests/src/demo_int_map.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; function test() { let m; diff --git a/tests/tests/src/directives.mjs b/tests/tests/src/directives.mjs index 7814c1205e0..a8d05c93959 100644 --- a/tests/tests/src/directives.mjs +++ b/tests/tests/src/directives.mjs @@ -2,7 +2,7 @@ first directive; second directive; // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let a = Belt_Array.forEach; diff --git a/tests/tests/src/earger_curry_test.mjs b/tests/tests/src/earger_curry_test.mjs index 0ec6b670641..e930720cf0a 100644 --- a/tests/tests/src/earger_curry_test.mjs +++ b/tests/tests/src/earger_curry_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Test_utils from "./test_utils.mjs"; diff --git a/tests/tests/src/event_ffi.mjs b/tests/tests/src/event_ffi.mjs index 15f7d8da753..ee534c50df2 100644 --- a/tests/tests/src/event_ffi.mjs +++ b/tests/tests/src/event_ffi.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; function h0(x) { return x(); diff --git a/tests/tests/src/exception_alias.mjs b/tests/tests/src/exception_alias.mjs index bd3ce69ff67..d6a67f68ada 100644 --- a/tests/tests/src/exception_alias.mjs +++ b/tests/tests/src/exception_alias.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; let a0 = { RE_EXN_ID: "Not_found" diff --git a/tests/tests/src/exception_raise_test.mjs b/tests/tests/src/exception_raise_test.mjs index c26ef72c659..57c9f295e93 100644 --- a/tests/tests/src/exception_raise_test.mjs +++ b/tests/tests/src/exception_raise_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Stdlib_Exn from "@rescript/runtime/lib/es6/Stdlib_Exn.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; diff --git a/tests/tests/src/ext_array_test.mjs b/tests/tests/src/ext_array_test.mjs index 0cbb2cdbe24..9a74cd9aa9c 100644 --- a/tests/tests/src/ext_array_test.mjs +++ b/tests/tests/src/ext_array_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; diff --git a/tests/tests/src/flexible_array_test.mjs b/tests/tests/src/flexible_array_test.mjs index a2e3e8b4aef..7794b18da6e 100644 --- a/tests/tests/src/flexible_array_test.mjs +++ b/tests/tests/src/flexible_array_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/for_loop_test.mjs b/tests/tests/src/for_loop_test.mjs index 87d241555aa..32119aaa644 100644 --- a/tests/tests/src/for_loop_test.mjs +++ b/tests/tests/src/for_loop_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; Mocha.describe("For_loop_test", () => { diff --git a/tests/tests/src/global_module_alias_test.mjs b/tests/tests/src/global_module_alias_test.mjs index 14646443b1e..85e539507e4 100644 --- a/tests/tests/src/global_module_alias_test.mjs +++ b/tests/tests/src/global_module_alias_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; let v = { diff --git a/tests/tests/src/gpr_1409_test.mjs b/tests/tests/src/gpr_1409_test.mjs index c91dfb9a4bd..7ec9862a34b 100644 --- a/tests/tests/src/gpr_1409_test.mjs +++ b/tests/tests/src/gpr_1409_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as String_set from "./string_set.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; diff --git a/tests/tests/src/gpr_1701_test.mjs b/tests/tests/src/gpr_1701_test.mjs index dcdc4574a14..63e354a9cd7 100644 --- a/tests/tests/src/gpr_1701_test.mjs +++ b/tests/tests/src/gpr_1701_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; let Foo = /* @__PURE__ */Primitive_exceptions.create("Gpr_1701_test.Foo"); diff --git a/tests/tests/src/gpr_2487.mjs b/tests/tests/src/gpr_2487.mjs index 9ef472624db..57a1b618882 100644 --- a/tests/tests/src/gpr_2487.mjs +++ b/tests/tests/src/gpr_2487.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let b = Belt_Array.eq([ 1, diff --git a/tests/tests/src/gpr_2608_test.mjs b/tests/tests/src/gpr_2608_test.mjs index 4c62eb1cce4..adc762faf8f 100644 --- a/tests/tests/src/gpr_2608_test.mjs +++ b/tests/tests/src/gpr_2608_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; let oppHeroes = { diff --git a/tests/tests/src/gpr_3931_test.mjs b/tests/tests/src/gpr_3931_test.mjs index ac4b4e07619..d30672461ff 100644 --- a/tests/tests/src/gpr_3931_test.mjs +++ b/tests/tests/src/gpr_3931_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Primitive_module from "@rescript/runtime/lib/es6/Primitive_module.mjs"; let PA = Primitive_module.init([ diff --git a/tests/tests/src/gpr_4265_test.mjs b/tests/tests/src/gpr_4265_test.mjs index 5087dfec67f..ca122c08aa6 100644 --- a/tests/tests/src/gpr_4265_test.mjs +++ b/tests/tests/src/gpr_4265_test.mjs @@ -2,7 +2,7 @@ import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MutableMapInt from "@rescript/runtime/lib/es6/Belt_MutableMapInt.mjs"; +import * as Belt_MutableMapInt from "@rescript/belt/src/Belt_MutableMapInt.mjs"; let mockMap = Belt_MutableMapInt.make(); diff --git a/tests/tests/src/gpr_4274_test.mjs b/tests/tests/src/gpr_4274_test.mjs index c371ba64e7b..b75c2b8e38b 100644 --- a/tests/tests/src/gpr_4274_test.mjs +++ b/tests/tests/src/gpr_4274_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let N = {}; diff --git a/tests/tests/src/hash_test.mjs b/tests/tests/src/hash_test.mjs index 999dd4539bd..d58b133f537 100644 --- a/tests/tests/src/hash_test.mjs +++ b/tests/tests/src/hash_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Hash_utils from "./hash_utils.mjs"; import * as Test_utils from "./test_utils.mjs"; diff --git a/tests/tests/src/hello_res.mjs b/tests/tests/src/hello_res.mjs index 82501f0936c..c92bf7cf41d 100644 --- a/tests/tests/src/hello_res.mjs +++ b/tests/tests/src/hello_res.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; let b = Belt_List.length({ hd: 1, diff --git a/tests/tests/src/inline_map2_test.mjs b/tests/tests/src/inline_map2_test.mjs index 43a7b917061..959c26340b8 100644 --- a/tests/tests/src/inline_map2_test.mjs +++ b/tests/tests/src/inline_map2_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; diff --git a/tests/tests/src/inline_map_demo.mjs b/tests/tests/src/inline_map_demo.mjs index 1e1d74398cf..5b9c1bf3677 100644 --- a/tests/tests/src/inline_map_demo.mjs +++ b/tests/tests/src/inline_map_demo.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; diff --git a/tests/tests/src/inline_map_test.mjs b/tests/tests/src/inline_map_test.mjs index 92a0d49f050..b6ef29c90bf 100644 --- a/tests/tests/src/inline_map_test.mjs +++ b/tests/tests/src/inline_map_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; diff --git a/tests/tests/src/inline_record_test.mjs b/tests/tests/src/inline_record_test.mjs index cc3e552a0b4..57d4aac539a 100644 --- a/tests/tests/src/inline_record_test.mjs +++ b/tests/tests/src/inline_record_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; diff --git a/tests/tests/src/int_map.mjs b/tests/tests/src/int_map.mjs index e2f6ec503a7..132f36da1d9 100644 --- a/tests/tests/src/int_map.mjs +++ b/tests/tests/src/int_map.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; -import * as Belt_Map from "@rescript/runtime/lib/es6/Belt_Map.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Map from "@rescript/belt/src/Belt_Map.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; let cmp = Primitive_object.compare; diff --git a/tests/tests/src/label_uncurry.mjs b/tests/tests/src/label_uncurry.mjs index 3566a35c630..270e445f436 100644 --- a/tests/tests/src/label_uncurry.mjs +++ b/tests/tests/src/label_uncurry.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Int from "@rescript/runtime/lib/es6/Belt_Int.mjs"; +import * as Belt_Int from "@rescript/belt/src/Belt_Int.mjs"; function f(x) { return x; diff --git a/tests/tests/src/list_test.mjs b/tests/tests/src/list_test.mjs index b4b8fa8fbe3..079b877f1fb 100644 --- a/tests/tests/src/list_test.mjs +++ b/tests/tests/src/list_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/loop_control_test.mjs b/tests/tests/src/loop_control_test.mjs index 71ca7f6a085..958900b465f 100644 --- a/tests/tests/src/loop_control_test.mjs +++ b/tests/tests/src/loop_control_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; Mocha.describe("Loop_control_test", () => { diff --git a/tests/tests/src/map_find_test.mjs b/tests/tests/src/map_find_test.mjs index a192f8279f9..ba828c42697 100644 --- a/tests/tests/src/map_find_test.mjs +++ b/tests/tests/src/map_find_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; -import * as Belt_MapString from "@rescript/runtime/lib/es6/Belt_MapString.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; let m = Belt_List.reduceReverse({ hd: [ diff --git a/tests/tests/src/mario_game.mjs b/tests/tests/src/mario_game.mjs index 0857748d8a1..4866cc80030 100644 --- a/tests/tests/src/mario_game.mjs +++ b/tests/tests/src/mario_game.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_float from "@rescript/runtime/lib/es6/Primitive_float.mjs"; diff --git a/tests/tests/src/module_alias_test.mjs b/tests/tests/src/module_alias_test.mjs index dcaa6aeb854..21a38d9a583 100644 --- a/tests/tests/src/module_alias_test.mjs +++ b/tests/tests/src/module_alias_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; function f(x) { diff --git a/tests/tests/src/module_missing_conversion.mjs b/tests/tests/src/module_missing_conversion.mjs index 6b3ff81d7e3..e5218fccdb2 100644 --- a/tests/tests/src/module_missing_conversion.mjs +++ b/tests/tests/src/module_missing_conversion.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Stdlib_String from "@rescript/runtime/lib/es6/Stdlib_String.mjs"; function f(x) { diff --git a/tests/tests/src/module_test.mjs b/tests/tests/src/module_test.mjs index 8dc29be36ed..25600fa5efa 100644 --- a/tests/tests/src/module_test.mjs +++ b/tests/tests/src/module_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; function length(param) { diff --git a/tests/tests/src/nested_module_alias.mjs b/tests/tests/src/nested_module_alias.mjs index 7235537862e..b4bf3587a15 100644 --- a/tests/tests/src/nested_module_alias.mjs +++ b/tests/tests/src/nested_module_alias.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; function v(x) { return [ diff --git a/tests/tests/src/option_repr_test.mjs b/tests/tests/src/option_repr_test.mjs index a872ce60e45..02163e984e5 100644 --- a/tests/tests/src/option_repr_test.mjs +++ b/tests/tests/src/option_repr_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; diff --git a/tests/tests/src/raw_pure_test.mjs b/tests/tests/src/raw_pure_test.mjs index 13c30aa0036..e1a1881c8da 100644 --- a/tests/tests/src/raw_pure_test.mjs +++ b/tests/tests/src/raw_pure_test.mjs @@ -4,7 +4,7 @@ */ // hello -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; let x0 = null; diff --git a/tests/tests/src/rec_module_opt.mjs b/tests/tests/src/rec_module_opt.mjs index 6f8ec788373..e6160f842e0 100644 --- a/tests/tests/src/rec_module_opt.mjs +++ b/tests/tests/src/rec_module_opt.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Id from "@rescript/runtime/lib/es6/Belt_Id.mjs"; +import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; import * as Primitive_module from "@rescript/runtime/lib/es6/Primitive_module.mjs"; import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.mjs"; diff --git a/tests/tests/src/record_extension_test.mjs b/tests/tests/src/record_extension_test.mjs index 581feb83a03..8672e74e208 100644 --- a/tests/tests/src/record_extension_test.mjs +++ b/tests/tests/src/record_extension_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Int from "@rescript/runtime/lib/es6/Belt_Int.mjs"; +import * as Belt_Int from "@rescript/belt/src/Belt_Int.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; diff --git a/tests/tests/src/recursive_records_test.mjs b/tests/tests/src/recursive_records_test.mjs index e9b4777c803..98f3b447b51 100644 --- a/tests/tests/src/recursive_records_test.mjs +++ b/tests/tests/src/recursive_records_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/set_gen.mjs b/tests/tests/src/set_gen.mjs index 576ef8f0e8e..7f975ad2d83 100644 --- a/tests/tests/src/set_gen.mjs +++ b/tests/tests/src/set_gen.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; diff --git a/tests/tests/src/side_effect2.mjs b/tests/tests/src/side_effect2.mjs index 4342186cf93..294afc61e16 100644 --- a/tests/tests/src/side_effect2.mjs +++ b/tests/tests/src/side_effect2.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let a = Belt_Array.map([1], x => x); diff --git a/tests/tests/src/splice_test.mjs b/tests/tests/src/splice_test.mjs index 72481fe54b7..e828c96ca8f 100644 --- a/tests/tests/src/splice_test.mjs +++ b/tests/tests/src/splice_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; let Caml_splice_call = {}; diff --git a/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs b/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs index 8b26a7cb3e1..7af94dd3c54 100644 --- a/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs +++ b/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Stdlib_Iterator from "@rescript/runtime/lib/es6/Stdlib_Iterator.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Stdlib_Generator from "@rescript/runtime/lib/es6/Stdlib_Generator.mjs"; diff --git a/tests/tests/src/string_set.mjs b/tests/tests/src/string_set.mjs index 97339a79da4..7258875071d 100644 --- a/tests/tests/src/string_set.mjs +++ b/tests/tests/src/string_set.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Set_gen from "./set_gen.mjs"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.mjs"; function compare_elt(a, b) { diff --git a/tests/tests/src/tailcall_inline_test.mjs b/tests/tests/src/tailcall_inline_test.mjs index 47f28fb0756..fb3a797eda4 100644 --- a/tests/tests/src/tailcall_inline_test.mjs +++ b/tests/tests/src/tailcall_inline_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; function f() { diff --git a/tests/tests/src/test_ari.mjs b/tests/tests/src/test_ari.mjs index 96f8e9cb852..6360448af81 100644 --- a/tests/tests/src/test_ari.mjs +++ b/tests/tests/src/test_ari.mjs @@ -2,7 +2,7 @@ import * as U from "U"; import * as VV from "VV"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; function f(x, y) { return x + y | 0; diff --git a/tests/tests/src/test_array.mjs b/tests/tests/src/test_array.mjs index 02ebf858538..982047beeae 100644 --- a/tests/tests/src/test_array.mjs +++ b/tests/tests/src/test_array.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let v = Belt_Array.make(6, 5); diff --git a/tests/tests/src/test_array_append.mjs b/tests/tests/src/test_array_append.mjs index 7e8bfc7aec8..970cd99738b 100644 --- a/tests/tests/src/test_array_append.mjs +++ b/tests/tests/src/test_array_append.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let const_v = Belt_Array.concat([ 1, diff --git a/tests/tests/src/test_closure.mjs b/tests/tests/src/test_closure.mjs index 09628d2cd34..a0b7605d2b4 100644 --- a/tests/tests/src/test_closure.mjs +++ b/tests/tests/src/test_closure.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let v = { contents: 0 diff --git a/tests/tests/src/test_cps.mjs b/tests/tests/src/test_cps.mjs index cfbf7c9bfcf..919b39aaf94 100644 --- a/tests/tests/src/test_cps.mjs +++ b/tests/tests/src/test_cps.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; function f(_n, _acc) { while (true) { diff --git a/tests/tests/src/test_demo.mjs b/tests/tests/src/test_demo.mjs index e68b0c11ec1..108f652c511 100644 --- a/tests/tests/src/test_demo.mjs +++ b/tests/tests/src/test_demo.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; function fib(x) { if (x !== 2 && x !== 1) { diff --git a/tests/tests/src/test_for_loop.mjs b/tests/tests/src/test_for_loop.mjs index ee897631600..5fece155b1a 100644 --- a/tests/tests/src/test_for_loop.mjs +++ b/tests/tests/src/test_for_loop.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; function for_(x) { for (let i = 0, i_finish = (console.log("hi"), x.length); i <= i_finish; ++i) { diff --git a/tests/tests/src/test_for_map.mjs b/tests/tests/src/test_for_map.mjs index 7714e425305..6ea8f9d0339 100644 --- a/tests/tests/src/test_for_map.mjs +++ b/tests/tests/src/test_for_map.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; function assertion_test() { let m; diff --git a/tests/tests/src/test_for_map2.mjs b/tests/tests/src/test_for_map2.mjs index 0454f41ee68..00cf3e49347 100644 --- a/tests/tests/src/test_for_map2.mjs +++ b/tests/tests/src/test_for_map2.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; function assertion_test() { let m; diff --git a/tests/tests/src/test_for_of.mjs b/tests/tests/src/test_for_of.mjs index 6a112759f42..8e99ee1f081 100644 --- a/tests/tests/src/test_for_of.mjs +++ b/tests/tests/src/test_for_of.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; function firstLargeOpenOrder(orders) { diff --git a/tests/tests/src/test_functor_dead_code.mjs b/tests/tests/src/test_functor_dead_code.mjs index fb93d4be3f6..9b187d675eb 100644 --- a/tests/tests/src/test_functor_dead_code.mjs +++ b/tests/tests/src/test_functor_dead_code.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapString from "@rescript/runtime/lib/es6/Belt_MapString.mjs"; +import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; let v = Belt_MapString.isEmpty(undefined); diff --git a/tests/tests/src/test_google_closure.mjs b/tests/tests/src/test_google_closure.mjs index 4f25dd724fb..6775a67e986 100644 --- a/tests/tests/src/test_google_closure.mjs +++ b/tests/tests/src/test_google_closure.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; function f(a, b, param) { return a + b | 0; diff --git a/tests/tests/src/test_include.mjs b/tests/tests/src/test_include.mjs index a90af9a603b..e17c0edeb6a 100644 --- a/tests/tests/src/test_include.mjs +++ b/tests/tests/src/test_include.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_order from "./test_order.mjs"; function Make(U) { diff --git a/tests/tests/src/test_int_map_find.mjs b/tests/tests/src/test_int_map_find.mjs index d4729d0be55..41644c95263 100644 --- a/tests/tests/src/test_int_map_find.mjs +++ b/tests/tests/src/test_int_map_find.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_MapInt from "@rescript/runtime/lib/es6/Belt_MapInt.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; Belt_List.reduceReverse({ hd: [ diff --git a/tests/tests/src/test_list.mjs b/tests/tests/src/test_list.mjs index 056142a0502..39b01c89aed 100644 --- a/tests/tests/src/test_list.mjs +++ b/tests/tests/src/test_list.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; function length_aux(_len, _x) { diff --git a/tests/tests/src/test_pervasive.mjs b/tests/tests/src/test_pervasive.mjs index f0f026c6c01..65092465dc8 100644 --- a/tests/tests/src/test_pervasive.mjs +++ b/tests/tests/src/test_pervasive.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; let Pervasives$1 = { diff --git a/tests/tests/src/test_pervasives3.mjs b/tests/tests/src/test_pervasives3.mjs index 9a926f607e1..9de7cc3fc94 100644 --- a/tests/tests/src/test_pervasives3.mjs +++ b/tests/tests/src/test_pervasives3.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; let Pervasives$1 = { diff --git a/tests/tests/src/test_set.mjs b/tests/tests/src/test_set.mjs index 61da94614f8..855e18b60ef 100644 --- a/tests/tests/src/test_set.mjs +++ b/tests/tests/src/test_set.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; function Make(Ord) { diff --git a/tests/tests/src/test_simple_include.mjs b/tests/tests/src/test_simple_include.mjs index b0756cde6aa..0fecfa9b33b 100644 --- a/tests/tests/src/test_simple_include.mjs +++ b/tests/tests/src/test_simple_include.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let v = { contents: 32 diff --git a/tests/tests/src/test_string_map.mjs b/tests/tests/src/test_string_map.mjs index de52cf5de00..1b816331091 100644 --- a/tests/tests/src/test_string_map.mjs +++ b/tests/tests/src/test_string_map.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapString from "@rescript/runtime/lib/es6/Belt_MapString.mjs"; +import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; function timing(label, f) { console.time(label); diff --git a/tests/tests/src/test_while_closure.mjs b/tests/tests/src/test_while_closure.mjs index dd30b138fd2..33161bada01 100644 --- a/tests/tests/src/test_while_closure.mjs +++ b/tests/tests/src/test_while_closure.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/runtime/lib/es6/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; let v = { contents: 0 diff --git a/tests/tests/src/ticker.mjs b/tests/tests/src/ticker.mjs index 2814daec777..50f4cf142f7 100644 --- a/tests/tests/src/ticker.mjs +++ b/tests/tests/src/ticker.mjs @@ -1,11 +1,11 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; -import * as Belt_Float from "@rescript/runtime/lib/es6/Belt_Float.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_Float from "@rescript/belt/src/Belt_Float.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; -import * as Belt_Option from "@rescript/runtime/lib/es6/Belt_Option.mjs"; +import * as Belt_Option from "@rescript/belt/src/Belt_Option.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; -import * as Belt_MapString from "@rescript/runtime/lib/es6/Belt_MapString.mjs"; +import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function split(delim, s) { diff --git a/tests/tests/src/topsort_test.mjs b/tests/tests/src/topsort_test.mjs index e368359f48f..7d49c09e919 100644 --- a/tests/tests/src/topsort_test.mjs +++ b/tests/tests/src/topsort_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; -import * as Belt_SetString from "@rescript/runtime/lib/es6/Belt_SetString.mjs"; +import * as Belt_SetString from "@rescript/belt/src/Belt_SetString.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; diff --git a/tests/tests/src/uncurried_cast.mjs b/tests/tests/src/uncurried_cast.mjs index 28135f925b3..665d834a34b 100644 --- a/tests/tests/src/uncurried_cast.mjs +++ b/tests/tests/src/uncurried_cast.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; function raise(e) { diff --git a/tests/tests/src/webpack_config.mjs b/tests/tests/src/webpack_config.mjs index 8988a659b9b..73ee64d0607 100644 --- a/tests/tests/src/webpack_config.mjs +++ b/tests/tests/src/webpack_config.mjs @@ -4,7 +4,7 @@ import * as List from "List"; import * as List$1 from "reactV"; import * as List$2 from "reactX"; import * as Local from "./local"; -import * as Belt_List from "@rescript/runtime/lib/es6/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as WebpackConfigJs from "../../../webpack.config.js"; import * as WebpackMiddlewareConfigJs from "../../../webpack.middleware.config.js"; diff --git a/yarn.lock b/yarn.lock index a687c28be73..065f2d755c4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -434,6 +434,16 @@ __metadata: languageName: node linkType: hard +"@rescript/belt@workspace:^, @rescript/belt@workspace:packages/@rescript/belt": + version: 0.0.0-use.local + resolution: "@rescript/belt@workspace:packages/@rescript/belt" + dependencies: + rescript: "workspace:^" + peerDependencies: + rescript: "workspace:^" + languageName: unknown + linkType: soft + "@rescript/darwin-arm64@npm:12.3.0": version: 12.3.0 resolution: "@rescript/darwin-arm64@npm:12.3.0" @@ -851,6 +861,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tests/analysis@workspace:tests/analysis_tests/tests" dependencies: + "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -860,6 +871,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tests/docstring-tests@workspace:tests/docstring_tests" dependencies: + "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -877,6 +889,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tests/gentype-react-example@workspace:tests/gentype_tests/typescript-react-example" dependencies: + "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" "@types/react": "npm:^19.2.18" "@types/react-dom": "npm:^19.2.4" @@ -916,6 +929,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tests/reanalyze-benchmark@workspace:tests/analysis_tests/tests-reanalyze/deadcode-benchmark" dependencies: + "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -925,6 +939,7 @@ __metadata: version: 0.0.0-use.local resolution: "@tests/reanalyze-deadcode@workspace:tests/analysis_tests/tests-reanalyze/deadcode" dependencies: + "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -1025,6 +1040,7 @@ __metadata: version: 0.0.0-use.local resolution: "@utils/scripts@workspace:scripts/res" dependencies: + "@rescript/belt": "workspace:^" "@tests/docstring-tests": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -2720,6 +2736,9 @@ __metadata: "rescript-commonjs-tests@workspace:tests/commonjs_tests": version: 0.0.0-use.local resolution: "rescript-commonjs-tests@workspace:tests/commonjs_tests" + dependencies: + "@rescript/belt": "workspace:^" + rescript: "workspace:^" languageName: unknown linkType: soft @@ -2734,6 +2753,7 @@ __metadata: version: 0.0.0-use.local resolution: "rescript-tests@workspace:tests/tests" dependencies: + "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown From 227b98bc85fb74c2d2da4d7371bf6eea98c76c01 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 8 Aug 2026 21:00:03 +0200 Subject: [PATCH 02/14] Use runtime primitives for collection spreads Signed-off-by: Christoph Knittel --- CONTRIBUTING.md | 2 +- compiler/ext/primitive_modules.ml | 2 + compiler/syntax/src/res_comments_table.ml | 8 +-- compiler/syntax/src/res_core.ml | 6 +-- compiler/syntax/src/res_parsetree_viewer.ml | 16 ++---- compiler/syntax/src/res_parsetree_viewer.mli | 4 +- compiler/syntax/src/res_printer.ml | 12 ++--- .../@rescript/runtime/Primitive_array.res | 27 ++++++++++ packages/@rescript/runtime/Primitive_list.res | 35 ++++++++++++ .../@rescript/runtime/Primitive_list.resi | 2 + .../runtime/lib/es6/Primitive_array.mjs | 19 +++++++ .../runtime/lib/es6/Primitive_list.mjs | 53 +++++++++++++++++++ .../runtime/lib/js/Primitive_array.cjs | 19 +++++++ .../runtime/lib/js/Primitive_list.cjs | 51 ++++++++++++++++++ packages/artifacts.json | 8 +++ .../installation_test/src/Test.res | 11 ++++ .../expressions/expected/array.res.txt | 10 ++-- .../grammar/expressions/expected/list.res.txt | 2 +- .../recovery/expression/expected/list.res.txt | 3 +- .../tests/src/stdlib/Stdlib_IteratorTests.mjs | 10 ++-- tests/tests/src/test_for_of.mjs | 4 +- 21 files changed, 259 insertions(+), 45 deletions(-) create mode 100644 packages/@rescript/runtime/Primitive_list.res create mode 100644 packages/@rescript/runtime/Primitive_list.resi create mode 100644 packages/@rescript/runtime/lib/es6/Primitive_list.mjs create mode 100644 packages/@rescript/runtime/lib/js/Primitive_list.cjs diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 46078febc0b..c278f90b626 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -147,7 +147,7 @@ make checkformat ## Adding new Files to the Npm Packages -To make sure that no files are added to or removed from the `rescript` or `@rescript/runtime` npm package inadvertently, an artifact list is kept at `packages/artifacts.json`. During CI build, it is verified that only the files that are listed there are actually included in the npm packages. +To make sure that no files are added to or removed from the `rescript`, `@rescript/runtime`, or `@rescript/belt` npm package inadvertently, an artifact list is kept at `packages/artifacts.json`. During CI build, it is verified that only the files that are listed there are actually included in the npm packages. After adding a new file to the repository that should go into one of the npm packages - e.g., a new stdlib module -, run `make artifacts`. diff --git a/compiler/ext/primitive_modules.ml b/compiler/ext/primitive_modules.ml index bff1d8b58a4..3a567de5242 100644 --- a/compiler/ext/primitive_modules.ml +++ b/compiler/ext/primitive_modules.ml @@ -34,6 +34,8 @@ let string = "Primitive_string" let array = "Primitive_array" +let list = "Primitive_list" + let dict = "Primitive_dict" let object_ = "Primitive_object" diff --git a/compiler/syntax/src/res_comments_table.ml b/compiler/syntax/src/res_comments_table.ml index 1d0a470e52a..712aa2b87d1 100644 --- a/compiler/syntax/src/res_comments_table.ml +++ b/compiler/syntax/src/res_comments_table.ml @@ -1593,14 +1593,10 @@ and walk_expression expr t comments = when Res_parsetree_viewer.is_tuple_array key_values -> walk_list [Expression key_values] t comments | Pexp_apply {funct = call_expr; args = arguments} -> ( - (* Special handling for Belt.Array.concatMany - treat like an array *) + (* Special handling for array spread - treat it like an array *) match call_expr.pexp_desc with | Pexp_ident - { - txt = - Longident.Ldot - (Longident.Ldot (Longident.Lident "Belt", "Array"), "concatMany"); - } + {txt = Longident.Ldot (Longident.Lident "Primitive_array", "spread")} when List.length arguments = 1 -> ( match arguments with | [(_, {pexp_desc = Pexp_array sub_arrays})] -> diff --git a/compiler/syntax/src/res_core.ml b/compiler/syntax/src/res_core.ml index 91b821a459d..cbdc8e319b4 100644 --- a/compiler/syntax/src/res_core.ml +++ b/compiler/syntax/src/res_core.ml @@ -4465,8 +4465,7 @@ and parse_list_expr ~start_pos p = Ast_helper.Exp.apply ~loc (Ast_helper.Exp.ident ~loc ~attrs:[spread_attr] (Location.mkloc - (Longident.Ldot - (Longident.Ldot (Longident.Lident "Belt", "List"), "concatMany")) + (Longident.Ldot (Longident.Lident Primitive_modules.list, "spread")) loc)) [(Asttypes.Nolabel, Ast_helper.Exp.array ~loc list_exprs)] @@ -4608,8 +4607,7 @@ and parse_array_exp p = Ast_helper.Exp.apply ~loc (Ast_helper.Exp.ident ~loc ~attrs:[spread_attr] (Location.mkloc - (Longident.Ldot - (Longident.Ldot (Longident.Lident "Belt", "Array"), "concatMany")) + (Longident.Ldot (Longident.Lident Primitive_modules.array, "spread")) loc)) [(Nolabel, Ast_helper.Exp.array ~loc list_exprs)] diff --git a/compiler/syntax/src/res_parsetree_viewer.ml b/compiler/syntax/src/res_parsetree_viewer.ml index 5a0301dbc7a..508acba1e3f 100644 --- a/compiler/syntax/src/res_parsetree_viewer.ml +++ b/compiler/syntax/src/res_parsetree_viewer.ml @@ -726,25 +726,17 @@ let has_spread_attr attrs = | _ -> false) attrs -let is_spread_belt_list_concat expr = +let is_spread_list expr = match expr.pexp_desc with | Pexp_ident - { - txt = - Longident.Ldot - (Longident.Ldot (Longident.Lident "Belt", "List"), "concatMany"); - } -> + {txt = Longident.Ldot (Longident.Lident "Primitive_list", "spread")} -> has_spread_attr expr.pexp_attributes | _ -> false -let is_spread_belt_array_concat expr = +let is_spread_array expr = match expr.pexp_desc with | Pexp_ident - { - txt = - Longident.Ldot - (Longident.Ldot (Longident.Lident "Belt", "Array"), "concatMany"); - } -> + {txt = Longident.Ldot (Longident.Lident "Primitive_array", "spread")} -> has_spread_attr expr.pexp_attributes | _ -> false diff --git a/compiler/syntax/src/res_parsetree_viewer.mli b/compiler/syntax/src/res_parsetree_viewer.mli index 8d4536717fe..5fc8c74e877 100644 --- a/compiler/syntax/src/res_parsetree_viewer.mli +++ b/compiler/syntax/src/res_parsetree_viewer.mli @@ -133,9 +133,9 @@ val is_template_literal : Parsetree.expression -> bool val is_tagged_template_literal : Parsetree.expression -> bool val has_template_literal_attr : Parsetree.attributes -> bool -val is_spread_belt_list_concat : Parsetree.expression -> bool +val is_spread_list : Parsetree.expression -> bool -val is_spread_belt_array_concat : Parsetree.expression -> bool +val is_spread_array : Parsetree.expression -> bool val collect_spread_dict_expr_parts : Parsetree.expression -> dict_expr_part list option diff --git a/compiler/syntax/src/res_printer.ml b/compiler/syntax/src/res_printer.ml index da48b02561e..14eed92ec17 100644 --- a/compiler/syntax/src/res_printer.ml +++ b/compiler/syntax/src/res_printer.ml @@ -3583,12 +3583,12 @@ and print_expression ~state (e : Parsetree.expression) cmt_tbl = print_extension ~state ~at_module_lvl:false extension cmt_tbl) | Pexp_apply {funct = e; args = [(Nolabel, {pexp_desc = Pexp_array sub_lists})]} - when Parsetree_viewer.is_spread_belt_array_concat e -> - print_belt_array_concat_apply ~state sub_lists cmt_tbl + when Parsetree_viewer.is_spread_array e -> + print_array_spread_apply ~state sub_lists cmt_tbl | Pexp_apply {funct = e; args = [(Nolabel, {pexp_desc = Pexp_array sub_lists})]} - when Parsetree_viewer.is_spread_belt_list_concat e -> - print_belt_list_concat_apply ~state sub_lists cmt_tbl + when Parsetree_viewer.is_spread_list e -> + print_list_spread_apply ~state sub_lists cmt_tbl | Pexp_apply {funct = call_expr; args} -> if Parsetree_viewer.is_unary_expression e then print_unary_expression ~state e cmt_tbl @@ -4381,7 +4381,7 @@ and print_binary_expression ~state (expr : Parsetree.expression) cmt_tbl = ]) | _ -> Doc.nil -and print_belt_array_concat_apply ~state sub_lists cmt_tbl = +and print_array_spread_apply ~state sub_lists cmt_tbl = let make_spread_doc comma_before_spread = function | Some expr -> (* Extract leading comments before dotdotdot *) @@ -4451,7 +4451,7 @@ and print_belt_array_concat_apply ~state sub_lists cmt_tbl = Doc.rbracket; ]) -and print_belt_list_concat_apply ~state sub_lists cmt_tbl = +and print_list_spread_apply ~state sub_lists cmt_tbl = let make_spread_doc comma_before_spread = function | Some expr -> Doc.concat diff --git a/packages/@rescript/runtime/Primitive_array.res b/packages/@rescript/runtime/Primitive_array.res index 6a7d994d4de..7bfef9b575d 100644 --- a/packages/@rescript/runtime/Primitive_array.res +++ b/packages/@rescript/runtime/Primitive_array.res @@ -13,3 +13,30 @@ let set = (xs, index, newval) => } else { xs->Primitive_array_extern.setUnsafe(index, newval) } + +// Note: this is exposed to support syntax +@new external makeUninitializedUnsafe: int => array<'a> = "Array" + +let spread = arrays => { + let arraysLength = length(arrays) + let resultLength = ref(0) + for i in 0 to arraysLength - 1 { + resultLength.contents = + resultLength.contents + length(Primitive_array_extern.getUnsafe(arrays, i)) + } + + let result = makeUninitializedUnsafe(resultLength.contents) + resultLength.contents = 0 + for i in 0 to arraysLength - 1 { + let array = Primitive_array_extern.getUnsafe(arrays, i) + for j in 0 to length(array) - 1 { + Primitive_array_extern.setUnsafe( + result, + resultLength.contents, + Primitive_array_extern.getUnsafe(array, j), + ) + resultLength.contents = resultLength.contents + 1 + } + } + result +} diff --git a/packages/@rescript/runtime/Primitive_list.res b/packages/@rescript/runtime/Primitive_list.res new file mode 100644 index 00000000000..9eeb7c75eb3 --- /dev/null +++ b/packages/@rescript/runtime/Primitive_list.res @@ -0,0 +1,35 @@ +// Note: this is exposed to support syntax +external mutableCell: ('a, list<'a>) => list<'a> = "#makemutablelist" + +@set external unsafeMutateTail: (list<'a>, list<'a>) => unit = "tl" + +let rec copyAux = (list, previous) => + switch list { + | list{} => previous + | list{head, ...tail} => + let next = mutableCell(head, list{}) + unsafeMutateTail(previous, next) + copyAux(tail, next) + } + +let concat = (left, right) => + switch left { + | list{} => right + | list{head, ...tail} => + let result = mutableCell(head, list{}) + unsafeMutateTail(copyAux(tail, result), right) + result + } + +let spread = lists => + switch lists { + | [] => list{} + | [list] => list + | _ => + let length = Primitive_array_extern.length(lists) + let result = ref(Primitive_array_extern.getUnsafe(lists, length - 1)) + for i in length - 2 downto 0 { + result.contents = concat(Primitive_array_extern.getUnsafe(lists, i), result.contents) + } + result.contents + } diff --git a/packages/@rescript/runtime/Primitive_list.resi b/packages/@rescript/runtime/Primitive_list.resi new file mode 100644 index 00000000000..0ab7bf2d8c0 --- /dev/null +++ b/packages/@rescript/runtime/Primitive_list.resi @@ -0,0 +1,2 @@ +// Note: this is exposed to support syntax +let spread: array> => list<'a> diff --git a/packages/@rescript/runtime/lib/es6/Primitive_array.mjs b/packages/@rescript/runtime/lib/es6/Primitive_array.mjs index 61e5492a8ba..b85c60c3237 100644 --- a/packages/@rescript/runtime/lib/es6/Primitive_array.mjs +++ b/packages/@rescript/runtime/lib/es6/Primitive_array.mjs @@ -27,9 +27,28 @@ function set(xs, index, newval) { xs[index] = newval; } +function spread(arrays) { + let arraysLength = arrays.length; + let resultLength = 0; + for (let i = 0; i < arraysLength; ++i) { + resultLength = resultLength + arrays[i].length | 0; + } + let result = new Array(resultLength); + resultLength = 0; + for (let i$1 = 0; i$1 < arraysLength; ++i$1) { + let array = arrays[i$1]; + for (let j = 0, j_finish = array.length; j < j_finish; ++j) { + result[resultLength] = array[j]; + resultLength = resultLength + 1 | 0; + } + } + return result; +} + export { length, get, set, + spread, } /* No side effect */ diff --git a/packages/@rescript/runtime/lib/es6/Primitive_list.mjs b/packages/@rescript/runtime/lib/es6/Primitive_list.mjs new file mode 100644 index 00000000000..53ae38b0aab --- /dev/null +++ b/packages/@rescript/runtime/lib/es6/Primitive_list.mjs @@ -0,0 +1,53 @@ + + + +function copyAux(_list, _previous) { + while (true) { + let previous = _previous; + let list = _list; + if (list === 0) { + return previous; + } + let next = { + hd: list.hd, + tl: /* [] */0 + }; + previous.tl = next; + _previous = next; + _list = list.tl; + continue; + }; +} + +function concat(left, right) { + if (left === 0) { + return right; + } + let result = { + hd: left.hd, + tl: /* [] */0 + }; + copyAux(left.tl, result).tl = right; + return result; +} + +function spread(lists) { + let len = lists.length; + if (len === 1) { + return lists[0]; + } + if (len === 0) { + return /* [] */0; + } + let length = lists.length; + let result = lists[length - 1 | 0]; + for (let i = length - 2 | 0; i >= 0; --i) { + result = concat(lists[i], result); + } + return result; +} + +export { + spread, +} +/* No side effect */ diff --git a/packages/@rescript/runtime/lib/js/Primitive_array.cjs b/packages/@rescript/runtime/lib/js/Primitive_array.cjs index 7bd0ed82576..d4eeabe9f77 100644 --- a/packages/@rescript/runtime/lib/js/Primitive_array.cjs +++ b/packages/@rescript/runtime/lib/js/Primitive_array.cjs @@ -27,7 +27,26 @@ function set(xs, index, newval) { xs[index] = newval; } +function spread(arrays) { + let arraysLength = arrays.length; + let resultLength = 0; + for (let i = 0; i < arraysLength; ++i) { + resultLength = resultLength + arrays[i].length | 0; + } + let result = new Array(resultLength); + resultLength = 0; + for (let i$1 = 0; i$1 < arraysLength; ++i$1) { + let array = arrays[i$1]; + for (let j = 0, j_finish = array.length; j < j_finish; ++j) { + result[resultLength] = array[j]; + resultLength = resultLength + 1 | 0; + } + } + return result; +} + exports.length = length; exports.get = get; exports.set = set; +exports.spread = spread; /* No side effect */ diff --git a/packages/@rescript/runtime/lib/js/Primitive_list.cjs b/packages/@rescript/runtime/lib/js/Primitive_list.cjs new file mode 100644 index 00000000000..4b184399789 --- /dev/null +++ b/packages/@rescript/runtime/lib/js/Primitive_list.cjs @@ -0,0 +1,51 @@ +'use strict'; + + +function copyAux(_list, _previous) { + while (true) { + let previous = _previous; + let list = _list; + if (list === 0) { + return previous; + } + let next = { + hd: list.hd, + tl: /* [] */0 + }; + previous.tl = next; + _previous = next; + _list = list.tl; + continue; + }; +} + +function concat(left, right) { + if (left === 0) { + return right; + } + let result = { + hd: left.hd, + tl: /* [] */0 + }; + copyAux(left.tl, result).tl = right; + return result; +} + +function spread(lists) { + let len = lists.length; + if (len === 1) { + return lists[0]; + } + if (len === 0) { + return /* [] */0; + } + let length = lists.length; + let result = lists[length - 1 | 0]; + for (let i = length - 2 | 0; i >= 0; --i) { + result = concat(lists[i], result); + } + return result; +} + +exports.spread = spread; +/* No side effect */ diff --git a/packages/artifacts.json b/packages/artifacts.json index 84e57cd56b2..135b8da7f6b 100644 --- a/packages/artifacts.json +++ b/packages/artifacts.json @@ -42,6 +42,7 @@ "lib/es6/Primitive_int.mjs", "lib/es6/Primitive_int_extern.mjs", "lib/es6/Primitive_js_extern.mjs", + "lib/es6/Primitive_list.mjs", "lib/es6/Primitive_module.mjs", "lib/es6/Primitive_object.mjs", "lib/es6/Primitive_object_extern.mjs", @@ -149,6 +150,7 @@ "lib/js/Primitive_int.cjs", "lib/js/Primitive_int_extern.cjs", "lib/js/Primitive_js_extern.cjs", + "lib/js/Primitive_list.cjs", "lib/js/Primitive_module.cjs", "lib/js/Primitive_object.cjs", "lib/js/Primitive_object_extern.cjs", @@ -336,6 +338,12 @@ "lib/ocaml/Primitive_js_extern.cmj", "lib/ocaml/Primitive_js_extern.cmt", "lib/ocaml/Primitive_js_extern.res", + "lib/ocaml/Primitive_list.cmi", + "lib/ocaml/Primitive_list.cmj", + "lib/ocaml/Primitive_list.cmt", + "lib/ocaml/Primitive_list.cmti", + "lib/ocaml/Primitive_list.res", + "lib/ocaml/Primitive_list.resi", "lib/ocaml/Primitive_module.cmi", "lib/ocaml/Primitive_module.cmj", "lib/ocaml/Primitive_module.cmt", diff --git a/tests/package_tests/installation_test/src/Test.res b/tests/package_tests/installation_test/src/Test.res index 2bb95f0a6ee..3eb42775186 100644 --- a/tests/package_tests/installation_test/src/Test.res +++ b/tests/package_tests/installation_test/src/Test.res @@ -1 +1,12 @@ Console.log("Hello, world!") + +let middleArray = [2, 3] +let endArray = [5] +let array = [1, ...middleArray, 4, ...endArray] + +let middleList = list{2, 3} +let endList = list{5} +let list = list{1, ...middleList, 4, ...endList} + +assert(array == [1, 2, 3, 4, 5]) +assert(list == list{1, 2, 3, 4, 5}) diff --git a/tests/syntax_tests/data/parsing/grammar/expressions/expected/array.res.txt b/tests/syntax_tests/data/parsing/grammar/expressions/expected/array.res.txt index 3c21a9a9ab2..af12c028724 100644 --- a/tests/syntax_tests/data/parsing/grammar/expressions/expected/array.res.txt +++ b/tests/syntax_tests/data/parsing/grammar/expressions/expected/array.res.txt @@ -1,8 +1,8 @@ let x = [|1;2;3|] let x = [|1;2;3|] let x = [|(1 : int);(2 : int);(3 : int)|] -let x = ((Belt.Array.concatMany)[@res.spread ]) [|[|4;5|];y|] -let x = ((Belt.Array.concatMany)[@res.spread ]) [|[|4;5|];y;[|7|];y|] -let x = ((Belt.Array.concatMany)[@res.spread ]) [|[|4;5|];(y : int array)|] -let x = ((Belt.Array.concatMany)[@res.spread ]) [|[|4;5;k|];y|] -let x = ((Belt.Array.concatMany)[@res.spread ]) [|y|] \ No newline at end of file +let x = ((Primitive_array.spread)[@res.spread ]) [|[|4;5|];y|] +let x = ((Primitive_array.spread)[@res.spread ]) [|[|4;5|];y;[|7|];y|] +let x = ((Primitive_array.spread)[@res.spread ]) [|[|4;5|];(y : int array)|] +let x = ((Primitive_array.spread)[@res.spread ]) [|[|4;5;k|];y|] +let x = ((Primitive_array.spread)[@res.spread ]) [|y|] \ No newline at end of file diff --git a/tests/syntax_tests/data/parsing/grammar/expressions/expected/list.res.txt b/tests/syntax_tests/data/parsing/grammar/expressions/expected/list.res.txt index 4205548d1ee..8506759923e 100644 --- a/tests/syntax_tests/data/parsing/grammar/expressions/expected/list.res.txt +++ b/tests/syntax_tests/data/parsing/grammar/expressions/expected/list.res.txt @@ -3,5 +3,5 @@ let x = [1; 2; 3] let x = [1; 2; 3] let x = [(1 : int); (2 : int); (3 : int)] let x = 4 :: 5 :: y -let x = ((Belt.List.concatMany)[@res.spread ]) [|(1 :: x);(2 :: 3 :: x)|] +let x = ((Primitive_list.spread)[@res.spread ]) [|(1 :: x);(2 :: 3 :: x)|] let x = 1 :: 2 :: (y : int list) \ No newline at end of file diff --git a/tests/syntax_tests/data/parsing/recovery/expression/expected/list.res.txt b/tests/syntax_tests/data/parsing/recovery/expression/expected/list.res.txt index 3b8e3ad5871..efdedd7aa6c 100644 --- a/tests/syntax_tests/data/parsing/recovery/expression/expected/list.res.txt +++ b/tests/syntax_tests/data/parsing/recovery/expression/expected/list.res.txt @@ -42,7 +42,8 @@ let flags = ((match items with | [|{js|-pp|js};_ppFlag;rest|] -> loop rest | [|x;rest|] -> - ((Belt.Array.concatMany)[@res.spread ]) [|[|x|];(loop rest)|] + ((Primitive_array.spread)[@res.spread ]) + [|[|x|];(loop rest)|] | [||] -> [||]) [@res.braces ]) in (loop parts) -> (String.concat {js| |js})) diff --git a/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs b/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs index 7af94dd3c54..d32ecb0bc0c 100644 --- a/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs +++ b/tests/tests/src/stdlib/Stdlib_IteratorTests.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Test from "./Test.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Primitive_array from "@rescript/runtime/lib/es6/Primitive_array.mjs"; import * as Stdlib_Iterator from "@rescript/runtime/lib/es6/Stdlib_Iterator.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Stdlib_Generator from "@rescript/runtime/lib/es6/Stdlib_Generator.mjs"; @@ -571,7 +571,7 @@ let asyncOmittedDoneIterator = (({ })); await Stdlib_AsyncIterator.forEach(asyncOmittedDoneIterator, value => { - asyncOmittedDoneValues.contents = Belt_Array.concatMany([ + asyncOmittedDoneValues.contents = Primitive_array.spread([ asyncOmittedDoneValues.contents, [value] ]); @@ -624,7 +624,7 @@ let asyncGeneratorIterable = ((async function* () { })()); await Stdlib_AsyncIterableIterator.forEach(asyncGeneratorIterable, value => { - asyncGeneratorIterableValues.contents = Belt_Array.concatMany([ + asyncGeneratorIterableValues.contents = Primitive_array.spread([ asyncGeneratorIterableValues.contents, [value] ]); @@ -654,7 +654,7 @@ let asyncIterableForAwait = ((async function* () { })()); for await (let value of asyncIterableForAwait) { - asyncIterableForAwaitValues.contents = Belt_Array.concatMany([ + asyncIterableForAwaitValues.contents = Primitive_array.spread([ asyncIterableForAwaitValues.contents, [value] ]); @@ -696,7 +696,7 @@ loop_0: for await (let value$1 of asyncIterableForAwaitLoopControl) { exit = 1; } if (exit === 1) { - asyncIterableForAwaitLoopControlValues.contents = Belt_Array.concatMany([ + asyncIterableForAwaitLoopControlValues.contents = Primitive_array.spread([ asyncIterableForAwaitLoopControlValues.contents, [value$1] ]); diff --git a/tests/tests/src/test_for_of.mjs b/tests/tests/src/test_for_of.mjs index 8e99ee1f081..f9707126aff 100644 --- a/tests/tests/src/test_for_of.mjs +++ b/tests/tests/src/test_for_of.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Primitive_array from "@rescript/runtime/lib/es6/Primitive_array.mjs"; function firstLargeOpenOrder(orders) { let matchId; @@ -93,7 +93,7 @@ Mocha.describe("Test_for_of", () => { case 3 : break loop_0; default: - seen = Belt_Array.concatMany([ + seen = Primitive_array.spread([ seen, [x] ]); From 05142cbea32e5e0051231180e8a0a8a543fefc9c Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sat, 8 Aug 2026 21:13:06 +0200 Subject: [PATCH 03/14] Remove Belt-specific compiler handling Signed-off-by: Christoph Knittel --- compiler/core/outcome_printer_ns.ml | 38 ++----------------- compiler/frontend/bs_builtin_ppx.ml | 14 +++---- .../gentype/translate_type_expr_from_types.ml | 5 +-- compiler/syntax/src/res_diagnostics.ml | 2 +- compiler/syntax/src/res_grammar.ml | 2 +- compiler/syntax/src/res_printer.ml | 2 +- .../typescript-react-example/src/Variants.res | 2 +- 7 files changed, 15 insertions(+), 50 deletions(-) diff --git a/compiler/core/outcome_printer_ns.ml b/compiler/core/outcome_printer_ns.ml index 6163bf3433e..f9179e28d5a 100644 --- a/compiler/core/outcome_printer_ns.ml +++ b/compiler/core/outcome_printer_ns.ml @@ -26,38 +26,6 @@ let ps = Format.pp_print_string let out_ident ppf s = ps ppf - (match s with - (* Belt_libs *) - | "Belt_Id" -> "Belt.Id" - | "Belt_Array" -> "Belt.Array" - | "Belt_SortArray" -> "Belt.SortArray" - | "Belt_SortArrayInt" -> "Belt.SortArray.Int" - | "Belt_SortArrayString" -> "Belt.SortArray.String" - | "Belt_MutableQueue" -> "Belt.MutableQueue" - | "Belt_MutableStack" -> "Belt.MutableStack" - | "Belt_List" -> "Belt.List" - | "Belt_Range" -> "Belt.Range" - | "Belt_Set" -> "Belt.Set" - | "Belt_SetInt" -> "Belt.Set.Int" - | "Belt_SetString" -> "Belt.Set.String" - | "Belt_Map" -> "Belt.Map" - | "Belt_MapInt" -> "Belt.Map.Int" - | "Belt_MapString" -> "Belt.Map.String" - | "Belt_Option" -> "Belt.Option" - | "Belt_MutableSet" -> "Belt.MutableSet" - | "Belt_MutableSetInt" -> "Belt.MutableSet.Int" - | "Belt_MutableSetString" -> "Belt.MutableSet.String" - | "Belt_MutableMap" -> "Belt.MutableMap" - | "Belt_MutableMapInt" -> "Belt.MutableMap.Int" - | "Belt_MutableMapString" -> "Belt.MutableMap.String" - | "Belt_HashSet" -> "Belt.HashSet" - | "Belt_HashSetInt" -> "Belt.HashSet.Int" - | "Belt_HashSetString" -> "Belt.HashSet.String" - | "Belt_HashMap" -> "Belt.HashMap" - | "Belt_HashMapString" -> "Belt.HashMap.String" - | "Belt_HashMapInt" -> "Belt.HashMap.Int" - | "Belt_Debug" -> "Belt.Debug" - | s -> ( - match Ext_namespace.try_split_module_name s with - | None -> s - | Some (ns, m) -> ns ^ "." ^ m)) + (match Ext_namespace.try_split_module_name s with + | None -> s + | Some (ns, m) -> ns ^ "." ^ m) diff --git a/compiler/frontend/bs_builtin_ppx.ml b/compiler/frontend/bs_builtin_ppx.ml index 40e9ff79bfb..ae63e0d4b4a 100644 --- a/compiler/frontend/bs_builtin_ppx.ml +++ b/compiler/frontend/bs_builtin_ppx.ml @@ -73,7 +73,7 @@ let pat_mapper (self : mapper) (p : Parsetree.pattern) = | _ -> default_pat_mapper self p (* Unpack requires core_type package for type inference: - Generate a module type name eg. __Belt_List__*) + Generate a module type name eg. __List__*) let local_module_type_name txt = "_" ^ (Longident.flatten txt |> List.fold_left (fun ll l -> ll ^ "_" ^ l) "") @@ -323,7 +323,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper) the attribute to the whole expression, in general, when shuffuling the ast it is very hard to place attributes correctly *) - (* module M = await Belt.List *) + (* module M = await List *) | Pexp_letmodule (lid, ({pmod_desc = Pmod_ident {txt}; pmod_attributes} as me), expr) when Res_parsetree_viewer.has_await_attribute pmod_attributes -> @@ -339,7 +339,7 @@ let expr_mapper ~async_context ~in_function_def (self : mapper) ~module_type_lid:safe_module_type_lid me, self.expr self expr ); } - (* module M = await (Belt.List: BeltList) *) + (* module M = await (List: ListType) *) | Pexp_letmodule ( lid, ({ @@ -661,7 +661,7 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t) | _ -> expand_reverse acc (structure_mapper ~await_context self rest) in aux [] stru - (* Dynamic import of module transformation: module M = @res.await Belt.List *) + (* Dynamic import of module transformation: module M = @res.await List *) | Pstr_module ({pmb_expr = {pmod_desc = Pmod_ident {txt; loc}; pmod_attributes} as me} as mb) @@ -671,7 +671,7 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t) let has_local_module_name = Hashtbl.find_opt !await_context safe_module_type_name in - (* module __Belt_List__ = module type of Belt.List *) + (* module __List__ = module type of List *) let module_type_decl = match has_local_module_name with | Some _ -> [] @@ -690,7 +690,7 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t) in module_type_decl @ - (* module M = @res.await Belt.List *) + (* module M = @res.await List *) { item with pstr_desc = @@ -705,7 +705,7 @@ let rec structure_mapper ~await_context (self : mapper) (stru : Ast_structure.t) :: structure_mapper ~await_context self rest | Pstr_value (_, vbs) -> let item = self.structure_item self item in - (* [ module __Belt_List__ = module type of Belt.List ] *) + (* [ module __List__ = module type of List ] *) let rec spelunk_vbs acc vbs = match vbs with | [] -> acc diff --git a/compiler/gentype/translate_type_expr_from_types.ml b/compiler/gentype/translate_type_expr_from_types.ml index 193848fe086..80ab06128fc 100644 --- a/compiler/gentype/translate_type_expr_from_types.ml +++ b/compiler/gentype/translate_type_expr_from_types.ml @@ -312,10 +312,7 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env = }; ] ); } - | ( ( ["Pervasives"; "result"] - | ["Belt"; "Result"; "t"] - | ["result"] - | ["Stdlib"; "Result"; "t"] ), + | ( (["Pervasives"; "result"] | ["result"] | ["Stdlib"; "Result"; "t"]), [param_translation1; param_translation2] ) -> let case name type_ = {case = {label_js = StringLabel name}; t = type_} in let variant = diff --git a/compiler/syntax/src/res_diagnostics.ml b/compiler/syntax/src/res_diagnostics.ml index 76c39a39033..fc025169444 100644 --- a/compiler/syntax/src/res_diagnostics.ml +++ b/compiler/syntax/src/res_diagnostics.ml @@ -47,7 +47,7 @@ let explain t = let token = Token.to_string t in "`" ^ token ^ "` is a reserved keyword." | _ -> - "At this point, I'm looking for an uppercased name like `Belt` or `Array`" + "At this point, I'm looking for an uppercased name like `Array` or `Math`" ) | Lident current_token -> ( match current_token with diff --git a/compiler/syntax/src/res_grammar.ml b/compiler/syntax/src/res_grammar.ml index de4a9578064..1d21062fcfd 100644 --- a/compiler/syntax/src/res_grammar.ml +++ b/compiler/syntax/src/res_grammar.ml @@ -1,7 +1,7 @@ module Token = Res_token type t = - | OpenDescription (* open Belt *) + | OpenDescription (* open Array *) | ModuleLongIdent (* Foo or Foo.Bar *) [@live] | Ternary (* condExpr ? trueExpr : falseExpr *) | Es6ArrowExpr diff --git a/compiler/syntax/src/res_printer.ml b/compiler/syntax/src/res_printer.ml index 14eed92ec17..820e5461244 100644 --- a/compiler/syntax/src/res_printer.ml +++ b/compiler/syntax/src/res_printer.ml @@ -2453,7 +2453,7 @@ and print_value_binding ~state ~rec_flag (vb : Parsetree.value_binding) cmt_tbl * let decoratorTags = * items * ->Array.filter(items => {items.category === Decorators}) - * ->Belt.Array.map(...) + * ->Array.map(...) * Multiple pipes chained together lend themselves more towards the last layout. *) if Parsetree_viewer.is_single_pipe_expr vb.pvb_expr then diff --git a/tests/gentype_tests/typescript-react-example/src/Variants.res b/tests/gentype_tests/typescript-react-example/src/Variants.res index 9b1fb0e6724..623f0b4ca89 100644 --- a/tests/gentype_tests/typescript-react-example/src/Variants.res +++ b/tests/gentype_tests/typescript-react-example/src/Variants.res @@ -101,7 +101,7 @@ type result1<'a, 'b> = @genType type result2<'a, 'b> = result<'a, 'b> -@genType type result3<'a, 'b> = Belt.Result.t<'a, 'b> +@genType type result3<'a, 'b> = Stdlib.Result.t<'a, 'b> @genType let restResult1 = (x: result1) => x From 01ffa996e132cad6f3a3bf8c1bc26974ae5a892f Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 9 Aug 2026 11:49:31 +0200 Subject: [PATCH 04/14] Move Belt-specific collection tests into a dedicated suite Signed-off-by: Christoph Knittel --- tests/{tests => belt_tests}/src/belt_float_test.mjs | 0 tests/{tests => belt_tests}/src/belt_float_test.res | 0 tests/{tests => belt_tests}/src/belt_hashmap_test.mjs | 0 tests/{tests => belt_tests}/src/belt_hashmap_test.res | 0 tests/{tests => belt_tests}/src/belt_hashset_int_test.mjs | 0 tests/{tests => belt_tests}/src/belt_hashset_int_test.res | 0 tests/{tests => belt_tests}/src/belt_int_test.mjs | 0 tests/{tests => belt_tests}/src/belt_int_test.res | 0 tests/{tests => belt_tests}/src/belt_list_test.mjs | 0 tests/{tests => belt_tests}/src/belt_list_test.res | 0 tests/{tests => belt_tests}/src/belt_mapint_test.mjs | 0 tests/{tests => belt_tests}/src/belt_mapint_test.res | 0 tests/{tests => belt_tests}/src/belt_result_alias_test.mjs | 0 tests/{tests => belt_tests}/src/belt_result_alias_test.res | 0 tests/{tests => belt_tests}/src/belt_sortarray_test.mjs | 0 tests/{tests => belt_tests}/src/belt_sortarray_test.res | 0 tests/{tests => belt_tests}/src/bs_array_test.mjs | 0 tests/{tests => belt_tests}/src/bs_array_test.res | 0 tests/{tests => belt_tests}/src/bs_map_set_dict_test.mjs | 0 tests/{tests => belt_tests}/src/bs_map_set_dict_test.res | 0 tests/{tests => belt_tests}/src/bs_map_test.mjs | 0 tests/{tests => belt_tests}/src/bs_map_test.res | 0 tests/{tests => belt_tests}/src/bs_mutable_set_test.mjs | 0 tests/{tests => belt_tests}/src/bs_mutable_set_test.res | 0 tests/{tests => belt_tests}/src/bs_poly_map_test.mjs | 0 tests/{tests => belt_tests}/src/bs_poly_map_test.res | 0 tests/{tests => belt_tests}/src/bs_poly_mutable_map_test.mjs | 0 tests/{tests => belt_tests}/src/bs_poly_mutable_map_test.res | 0 tests/{tests => belt_tests}/src/bs_poly_mutable_set_test.mjs | 0 tests/{tests => belt_tests}/src/bs_poly_mutable_set_test.res | 0 tests/{tests => belt_tests}/src/bs_poly_set_test.mjs | 0 tests/{tests => belt_tests}/src/bs_poly_set_test.res | 0 tests/{tests => belt_tests}/src/bs_queue_test.mjs | 0 tests/{tests => belt_tests}/src/bs_queue_test.res | 0 tests/{tests => belt_tests}/src/bs_set_int_test.mjs | 0 tests/{tests => belt_tests}/src/bs_set_int_test.res | 0 tests/{tests => belt_tests}/src/bs_stack_test.mjs | 0 tests/{tests => belt_tests}/src/bs_stack_test.res | 0 38 files changed, 0 insertions(+), 0 deletions(-) rename tests/{tests => belt_tests}/src/belt_float_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_float_test.res (100%) rename tests/{tests => belt_tests}/src/belt_hashmap_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_hashmap_test.res (100%) rename tests/{tests => belt_tests}/src/belt_hashset_int_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_hashset_int_test.res (100%) rename tests/{tests => belt_tests}/src/belt_int_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_int_test.res (100%) rename tests/{tests => belt_tests}/src/belt_list_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_list_test.res (100%) rename tests/{tests => belt_tests}/src/belt_mapint_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_mapint_test.res (100%) rename tests/{tests => belt_tests}/src/belt_result_alias_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_result_alias_test.res (100%) rename tests/{tests => belt_tests}/src/belt_sortarray_test.mjs (100%) rename tests/{tests => belt_tests}/src/belt_sortarray_test.res (100%) rename tests/{tests => belt_tests}/src/bs_array_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_array_test.res (100%) rename tests/{tests => belt_tests}/src/bs_map_set_dict_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_map_set_dict_test.res (100%) rename tests/{tests => belt_tests}/src/bs_map_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_map_test.res (100%) rename tests/{tests => belt_tests}/src/bs_mutable_set_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_mutable_set_test.res (100%) rename tests/{tests => belt_tests}/src/bs_poly_map_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_poly_map_test.res (100%) rename tests/{tests => belt_tests}/src/bs_poly_mutable_map_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_poly_mutable_map_test.res (100%) rename tests/{tests => belt_tests}/src/bs_poly_mutable_set_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_poly_mutable_set_test.res (100%) rename tests/{tests => belt_tests}/src/bs_poly_set_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_poly_set_test.res (100%) rename tests/{tests => belt_tests}/src/bs_queue_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_queue_test.res (100%) rename tests/{tests => belt_tests}/src/bs_set_int_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_set_int_test.res (100%) rename tests/{tests => belt_tests}/src/bs_stack_test.mjs (100%) rename tests/{tests => belt_tests}/src/bs_stack_test.res (100%) diff --git a/tests/tests/src/belt_float_test.mjs b/tests/belt_tests/src/belt_float_test.mjs similarity index 100% rename from tests/tests/src/belt_float_test.mjs rename to tests/belt_tests/src/belt_float_test.mjs diff --git a/tests/tests/src/belt_float_test.res b/tests/belt_tests/src/belt_float_test.res similarity index 100% rename from tests/tests/src/belt_float_test.res rename to tests/belt_tests/src/belt_float_test.res diff --git a/tests/tests/src/belt_hashmap_test.mjs b/tests/belt_tests/src/belt_hashmap_test.mjs similarity index 100% rename from tests/tests/src/belt_hashmap_test.mjs rename to tests/belt_tests/src/belt_hashmap_test.mjs diff --git a/tests/tests/src/belt_hashmap_test.res b/tests/belt_tests/src/belt_hashmap_test.res similarity index 100% rename from tests/tests/src/belt_hashmap_test.res rename to tests/belt_tests/src/belt_hashmap_test.res diff --git a/tests/tests/src/belt_hashset_int_test.mjs b/tests/belt_tests/src/belt_hashset_int_test.mjs similarity index 100% rename from tests/tests/src/belt_hashset_int_test.mjs rename to tests/belt_tests/src/belt_hashset_int_test.mjs diff --git a/tests/tests/src/belt_hashset_int_test.res b/tests/belt_tests/src/belt_hashset_int_test.res similarity index 100% rename from tests/tests/src/belt_hashset_int_test.res rename to tests/belt_tests/src/belt_hashset_int_test.res diff --git a/tests/tests/src/belt_int_test.mjs b/tests/belt_tests/src/belt_int_test.mjs similarity index 100% rename from tests/tests/src/belt_int_test.mjs rename to tests/belt_tests/src/belt_int_test.mjs diff --git a/tests/tests/src/belt_int_test.res b/tests/belt_tests/src/belt_int_test.res similarity index 100% rename from tests/tests/src/belt_int_test.res rename to tests/belt_tests/src/belt_int_test.res diff --git a/tests/tests/src/belt_list_test.mjs b/tests/belt_tests/src/belt_list_test.mjs similarity index 100% rename from tests/tests/src/belt_list_test.mjs rename to tests/belt_tests/src/belt_list_test.mjs diff --git a/tests/tests/src/belt_list_test.res b/tests/belt_tests/src/belt_list_test.res similarity index 100% rename from tests/tests/src/belt_list_test.res rename to tests/belt_tests/src/belt_list_test.res diff --git a/tests/tests/src/belt_mapint_test.mjs b/tests/belt_tests/src/belt_mapint_test.mjs similarity index 100% rename from tests/tests/src/belt_mapint_test.mjs rename to tests/belt_tests/src/belt_mapint_test.mjs diff --git a/tests/tests/src/belt_mapint_test.res b/tests/belt_tests/src/belt_mapint_test.res similarity index 100% rename from tests/tests/src/belt_mapint_test.res rename to tests/belt_tests/src/belt_mapint_test.res diff --git a/tests/tests/src/belt_result_alias_test.mjs b/tests/belt_tests/src/belt_result_alias_test.mjs similarity index 100% rename from tests/tests/src/belt_result_alias_test.mjs rename to tests/belt_tests/src/belt_result_alias_test.mjs diff --git a/tests/tests/src/belt_result_alias_test.res b/tests/belt_tests/src/belt_result_alias_test.res similarity index 100% rename from tests/tests/src/belt_result_alias_test.res rename to tests/belt_tests/src/belt_result_alias_test.res diff --git a/tests/tests/src/belt_sortarray_test.mjs b/tests/belt_tests/src/belt_sortarray_test.mjs similarity index 100% rename from tests/tests/src/belt_sortarray_test.mjs rename to tests/belt_tests/src/belt_sortarray_test.mjs diff --git a/tests/tests/src/belt_sortarray_test.res b/tests/belt_tests/src/belt_sortarray_test.res similarity index 100% rename from tests/tests/src/belt_sortarray_test.res rename to tests/belt_tests/src/belt_sortarray_test.res diff --git a/tests/tests/src/bs_array_test.mjs b/tests/belt_tests/src/bs_array_test.mjs similarity index 100% rename from tests/tests/src/bs_array_test.mjs rename to tests/belt_tests/src/bs_array_test.mjs diff --git a/tests/tests/src/bs_array_test.res b/tests/belt_tests/src/bs_array_test.res similarity index 100% rename from tests/tests/src/bs_array_test.res rename to tests/belt_tests/src/bs_array_test.res diff --git a/tests/tests/src/bs_map_set_dict_test.mjs b/tests/belt_tests/src/bs_map_set_dict_test.mjs similarity index 100% rename from tests/tests/src/bs_map_set_dict_test.mjs rename to tests/belt_tests/src/bs_map_set_dict_test.mjs diff --git a/tests/tests/src/bs_map_set_dict_test.res b/tests/belt_tests/src/bs_map_set_dict_test.res similarity index 100% rename from tests/tests/src/bs_map_set_dict_test.res rename to tests/belt_tests/src/bs_map_set_dict_test.res diff --git a/tests/tests/src/bs_map_test.mjs b/tests/belt_tests/src/bs_map_test.mjs similarity index 100% rename from tests/tests/src/bs_map_test.mjs rename to tests/belt_tests/src/bs_map_test.mjs diff --git a/tests/tests/src/bs_map_test.res b/tests/belt_tests/src/bs_map_test.res similarity index 100% rename from tests/tests/src/bs_map_test.res rename to tests/belt_tests/src/bs_map_test.res diff --git a/tests/tests/src/bs_mutable_set_test.mjs b/tests/belt_tests/src/bs_mutable_set_test.mjs similarity index 100% rename from tests/tests/src/bs_mutable_set_test.mjs rename to tests/belt_tests/src/bs_mutable_set_test.mjs diff --git a/tests/tests/src/bs_mutable_set_test.res b/tests/belt_tests/src/bs_mutable_set_test.res similarity index 100% rename from tests/tests/src/bs_mutable_set_test.res rename to tests/belt_tests/src/bs_mutable_set_test.res diff --git a/tests/tests/src/bs_poly_map_test.mjs b/tests/belt_tests/src/bs_poly_map_test.mjs similarity index 100% rename from tests/tests/src/bs_poly_map_test.mjs rename to tests/belt_tests/src/bs_poly_map_test.mjs diff --git a/tests/tests/src/bs_poly_map_test.res b/tests/belt_tests/src/bs_poly_map_test.res similarity index 100% rename from tests/tests/src/bs_poly_map_test.res rename to tests/belt_tests/src/bs_poly_map_test.res diff --git a/tests/tests/src/bs_poly_mutable_map_test.mjs b/tests/belt_tests/src/bs_poly_mutable_map_test.mjs similarity index 100% rename from tests/tests/src/bs_poly_mutable_map_test.mjs rename to tests/belt_tests/src/bs_poly_mutable_map_test.mjs diff --git a/tests/tests/src/bs_poly_mutable_map_test.res b/tests/belt_tests/src/bs_poly_mutable_map_test.res similarity index 100% rename from tests/tests/src/bs_poly_mutable_map_test.res rename to tests/belt_tests/src/bs_poly_mutable_map_test.res diff --git a/tests/tests/src/bs_poly_mutable_set_test.mjs b/tests/belt_tests/src/bs_poly_mutable_set_test.mjs similarity index 100% rename from tests/tests/src/bs_poly_mutable_set_test.mjs rename to tests/belt_tests/src/bs_poly_mutable_set_test.mjs diff --git a/tests/tests/src/bs_poly_mutable_set_test.res b/tests/belt_tests/src/bs_poly_mutable_set_test.res similarity index 100% rename from tests/tests/src/bs_poly_mutable_set_test.res rename to tests/belt_tests/src/bs_poly_mutable_set_test.res diff --git a/tests/tests/src/bs_poly_set_test.mjs b/tests/belt_tests/src/bs_poly_set_test.mjs similarity index 100% rename from tests/tests/src/bs_poly_set_test.mjs rename to tests/belt_tests/src/bs_poly_set_test.mjs diff --git a/tests/tests/src/bs_poly_set_test.res b/tests/belt_tests/src/bs_poly_set_test.res similarity index 100% rename from tests/tests/src/bs_poly_set_test.res rename to tests/belt_tests/src/bs_poly_set_test.res diff --git a/tests/tests/src/bs_queue_test.mjs b/tests/belt_tests/src/bs_queue_test.mjs similarity index 100% rename from tests/tests/src/bs_queue_test.mjs rename to tests/belt_tests/src/bs_queue_test.mjs diff --git a/tests/tests/src/bs_queue_test.res b/tests/belt_tests/src/bs_queue_test.res similarity index 100% rename from tests/tests/src/bs_queue_test.res rename to tests/belt_tests/src/bs_queue_test.res diff --git a/tests/tests/src/bs_set_int_test.mjs b/tests/belt_tests/src/bs_set_int_test.mjs similarity index 100% rename from tests/tests/src/bs_set_int_test.mjs rename to tests/belt_tests/src/bs_set_int_test.mjs diff --git a/tests/tests/src/bs_set_int_test.res b/tests/belt_tests/src/bs_set_int_test.res similarity index 100% rename from tests/tests/src/bs_set_int_test.res rename to tests/belt_tests/src/bs_set_int_test.res diff --git a/tests/tests/src/bs_stack_test.mjs b/tests/belt_tests/src/bs_stack_test.mjs similarity index 100% rename from tests/tests/src/bs_stack_test.mjs rename to tests/belt_tests/src/bs_stack_test.mjs diff --git a/tests/tests/src/bs_stack_test.res b/tests/belt_tests/src/bs_stack_test.res similarity index 100% rename from tests/tests/src/bs_stack_test.res rename to tests/belt_tests/src/bs_stack_test.res From 73113e11581c696f25328f10c90dbcea11e4aea7 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 9 Aug 2026 11:49:38 +0200 Subject: [PATCH 05/14] Separate Belt tests from the compiler test suite Signed-off-by: Christoph Knittel --- package.json | 1 + scripts/res/package.json | 1 - scripts/res/rescript.json | 2 +- scripts/test.js | 18 ++ .../deadcode-benchmark/package.json | 1 - .../deadcode-benchmark/rescript.json | 2 +- tests/belt_tests/package.json | 11 + tests/belt_tests/rescript.json | 18 ++ .../src/array_data_util.mjs | 2 +- .../src/array_data_util.res | 0 tests/belt_tests/src/belt_float_test.mjs | 2 +- tests/belt_tests/src/belt_hashmap_test.mjs | 8 +- .../belt_tests/src/belt_hashset_int_test.mjs | 8 +- tests/belt_tests/src/belt_int_test.mjs | 2 +- tests/belt_tests/src/belt_list_test.mjs | 4 +- tests/belt_tests/src/belt_mapint_test.mjs | 2 +- .../belt_tests/src/belt_result_alias_test.mjs | 2 +- tests/belt_tests/src/belt_sortarray_test.mjs | 8 +- tests/belt_tests/src/bs_array_test.mjs | 4 +- tests/belt_tests/src/bs_map_set_dict_test.mjs | 14 +- tests/belt_tests/src/bs_map_test.mjs | 6 +- tests/belt_tests/src/bs_mutable_set_test.mjs | 8 +- tests/belt_tests/src/bs_poly_map_test.mjs | 8 +- .../src/bs_poly_mutable_map_test.mjs | 8 +- .../src/bs_poly_mutable_set_test.mjs | 8 +- tests/belt_tests/src/bs_poly_set_test.mjs | 12 +- tests/belt_tests/src/bs_queue_test.mjs | 4 +- tests/belt_tests/src/bs_set_int_test.mjs | 6 +- tests/belt_tests/src/bs_stack_test.mjs | 4 +- .../src/demo_int_map.mjs | 2 +- .../src/demo_int_map.res | 0 .../src/demo_int_map.resi | 0 .../src/gpr_4265_test.mjs | 2 +- .../src/gpr_4265_test.res | 0 tests/{tests => belt_tests}/src/hash_test.mjs | 2 +- tests/{tests => belt_tests}/src/hash_test.res | 0 .../{tests => belt_tests}/src/hash_utils.mjs | 0 .../{tests => belt_tests}/src/hash_utils.res | 0 .../{tests => belt_tests}/src/hash_utils.resi | 0 .../src/inner_unused.mjs | 0 .../src/inner_unused.res | 0 tests/{tests => belt_tests}/src/int_map.mjs | 4 +- tests/{tests => belt_tests}/src/int_map.res | 0 tests/{tests => belt_tests}/src/list_test.mjs | 4 +- tests/{tests => belt_tests}/src/list_test.res | 0 .../src/map_find_test.mjs | 6 +- .../src/map_find_test.res | 0 tests/belt_tests/src/mocha.mjs | 2 + tests/belt_tests/src/mocha.res | 5 + tests/belt_tests/src/node_assert.mjs | 2 + tests/belt_tests/src/node_assert.res | 5 + .../src/rec_module_opt.mjs | 2 +- .../src/rec_module_opt.res | 0 .../{tests => belt_tests}/src/test_array.mjs | 2 +- .../{tests => belt_tests}/src/test_array.res | 0 .../src/test_for_map.mjs | 2 +- .../src/test_for_map.res | 0 .../src/test_for_map2.mjs | 2 +- .../src/test_for_map2.res | 0 .../src/test_int_map_find.mjs | 4 +- .../src/test_int_map_find.res | 0 .../src/test_string_map.mjs | 2 +- .../src/test_string_map.res | 0 tests/belt_tests/src/test_utils.mjs | 28 ++ tests/belt_tests/src/test_utils.res | 8 + tests/{tests => belt_tests}/src/ticker.mjs | 8 +- tests/{tests => belt_tests}/src/ticker.res | 0 tests/docstring_tests/DocTest.res | 39 +-- tests/docstring_tests/DocTest.res.js | 35 +-- tests/tests/package.json | 1 - tests/tests/rescript.json | 2 +- tests/tests/src/Import.mjs | 64 +++-- tests/tests/src/Import.res | 54 ++-- tests/tests/src/UntaggedVariants.mjs | 5 +- tests/tests/src/UntaggedVariants.res | 4 +- tests/tests/src/a.res | 2 - tests/tests/src/alias_default_value_test.mjs | 2 +- tests/tests/src/alias_default_value_test.res | 2 +- tests/tests/src/async_await.mjs | 4 +- tests/tests/src/async_await.res | 6 +- tests/tests/src/bdd.mjs | 26 +- tests/tests/src/bdd.res | 26 +- tests/tests/src/bench.mjs | 6 +- tests/tests/src/bench.res | 6 +- tests/tests/src/block_alias_test.mjs | 6 +- tests/tests/src/block_alias_test.res | 4 +- .../tests/src/coercion_module_alias_test.mjs | 6 +- .../tests/src/coercion_module_alias_test.res | 2 - tests/tests/src/cps_test.mjs | 10 +- tests/tests/src/cps_test.res | 8 +- tests/tests/src/directives.mjs | 5 +- tests/tests/src/directives.res | 2 +- tests/tests/src/earger_curry_test.mjs | 24 +- tests/tests/src/earger_curry_test.res | 10 +- tests/tests/src/event_ffi.mjs | 4 +- tests/tests/src/event_ffi.res | 2 +- tests/tests/src/exception_alias.mjs | 153 +++++------ tests/tests/src/exception_alias.res | 2 - tests/tests/src/exception_raise_test.mjs | 4 +- tests/tests/src/exception_raise_test.res | 2 +- tests/tests/src/ext_array_test.mjs | 26 +- tests/tests/src/ext_array_test.res | 18 +- tests/tests/src/flexible_array_test.mjs | 6 +- tests/tests/src/flexible_array_test.res | 6 +- tests/tests/src/for_loop_test.mjs | 46 ++-- tests/tests/src/for_loop_test.res | 50 ++-- tests/tests/src/global_module_alias_test.mjs | 22 +- tests/tests/src/global_module_alias_test.res | 1 - tests/tests/src/gpr_1409_test.mjs | 26 +- tests/tests/src/gpr_1409_test.res | 3 +- tests/tests/src/gpr_1701_test.mjs | 8 +- tests/tests/src/gpr_1701_test.res | 2 - tests/tests/src/gpr_2487.mjs | 4 +- tests/tests/src/gpr_2487.res | 4 +- tests/tests/src/gpr_2608_test.mjs | 18 +- tests/tests/src/gpr_2608_test.res | 1 - tests/tests/src/gpr_3931_test.mjs | 3 +- tests/tests/src/gpr_3931_test.res | 2 +- tests/tests/src/gpr_4274_test.mjs | 7 +- tests/tests/src/gpr_4274_test.res | 4 +- tests/tests/src/hello_res.mjs | 6 +- tests/tests/src/hello_res.res | 2 - tests/tests/src/inline_map2_test.mjs | 10 +- tests/tests/src/inline_map2_test.res | 16 +- tests/tests/src/inline_map_demo.mjs | 6 +- tests/tests/src/inline_map_demo.res | 7 +- tests/tests/src/inline_map_test.mjs | 6 +- tests/tests/src/inline_map_test.res | 7 +- tests/tests/src/inline_record_test.mjs | 6 +- tests/tests/src/inline_record_test.res | 4 +- tests/tests/src/label_uncurry.mjs | 4 +- tests/tests/src/label_uncurry.res | 2 +- tests/tests/src/loop_control_test.mjs | 22 +- tests/tests/src/loop_control_test.res | 20 +- tests/tests/src/mario_game.mjs | 18 +- tests/tests/src/mario_game.res | 2 - tests/tests/src/module_alias_test.mjs | 10 +- tests/tests/src/module_alias_test.res | 1 - tests/tests/src/module_missing_conversion.mjs | 101 ++------ tests/tests/src/module_missing_conversion.res | 2 +- tests/tests/src/module_test.mjs | 4 +- tests/tests/src/module_test.res | 2 +- tests/tests/src/nested_module_alias.mjs | 6 +- tests/tests/src/nested_module_alias.res | 4 +- tests/tests/src/obj_literal_ppx.res | 2 +- tests/tests/src/offset.res | 2 +- tests/tests/src/option_repr_test.mjs | 16 +- tests/tests/src/option_repr_test.res | 8 +- tests/tests/src/raw_pure_test.mjs | 4 +- tests/tests/src/raw_pure_test.res | 2 +- tests/tests/src/record_extension_test.mjs | 8 +- tests/tests/src/record_extension_test.res | 6 +- tests/tests/src/recursive_records_test.mjs | 6 +- tests/tests/src/recursive_records_test.res | 4 +- tests/tests/src/set_gen.mjs | 4 +- tests/tests/src/set_gen.res | 18 +- tests/tests/src/side_effect2.mjs | 3 +- tests/tests/src/side_effect2.res | 2 +- tests/tests/src/splice_test.mjs | 24 +- tests/tests/src/splice_test.res | 7 +- tests/tests/src/string_set.mjs | 8 +- tests/tests/src/string_set.res | 4 +- tests/tests/src/tailcall_inline_test.mjs | 4 +- tests/tests/src/tailcall_inline_test.res | 2 +- tests/tests/src/test_ari.mjs | 233 +++++------------ tests/tests/src/test_ari.res | 2 +- tests/tests/src/test_array_append.mjs | 5 +- tests/tests/src/test_array_append.res | 2 +- tests/tests/src/test_bool_equal.res | 4 +- tests/tests/src/test_closure.mjs | 6 +- tests/tests/src/test_closure.res | 4 +- tests/tests/src/test_cps.mjs | 4 +- tests/tests/src/test_cps.res | 2 +- tests/tests/src/test_demo.mjs | 4 +- tests/tests/src/test_demo.res | 2 +- tests/tests/src/test_for_loop.mjs | 17 +- tests/tests/src/test_for_loop.res | 28 +- tests/tests/src/test_functor_dead_code.mjs | 4 +- tests/tests/src/test_functor_dead_code.res | 4 +- tests/tests/src/test_google_closure.mjs | 4 +- tests/tests/src/test_google_closure.res | 2 +- tests/tests/src/test_include.mjs | 235 ++++++----------- tests/tests/src/test_include.res | 4 +- tests/tests/src/test_list.mjs | 4 +- tests/tests/src/test_list.res | 2 +- tests/tests/src/test_pervasive.mjs | 152 +++++------ tests/tests/src/test_pervasive.res | 2 +- tests/tests/src/test_pervasives3.mjs | 153 +++++------ tests/tests/src/test_pervasives3.res | 2 +- tests/tests/src/test_set.mjs | 6 +- tests/tests/src/test_set.res | 4 +- tests/tests/src/test_simple_include.mjs | 241 ++++-------------- tests/tests/src/test_simple_include.res | 2 +- tests/tests/src/test_while_closure.mjs | 6 +- tests/tests/src/test_while_closure.res | 4 +- tests/tests/src/topsort_test.mjs | 79 +++--- tests/tests/src/topsort_test.res | 16 +- tests/tests/src/uncurried_cast.mjs | 12 +- tests/tests/src/uncurried_cast.res | 2 +- tests/tests/src/webpack_config.mjs | 6 +- tests/tests/src/webpack_config.res | 2 - yarn.lock | 16 +- 202 files changed, 1160 insertions(+), 1570 deletions(-) create mode 100644 tests/belt_tests/package.json create mode 100644 tests/belt_tests/rescript.json rename tests/{tests => belt_tests}/src/array_data_util.mjs (82%) rename tests/{tests => belt_tests}/src/array_data_util.res (100%) rename tests/{tests => belt_tests}/src/demo_int_map.mjs (78%) rename tests/{tests => belt_tests}/src/demo_int_map.res (100%) rename tests/{tests => belt_tests}/src/demo_int_map.resi (100%) rename tests/{tests => belt_tests}/src/gpr_4265_test.mjs (88%) rename tests/{tests => belt_tests}/src/gpr_4265_test.res (100%) rename tests/{tests => belt_tests}/src/hash_test.mjs (95%) rename tests/{tests => belt_tests}/src/hash_test.res (100%) rename tests/{tests => belt_tests}/src/hash_utils.mjs (100%) rename tests/{tests => belt_tests}/src/hash_utils.res (100%) rename tests/{tests => belt_tests}/src/hash_utils.resi (100%) rename tests/{tests => belt_tests}/src/inner_unused.mjs (100%) rename tests/{tests => belt_tests}/src/inner_unused.res (100%) rename tests/{tests => belt_tests}/src/int_map.mjs (72%) rename tests/{tests => belt_tests}/src/int_map.res (100%) rename tests/{tests => belt_tests}/src/list_test.mjs (94%) rename tests/{tests => belt_tests}/src/list_test.res (100%) rename tests/{tests => belt_tests}/src/map_find_test.mjs (85%) rename tests/{tests => belt_tests}/src/map_find_test.res (100%) create mode 100644 tests/belt_tests/src/mocha.mjs create mode 100644 tests/belt_tests/src/mocha.res create mode 100644 tests/belt_tests/src/node_assert.mjs create mode 100644 tests/belt_tests/src/node_assert.res rename tests/{tests => belt_tests}/src/rec_module_opt.mjs (95%) rename tests/{tests => belt_tests}/src/rec_module_opt.res (100%) rename tests/{tests => belt_tests}/src/test_array.mjs (84%) rename tests/{tests => belt_tests}/src/test_array.res (100%) rename tests/{tests => belt_tests}/src/test_for_map.mjs (80%) rename tests/{tests => belt_tests}/src/test_for_map.res (100%) rename tests/{tests => belt_tests}/src/test_for_map2.mjs (81%) rename tests/{tests => belt_tests}/src/test_for_map2.res (100%) rename tests/{tests => belt_tests}/src/test_int_map_find.mjs (75%) rename tests/{tests => belt_tests}/src/test_int_map_find.res (100%) rename tests/{tests => belt_tests}/src/test_string_map.mjs (87%) rename tests/{tests => belt_tests}/src/test_string_map.res (100%) create mode 100644 tests/belt_tests/src/test_utils.mjs create mode 100644 tests/belt_tests/src/test_utils.res rename tests/{tests => belt_tests}/src/ticker.mjs (96%) rename tests/{tests => belt_tests}/src/ticker.res (100%) diff --git a/package.json b/package.json index c0a45689a10..50c42cffed2 100644 --- a/package.json +++ b/package.json @@ -103,6 +103,7 @@ "tests/dependencies/**", "tests/analysis_tests/**", "tests/docstring_tests", + "tests/belt_tests", "tests/gentype_tests/**", "tests/tests", "tests/tools_tests", diff --git a/scripts/res/package.json b/scripts/res/package.json index 05e89adb508..ed2a8a2a3a0 100644 --- a/scripts/res/package.json +++ b/scripts/res/package.json @@ -9,7 +9,6 @@ "apidocs:generate": "yarn build && node GenApiDocs.res.js" }, "dependencies": { - "@rescript/belt": "workspace:^", "@tests/docstring-tests": "workspace:^", "rescript": "workspace:^" } diff --git a/scripts/res/rescript.json b/scripts/res/rescript.json index cbcea617743..31f7a5c6c36 100644 --- a/scripts/res/rescript.json +++ b/scripts/res/rescript.json @@ -6,7 +6,7 @@ "dir": "./" } ], - "dependencies": ["@rescript/belt", "@tests/docstring-tests"], + "dependencies": ["@tests/docstring-tests"], "package-specs": { "module": "esmodule", "in-source": true diff --git a/scripts/test.js b/scripts/test.js index cfbed1b2009..a59676a0e48 100644 --- a/scripts/test.js +++ b/scripts/test.js @@ -73,18 +73,36 @@ if (ounitTest) { } if (mochaTest) { + const beltPackageDir = path.join(projectDir, "packages/@rescript/belt"); + const beltTestDir = path.join(projectDir, "tests/belt_tests"); + // No need to clean beforehand, rewatch detects changes to the compiler binary // and rebuilds automatically in that case. await execBuild([], { cwd: compilerTestDir, stdio: "inherit", }); + // The CommonJS tests clean their dependencies, including Belt. Force a full + // rebuild so repeated test runs don't rely on stale dependency artifacts. + await execClean([], { + cwd: beltPackageDir, + stdio: "inherit", + }); + await execBuild([], { + cwd: beltPackageDir, + stdio: "inherit", + }); + await execBuild([], { + cwd: beltTestDir, + stdio: "inherit", + }); await mocha( [ "-t", "10000", "tests/tests/src/**/*_test.mjs", + "tests/belt_tests/src/**/*_test.mjs", // Ignore the preserve_jsx_test.mjs file. // I can't run because Mocha doesn't support jsx. // We also want to keep the output as is. diff --git a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json index 7af9ea08687..b0dd6bd3432 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/package.json @@ -6,7 +6,6 @@ "clean": "rescript clean" }, "dependencies": { - "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" } diff --git a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json index 3dbc24ac0ce..a640120b97c 100644 --- a/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json +++ b/tests/analysis_tests/tests-reanalyze/deadcode-benchmark/rescript.json @@ -7,7 +7,7 @@ }, "name": "reanalyze-benchmark", "jsx": { "version": 4 }, - "dependencies": ["@rescript/belt", "@rescript/react"], + "dependencies": ["@rescript/react"], "sources": [ { "dir": "src", diff --git a/tests/belt_tests/package.json b/tests/belt_tests/package.json new file mode 100644 index 00000000000..6e27fe560c8 --- /dev/null +++ b/tests/belt_tests/package.json @@ -0,0 +1,11 @@ +{ + "name": "@tests/belt", + "private": true, + "type": "module", + "dependencies": { + "@rescript/belt": "workspace:^", + "@rescript/runtime": "workspace:^", + "mocha": "11.7.6", + "rescript": "workspace:^" + } +} diff --git a/tests/belt_tests/rescript.json b/tests/belt_tests/rescript.json new file mode 100644 index 00000000000..dadb4350db4 --- /dev/null +++ b/tests/belt_tests/rescript.json @@ -0,0 +1,18 @@ +{ + "name": "@tests/belt", + "sources": [ + { + "dir": "src" + } + ], + "package-specs": { + "module": "esmodule", + "in-source": true, + "suffix": ".mjs" + }, + "dependencies": ["@rescript/belt"], + "compiler-flags": [ + "-w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104", + "-warn-error A" + ] +} diff --git a/tests/tests/src/array_data_util.mjs b/tests/belt_tests/src/array_data_util.mjs similarity index 82% rename from tests/tests/src/array_data_util.mjs rename to tests/belt_tests/src/array_data_util.mjs index dc18d1d4bf5..1140f312706 100644 --- a/tests/tests/src/array_data_util.mjs +++ b/tests/belt_tests/src/array_data_util.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; function range(i, j) { return Belt_Array.makeBy((j - i | 0) + 1 | 0, k => k + i | 0); diff --git a/tests/tests/src/array_data_util.res b/tests/belt_tests/src/array_data_util.res similarity index 100% rename from tests/tests/src/array_data_util.res rename to tests/belt_tests/src/array_data_util.res diff --git a/tests/belt_tests/src/belt_float_test.mjs b/tests/belt_tests/src/belt_float_test.mjs index 7edabc0ba66..8b684785693 100644 --- a/tests/belt_tests/src/belt_float_test.mjs +++ b/tests/belt_tests/src/belt_float_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Float from "@rescript/belt/src/Belt_Float.mjs"; +import * as Belt_Float from "@rescript/belt/lib/es6/src/Belt_Float.mjs"; import * as Test_utils from "./test_utils.mjs"; Mocha.describe("Belt_float_test", () => { diff --git a/tests/belt_tests/src/belt_hashmap_test.mjs b/tests/belt_tests/src/belt_hashmap_test.mjs index 0999ac84eda..d38d5dd06a9 100644 --- a/tests/belt_tests/src/belt_hashmap_test.mjs +++ b/tests/belt_tests/src/belt_hashmap_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Hash_utils from "./hash_utils.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_HashMap from "@rescript/belt/src/Belt_HashMap.mjs"; +import * as Belt_HashMap from "@rescript/belt/lib/es6/src/Belt_HashMap.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; -import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; +import * as Belt_SortArray from "@rescript/belt/lib/es6/src/Belt_SortArray.mjs"; import * as Array_data_util from "./array_data_util.mjs"; function intEq(x, y) { diff --git a/tests/belt_tests/src/belt_hashset_int_test.mjs b/tests/belt_tests/src/belt_hashset_int_test.mjs index 9583dca2530..159f97cb719 100644 --- a/tests/belt_tests/src/belt_hashset_int_test.mjs +++ b/tests/belt_tests/src/belt_hashset_int_test.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SetInt from "@rescript/belt/src/Belt_SetInt.mjs"; +import * as Belt_SetInt from "@rescript/belt/lib/es6/src/Belt_SetInt.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_HashSetInt from "@rescript/belt/src/Belt_HashSetInt.mjs"; -import * as Belt_SortArrayInt from "@rescript/belt/src/Belt_SortArrayInt.mjs"; +import * as Belt_HashSetInt from "@rescript/belt/lib/es6/src/Belt_HashSetInt.mjs"; +import * as Belt_SortArrayInt from "@rescript/belt/lib/es6/src/Belt_SortArrayInt.mjs"; function add(x, y) { return x + y | 0; diff --git a/tests/belt_tests/src/belt_int_test.mjs b/tests/belt_tests/src/belt_int_test.mjs index d8f183e1d23..10fdfbbcdd1 100644 --- a/tests/belt_tests/src/belt_int_test.mjs +++ b/tests/belt_tests/src/belt_int_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Int from "@rescript/belt/src/Belt_Int.mjs"; +import * as Belt_Int from "@rescript/belt/lib/es6/src/Belt_Int.mjs"; import * as Test_utils from "./test_utils.mjs"; Mocha.describe("Belt_int_test", () => { diff --git a/tests/belt_tests/src/belt_list_test.mjs b/tests/belt_tests/src/belt_list_test.mjs index 4b33795ccbe..395ea5da21c 100644 --- a/tests/belt_tests/src/belt_list_test.mjs +++ b/tests/belt_tests/src/belt_list_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/belt_tests/src/belt_mapint_test.mjs b/tests/belt_tests/src/belt_mapint_test.mjs index 80562534bda..11fde6a0c8a 100644 --- a/tests/belt_tests/src/belt_mapint_test.mjs +++ b/tests/belt_tests/src/belt_mapint_test.mjs @@ -2,7 +2,7 @@ import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; Mocha.describe("Belt_mapint_test", () => { Mocha.test("set", () => { diff --git a/tests/belt_tests/src/belt_result_alias_test.mjs b/tests/belt_tests/src/belt_result_alias_test.mjs index c2db2db3003..c843910b845 100644 --- a/tests/belt_tests/src/belt_result_alias_test.mjs +++ b/tests/belt_tests/src/belt_result_alias_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Result from "@rescript/belt/src/Belt_Result.mjs"; +import * as Belt_Result from "@rescript/belt/lib/es6/src/Belt_Result.mjs"; Belt_Result.map({ TAG: "Ok", diff --git a/tests/belt_tests/src/belt_sortarray_test.mjs b/tests/belt_tests/src/belt_sortarray_test.mjs index 7c7950be5e6..c9d9cbb9d4b 100644 --- a/tests/belt_tests/src/belt_sortarray_test.mjs +++ b/tests/belt_tests/src/belt_sortarray_test.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; -import * as Belt_Range from "@rescript/belt/src/Belt_Range.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; +import * as Belt_Range from "@rescript/belt/lib/es6/src/Belt_Range.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; +import * as Belt_SortArray from "@rescript/belt/lib/es6/src/Belt_SortArray.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_SortArrayInt from "@rescript/belt/src/Belt_SortArrayInt.mjs"; +import * as Belt_SortArrayInt from "@rescript/belt/lib/es6/src/Belt_SortArrayInt.mjs"; function cmp(x, y) { return x - y | 0; diff --git a/tests/belt_tests/src/bs_array_test.mjs b/tests/belt_tests/src/bs_array_test.mjs index 94d4b89a38a..74bd6912029 100644 --- a/tests/belt_tests/src/bs_array_test.mjs +++ b/tests/belt_tests/src/bs_array_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; diff --git a/tests/belt_tests/src/bs_map_set_dict_test.mjs b/tests/belt_tests/src/bs_map_set_dict_test.mjs index 3ce435a6abd..ced362803af 100644 --- a/tests/belt_tests/src/bs_map_set_dict_test.mjs +++ b/tests/belt_tests/src/bs_map_set_dict_test.mjs @@ -1,14 +1,14 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_Map from "@rescript/belt/src/Belt_Map.mjs"; -import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_Map from "@rescript/belt/lib/es6/src/Belt_Map.mjs"; +import * as Belt_Set from "@rescript/belt/lib/es6/src/Belt_Set.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MapDict from "@rescript/belt/src/Belt_MapDict.mjs"; -import * as Belt_SetDict from "@rescript/belt/src/Belt_SetDict.mjs"; +import * as Belt_MapDict from "@rescript/belt/lib/es6/src/Belt_MapDict.mjs"; +import * as Belt_SetDict from "@rescript/belt/lib/es6/src/Belt_SetDict.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; diff --git a/tests/belt_tests/src/bs_map_test.mjs b/tests/belt_tests/src/bs_map_test.mjs index 726b737f9fd..9bad714f74a 100644 --- a/tests/belt_tests/src/bs_map_test.mjs +++ b/tests/belt_tests/src/bs_map_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; -import * as Belt_SetInt from "@rescript/belt/src/Belt_SetInt.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; +import * as Belt_SetInt from "@rescript/belt/lib/es6/src/Belt_SetInt.mjs"; let mapOfArray = Belt_MapInt.fromArray; diff --git a/tests/belt_tests/src/bs_mutable_set_test.mjs b/tests/belt_tests/src/bs_mutable_set_test.mjs index af6f3bdad1a..a57eaae9bb7 100644 --- a/tests/belt_tests/src/bs_mutable_set_test.mjs +++ b/tests/belt_tests/src/bs_mutable_set_test.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; -import * as Belt_Range from "@rescript/belt/src/Belt_Range.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; +import * as Belt_Range from "@rescript/belt/lib/es6/src/Belt_Range.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_MutableSetInt from "@rescript/belt/src/Belt_MutableSetInt.mjs"; +import * as Belt_MutableSetInt from "@rescript/belt/lib/es6/src/Belt_MutableSetInt.mjs"; Mocha.describe("Bs_mutable_set_test", () => { Mocha.test("mutable set basic operations", () => { diff --git a/tests/belt_tests/src/bs_poly_map_test.mjs b/tests/belt_tests/src/bs_poly_map_test.mjs index 4c065e5e8e5..9da7230bb82 100644 --- a/tests/belt_tests/src/bs_poly_map_test.mjs +++ b/tests/belt_tests/src/bs_poly_map_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_Map from "@rescript/belt/src/Belt_Map.mjs"; -import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_Map from "@rescript/belt/lib/es6/src/Belt_Map.mjs"; +import * as Belt_Set from "@rescript/belt/lib/es6/src/Belt_Set.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; diff --git a/tests/belt_tests/src/bs_poly_mutable_map_test.mjs b/tests/belt_tests/src/bs_poly_mutable_map_test.mjs index 0393977a567..bbc34855e3e 100644 --- a/tests/belt_tests/src/bs_poly_mutable_map_test.mjs +++ b/tests/belt_tests/src/bs_poly_mutable_map_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_Set from "@rescript/belt/lib/es6/src/Belt_Set.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_MutableMap from "@rescript/belt/src/Belt_MutableMap.mjs"; +import * as Belt_MutableMap from "@rescript/belt/lib/es6/src/Belt_MutableMap.mjs"; let Icmp = Belt_Id.comparable(Primitive_int.compare); diff --git a/tests/belt_tests/src/bs_poly_mutable_set_test.mjs b/tests/belt_tests/src/bs_poly_mutable_set_test.mjs index e36de3f4267..f0acb9fcbc7 100644 --- a/tests/belt_tests/src/bs_poly_mutable_set_test.mjs +++ b/tests/belt_tests/src/bs_poly_mutable_set_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Array_data_util from "./array_data_util.mjs"; -import * as Belt_MutableSet from "@rescript/belt/src/Belt_MutableSet.mjs"; +import * as Belt_MutableSet from "@rescript/belt/lib/es6/src/Belt_MutableSet.mjs"; let IntCmp = Belt_Id.comparable(Primitive_int.compare); diff --git a/tests/belt_tests/src/bs_poly_set_test.mjs b/tests/belt_tests/src/bs_poly_set_test.mjs index c8e65e300a5..ae85ac5ca0a 100644 --- a/tests/belt_tests/src/bs_poly_set_test.mjs +++ b/tests/belt_tests/src/bs_poly_set_test.mjs @@ -1,14 +1,14 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_Set from "@rescript/belt/src/Belt_Set.mjs"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_Set from "@rescript/belt/lib/es6/src/Belt_Set.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SetDict from "@rescript/belt/src/Belt_SetDict.mjs"; +import * as Belt_SetDict from "@rescript/belt/lib/es6/src/Belt_SetDict.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; -import * as Belt_SortArray from "@rescript/belt/src/Belt_SortArray.mjs"; +import * as Belt_SortArray from "@rescript/belt/lib/es6/src/Belt_SortArray.mjs"; import * as Array_data_util from "./array_data_util.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/belt_tests/src/bs_queue_test.mjs b/tests/belt_tests/src/bs_queue_test.mjs index 757a57e52a5..ba9db353547 100644 --- a/tests/belt_tests/src/bs_queue_test.mjs +++ b/tests/belt_tests/src/bs_queue_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; -import * as Belt_MutableQueue from "@rescript/belt/src/Belt_MutableQueue.mjs"; +import * as Belt_MutableQueue from "@rescript/belt/lib/es6/src/Belt_MutableQueue.mjs"; function does_raise(f, q) { try { diff --git a/tests/belt_tests/src/bs_set_int_test.mjs b/tests/belt_tests/src/bs_set_int_test.mjs index 1bf0f312905..a14053aa637 100644 --- a/tests/belt_tests/src/bs_set_int_test.mjs +++ b/tests/belt_tests/src/bs_set_int_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_SetInt from "@rescript/belt/src/Belt_SetInt.mjs"; +import * as Belt_SetInt from "@rescript/belt/lib/es6/src/Belt_SetInt.mjs"; import * as Array_data_util from "./array_data_util.mjs"; function setEqArray(s, i) { diff --git a/tests/belt_tests/src/bs_stack_test.mjs b/tests/belt_tests/src/bs_stack_test.mjs index 59595748018..852a1bc015e 100644 --- a/tests/belt_tests/src/bs_stack_test.mjs +++ b/tests/belt_tests/src/bs_stack_test.mjs @@ -4,8 +4,8 @@ import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; -import * as Belt_MutableQueue from "@rescript/belt/src/Belt_MutableQueue.mjs"; -import * as Belt_MutableStack from "@rescript/belt/src/Belt_MutableStack.mjs"; +import * as Belt_MutableQueue from "@rescript/belt/lib/es6/src/Belt_MutableQueue.mjs"; +import * as Belt_MutableStack from "@rescript/belt/lib/es6/src/Belt_MutableStack.mjs"; function inOrder(v) { let current = v; diff --git a/tests/tests/src/demo_int_map.mjs b/tests/belt_tests/src/demo_int_map.mjs similarity index 78% rename from tests/tests/src/demo_int_map.mjs rename to tests/belt_tests/src/demo_int_map.mjs index 2856a500377..f841acdd004 100644 --- a/tests/tests/src/demo_int_map.mjs +++ b/tests/belt_tests/src/demo_int_map.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; function test() { let m; diff --git a/tests/tests/src/demo_int_map.res b/tests/belt_tests/src/demo_int_map.res similarity index 100% rename from tests/tests/src/demo_int_map.res rename to tests/belt_tests/src/demo_int_map.res diff --git a/tests/tests/src/demo_int_map.resi b/tests/belt_tests/src/demo_int_map.resi similarity index 100% rename from tests/tests/src/demo_int_map.resi rename to tests/belt_tests/src/demo_int_map.resi diff --git a/tests/tests/src/gpr_4265_test.mjs b/tests/belt_tests/src/gpr_4265_test.mjs similarity index 88% rename from tests/tests/src/gpr_4265_test.mjs rename to tests/belt_tests/src/gpr_4265_test.mjs index ca122c08aa6..bc4b5499adf 100644 --- a/tests/tests/src/gpr_4265_test.mjs +++ b/tests/belt_tests/src/gpr_4265_test.mjs @@ -2,7 +2,7 @@ import * as Mocha from "mocha"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MutableMapInt from "@rescript/belt/src/Belt_MutableMapInt.mjs"; +import * as Belt_MutableMapInt from "@rescript/belt/lib/es6/src/Belt_MutableMapInt.mjs"; let mockMap = Belt_MutableMapInt.make(); diff --git a/tests/tests/src/gpr_4265_test.res b/tests/belt_tests/src/gpr_4265_test.res similarity index 100% rename from tests/tests/src/gpr_4265_test.res rename to tests/belt_tests/src/gpr_4265_test.res diff --git a/tests/tests/src/hash_test.mjs b/tests/belt_tests/src/hash_test.mjs similarity index 95% rename from tests/tests/src/hash_test.mjs rename to tests/belt_tests/src/hash_test.mjs index d58b133f537..b4a09d8db54 100644 --- a/tests/tests/src/hash_test.mjs +++ b/tests/belt_tests/src/hash_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Hash_utils from "./hash_utils.mjs"; import * as Test_utils from "./test_utils.mjs"; diff --git a/tests/tests/src/hash_test.res b/tests/belt_tests/src/hash_test.res similarity index 100% rename from tests/tests/src/hash_test.res rename to tests/belt_tests/src/hash_test.res diff --git a/tests/tests/src/hash_utils.mjs b/tests/belt_tests/src/hash_utils.mjs similarity index 100% rename from tests/tests/src/hash_utils.mjs rename to tests/belt_tests/src/hash_utils.mjs diff --git a/tests/tests/src/hash_utils.res b/tests/belt_tests/src/hash_utils.res similarity index 100% rename from tests/tests/src/hash_utils.res rename to tests/belt_tests/src/hash_utils.res diff --git a/tests/tests/src/hash_utils.resi b/tests/belt_tests/src/hash_utils.resi similarity index 100% rename from tests/tests/src/hash_utils.resi rename to tests/belt_tests/src/hash_utils.resi diff --git a/tests/tests/src/inner_unused.mjs b/tests/belt_tests/src/inner_unused.mjs similarity index 100% rename from tests/tests/src/inner_unused.mjs rename to tests/belt_tests/src/inner_unused.mjs diff --git a/tests/tests/src/inner_unused.res b/tests/belt_tests/src/inner_unused.res similarity index 100% rename from tests/tests/src/inner_unused.res rename to tests/belt_tests/src/inner_unused.res diff --git a/tests/tests/src/int_map.mjs b/tests/belt_tests/src/int_map.mjs similarity index 72% rename from tests/tests/src/int_map.mjs rename to tests/belt_tests/src/int_map.mjs index 132f36da1d9..a9a44bcfeda 100644 --- a/tests/tests/src/int_map.mjs +++ b/tests/belt_tests/src/int_map.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; -import * as Belt_Map from "@rescript/belt/src/Belt_Map.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; +import * as Belt_Map from "@rescript/belt/lib/es6/src/Belt_Map.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; let cmp = Primitive_object.compare; diff --git a/tests/tests/src/int_map.res b/tests/belt_tests/src/int_map.res similarity index 100% rename from tests/tests/src/int_map.res rename to tests/belt_tests/src/int_map.res diff --git a/tests/tests/src/list_test.mjs b/tests/belt_tests/src/list_test.mjs similarity index 94% rename from tests/tests/src/list_test.mjs rename to tests/belt_tests/src/list_test.mjs index 079b877f1fb..e209f8e996e 100644 --- a/tests/tests/src/list_test.mjs +++ b/tests/belt_tests/src/list_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; diff --git a/tests/tests/src/list_test.res b/tests/belt_tests/src/list_test.res similarity index 100% rename from tests/tests/src/list_test.res rename to tests/belt_tests/src/list_test.res diff --git a/tests/tests/src/map_find_test.mjs b/tests/belt_tests/src/map_find_test.mjs similarity index 85% rename from tests/tests/src/map_find_test.mjs rename to tests/belt_tests/src/map_find_test.mjs index ba828c42697..1743d6ba2c2 100644 --- a/tests/tests/src/map_find_test.mjs +++ b/tests/belt_tests/src/map_find_test.mjs @@ -1,10 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; -import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; +import * as Belt_MapString from "@rescript/belt/lib/es6/src/Belt_MapString.mjs"; let m = Belt_List.reduceReverse({ hd: [ diff --git a/tests/tests/src/map_find_test.res b/tests/belt_tests/src/map_find_test.res similarity index 100% rename from tests/tests/src/map_find_test.res rename to tests/belt_tests/src/map_find_test.res diff --git a/tests/belt_tests/src/mocha.mjs b/tests/belt_tests/src/mocha.mjs new file mode 100644 index 00000000000..d856702bfe6 --- /dev/null +++ b/tests/belt_tests/src/mocha.mjs @@ -0,0 +1,2 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/tests/belt_tests/src/mocha.res b/tests/belt_tests/src/mocha.res new file mode 100644 index 00000000000..a7fc8c9ed39 --- /dev/null +++ b/tests/belt_tests/src/mocha.res @@ -0,0 +1,5 @@ +@module("mocha") +external test: (string, unit => unit) => unit = "test" + +@module("mocha") +external describe: (string, unit => unit) => unit = "describe" diff --git a/tests/belt_tests/src/node_assert.mjs b/tests/belt_tests/src/node_assert.mjs new file mode 100644 index 00000000000..d856702bfe6 --- /dev/null +++ b/tests/belt_tests/src/node_assert.mjs @@ -0,0 +1,2 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE +/* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */ diff --git a/tests/belt_tests/src/node_assert.res b/tests/belt_tests/src/node_assert.res new file mode 100644 index 00000000000..3acfbc38ae3 --- /dev/null +++ b/tests/belt_tests/src/node_assert.res @@ -0,0 +1,5 @@ +@module("node:assert") external ok: (bool, ~message: string=?) => unit = "ok" +@module("node:assert") +external deepEqual: ('a, 'a, ~message: string=?) => unit = "deepStrictEqual" +@module("node:assert") +external throws: (unit => 'a, ~error: 'b=?, ~message: string=?) => unit = "throws" diff --git a/tests/tests/src/rec_module_opt.mjs b/tests/belt_tests/src/rec_module_opt.mjs similarity index 95% rename from tests/tests/src/rec_module_opt.mjs rename to tests/belt_tests/src/rec_module_opt.mjs index e6160f842e0..34577f8c6b0 100644 --- a/tests/tests/src/rec_module_opt.mjs +++ b/tests/belt_tests/src/rec_module_opt.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Id from "@rescript/belt/src/Belt_Id.mjs"; +import * as Belt_Id from "@rescript/belt/lib/es6/src/Belt_Id.mjs"; import * as Primitive_module from "@rescript/runtime/lib/es6/Primitive_module.mjs"; import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.mjs"; diff --git a/tests/tests/src/rec_module_opt.res b/tests/belt_tests/src/rec_module_opt.res similarity index 100% rename from tests/tests/src/rec_module_opt.res rename to tests/belt_tests/src/rec_module_opt.res diff --git a/tests/tests/src/test_array.mjs b/tests/belt_tests/src/test_array.mjs similarity index 84% rename from tests/tests/src/test_array.mjs rename to tests/belt_tests/src/test_array.mjs index 982047beeae..620b3842f69 100644 --- a/tests/tests/src/test_array.mjs +++ b/tests/belt_tests/src/test_array.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Belt_Array from "@rescript/belt/lib/es6/src/Belt_Array.mjs"; let v = Belt_Array.make(6, 5); diff --git a/tests/tests/src/test_array.res b/tests/belt_tests/src/test_array.res similarity index 100% rename from tests/tests/src/test_array.res rename to tests/belt_tests/src/test_array.res diff --git a/tests/tests/src/test_for_map.mjs b/tests/belt_tests/src/test_for_map.mjs similarity index 80% rename from tests/tests/src/test_for_map.mjs rename to tests/belt_tests/src/test_for_map.mjs index 6ea8f9d0339..b14e15e2e1e 100644 --- a/tests/tests/src/test_for_map.mjs +++ b/tests/belt_tests/src/test_for_map.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; function assertion_test() { let m; diff --git a/tests/tests/src/test_for_map.res b/tests/belt_tests/src/test_for_map.res similarity index 100% rename from tests/tests/src/test_for_map.res rename to tests/belt_tests/src/test_for_map.res diff --git a/tests/tests/src/test_for_map2.mjs b/tests/belt_tests/src/test_for_map2.mjs similarity index 81% rename from tests/tests/src/test_for_map2.mjs rename to tests/belt_tests/src/test_for_map2.mjs index 00cf3e49347..adc01d3648c 100644 --- a/tests/tests/src/test_for_map2.mjs +++ b/tests/belt_tests/src/test_for_map2.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; function assertion_test() { let m; diff --git a/tests/tests/src/test_for_map2.res b/tests/belt_tests/src/test_for_map2.res similarity index 100% rename from tests/tests/src/test_for_map2.res rename to tests/belt_tests/src/test_for_map2.res diff --git a/tests/tests/src/test_int_map_find.mjs b/tests/belt_tests/src/test_int_map_find.mjs similarity index 75% rename from tests/tests/src/test_int_map_find.mjs rename to tests/belt_tests/src/test_int_map_find.mjs index 41644c95263..24dc3ebac04 100644 --- a/tests/tests/src/test_int_map_find.mjs +++ b/tests/belt_tests/src/test_int_map_find.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_MapInt from "@rescript/belt/src/Belt_MapInt.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_MapInt from "@rescript/belt/lib/es6/src/Belt_MapInt.mjs"; Belt_List.reduceReverse({ hd: [ diff --git a/tests/tests/src/test_int_map_find.res b/tests/belt_tests/src/test_int_map_find.res similarity index 100% rename from tests/tests/src/test_int_map_find.res rename to tests/belt_tests/src/test_int_map_find.res diff --git a/tests/tests/src/test_string_map.mjs b/tests/belt_tests/src/test_string_map.mjs similarity index 87% rename from tests/tests/src/test_string_map.mjs rename to tests/belt_tests/src/test_string_map.mjs index 1b816331091..e21e0922a4f 100644 --- a/tests/tests/src/test_string_map.mjs +++ b/tests/belt_tests/src/test_string_map.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; +import * as Belt_MapString from "@rescript/belt/lib/es6/src/Belt_MapString.mjs"; function timing(label, f) { console.time(label); diff --git a/tests/tests/src/test_string_map.res b/tests/belt_tests/src/test_string_map.res similarity index 100% rename from tests/tests/src/test_string_map.res rename to tests/belt_tests/src/test_string_map.res diff --git a/tests/belt_tests/src/test_utils.mjs b/tests/belt_tests/src/test_utils.mjs new file mode 100644 index 00000000000..8dbe369ec5c --- /dev/null +++ b/tests/belt_tests/src/test_utils.mjs @@ -0,0 +1,28 @@ +// Generated by ReScript, PLEASE EDIT WITH CARE + +import * as Nodeassert from "node:assert"; + +function ok(loc, a) { + Nodeassert.ok(a, loc); +} + +function eq(loc, a, b) { + Nodeassert.deepStrictEqual(a, b, loc); +} + +function throws(loc, f) { + Nodeassert.throws(f, undefined, loc); +} + +function approxEq(loc, threshold, a, b) { + let diff = Math.abs(a - b); + Nodeassert.ok(diff <= threshold, loc); +} + +export { + ok, + eq, + throws, + approxEq, +} +/* node:assert Not a pure module */ diff --git a/tests/belt_tests/src/test_utils.res b/tests/belt_tests/src/test_utils.res new file mode 100644 index 00000000000..a713650a8f8 --- /dev/null +++ b/tests/belt_tests/src/test_utils.res @@ -0,0 +1,8 @@ +let ok = (loc, a) => Node_assert.ok(a, ~message=loc) +let eq = (loc, a, b) => Node_assert.deepEqual(a, b, ~message=loc) +let throws = (loc, f) => Node_assert.throws(f, ~message=loc) + +let approxEq = (loc, threshold, a, b) => { + let diff = Math.abs(a -. b) + Node_assert.ok(diff <= threshold, ~message=loc) +} diff --git a/tests/tests/src/ticker.mjs b/tests/belt_tests/src/ticker.mjs similarity index 96% rename from tests/tests/src/ticker.mjs rename to tests/belt_tests/src/ticker.mjs index 50f4cf142f7..7303100f71e 100644 --- a/tests/tests/src/ticker.mjs +++ b/tests/belt_tests/src/ticker.mjs @@ -1,11 +1,11 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Float from "@rescript/belt/src/Belt_Float.mjs"; +import * as Belt_List from "@rescript/belt/lib/es6/src/Belt_List.mjs"; +import * as Belt_Float from "@rescript/belt/lib/es6/src/Belt_Float.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; -import * as Belt_Option from "@rescript/belt/src/Belt_Option.mjs"; +import * as Belt_Option from "@rescript/belt/lib/es6/src/Belt_Option.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; -import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; +import * as Belt_MapString from "@rescript/belt/lib/es6/src/Belt_MapString.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function split(delim, s) { diff --git a/tests/tests/src/ticker.res b/tests/belt_tests/src/ticker.res similarity index 100% rename from tests/tests/src/ticker.res rename to tests/belt_tests/src/ticker.res diff --git a/tests/docstring_tests/DocTest.res b/tests/docstring_tests/DocTest.res index f806d9d0176..34f84372767 100644 --- a/tests/docstring_tests/DocTest.res +++ b/tests/docstring_tests/DocTest.res @@ -51,26 +51,35 @@ let extractDocFromFile = async file => { let batchSize = OS.cpus()->Array.length -let runtimePath = Path.join(["packages", "@rescript", "runtime"]) +let docPaths = [ + Path.join(["packages", "@rescript", "runtime"]), + Path.join(["packages", "@rescript", "belt", "src"]), +] let extractExamples = async () => { - let files = Fs.readdirSync(runtimePath) - - let docFiles = files->Array.filter(f => - switch f { - // Ignore Js modules and RescriptTools for now - | f if f->String.startsWith("Js") || f->String.startsWith("RescriptTools") => false - | f if f->String.endsWith(".resi") => true - | f if f->String.endsWith(".res") && !(files->Array.includes(f ++ "i")) => true - | _ => false - } - ) + let docFiles = docPaths->Array.flatMap(docPath => { + let files = Fs.readdirSync(docPath) + + files + ->Array.filter(f => + switch f { + // Ignore Js modules and RescriptTools for now + | f if f->String.startsWith("Js") || f->String.startsWith("RescriptTools") => false + | f if f->String.endsWith(".resi") => true + | f if f->String.endsWith(".res") && !(files->Array.includes(f ++ "i")) => true + | _ => false + } + ) + ->Array.map(f => Path.join([docPath, f])) + }) - Console.log(`Extracting examples from ${docFiles->Array.length->Int.toString} runtime files...`) + Console.log( + `Extracting examples from ${docFiles->Array.length->Int.toString} runtime and Belt files...`, + ) let examples = [] - await docFiles->ArrayUtils.forEachAsyncInBatches(~batchSize, async f => { - let doc = await extractDocFromFile(Path.join([runtimePath, f])) + await docFiles->ArrayUtils.forEachAsyncInBatches(~batchSize, async file => { + let doc = await extractDocFromFile(file) // TODO: Should this be a flag in the actual command instead, to only include code blocks with tests? examples->Array.pushMany(doc->Array.filter(d => d.code->String.includes("assertEqual("))) }) diff --git a/tests/docstring_tests/DocTest.res.js b/tests/docstring_tests/DocTest.res.js index c372acd3dc5..ced1ac1dac7 100644 --- a/tests/docstring_tests/DocTest.res.js +++ b/tests/docstring_tests/DocTest.res.js @@ -58,25 +58,30 @@ async function extractDocFromFile(file) { let batchSize = Nodeos.cpus().length; -let runtimePath = Nodepath.join("packages", "@rescript", "runtime"); +let docPaths = [ + Nodepath.join("packages", "@rescript", "runtime"), + Nodepath.join("packages", "@rescript", "belt", "src") +]; async function extractExamples() { - let files = Nodefs.readdirSync(runtimePath); - let docFiles = files.filter(f => { - if (f.startsWith("Js") || f.startsWith("RescriptTools")) { - return false; - } else if (f.endsWith(".resi")) { - return true; - } else if (f.endsWith(".res")) { - return !files.includes(f + "i"); - } else { - return false; - } + let docFiles = docPaths.flatMap(docPath => { + let files = Nodefs.readdirSync(docPath); + return files.filter(f => { + if (f.startsWith("Js") || f.startsWith("RescriptTools")) { + return false; + } else if (f.endsWith(".resi")) { + return true; + } else if (f.endsWith(".res")) { + return !files.includes(f + "i"); + } else { + return false; + } + }).map(f => Nodepath.join(docPath, f)); }); - console.log(`Extracting examples from ` + docFiles.length.toString() + ` runtime files...`); + console.log(`Extracting examples from ` + docFiles.length.toString() + ` runtime and Belt files...`); let examples = []; - await ArrayUtils.forEachAsyncInBatches(docFiles, batchSize, async f => { - let doc = await extractDocFromFile(Nodepath.join(runtimePath, f)); + await ArrayUtils.forEachAsyncInBatches(docFiles, batchSize, async file => { + let doc = await extractDocFromFile(file); examples.push(...doc.filter(d => d.code.includes("assertEqual("))); }); examples.sort((a, b) => Primitive_string.compare(a.id, b.id)); diff --git a/tests/tests/package.json b/tests/tests/package.json index fe64f16f0f1..7b03eaa4cbd 100644 --- a/tests/tests/package.json +++ b/tests/tests/package.json @@ -2,7 +2,6 @@ "name": "rescript-tests", "private": true, "dependencies": { - "@rescript/belt": "workspace:^", "@rescript/react": "workspace:^", "rescript": "workspace:^" }, diff --git a/tests/tests/rescript.json b/tests/tests/rescript.json index c0ffcc409b8..b79f9f59b20 100644 --- a/tests/tests/rescript.json +++ b/tests/tests/rescript.json @@ -11,7 +11,7 @@ "in-source": true, "suffix": ".mjs" }, - "dependencies": ["@rescript/belt", "@rescript/react"], + "dependencies": ["@rescript/react"], "compiler-flags": [ "-check-lam", "-w -3-6-26-27-29-30-32..40-44-45-52-60-9-106+104", diff --git a/tests/tests/src/Import.mjs b/tests/tests/src/Import.mjs index 2300dfe17a0..fceabb7d2e2 100644 --- a/tests/tests/src/Import.mjs +++ b/tests/tests/src/Import.mjs @@ -2,11 +2,11 @@ async function eachIntAsync(list, f) { - return (await import("@rescript/belt/src/Belt_List.mjs").then(m => m.forEach))(list, f); + return (await import("@rescript/runtime/lib/es6/Stdlib_List.mjs").then(m => m.forEach))(list, f); } function eachIntLazy(list, f) { - return import("@rescript/belt/src/Belt_List.mjs").then(m => m.forEach).then(each => Promise.resolve(each(list, f))); + return import("@rescript/runtime/lib/es6/Stdlib_List.mjs").then(m => m.forEach).then(each => Promise.resolve(each(list, f))); } eachIntLazy({ @@ -35,13 +35,13 @@ eachIntAsync({ console.log("async", n); }); -let beltAsModule = await import("@rescript/belt/src/Belt_List.mjs"); +let listAsModule = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); -let M = await import("@rescript/belt/src/Belt_List.mjs"); +let M = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); -let N0 = await import("@rescript/belt/src/Belt_List.mjs"); +let N0 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); -let O = await import("@rescript/belt/src/Belt_List.mjs"); +let O = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); let N1_each = O.forEach; @@ -50,7 +50,7 @@ let N1 = { each: N1_each }; -let N2 = await import("@rescript/belt/src/Belt_List.mjs"); +let N2 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); let N_each = N2.forEach; @@ -61,21 +61,21 @@ let N = { each: N_each }; -let M0 = await import("@rescript/belt/src/Belt_List.mjs"); +let M0 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); -let M1 = await import("@rescript/belt/src/Belt_List.mjs"); +let M1 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); async function f() { - return (await import("@rescript/belt/src/Belt_List.mjs")).forEach; + return (await import("@rescript/runtime/lib/es6/Stdlib_List.mjs")).forEach; } async function f1() { - return (await import("@rescript/belt/src/Belt_List.mjs")).forEach; + return (await import("@rescript/runtime/lib/es6/Stdlib_List.mjs")).forEach; } async function f2() { - let M3 = await import("@rescript/belt/src/Belt_List.mjs"); - let M4 = await import("@rescript/belt/src/Belt_List.mjs"); + let M3 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); + let M4 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); return [ M3.forEach, M4.forEach @@ -83,8 +83,8 @@ async function f2() { } async function f3() { - let M3 = await import("@rescript/belt/src/Belt_List.mjs"); - let M4 = await import("@rescript/belt/src/Belt_List.mjs"); + let M3 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); + let M4 = await import("@rescript/runtime/lib/es6/Stdlib_List.mjs"); return [ M3.forEach, M4.forEach @@ -92,41 +92,51 @@ async function f3() { } async function f4() { - return (await import("@rescript/belt/src/Belt_Array.mjs")).forEach; + await import("@rescript/runtime/lib/es6/Stdlib_Array.mjs"); + return (prim0, prim1) => { + prim0.forEach(prim1); + }; } async function f5() { - let A = await import("@rescript/belt/src/Belt_Array.mjs"); - let O = await import("@rescript/belt/src/Belt_Option.mjs"); + await import("@rescript/runtime/lib/es6/Stdlib_Array.mjs"); + let O = await import("@rescript/runtime/lib/es6/Stdlib_Option.mjs"); return [ - A.forEach, + (prim0, prim1) => { + prim0.forEach(prim1); + }, O.forEach ]; } async function f6() { - let MS = await import("@rescript/belt/src/Belt_MapString.mjs"); - let A = await import("@rescript/belt/src/Belt_Array.mjs"); + await import("@rescript/runtime/lib/es6/Stdlib_Set.mjs"); + let b = (prim0, prim1) => { + prim0.forEach(prim1); + }; + await import("@rescript/runtime/lib/es6/Stdlib_Array.mjs"); return [ 0, - MS.forEach, - A.forEach + b, + (prim0, prim1) => { + prim0.forEach(prim1); + } ]; } async function f7() { - await import("@rescript/belt/src/Belt_MapInt.mjs"); + await import("@rescript/runtime/lib/es6/Stdlib_Int.mjs"); return 1; } async function f8() { - await import("@rescript/belt/src/Belt_MutableQueue.mjs"); + await import("@rescript/runtime/lib/es6/Stdlib_Set.mjs"); return 1; } async function f9(value) { if (value !== undefined) { - await import("@rescript/belt/src/Belt_HashMapInt.mjs"); + await import("@rescript/runtime/lib/es6/Stdlib_Math.mjs"); return; } } @@ -140,7 +150,7 @@ let each2 = O.forEach; export { eachIntAsync, eachIntLazy, - beltAsModule, + listAsModule, M, N, M0, diff --git a/tests/tests/src/Import.res b/tests/tests/src/Import.res index d3ec0107235..3dcb159d339 100644 --- a/tests/tests/src/Import.res +++ b/tests/tests/src/Import.res @@ -1,105 +1,105 @@ let eachIntAsync = async (list: list, f: int => unit) => { - list->(await import(Belt.List.forEach))(f) + list->(await import(List.forEach))(f) } let eachIntLazy = (list: list, f: int => unit) => - Promise.then(import(Belt.List.forEach), each => list->each(f)->Promise.resolve) + Promise.then(import(List.forEach), each => list->each(f)->Promise.resolve) let _ = list{1, 2, 3}->eachIntLazy(n => Console.log2("lazy", n)) let _ = list{1, 2, 3}->eachIntAsync(n => Console.log2("async", n)) -module type BeltList = module type of Belt.List -let beltAsModule = await import(module(Belt.List: BeltList)) +module type ListType = module type of List +let listAsModule = await import(module(List: ListType)) -// module type BeltList0 = module type of Belt.List -// module M = unpack(@res.await import(module(Belt.List: BeltList0))) -module M = await Belt.List +// module type ListType0 = module type of List +// module M = unpack(@res.await import(module(List: ListType0))) +module M = await List let each = M.forEach module N = { - module N0 = await Belt.List + module N0 = await List let each = N0.forEach module N1 = { - module O = await Belt.List + module O = await List let each = O.forEach } - module N2 = await Belt.List + module N2 = await List let each = N2.forEach } -module M0 = await Belt.List +module M0 = await List let each = M0.forEach -module M1 = await Belt.List +module M1 = await List let each = M1.forEach module M2 = N.N1.O let each2 = M2.forEach let f = async () => { - module M3 = await Belt.List + module M3 = await List M3.forEach } let f1 = async () => { - module M3 = await (Belt.List: BeltList) + module M3 = await (List: ListType) M3.forEach } let f2 = async () => { - module M3 = await (Belt.List: BeltList) - module M4 = await (Belt.List: BeltList) + module M3 = await (List: ListType) + module M4 = await (List: ListType) (M3.forEach, M4.forEach) } let f3 = async () => { - module M3 = await Belt.List - module M4 = await Belt.List + module M3 = await List + module M4 = await List (M3.forEach, M4.forEach) } let f4 = async () => { - module A = await Belt.Array + module A = await Array A.forEach } let f5 = async () => { - module A = await Belt.Array - module O = await Belt.Option + module A = await Array + module O = await Option (A.forEach, O.forEach) } let f6 = async () => { let a = 0 and b = { - module MS = await Belt.Map.String + module MS = await Set MS.forEach } - module A = await Belt.Array + module A = await Array (a, b, A.forEach) } let f7 = async () => { if true { - module MI = await Belt.Map.Int + module MI = await Int 1 } else { - module MI = await Belt.Map.Dict + module MI = await Dict 0 } } let f8 = async (): int => { - module MQ = await Belt.MutableQueue + module S = await Set 1 } let f9 = async value => { switch value { | Some(_) => - module HashMapInt = await Belt.HashMap.Int + module MathModule = await Math () | None => () } diff --git a/tests/tests/src/UntaggedVariants.mjs b/tests/tests/src/UntaggedVariants.mjs index 1399439f905..29c3349792e 100644 --- a/tests/tests/src/UntaggedVariants.mjs +++ b/tests/tests/src/UntaggedVariants.mjs @@ -1,6 +1,5 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function classify(x) { @@ -473,7 +472,7 @@ async function classify$10(a) { return; } else { if (Array.isArray(a)) { - console.log(Belt_Array.joinWith(a, "-", x => x)); + console.log(a.join("-")); return; } if (a instanceof Promise) { @@ -497,7 +496,7 @@ let Arr = { async function classifyAll(t) { if (Array.isArray(t)) { - console.log(Belt_Array.joinWith(t, "-", x => x)); + console.log(t.join("-")); return; } if (t instanceof Promise) { diff --git a/tests/tests/src/UntaggedVariants.res b/tests/tests/src/UntaggedVariants.res index 822b0b0ce4f..1d0eafe49fd 100644 --- a/tests/tests/src/UntaggedVariants.res +++ b/tests/tests/src/UntaggedVariants.res @@ -375,7 +375,7 @@ module Arr = { let classify = async (a: arr) => switch a { - | Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x)) + | Array(arr) => Console.log(arr->Array.joinWith("-")) | String(s) => Console.log(s) | Promise(p) => Console.log(await p) | Object({userName}) => Console.log(userName) @@ -425,7 +425,7 @@ module AllInstanceofTypes = { | Object({userName}) => Console.log(userName) | Date(date) => Console.log(date->Date.toString) | RegExp(re) => Console.log(re->RegExp.test("test")) - | Array(arr) => Console.log(arr->Belt.Array.joinWith("-", x => x)) + | Array(arr) => Console.log(arr->Array.joinWith("-")) | File(file) => Console.log(file->fileName) | Blob(blob) => Console.log(blob->blobSize) | ArrayBuffer(_) => Console.log("ArrayBuffer") diff --git a/tests/tests/src/a.res b/tests/tests/src/a.res index d6dfa0c8689..6a68ebedef1 100644 --- a/tests/tests/src/a.res +++ b/tests/tests/src/a.res @@ -20,8 +20,6 @@ include ( let add = (x, y) => x + y }) - open Belt - include List module N = List let v = N.length diff --git a/tests/tests/src/alias_default_value_test.mjs b/tests/tests/src/alias_default_value_test.mjs index 714b76ab98a..e6024d44a48 100644 --- a/tests/tests/src/alias_default_value_test.mjs +++ b/tests/tests/src/alias_default_value_test.mjs @@ -72,7 +72,7 @@ function Alias_default_value_test$C7(props) { let username = props.username; let count = props.count; let times = count !== 1 ? ( - count !== 2 ? String(count) + " times" : "twice" + count !== 2 ? count.toString() + " times" : "twice" ) : "once"; let name = username !== undefined && username !== "" ? username : "Anonymous"; return `Hello ` + name + `, you clicked me ` + times; diff --git a/tests/tests/src/alias_default_value_test.res b/tests/tests/src/alias_default_value_test.res index f5837af7a62..032b1e75d4e 100644 --- a/tests/tests/src/alias_default_value_test.res +++ b/tests/tests/src/alias_default_value_test.res @@ -52,7 +52,7 @@ module C7 = { let times = switch count { | 1 => "once" | 2 => "twice" - | n => Belt.Int.toString(n) ++ " times" + | n => Int.toString(n) ++ " times" } let name = switch username { diff --git a/tests/tests/src/async_await.mjs b/tests/tests/src/async_await.mjs index 7d6ff72f39c..a262cdc0d22 100644 --- a/tests/tests/src/async_await.mjs +++ b/tests/tests/src/async_await.mjs @@ -35,11 +35,11 @@ async function f(value) { } async function f0() { - return (await import("@rescript/belt/src/Belt_Option.mjs")).forEach; + return (await import("@rescript/runtime/lib/es6/Stdlib_Option.mjs")).forEach; } async function f1() { - return (await import("@rescript/belt/src/Belt_Option.mjs")).forEach; + return (await import("@rescript/runtime/lib/es6/Stdlib_Option.mjs")).forEach; } export { diff --git a/tests/tests/src/async_await.res b/tests/tests/src/async_await.res index 6fdeba0d6a0..26f1863e23f 100644 --- a/tests/tests/src/async_await.res +++ b/tests/tests/src/async_await.res @@ -19,14 +19,14 @@ let f = async (type input, value: input) => { await Promise.resolve(1) } -module type MT = module type of Belt.Option +module type MT = module type of Option let f0 = async () => { - module O = await Belt.Option + module O = await Option O.forEach } let f1 = async () => { - module O: MT = await Belt.Option + module O: MT = await Option O.forEach } diff --git a/tests/tests/src/bdd.mjs b/tests/tests/src/bdd.mjs index c436388d7da..bbdc679fa72 100644 --- a/tests/tests/src/bdd.mjs +++ b/tests/tests/src/bdd.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function $$eval(_bdd, vars) { while (true) { @@ -38,7 +38,7 @@ let sz_1 = { }; let htab = { - contents: Belt_Array.make(sz_1.contents + 1 | 0, /* [] */0) + contents: Stdlib_Array.make(sz_1.contents + 1 | 0, /* [] */0) }; let n_items = { @@ -52,7 +52,7 @@ function hashVal(x, y, v) { function resize(newSize) { let arr = htab.contents; let newSz_1 = newSize - 1 | 0; - let newArr = Belt_Array.make(newSize, /* [] */0); + let newArr = Stdlib_Array.make(newSize, /* [] */0); let copyBucket = _bucket => { while (true) { let bucket = _bucket; @@ -118,7 +118,7 @@ function insert(idl, idh, v, ind, bucket, newNode) { function resetUnique() { sz_1.contents = 8191; - htab.contents = Belt_Array.make(sz_1.contents + 1 | 0, /* [] */0); + htab.contents = Stdlib_Array.make(sz_1.contents + 1 | 0, /* [] */0); n_items.contents = 0; nodeC.contents = 1; } @@ -193,21 +193,21 @@ function mkVar(x) { return mkNode("Zero", x, "One"); } -let andslot1 = Belt_Array.make(1999, 0); +let andslot1 = Stdlib_Array.make(1999, 0); -let andslot2 = Belt_Array.make(1999, 0); +let andslot2 = Stdlib_Array.make(1999, 0); -let andslot3 = Belt_Array.make(1999, "Zero"); +let andslot3 = Stdlib_Array.make(1999, "Zero"); -let xorslot1 = Belt_Array.make(1999, 0); +let xorslot1 = Stdlib_Array.make(1999, 0); -let xorslot2 = Belt_Array.make(1999, 0); +let xorslot2 = Stdlib_Array.make(1999, 0); -let xorslot3 = Belt_Array.make(1999, "Zero"); +let xorslot3 = Stdlib_Array.make(1999, "Zero"); -let notslot1 = Belt_Array.make(1999, 0); +let notslot1 = Stdlib_Array.make(1999, 0); -let notslot2 = Belt_Array.make(1999, "One"); +let notslot2 = Stdlib_Array.make(1999, "One"); function hash(x, y) { return ((x << 1) + y | 0) % 1999; @@ -352,7 +352,7 @@ function random() { } function random_vars(n) { - let vars = Belt_Array.make(n, false); + let vars = Stdlib_Array.make(n, false); for (let i = 0; i < n; ++i) { vars[i] = random(); } diff --git a/tests/tests/src/bdd.res b/tests/tests/src/bdd.res index 32a89c26f67..3428026261d 100644 --- a/tests/tests/src/bdd.res +++ b/tests/tests/src/bdd.res @@ -39,14 +39,14 @@ let getId = bdd => let initSize_1 = 8 * 1024 - 1 let nodeC = ref(1) let sz_1 = ref(initSize_1) -let htab = ref(Belt.Array.make(sz_1.contents + 1, list{})) +let htab = ref(Array.make(~length=sz_1.contents + 1, list{})) let n_items = ref(0) let hashVal = (x, y, v) => lsl(x, 1) + y + lsl(v, 2) let resize = newSize => { let arr = htab.contents let newSz_1 = newSize - 1 - let newArr = Belt.Array.make(newSize, list{}) + let newArr = Array.make(~length=newSize, list{}) let rec copyBucket = bucket => switch bucket { | list{} => () @@ -81,7 +81,7 @@ let rec insert = (idl, idh, v, ind, bucket, newNode) => let resetUnique = () => { sz_1 := initSize_1 - htab := Belt.Array.make(sz_1.contents + 1, list{}) + htab := Array.make(~length=sz_1.contents + 1, list{}) n_items := 0 nodeC := 1 } @@ -144,14 +144,14 @@ let mkVar = x => mkNode(zero, x, one) let cacheSize = 1999 -let andslot1 = Belt.Array.make(cacheSize, 0) -let andslot2 = Belt.Array.make(cacheSize, 0) -let andslot3 = Belt.Array.make(cacheSize, zero) -let xorslot1 = Belt.Array.make(cacheSize, 0) -let xorslot2 = Belt.Array.make(cacheSize, 0) -let xorslot3 = Belt.Array.make(cacheSize, zero) -let notslot1 = Belt.Array.make(cacheSize, 0) -let notslot2 = Belt.Array.make(cacheSize, one) +let andslot1 = Array.make(~length=cacheSize, 0) +let andslot2 = Array.make(~length=cacheSize, 0) +let andslot3 = Array.make(~length=cacheSize, zero) +let xorslot1 = Array.make(~length=cacheSize, 0) +let xorslot2 = Array.make(~length=cacheSize, 0) +let xorslot3 = Array.make(~length=cacheSize, zero) +let notslot1 = Array.make(~length=cacheSize, 0) +let notslot2 = Array.make(~length=cacheSize, one) let hash = (x, y) => mod(lsl(x, 1) + y, cacheSize) let rec not = n => @@ -254,7 +254,7 @@ let random = () => { } let random_vars = n => { - let vars = Belt.Array.make(n, false) + let vars = Array.make(~length=n, false) for i in 0 to n - 1 { vars->Array.setUnsafe(i, random()) } @@ -274,7 +274,7 @@ let test_hwb = (bdd, vars) => { eval bdd vars = false if n = 0 where n is the number of "true" elements in vars. */ let ntrue = ref(0) - for i in 0 to Belt.Array.length(vars) - 1 { + for i in 0 to Array.length(vars) - 1 { if vars->Array.getUnsafe(i) { incr(ntrue) } diff --git a/tests/tests/src/bench.mjs b/tests/tests/src/bench.mjs index 5c51cdba820..f48d7376714 100644 --- a/tests/tests/src/bench.mjs +++ b/tests/tests/src/bench.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function map(f, a) { let f$1 = x => f(x); @@ -9,7 +9,7 @@ function map(f, a) { if (l === 0) { return []; } - let r = Belt_Array.make(l, f$1(a[0])); + let r = Stdlib_Array.make(l, f$1(a[0])); for (let i = 1; i < l; ++i) { r[i] = f$1(a[i]); } @@ -24,7 +24,7 @@ function init(l, f) { if (l < 0) { return Pervasives.invalid_arg("Array.init"); } - let res = Belt_Array.make(l, f$1(0)); + let res = Stdlib_Array.make(l, f$1(0)); for (let i = 1; i < l; ++i) { res[i] = f$1(i); } diff --git a/tests/tests/src/bench.res b/tests/tests/src/bench.res index 690c65de190..5e025249d3f 100644 --- a/tests/tests/src/bench.res +++ b/tests/tests/src/bench.res @@ -1,11 +1,9 @@ -open Belt - let map = (f, a) => { let l = Array.length(a) if l == 0 { [] } else { - let r = Array.make(l, f(Array.getUnsafe(a, 0))) + let r = Array.make(~length=l, f(Array.getUnsafe(a, 0))) for i in 1 to l - 1 { Array.setUnsafe(r, i, f(Array.getUnsafe(a, i))) } @@ -24,7 +22,7 @@ let init = (l, f) => /* See #6575. We could also check for maximum array size, but this depends on whether we create a float array or a regular one... */ - let res = Array.make(l, f(0)) + let res = Array.make(~length=l, f(0)) for i in 1 to pred(l) { Array.setUnsafe(res, i, f(i)) } diff --git a/tests/tests/src/block_alias_test.mjs b/tests/tests/src/block_alias_test.mjs index 0572eefab37..0fcd2329302 100644 --- a/tests/tests/src/block_alias_test.mjs +++ b/tests/tests/src/block_alias_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; let Block = {}; @@ -38,7 +38,7 @@ let f = Primitive_object.equal; Mocha.describe("Block_alias_test", () => { Mocha.test("block_alias_tests", () => { - Test_utils.eq("File \"block_alias_test.res\", line 28, characters 7-14", Belt_List.length({ + Test_utils.eq("File \"block_alias_test.res\", line 28, characters 7-14", Stdlib_List.length({ hd: 1, tl: { hd: 2, @@ -54,7 +54,7 @@ Mocha.describe("Block_alias_test", () => { }); }); -let h = Belt_List.length; +let h = Stdlib_List.length; export { Block, diff --git a/tests/tests/src/block_alias_test.res b/tests/tests/src/block_alias_test.res index df219eefd44..74885e253ca 100644 --- a/tests/tests/src/block_alias_test.res +++ b/tests/tests/src/block_alias_test.res @@ -20,11 +20,11 @@ module V = { } let f = (a, b) => a == b -let h = Belt.List.length +let h = List.length describe(__MODULE__, () => { test("block_alias_tests", () => { - let h = Belt.List.length + let h = List.length eq(__LOC__, h(list{1, 2}), 2) ok(__LOC__, f(v0, A(0, 1))) eq(__LOC__, v0, N.v1) diff --git a/tests/tests/src/coercion_module_alias_test.mjs b/tests/tests/src/coercion_module_alias_test.mjs index 05bba81c084..5984f94a192 100644 --- a/tests/tests/src/coercion_module_alias_test.mjs +++ b/tests/tests/src/coercion_module_alias_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Char from "@rescript/runtime/lib/es6/Char.mjs"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function l(prim) { console.log(prim); @@ -17,10 +17,10 @@ let C3 = Char; console.log(66); -let f = Belt_List.length; +let f = Stdlib_List.length; function g(x) { - return Belt_List.length(Belt_List.map(x, prim => prim + 1 | 0)); + return Stdlib_List.length(Stdlib_List.map(x, prim => prim + 1 | 0)); } function F(X) { diff --git a/tests/tests/src/coercion_module_alias_test.res b/tests/tests/src/coercion_module_alias_test.res index 3801348a0d9..26d0970c3f7 100644 --- a/tests/tests/src/coercion_module_alias_test.res +++ b/tests/tests/src/coercion_module_alias_test.res @@ -1,5 +1,3 @@ -open Belt - let l = Console.log module C = Char diff --git a/tests/tests/src/cps_test.mjs b/tests/tests/src/cps_test.mjs index 1c0ca5a82d9..008e854db08 100644 --- a/tests/tests/src/cps_test.mjs +++ b/tests/tests/src/cps_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function test_sum() { let v = { @@ -31,11 +31,11 @@ function test_closure() { let v = { contents: 0 }; - let arr = Belt_Array.make(6, x => x); + let arr = Stdlib_Array.make(6, x => x); for (let i = 0; i <= 5; ++i) { arr[i] = param => i; } - Belt_Array.forEach(arr, i => { + arr.forEach(i => { v.contents = v.contents + i(0) | 0; }); return v.contents; @@ -45,12 +45,12 @@ function test_closure2() { let v = { contents: 0 }; - let arr = Belt_Array.make(6, x => x); + let arr = Stdlib_Array.make(6, x => x); for (let i = 0; i <= 5; ++i) { let j = i + i | 0; arr[i] = param => j; } - Belt_Array.forEach(arr, i => { + arr.forEach(i => { v.contents = v.contents + i(0) | 0; }); return v.contents; diff --git a/tests/tests/src/cps_test.res b/tests/tests/src/cps_test.res index a5e998733c0..e94233b2f50 100644 --- a/tests/tests/src/cps_test.res +++ b/tests/tests/src/cps_test.res @@ -19,23 +19,23 @@ let test_sum = () => { let test_closure = () => { let n = 6 let v = ref(0) - let arr = Belt.Array.make(n, x => x) + let arr = Array.make(~length=n, x => x) for i in 0 to n - 1 { arr[i] = _ => i } - arr->Belt.Array.forEach(i => v := v.contents + i(0)) + arr->Array.forEach(i => v := v.contents + i(0)) v.contents } let test_closure2 = () => { let n = 6 let v = ref(0) - let arr = Belt.Array.make(n, x => x) + let arr = Array.make(~length=n, x => x) for i in 0 to n - 1 { let j = i + i arr[i] = _ => j } - arr->Belt.Array.forEach(i => v := v.contents + i(0)) + arr->Array.forEach(i => v := v.contents + i(0)) v.contents } diff --git a/tests/tests/src/directives.mjs b/tests/tests/src/directives.mjs index a8d05c93959..205ac9baa69 100644 --- a/tests/tests/src/directives.mjs +++ b/tests/tests/src/directives.mjs @@ -2,9 +2,10 @@ first directive; second directive; // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; -let a = Belt_Array.forEach; +function a(prim0, prim1) { + prim0.forEach(prim1); +} export { a, diff --git a/tests/tests/src/directives.res b/tests/tests/src/directives.res index e6369d8ea99..a6907970277 100644 --- a/tests/tests/src/directives.res +++ b/tests/tests/src/directives.res @@ -1,4 +1,4 @@ @@directive("first directive;") @@directive("second directive;") -let a = Belt.Array.forEach +let a = Array.forEach diff --git a/tests/tests/src/earger_curry_test.mjs b/tests/tests/src/earger_curry_test.mjs index e930720cf0a..32b91816480 100644 --- a/tests/tests/src/earger_curry_test.mjs +++ b/tests/tests/src/earger_curry_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function map(f, a) { let f$1 = x => f(x); @@ -11,7 +11,7 @@ function map(f, a) { if (l === 0) { return []; } - let r = Belt_Array.make(l, f$1(a[0])); + let r = Stdlib_Array.make(l, f$1(a[0])); for (let i = 1; i < l; ++i) { r[i] = f$1(a[i]); } @@ -26,7 +26,7 @@ function init(l, f) { if (l < 0) { return Pervasives.invalid_arg("Array.init"); } - let res = Belt_Array.make(l, f$1(0)); + let res = Stdlib_Array.make(l, f$1(0)); for (let i = 1; i < l; ++i) { res[i] = f$1(i); } @@ -43,10 +43,10 @@ function fold_left(f, x, a) { } function f2() { - let arr = Belt_Array.init(30000000, i => i); - let b = Belt_Array.map(arr, i => i + i - 1); - let v = Belt_Array.reduceReverse(b, 0, (prim0, prim1) => prim0 + prim1); - console.log(String(v)); + let arr = init(30000000, i => i); + let b = arr.map(i => i + i - 1); + let v = Stdlib_Array.reduceRight(b, 0, (prim0, prim1) => prim0 + prim1); + console.log(v.toString()); } f2(); @@ -96,11 +96,11 @@ let c = g(0)(3, 4); let d = g(0)(3, 5); Mocha.describe("Earger_curry_test", () => { - Mocha.test("earger curry a", () => Test_utils.eq("File \"earger_curry_test.res\", line 139, characters 34-41", a, 10)); - Mocha.test("earger curry b", () => Test_utils.eq("File \"earger_curry_test.res\", line 140, characters 34-41", b, 11)); - Mocha.test("earger curry c", () => Test_utils.eq("File \"earger_curry_test.res\", line 141, characters 34-41", c, 10)); - Mocha.test("earger curry d", () => Test_utils.eq("File \"earger_curry_test.res\", line 142, characters 34-41", d, 11)); - Mocha.test("earger curry all_v", () => Test_utils.eq("File \"earger_curry_test.res\", line 143, characters 38-45", all_v.contents, { + Mocha.test("earger curry a", () => Test_utils.eq("File \"earger_curry_test.res\", line 137, characters 34-41", a, 10)); + Mocha.test("earger curry b", () => Test_utils.eq("File \"earger_curry_test.res\", line 138, characters 34-41", b, 11)); + Mocha.test("earger curry c", () => Test_utils.eq("File \"earger_curry_test.res\", line 139, characters 34-41", c, 10)); + Mocha.test("earger curry d", () => Test_utils.eq("File \"earger_curry_test.res\", line 140, characters 34-41", d, 11)); + Mocha.test("earger curry all_v", () => Test_utils.eq("File \"earger_curry_test.res\", line 141, characters 38-45", all_v.contents, { hd: 8, tl: { hd: 6, diff --git a/tests/tests/src/earger_curry_test.res b/tests/tests/src/earger_curry_test.res index 310d08464fd..07cb32b549c 100644 --- a/tests/tests/src/earger_curry_test.res +++ b/tests/tests/src/earger_curry_test.res @@ -1,5 +1,3 @@ -open Belt - let f = g => x => g(x) let map = (f, a) => { @@ -7,7 +5,7 @@ let map = (f, a) => { if l == 0 { [] } else { - let r = Array.make(l, f(Array.getUnsafe(a, 0))) + let r = Array.make(~length=l, f(Array.getUnsafe(a, 0))) for i in 1 to l - 1 { Array.setUnsafe(r, i, f(Array.getUnsafe(a, i))) } @@ -26,7 +24,7 @@ let init = (l, f) => /* See #6575. We could also check for maximum array size, but this depends on whether we create a float array or a regular one... */ - let res = Array.make(l, f(0)) + let res = Array.make(~length=l, f(0)) for i in 1 to pred(l) { Array.setUnsafe(res, i, f(i)) } @@ -54,7 +52,7 @@ let f = { () => { let arr = init(10000000, i => float_of_int(i)) let b = arr->map(i => i +. i -. 1.) - let v = b->reduceReverse(0., \"+.") + let v = b->Array.reduceRight(0., \"+.") v->Float.toString->Console.log } } @@ -63,7 +61,7 @@ let f2 = () => { open Array let arr = init(30_000_000, i => float_of_int(i)) let b = arr->map(i => i +. i -. 1.) - let v = b->reduceReverse(0., \"+.") + let v = b->Array.reduceRight(0., \"+.") v->Float.toString->Console.log } diff --git a/tests/tests/src/event_ffi.mjs b/tests/tests/src/event_ffi.mjs index ee534c50df2..288a05575bc 100644 --- a/tests/tests/src/event_ffi.mjs +++ b/tests/tests/src/event_ffi.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function h0(x) { return x(); @@ -56,7 +56,7 @@ function xx() { }; } -let test_as = Belt_List.map; +let test_as = Stdlib_List.map; export { h0, diff --git a/tests/tests/src/event_ffi.res b/tests/tests/src/event_ffi.res index 83c0a4b33c0..57b3da34553 100644 --- a/tests/tests/src/event_ffi.res +++ b/tests/tests/src/event_ffi.res @@ -22,7 +22,7 @@ let a2 = (x, y) => x + y let a3 = (x, y, z) => x + y + z /* polymoprhic restriction */ -let test_as: (_ as 'b, 'a => 'a) => 'b = Belt.List.map +let test_as: (_ as 'b, 'a => 'a) => 'b = List.map let xx: unit => _ => unit = () => _ => Console.log(3) diff --git a/tests/tests/src/exception_alias.mjs b/tests/tests/src/exception_alias.mjs index d6a67f68ada..c057d5d3926 100644 --- a/tests/tests/src/exception_alias.mjs +++ b/tests/tests/src/exception_alias.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let a0 = { RE_EXN_ID: "Not_found" }; -let b = Belt_List.length({ +let b = Stdlib_List.length({ hd: 1, tl: { hd: 2, @@ -15,96 +15,65 @@ let b = Belt_List.length({ }); let List = { - size: Belt_List.size, - head: Belt_List.head, - headExn: Belt_List.headExn, - headOrThrow: Belt_List.headOrThrow, - tail: Belt_List.tail, - tailExn: Belt_List.tailExn, - tailOrThrow: Belt_List.tailOrThrow, - add: Belt_List.add, - get: Belt_List.get, - getExn: Belt_List.getExn, - getOrThrow: Belt_List.getOrThrow, - make: Belt_List.make, - makeByU: Belt_List.makeByU, - makeBy: Belt_List.makeBy, - shuffle: Belt_List.shuffle, - drop: Belt_List.drop, - take: Belt_List.take, - splitAt: Belt_List.splitAt, - concat: Belt_List.concat, - concatMany: Belt_List.concatMany, - reverseConcat: Belt_List.reverseConcat, - flatten: Belt_List.flatten, - mapU: Belt_List.mapU, - map: Belt_List.map, - zip: Belt_List.zip, - zipByU: Belt_List.zipByU, - zipBy: Belt_List.zipBy, - mapWithIndexU: Belt_List.mapWithIndexU, - mapWithIndex: Belt_List.mapWithIndex, - fromArray: Belt_List.fromArray, - toArray: Belt_List.toArray, - reverse: Belt_List.reverse, - mapReverseU: Belt_List.mapReverseU, - mapReverse: Belt_List.mapReverse, - forEachU: Belt_List.forEachU, - forEach: Belt_List.forEach, - forEachWithIndexU: Belt_List.forEachWithIndexU, - forEachWithIndex: Belt_List.forEachWithIndex, - reduceU: Belt_List.reduceU, - reduce: Belt_List.reduce, - reduceWithIndexU: Belt_List.reduceWithIndexU, - reduceWithIndex: Belt_List.reduceWithIndex, - reduceReverseU: Belt_List.reduceReverseU, - reduceReverse: Belt_List.reduceReverse, - mapReverse2U: Belt_List.mapReverse2U, - mapReverse2: Belt_List.mapReverse2, - forEach2U: Belt_List.forEach2U, - forEach2: Belt_List.forEach2, - reduce2U: Belt_List.reduce2U, - reduce2: Belt_List.reduce2, - reduceReverse2U: Belt_List.reduceReverse2U, - reduceReverse2: Belt_List.reduceReverse2, - everyU: Belt_List.everyU, - every: Belt_List.every, - someU: Belt_List.someU, - some: Belt_List.some, - every2U: Belt_List.every2U, - every2: Belt_List.every2, - some2U: Belt_List.some2U, - some2: Belt_List.some2, - cmpByLength: Belt_List.cmpByLength, - cmpU: Belt_List.cmpU, - cmp: Belt_List.cmp, - eqU: Belt_List.eqU, - eq: Belt_List.eq, - hasU: Belt_List.hasU, - has: Belt_List.has, - getByU: Belt_List.getByU, - getBy: Belt_List.getBy, - keepU: Belt_List.keepU, - keep: Belt_List.keep, - filter: Belt_List.filter, - keepWithIndexU: Belt_List.keepWithIndexU, - keepWithIndex: Belt_List.keepWithIndex, - filterWithIndex: Belt_List.filterWithIndex, - keepMapU: Belt_List.keepMapU, - keepMap: Belt_List.keepMap, - partitionU: Belt_List.partitionU, - partition: Belt_List.partition, - unzip: Belt_List.unzip, - getAssocU: Belt_List.getAssocU, - getAssoc: Belt_List.getAssoc, - hasAssocU: Belt_List.hasAssocU, - hasAssoc: Belt_List.hasAssoc, - removeAssocU: Belt_List.removeAssocU, - removeAssoc: Belt_List.removeAssoc, - setAssocU: Belt_List.setAssocU, - setAssoc: Belt_List.setAssoc, - sortU: Belt_List.sortU, - sort: Belt_List.sort, + size: Stdlib_List.size, + head: Stdlib_List.head, + headExn: Stdlib_List.headExn, + headOrThrow: Stdlib_List.headOrThrow, + tail: Stdlib_List.tail, + tailExn: Stdlib_List.tailExn, + tailOrThrow: Stdlib_List.tailOrThrow, + add: Stdlib_List.add, + get: Stdlib_List.get, + getExn: Stdlib_List.getExn, + getOrThrow: Stdlib_List.getOrThrow, + make: Stdlib_List.make, + fromInitializer: Stdlib_List.fromInitializer, + shuffle: Stdlib_List.shuffle, + toShuffled: Stdlib_List.toShuffled, + drop: Stdlib_List.drop, + take: Stdlib_List.take, + splitAt: Stdlib_List.splitAt, + concat: Stdlib_List.concat, + concatMany: Stdlib_List.concatMany, + reverseConcat: Stdlib_List.reverseConcat, + flat: Stdlib_List.flat, + map: Stdlib_List.map, + zip: Stdlib_List.zip, + zipBy: Stdlib_List.zipBy, + mapWithIndex: Stdlib_List.mapWithIndex, + fromArray: Stdlib_List.fromArray, + toArray: Stdlib_List.toArray, + reverse: Stdlib_List.reverse, + mapReverse: Stdlib_List.mapReverse, + forEach: Stdlib_List.forEach, + forEachWithIndex: Stdlib_List.forEachWithIndex, + reduce: Stdlib_List.reduce, + reduceWithIndex: Stdlib_List.reduceWithIndex, + reduceReverse: Stdlib_List.reduceReverse, + mapReverse2: Stdlib_List.mapReverse2, + forEach2: Stdlib_List.forEach2, + reduce2: Stdlib_List.reduce2, + reduceReverse2: Stdlib_List.reduceReverse2, + every: Stdlib_List.every, + some: Stdlib_List.some, + every2: Stdlib_List.every2, + some2: Stdlib_List.some2, + compareLength: Stdlib_List.compareLength, + compare: Stdlib_List.compare, + equal: Stdlib_List.equal, + has: Stdlib_List.has, + includes: Stdlib_List.includes, + find: Stdlib_List.find, + filter: Stdlib_List.filter, + filterWithIndex: Stdlib_List.filterWithIndex, + filterMap: Stdlib_List.filterMap, + partition: Stdlib_List.partition, + unzip: Stdlib_List.unzip, + getAssoc: Stdlib_List.getAssoc, + hasAssoc: Stdlib_List.hasAssoc, + removeAssoc: Stdlib_List.removeAssoc, + setAssoc: Stdlib_List.setAssoc, + sort: Stdlib_List.sort, b: b, length: 3 }; diff --git a/tests/tests/src/exception_alias.res b/tests/tests/src/exception_alias.res index 205b2c1d781..cdd03d51900 100644 --- a/tests/tests/src/exception_alias.res +++ b/tests/tests/src/exception_alias.res @@ -10,8 +10,6 @@ let a4 = a3 let a5 = a4 -open Belt - module List = { include List let b = length(list{1, 2}) diff --git a/tests/tests/src/exception_raise_test.mjs b/tests/tests/src/exception_raise_test.mjs index 57c9f295e93..016b263105b 100644 --- a/tests/tests/src/exception_raise_test.mjs +++ b/tests/tests/src/exception_raise_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Stdlib_Exn from "@rescript/runtime/lib/es6/Stdlib_Exn.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; let Local = /* @__PURE__ */Primitive_exceptions.create("Exception_raise_test.Local"); @@ -138,7 +138,7 @@ function input_lines(ic, _acc) { try { line = input_line(ic); } catch (exn) { - return Belt_List.reverse(acc); + return Stdlib_List.reverse(acc); } _acc = { hd: line, diff --git a/tests/tests/src/exception_raise_test.res b/tests/tests/src/exception_raise_test.res index 5d44a46936e..ca6ea90f722 100644 --- a/tests/tests/src/exception_raise_test.res +++ b/tests/tests/src/exception_raise_test.res @@ -63,7 +63,7 @@ type in_channel @val external input_line: in_channel => string = "input_line" let rec input_lines = (ic, acc) => switch input_line(ic) { - | exception _ => Belt.List.reverse(acc) + | exception _ => List.reverse(acc) | line => input_lines(ic, list{line, ...acc}) } diff --git a/tests/tests/src/ext_array_test.mjs b/tests/tests/src/ext_array_test.mjs index 9a74cd9aa9c..8c52d21947f 100644 --- a/tests/tests/src/ext_array_test.mjs +++ b/tests/tests/src/ext_array_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; function reverse_range(a, i, len) { @@ -25,7 +25,7 @@ function reverse(a) { if (b_len === 0) { return []; } - let b = a.slice(0); + let b = a.slice(); for (let i = 0; i < b_len; ++i) { b[i] = a[(b_len - 1 | 0) - i | 0]; } @@ -36,8 +36,8 @@ function reverse_of_list(x) { if (x === 0) { return []; } - let len = Belt_List.length(x); - let a = Belt_Array.make(len, x.hd); + let len = Stdlib_List.length(x); + let a = Stdlib_Array.make(len, x.hd); let _i = 0; let _x = x.tl; while (true) { @@ -106,7 +106,7 @@ function range(from, to_) { if (from > to_) { return Pervasives.invalid_arg("Ext_array_test.range"); } else { - return Belt_Array.init((to_ - from | 0) + 1 | 0, i => i + from | 0); + return Stdlib_Array.fromInitializer((to_ - from | 0) + 1 | 0, i => i + from | 0); } } @@ -115,7 +115,7 @@ function map2i(f, a, b) { if (len !== b.length) { return Pervasives.invalid_arg("Ext_array_test.map2i"); } else { - return Belt_Array.mapWithIndex(a, (i, a) => f(i, a, b[i])); + return a.map((i, a) => f(i, a, b[i])); } } @@ -151,8 +151,8 @@ function of_list_map(f, a) { } let tl = a.tl; let hd = f(a.hd); - let len = Belt_List.length(tl) + 1 | 0; - let arr = Belt_Array.make(len, hd); + let len = Stdlib_List.length(tl) + 1 | 0; + let arr = Stdlib_Array.make(len, hd); let _i = 1; let _x = tl; while (true) { @@ -192,8 +192,8 @@ function rfind_and_split(arr, cmp, v) { return { NAME: "Split", VAL: [ - Belt_Array.slice(arr, 0, i), - Belt_Array.slice(arr, i + 1 | 0, (arr.length - i | 0) - 1 | 0) + arr.slice(0, i), + arr.slice(i + 1 | 0) ] }; } @@ -223,8 +223,8 @@ function find_and_split(arr, cmp, v) { return { NAME: "Split", VAL: [ - Belt_Array.slice(arr, 0, i), - Belt_Array.slice(arr, i + 1 | 0, (arr.length - i | 0) - 1 | 0) + arr.slice(0, i), + arr.slice(i + 1 | 0) ] }; } diff --git a/tests/tests/src/ext_array_test.res b/tests/tests/src/ext_array_test.res index c2fbe5e4f93..4bf4b373e8b 100644 --- a/tests/tests/src/ext_array_test.res +++ b/tests/tests/src/ext_array_test.res @@ -22,8 +22,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -open Belt - let reverse_range = (a, i, len) => if len == 0 { () @@ -55,7 +53,7 @@ let reverse_of_list = x => | list{} => [] | list{hd, ...tl} as l => let len = List.length(l) - let a = Array.make(len, hd) + let a = Array.make(~length=len, hd) let rec fill = (i, x) => switch x { | list{} => a @@ -101,7 +99,7 @@ let range = (from, to_) => if from > to_ { invalid_arg("Ext_array_test.range") } else { - Array.init(to_ - from + 1, i => i + from) + Array.fromInitializer(~length=to_ - from + 1, i => i + from) } let map2i = (f, a, b) => { @@ -140,7 +138,7 @@ let of_list_map = (f, a) => | list{h, ...tl} => let hd = f(h) let len = List.length(tl) + 1 - let arr = Array.make(len, hd) + let arr = Array.make(~length=len, hd) let rec fill = (i, x) => switch x { | list{} => arr @@ -182,10 +180,7 @@ let rfind_and_split = (arr, cmp, v): split<_> => { if i < 0 { #No_split } else { - #Split( - Array.slice(arr, ~offset=0, ~len=i), - Array.slice(arr, ~offset=i + 1, ~len=Array.length(arr) - i - 1), - ) + #Split(Array.slice(arr, ~start=0, ~end=i), Array.slice(arr, ~start=i + 1)) } } @@ -207,10 +202,7 @@ let find_and_split = (arr, cmp, v): split<_> => { if i < 0 { #No_split } else { - #Split( - Array.slice(arr, ~offset=0, ~len=i), - Array.slice(arr, ~offset=i + 1, ~len=Array.length(arr) - i - 1), - ) + #Split(Array.slice(arr, ~start=0, ~end=i), Array.slice(arr, ~start=i + 1)) } } diff --git a/tests/tests/src/flexible_array_test.mjs b/tests/tests/src/flexible_array_test.mjs index 7794b18da6e..10c14996b35 100644 --- a/tests/tests/src/flexible_array_test.mjs +++ b/tests/tests/src/flexible_array_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; function sub(_tr, _k) { @@ -307,9 +307,9 @@ if (!$eq$tilde(sort(u), [ }; } -let v = Belt_Array.init(500, i => 500 - i | 0); +let v = Stdlib_Array.fromInitializer(500, i => 500 - i | 0); -$eq$tilde(sort(of_array(v)), Belt_Array.init(500, i => i + 1 | 0)); +$eq$tilde(sort(of_array(v)), Stdlib_Array.fromInitializer(500, i => i + 1 | 0)); export { sub, diff --git a/tests/tests/src/flexible_array_test.res b/tests/tests/src/flexible_array_test.res index 87360e61607..17fc07b69cb 100644 --- a/tests/tests/src/flexible_array_test.res +++ b/tests/tests/src/flexible_array_test.res @@ -168,7 +168,7 @@ module Int_array: { } let of_array = arr => { let v = ref(empty) - for i in 0 to Belt.Array.length(arr) - 1 { + for i in 0 to Array.length(arr) - 1 { v := push_back(v.contents, arr->Array.getUnsafe(i)) } v.contents @@ -183,6 +183,6 @@ let _ = { let u = Int_array.of_array([1, 2, 2, 5, 3, 6]) assert(\"=~"(Int_array.sort(u), [1, 2, 2, 3, 5, 6])) let len = 500 - let v = Belt.Array.init(len, i => len - i) - \"=~"(Int_array.sort(Int_array.of_array(v)), Belt.Array.init(len, i => i + 1)) + let v = Array.fromInitializer(~length=len, i => len - i) + \"=~"(Int_array.sort(Int_array.of_array(v)), Array.fromInitializer(~length=len, i => i + 1)) } diff --git a/tests/tests/src/for_loop_test.mjs b/tests/tests/src/for_loop_test.mjs index 32119aaa644..9cd4c63ad46 100644 --- a/tests/tests/src/for_loop_test.mjs +++ b/tests/tests/src/for_loop_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; Mocha.describe("For_loop_test", () => { Mocha.test("for_loop_test_3", () => { @@ -11,24 +11,24 @@ Mocha.describe("For_loop_test", () => { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); arr[i] = () => { v.contents = v.contents + j | 0; }; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; }; - Test_utils.eq("File \"for_loop_test.res\", line 16, characters 7-14", 90, for_3(Belt_Array.make(10, 2))); + Test_utils.eq("File \"for_loop_test.res\", line 16, characters 7-14", 90, for_3(Stdlib_Array.make(10, 2))); }); Mocha.test("for_loop_test_4", () => { let for_4 = x => { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let j = (i << 1); let k = (j << 1); @@ -36,34 +36,34 @@ Mocha.describe("For_loop_test", () => { v.contents = v.contents + k | 0; }; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; }; - Test_utils.eq("File \"for_loop_test.res\", line 31, characters 7-14", 180, for_4(Belt_Array.make(10, 2))); + Test_utils.eq("File \"for_loop_test.res\", line 31, characters 7-14", 180, for_4(Stdlib_Array.make(10, 2))); }); Mocha.test("for_loop_test_5", () => { let for_5 = (x, u) => { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); for (let i = 0, i_finish = x.length; i < i_finish; ++i) { let k = (u << 1) * u | 0; arr[i] = () => { v.contents = v.contents + k | 0; }; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; }; - Test_utils.eq("File \"for_loop_test.res\", line 46, characters 7-14", 2420, for_5(Belt_Array.make(10, 2), 11)); + Test_utils.eq("File \"for_loop_test.res\", line 46, characters 7-14", 2420, for_5(Stdlib_Array.make(10, 2), 11)); }); Mocha.test("for_loop_test_6", () => { let for_6 = (x, u) => { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); let v4 = { contents: 0 }; @@ -87,7 +87,7 @@ Mocha.describe("For_loop_test", () => { } inspect_3 = v2.contents; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return [ v.contents, v4.contents, @@ -100,14 +100,14 @@ Mocha.describe("For_loop_test", () => { 1, 2, 3 - ], for_6(Belt_Array.make(3, 0), 0)); + ], for_6(Stdlib_Array.make(3, 0), 0)); }); Mocha.test("for_loop_test_7", () => { let for_7 = () => { let v = { contents: 0 }; - let arr = Belt_Array.make(21, () => {}); + let arr = Stdlib_Array.make(21, () => {}); for (let i = 0; i <= 6; ++i) { for (let j = 0; j <= 2; ++j) { arr[(i * 3 | 0) + j | 0] = () => { @@ -115,7 +115,7 @@ Mocha.describe("For_loop_test", () => { }; } } - Belt_Array.forEach(arr, f => f()); + arr.forEach(f => f()); return v.contents; }; Test_utils.eq("File \"for_loop_test.res\", line 91, characters 7-14", 84, for_7()); @@ -125,7 +125,7 @@ Mocha.describe("For_loop_test", () => { let v = { contents: 0 }; - let arr = Belt_Array.make(21, () => {}); + let arr = Stdlib_Array.make(21, () => {}); for (let i = 0; i <= 6; ++i) { let k = (i << 1); for (let j = 0; j <= 2; ++j) { @@ -135,7 +135,7 @@ Mocha.describe("For_loop_test", () => { }; } } - Belt_Array.forEach(arr, f => f()); + arr.forEach(f => f()); return v.contents; }; Test_utils.eq("File \"for_loop_test.res\", line 110, characters 7-14", 294, for_8()); @@ -157,8 +157,8 @@ Mocha.describe("For_loop_test", () => { let vv2 = { contents: 0 }; - let arr = Belt_Array.make(4, () => {}); - let arr2 = Belt_Array.make(2, () => {}); + let arr = Stdlib_Array.make(4, () => {}); + let arr2 = Stdlib_Array.make(2, () => {}); for (let i = 0; i <= 1; ++i) { let v$1 = { contents: 0 @@ -175,11 +175,11 @@ Mocha.describe("For_loop_test", () => { vv2.contents = vv2.contents + v$1.contents | 0; }; } - Belt_Array.forEach(arr, f => f()); - Belt_Array.forEach(arr2, f => f()); + arr.forEach(f => f()); + arr2.forEach(f => f()); return [[ vv.contents, - Belt_List.toArray(Belt_List.reverse(v.contents)), + Stdlib_List.toArray(Stdlib_List.reverse(v.contents)), vv2.contents ]]; }; diff --git a/tests/tests/src/for_loop_test.res b/tests/tests/src/for_loop_test.res index 9c1e9726aca..429ff44159e 100644 --- a/tests/tests/src/for_loop_test.res +++ b/tests/tests/src/for_loop_test.res @@ -5,51 +5,51 @@ describe(__MODULE__, () => { test("for_loop_test_3", () => { let for_3 = x => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) - for i in 0 to Belt.Array.length(x) - 1 { + let arr = x->Array.map(_ => _ => ()) + for i in 0 to Array.length(x) - 1 { let j = i * 2 arr[i] = _ => v := v.contents + j } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } - eq(__LOC__, 90, for_3(Belt.Array.make(10, 2))) + eq(__LOC__, 90, for_3(Array.make(~length=10, 2))) }) test("for_loop_test_4", () => { let for_4 = x => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) - for i in 0 to Belt.Array.length(x) - 1 { + let arr = x->Array.map(_ => _ => ()) + for i in 0 to Array.length(x) - 1 { let j = i * 2 let k = 2 * j arr[i] = _ => v := v.contents + k } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } - eq(__LOC__, 180, for_4(Belt.Array.make(10, 2))) + eq(__LOC__, 180, for_4(Array.make(~length=10, 2))) }) test("for_loop_test_5", () => { let for_5 = (x, u) => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) - for i in 0 to Belt.Array.length(x) - 1 { + let arr = x->Array.map(_ => _ => ()) + for i in 0 to Array.length(x) - 1 { let _j = i * 2 let k = 2 * u * u arr[i] = _ => v := v.contents + k } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } - eq(__LOC__, 2420, for_5(Belt.Array.make(10, 2), 11)) + eq(__LOC__, 2420, for_5(Array.make(~length=10, 2), 11)) }) test("for_loop_test_6", () => { let for_6 = (x, u) => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) + let arr = x->Array.map(_ => _ => ()) let v4 = ref(0) let v5 = ref(0) let inspect_3 = ref(-1) @@ -58,7 +58,7 @@ describe(__MODULE__, () => { incr(v5) let v2 = ref(0) let v3 = u - for i in 0 to Belt.Array.length(x) - 1 { + for i in 0 to Array.length(x) - 1 { let _j = i * 2 let k = 2 * u * u let h = 2 * v5.contents @@ -68,10 +68,10 @@ describe(__MODULE__, () => { } inspect_3 := v2.contents } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) [v.contents, v4.contents, v5.contents, inspect_3.contents] } - eq(__LOC__, [30, 1, 2, 3], for_6(Belt.Array.make(3, 0), 0)) + eq(__LOC__, [30, 1, 2, 3], for_6(Array.make(~length=3, 0), 0)) }) test("for_loop_test_7", () => { @@ -79,13 +79,13 @@ describe(__MODULE__, () => { let i_len = 7 let j_len = 3 let v = ref(0) - let arr = Belt.Array.make(i_len * j_len, _ => ()) + let arr = Array.make(~length=i_len * j_len, _ => ()) for i in 0 to i_len - 1 { for j in 0 to j_len - 1 { arr[i * j_len + j] = _ => v := v.contents + i + j } } - arr->Belt.Array.forEach(f => f()) + arr->Array.forEach(f => f()) v.contents } eq(__LOC__, 84, for_7()) @@ -96,7 +96,7 @@ describe(__MODULE__, () => { let i_len = 7 let j_len = 3 let v = ref(0) - let arr = Belt.Array.make(i_len * j_len, _ => ()) + let arr = Array.make(~length=i_len * j_len, _ => ()) for i in 0 to i_len - 1 { let k = 2 * i for j in 0 to j_len - 1 { @@ -104,7 +104,7 @@ describe(__MODULE__, () => { arr[i * j_len + j] = _ => v := v.contents + i + j + h + k } } - arr->Belt.Array.forEach(f => f()) + arr->Array.forEach(f => f()) v.contents } eq(__LOC__, 294, for_8()) @@ -114,15 +114,15 @@ describe(__MODULE__, () => { let for_9 = () => { let (collect, get) = { let v: ref> = ref(list{}) - (x => v := list{x, ...v.contents}, () => Belt.List.toArray(Belt.List.reverse(v.contents))) + (x => v := list{x, ...v.contents}, () => List.toArray(List.reverse(v.contents))) } let i_len = 2 let j_len = 2 let vv = ref(0) let vv2 = ref(0) - let arr = Belt.Array.make(i_len * j_len, _ => ()) - let arr2 = Belt.Array.make(i_len, _ => ()) + let arr = Array.make(~length=i_len * j_len, _ => ()) + let arr2 = Array.make(~length=i_len, _ => ()) for i in 0 to i_len - 1 { let v = ref(0) /* incr v ; */ @@ -151,8 +151,8 @@ describe(__MODULE__, () => { v is changed */ } - arr->Belt.Array.forEach(f => f()) - arr2->Belt.Array.forEach(f => f()) + arr->Array.forEach(f => f()) + arr2->Array.forEach(f => f()) [(vv.contents, get(), vv2.contents)] } eq(__LOC__, [(10, [1, 2, 2, 3], 5)], for_9()) diff --git a/tests/tests/src/global_module_alias_test.mjs b/tests/tests/src/global_module_alias_test.mjs index 85e539507e4..ae9c72b4c24 100644 --- a/tests/tests/src/global_module_alias_test.mjs +++ b/tests/tests/src/global_module_alias_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let v = { contents: 0 @@ -22,11 +22,11 @@ function f() { v.contents = v.contents + 1 | 0; v.contents = v.contents + 1 | 0; v.contents = v.contents + 1 | 0; - return Belt_List; + return Stdlib_List; } function g() { - return Belt_List.length({ + return Stdlib_List.length({ hd: 1, tl: { hd: 2, @@ -45,11 +45,11 @@ function xx() { v.contents = v.contents + 1 | 0; v.contents = v.contents + 1 | 0; v.contents = v.contents + 1 | 0; - return Belt_List; + return Stdlib_List; } Mocha.describe("Global_module_alias_test", () => { - Mocha.test("module alias basic operations", () => Test_utils.eq("File \"global_module_alias_test.res\", line 72, characters 7-14", Belt_List.length({ + Mocha.test("module alias basic operations", () => Test_utils.eq("File \"global_module_alias_test.res\", line 71, characters 7-14", Stdlib_List.length({ hd: 1, tl: { hd: 2, @@ -69,12 +69,12 @@ Mocha.describe("Global_module_alias_test", () => { v.contents = v.contents + 1 | 0; v.contents = v.contents + 1 | 0; v.contents = v.contents + 1 | 0; - Test_utils.eq("File \"global_module_alias_test.res\", line 77, characters 7-14", v.contents, 12); + Test_utils.eq("File \"global_module_alias_test.res\", line 76, characters 7-14", v.contents, 12); }); - Mocha.test("module alias unpacking", () => Test_utils.eq("File \"global_module_alias_test.res\", line 81, characters 7-14", g(), 4)); + Mocha.test("module alias unpacking", () => Test_utils.eq("File \"global_module_alias_test.res\", line 80, characters 7-14", g(), 4)); Mocha.test("module alias with functor applications", () => { let V = xx(); - Test_utils.eq("File \"global_module_alias_test.res\", line 86, characters 7-14", V.length({ + Test_utils.eq("File \"global_module_alias_test.res\", line 85, characters 7-14", V.length({ hd: 1, tl: { hd: 2, @@ -84,16 +84,16 @@ Mocha.describe("Global_module_alias_test", () => { } } }), 3); - Test_utils.eq("File \"global_module_alias_test.res\", line 87, characters 7-14", v.contents, 15); + Test_utils.eq("File \"global_module_alias_test.res\", line 86, characters 7-14", v.contents, 15); let H = f(); - Test_utils.eq("File \"global_module_alias_test.res\", line 89, characters 7-14", H.length({ + Test_utils.eq("File \"global_module_alias_test.res\", line 88, characters 7-14", H.length({ hd: 1, tl: { hd: 2, tl: /* [] */0 } }), 2); - Test_utils.eq("File \"global_module_alias_test.res\", line 90, characters 7-14", v.contents, 21); + Test_utils.eq("File \"global_module_alias_test.res\", line 89, characters 7-14", v.contents, 21); }); }); diff --git a/tests/tests/src/global_module_alias_test.res b/tests/tests/src/global_module_alias_test.res index 5e7c42eadfc..aecede20a3d 100644 --- a/tests/tests/src/global_module_alias_test.res +++ b/tests/tests/src/global_module_alias_test.res @@ -1,4 +1,3 @@ -open Belt open Mocha open Test_utils diff --git a/tests/tests/src/gpr_1409_test.mjs b/tests/tests/src/gpr_1409_test.mjs index 7ec9862a34b..33dc60ce467 100644 --- a/tests/tests/src/gpr_1409_test.mjs +++ b/tests/tests/src/gpr_1409_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as String_set from "./string_set.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; let a = {}; @@ -20,7 +20,7 @@ function map(f, x) { function make(foo, param) { let tmp = {}; - let tmp$1 = map(prim => String(prim), foo); + let tmp$1 = map(x => x.toString(), foo); if (tmp$1 !== undefined) { tmp.foo = tmp$1; } @@ -31,13 +31,13 @@ let a_ = make(undefined, undefined); let b_ = make(42, undefined); -Test_utils.eq("File \"gpr_1409_test.res\", line 24, characters 3-10", b_.foo, "42"); +Test_utils.eq("File \"gpr_1409_test.res\", line 23, characters 3-10", b_.foo, "42"); console.log(Object.keys(a_)); console.log(a, b, a_, b_); -Test_utils.eq("File \"gpr_1409_test.res\", line 29, characters 3-10", Object.keys(a_).length, 0); +Test_utils.eq("File \"gpr_1409_test.res\", line 28, characters 3-10", Object.keys(a_).length, 0); let test2 = { hi: 2 @@ -104,15 +104,15 @@ function test6(f, x) { } function keys(xs, ys) { - return String_set.equal(String_set.of_list(xs), String_set.of_list(Belt_List.fromArray(ys))); + return String_set.equal(String_set.of_list(xs), String_set.of_list(Stdlib_List.fromArray(ys))); } -Test_utils.eq("File \"gpr_1409_test.res\", line 67, characters 3-10", keys({ +Test_utils.eq("File \"gpr_1409_test.res\", line 66, characters 3-10", keys({ hd: "hi", tl: /* [] */0 }, Object.keys(test3(undefined, undefined))), true); -Test_utils.eq("File \"gpr_1409_test.res\", line 69, characters 3-10", keys({ +Test_utils.eq("File \"gpr_1409_test.res\", line 68, characters 3-10", keys({ hd: "hi", tl: { hd: "_open", @@ -120,7 +120,7 @@ Test_utils.eq("File \"gpr_1409_test.res\", line 69, characters 3-10", keys({ } }, Object.keys(test3(2, undefined))), true); -Test_utils.eq("File \"gpr_1409_test.res\", line 71, characters 3-10", keys({ +Test_utils.eq("File \"gpr_1409_test.res\", line 70, characters 3-10", keys({ hd: "hi", tl: { hd: "_open", @@ -132,20 +132,20 @@ Test_utils.eq("File \"gpr_1409_test.res\", line 71, characters 3-10", keys({ }, Object.keys(test3(2, 2))), true); Mocha.describe("Gpr_1409_test", () => { - Mocha.test("test1", () => Test_utils.eq("File \"gpr_1409_test.res\", line 75, characters 7-14", b_.foo, "42")); - Mocha.test("test2", () => Test_utils.eq("File \"gpr_1409_test.res\", line 79, characters 7-14", Object.keys(a_).length, 0)); - Mocha.test("test3", () => Test_utils.eq("File \"gpr_1409_test.res\", line 83, characters 7-14", keys({ + Mocha.test("test1", () => Test_utils.eq("File \"gpr_1409_test.res\", line 74, characters 7-14", b_.foo, "42")); + Mocha.test("test2", () => Test_utils.eq("File \"gpr_1409_test.res\", line 78, characters 7-14", Object.keys(a_).length, 0)); + Mocha.test("test3", () => Test_utils.eq("File \"gpr_1409_test.res\", line 82, characters 7-14", keys({ hd: "hi", tl: /* [] */0 }, Object.keys(test3(undefined, undefined))), true)); - Mocha.test("test4", () => Test_utils.eq("File \"gpr_1409_test.res\", line 87, characters 7-14", keys({ + Mocha.test("test4", () => Test_utils.eq("File \"gpr_1409_test.res\", line 86, characters 7-14", keys({ hd: "hi", tl: { hd: "_open", tl: /* [] */0 } }, Object.keys(test3(2, undefined))), true)); - Mocha.test("test5", () => Test_utils.eq("File \"gpr_1409_test.res\", line 92, characters 6-13", keys({ + Mocha.test("test5", () => Test_utils.eq("File \"gpr_1409_test.res\", line 91, characters 6-13", keys({ hd: "hi", tl: { hd: "_open", diff --git a/tests/tests/src/gpr_1409_test.res b/tests/tests/src/gpr_1409_test.res index 758ac8ad5ac..6934e2c4b5d 100644 --- a/tests/tests/src/gpr_1409_test.res +++ b/tests/tests/src/gpr_1409_test.res @@ -1,6 +1,5 @@ open Mocha open Test_utils -open Belt /* type t */ @get external foo: {..} => option = "foo" @@ -16,7 +15,7 @@ let map = (f, x) => | Some(x) => Some(f(x)) } -let make = (~foo: option=?, ()) => make(~foo=?map(Int.toString, foo), ()) +let make = (~foo: option=?, ()) => make(~foo=?map(x => Int.toString(x), foo), ()) let a_ = make() let b_ = make(~foo=42, ()) diff --git a/tests/tests/src/gpr_1701_test.mjs b/tests/tests/src/gpr_1701_test.mjs index 63e354a9cd7..aecc3ed504e 100644 --- a/tests/tests/src/gpr_1701_test.mjs +++ b/tests/tests/src/gpr_1701_test.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; let Foo = /* @__PURE__ */Primitive_exceptions.create("Gpr_1701_test.Foo"); @@ -41,7 +41,7 @@ function read_lines(inc) { } } if (l === undefined) { - return Belt_List.reverse(acc); + return Stdlib_List.reverse(acc); } _acc = { hd: l, @@ -61,7 +61,7 @@ function read_lines2(inc) { } catch (raw_exn) { let exn = Primitive_exceptions.internalToException(raw_exn); if (exn.RE_EXN_ID === "End_of_file") { - return Belt_List.reverse(acc); + return Stdlib_List.reverse(acc); } throw exn; } @@ -84,7 +84,7 @@ function read_lines3(inc) { } catch (raw_exn) { let exn = Primitive_exceptions.internalToException(raw_exn); if (exn.RE_EXN_ID === "End_of_file") { - return Belt_List.reverse(acc); + return Stdlib_List.reverse(acc); } throw exn; } diff --git a/tests/tests/src/gpr_1701_test.res b/tests/tests/src/gpr_1701_test.res index 6c8a9850454..d5c49713abe 100644 --- a/tests/tests/src/gpr_1701_test.res +++ b/tests/tests/src/gpr_1701_test.res @@ -1,5 +1,3 @@ -open Belt - exception Foo let rec test = n => diff --git a/tests/tests/src/gpr_2487.mjs b/tests/tests/src/gpr_2487.mjs index 57a1b618882..a47095f38dd 100644 --- a/tests/tests/src/gpr_2487.mjs +++ b/tests/tests/src/gpr_2487.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; -let b = Belt_Array.eq([ +let b = Stdlib_Array.equal([ 1, 2, 3 diff --git a/tests/tests/src/gpr_2487.res b/tests/tests/src/gpr_2487.res index 6cb3b8be39e..3930a1c9e7e 100644 --- a/tests/tests/src/gpr_2487.res +++ b/tests/tests/src/gpr_2487.res @@ -1,3 +1,3 @@ -module A = Belt.Array +module A = Array -let b = A.eq([1, 2, 3], [1, 2, 3], \"==") +let b = A.equal([1, 2, 3], [1, 2, 3], \"==") diff --git a/tests/tests/src/gpr_2608_test.mjs b/tests/tests/src/gpr_2608_test.mjs index adc762faf8f..ce8139163fc 100644 --- a/tests/tests/src/gpr_2608_test.mjs +++ b/tests/tests/src/gpr_2608_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let oppHeroes = { hd: 0, @@ -11,22 +11,22 @@ let oppHeroes = { let huntGrootCondition = false; -if (Belt_List.length(/* [] */0) > 0) { - let x = Belt_List.filter(oppHeroes, h => Belt_List.headExn(/* [] */0) <= 1000); - huntGrootCondition = Belt_List.length(x) === 0; +if (Stdlib_List.length(/* [] */0) > 0) { + let x = Stdlib_List.filter(oppHeroes, h => Stdlib_List.headExn(/* [] */0) <= 1000); + huntGrootCondition = Stdlib_List.length(x) === 0; } let huntGrootCondition2 = true; -if (Belt_List.length(/* [] */0) < 0) { - let x$1 = Belt_List.filter(oppHeroes, h => Belt_List.headExn(/* [] */0) <= 1000); - huntGrootCondition2 = Belt_List.length(x$1) === 0; +if (Stdlib_List.length(/* [] */0) < 0) { + let x$1 = Stdlib_List.filter(oppHeroes, h => Stdlib_List.headExn(/* [] */0) <= 1000); + huntGrootCondition2 = Stdlib_List.length(x$1) === 0; } Mocha.describe("Gpr_2608_test", () => { Mocha.test("huntGroot conditions", () => { - Test_utils.eq("File \"gpr_2608_test.res\", line 22, characters 7-14", huntGrootCondition, false); - Test_utils.eq("File \"gpr_2608_test.res\", line 23, characters 7-14", huntGrootCondition2, true); + Test_utils.eq("File \"gpr_2608_test.res\", line 21, characters 7-14", huntGrootCondition, false); + Test_utils.eq("File \"gpr_2608_test.res\", line 22, characters 7-14", huntGrootCondition2, true); }); }); diff --git a/tests/tests/src/gpr_2608_test.res b/tests/tests/src/gpr_2608_test.res index 916b31dd2e7..01719eade00 100644 --- a/tests/tests/src/gpr_2608_test.res +++ b/tests/tests/src/gpr_2608_test.res @@ -1,4 +1,3 @@ -open Belt open Mocha open Test_utils diff --git a/tests/tests/src/gpr_3931_test.mjs b/tests/tests/src/gpr_3931_test.mjs index d30672461ff..88806cb26d9 100644 --- a/tests/tests/src/gpr_3931_test.mjs +++ b/tests/tests/src/gpr_3931_test.mjs @@ -1,6 +1,5 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Primitive_module from "@rescript/runtime/lib/es6/Primitive_module.mjs"; let PA = Primitive_module.init([ @@ -28,7 +27,7 @@ let P = Primitive_module.init([ }); function print(a) { - Belt_Array.forEach(a, P.print); + a.forEach(P.print); } Primitive_module.update({ diff --git a/tests/tests/src/gpr_3931_test.res b/tests/tests/src/gpr_3931_test.res index 41fdb8ba789..450252cec37 100644 --- a/tests/tests/src/gpr_3931_test.res +++ b/tests/tests/src/gpr_3931_test.res @@ -3,7 +3,7 @@ module rec PA: { } = { /* let () = P.print 3 */ let print = { - let iter = Belt.Array.forEach(_, P.print) + let iter = Array.forEach(_, P.print) a => iter(a) } } diff --git a/tests/tests/src/gpr_4274_test.mjs b/tests/tests/src/gpr_4274_test.mjs index b75c2b8e38b..c326238a3b9 100644 --- a/tests/tests/src/gpr_4274_test.mjs +++ b/tests/tests/src/gpr_4274_test.mjs @@ -1,7 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let N = {}; @@ -13,7 +12,7 @@ function f(X, xs) { }); } -Belt_List.forEach({ +Stdlib_List.forEach({ hd: { x: 3 }, @@ -28,7 +27,7 @@ let bar = [{ foo: "bar" }]; -Belt_Array.map(bar, b => b.foo); +bar.map(b => b.foo); export { N, diff --git a/tests/tests/src/gpr_4274_test.res b/tests/tests/src/gpr_4274_test.res index 12729cf1d7b..6370177087a 100644 --- a/tests/tests/src/gpr_4274_test.res +++ b/tests/tests/src/gpr_4274_test.res @@ -10,11 +10,11 @@ module type X = { /* type annotation here interferes.. */ let f = (module(X: X), xs: array) => X.forEach(xs, {X.i: x => Console.log(x.x)}) -Belt.List.forEach(list{{N.x: 3}}, x => Console.log(x.x)) +List.forEach(list{{N.x: 3}}, x => Console.log(x.x)) module Foo = { type record = {foo: string} } let bar = [{Foo.foo: @reason.raw_literal("bar") "bar"}] -let _ = Belt.Array.map(bar, b => b.foo) +let _ = Array.map(bar, b => b.foo) diff --git a/tests/tests/src/hello_res.mjs b/tests/tests/src/hello_res.mjs index c92bf7cf41d..8a1f043af4e 100644 --- a/tests/tests/src/hello_res.mjs +++ b/tests/tests/src/hello_res.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; -let b = Belt_List.length({ +let b = Stdlib_List.length({ hd: 1, tl: { hd: 2, @@ -17,7 +17,7 @@ let a = b - 1 | 0; console.log("hello, res"); -Belt_List.add(/* [] */0, Belt_List.length({ +Stdlib_List.add(/* [] */0, Stdlib_List.length({ hd: 1, tl: { hd: 2, diff --git a/tests/tests/src/hello_res.res b/tests/tests/src/hello_res.res index 788c822dee0..abc71fef1a9 100644 --- a/tests/tests/src/hello_res.res +++ b/tests/tests/src/hello_res.res @@ -4,8 +4,6 @@ ], }) -open Belt - let b = List.length(list{1, 2, 3}) let a = b - 1 Console.log("hello, res") diff --git a/tests/tests/src/inline_map2_test.mjs b/tests/tests/src/inline_map2_test.mjs index 959c26340b8..8e98a44c5ca 100644 --- a/tests/tests/src/inline_map2_test.mjs +++ b/tests/tests/src/inline_map2_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.mjs"; @@ -1223,7 +1223,7 @@ let IntMap = { choose: min_binding }; -let m = Belt_List.reduceReverse({ +let m = Stdlib_List.reduceReverse({ hd: [ 10, /* 'a' */97 @@ -1875,7 +1875,7 @@ let SMap = { choose: min_binding$1 }; -let s = Belt_List.reduceReverse({ +let s = Stdlib_List.reduceReverse({ hd: [ "10", /* 'a' */97 @@ -1902,8 +1902,8 @@ let s = Belt_List.reduceReverse({ }, "Empty", (acc, param) => add$1(param[0], param[1], acc)); Mocha.describe("Inline_map2_test", () => { - Mocha.test("assertion1", () => Test_utils.eq("File \"inline_map2_test.res\", line 480, characters 30-37", find(10, m), /* 'a' */97)); - Mocha.test("assertion2", () => Test_utils.eq("File \"inline_map2_test.res\", line 481, characters 30-37", find$1("10", s), /* 'a' */97)); + Mocha.test("assertion1", () => Test_utils.eq("File \"inline_map2_test.res\", line 478, characters 30-37", find(10, m), /* 'a' */97)); + Mocha.test("assertion2", () => Test_utils.eq("File \"inline_map2_test.res\", line 479, characters 30-37", find$1("10", s), /* 'a' */97)); }); let eq = Test_utils.eq; diff --git a/tests/tests/src/inline_map2_test.res b/tests/tests/src/inline_map2_test.res index 84778b762dd..d850e2bd581 100644 --- a/tests/tests/src/inline_map2_test.res +++ b/tests/tests/src/inline_map2_test.res @@ -459,21 +459,19 @@ module IntMap = Make({ let empty = IntMap.empty -let m = Belt.List.reduceReverse(list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, empty, ( - acc, - (k, v), -) => IntMap.add(k, v, acc)) +let m = List.reduceReverse(list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, empty, (acc, (k, v)) => + IntMap.add(k, v, acc) +) module SMap = Make({ type t = string let compare = (x: t, y) => compare(x, y) }) -let s = Belt.List.reduceReverse( - list{("10", 'a'), ("3", 'b'), ("7", 'c'), ("20", 'd')}, - SMap.empty, - (acc, (k, v)) => SMap.add(k, v, acc), -) +let s = List.reduceReverse(list{("10", 'a'), ("3", 'b'), ("7", 'c'), ("20", 'd')}, SMap.empty, ( + acc, + (k, v), +) => SMap.add(k, v, acc)) @val("console.log") external log: 'a => unit = "" describe(__MODULE__, () => { diff --git a/tests/tests/src/inline_map_demo.mjs b/tests/tests/src/inline_map_demo.mjs index 5b9c1bf3677..17790a7b1db 100644 --- a/tests/tests/src/inline_map_demo.mjs +++ b/tests/tests/src/inline_map_demo.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; function height(x) { @@ -137,7 +137,7 @@ function add(x, data, tree) { } } -let m = Belt_List.reduceReverse({ +let m = Stdlib_List.reduceReverse({ hd: [ 10, /* 'a' */97 @@ -182,7 +182,7 @@ function find(px, _x) { } Mocha.describe("Inline_map_demo", () => { - Mocha.test("find", () => Test_utils.eq("File \"inline_map_demo.res\", line 142, characters 24-31", find(10, m), /* 'a' */97)); + Mocha.test("find", () => Test_utils.eq("File \"inline_map_demo.res\", line 141, characters 24-31", find(10, m), /* 'a' */97)); }); /* m Not a pure module */ diff --git a/tests/tests/src/inline_map_demo.res b/tests/tests/src/inline_map_demo.res index edda67595cd..691ac825fe0 100644 --- a/tests/tests/src/inline_map_demo.res +++ b/tests/tests/src/inline_map_demo.res @@ -111,10 +111,9 @@ let empty = Empty No assumption on the heights of l and r. */ /* end */ -let m = Belt.List.reduceReverse(list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, empty, ( - acc, - (k, v), -) => add(k, v, acc)) +let m = List.reduceReverse(list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, empty, (acc, (k, v)) => + add(k, v, acc) +) let rec find = (px, x) => switch x { diff --git a/tests/tests/src/inline_map_test.mjs b/tests/tests/src/inline_map_test.mjs index b6ef29c90bf..56120f4fd1c 100644 --- a/tests/tests/src/inline_map_test.mjs +++ b/tests/tests/src/inline_map_test.mjs @@ -1,9 +1,9 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; function height(x) { @@ -124,7 +124,7 @@ function find(x, _x_) { }; } -let m = Belt_List.reduceReverse({ +let m = Stdlib_List.reduceReverse({ hd: [ 10, /* 'a' */97 @@ -151,7 +151,7 @@ let m = Belt_List.reduceReverse({ }, "Empty", (acc, param) => add(param[0], param[1], acc)); Mocha.describe("Inline_map_test", () => { - Mocha.test("inline map test", () => Test_utils.eq("File \"inline_map_test.res\", line 420, characters 7-14", find(10, m), /* 'a' */97)); + Mocha.test("inline map test", () => Test_utils.eq("File \"inline_map_test.res\", line 419, characters 7-14", find(10, m), /* 'a' */97)); }); /* m Not a pure module */ diff --git a/tests/tests/src/inline_map_test.res b/tests/tests/src/inline_map_test.res index fdf1d98c204..970eb0101f0 100644 --- a/tests/tests/src/inline_map_test.res +++ b/tests/tests/src/inline_map_test.res @@ -408,10 +408,9 @@ let bindings = s => bindings_aux(list{}, s) let choose = min_binding /* end */ -let m = Belt.List.reduceReverse(list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, empty, ( - acc, - (k, v), -) => add(k, v, acc)) +let m = List.reduceReverse(list{(10, 'a'), (3, 'b'), (7, 'c'), (20, 'd')}, empty, (acc, (k, v)) => + add(k, v, acc) +) @val("console.log") external log: 'a => unit = "" diff --git a/tests/tests/src/inline_record_test.mjs b/tests/tests/src/inline_record_test.mjs index 57d4aac539a..a3890323766 100644 --- a/tests/tests/src/inline_record_test.mjs +++ b/tests/tests/src/inline_record_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; let v = { @@ -24,9 +24,9 @@ let v1 = { function f(x) { if (x.TAG === "A0") { - return Belt_List.reduceReverse(x.more, x.lbl, (a, b) => a + b | 0); + return Stdlib_List.reduceReverse(x.more, x.lbl, (a, b) => a + b | 0); } else { - return Belt_List.reduceReverse(x.more, 0, (a, b) => a + b | 0); + return Stdlib_List.reduceReverse(x.more, 0, (a, b) => a + b | 0); } } diff --git a/tests/tests/src/inline_record_test.res b/tests/tests/src/inline_record_test.res index b98d04e1537..89ad82934e4 100644 --- a/tests/tests/src/inline_record_test.res +++ b/tests/tests/src/inline_record_test.res @@ -10,8 +10,8 @@ let v1 = A1({more: list{1, 2}}) let f = (x: t0) => switch x { - | A0({lbl, more}) => more->Belt.List.reduceReverse(lbl, (a, b) => a + b) - | A1({more}) => more->Belt.List.reduceReverse(0, (a, b) => a + b) + | A0({lbl, more}) => more->List.reduceReverse(lbl, (a, b) => a + b) + | A1({more}) => more->List.reduceReverse(0, (a, b) => a + b) } type t1 = diff --git a/tests/tests/src/label_uncurry.mjs b/tests/tests/src/label_uncurry.mjs index 270e445f436..1714c8b7ecf 100644 --- a/tests/tests/src/label_uncurry.mjs +++ b/tests/tests/src/label_uncurry.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Int from "@rescript/belt/src/Belt_Int.mjs"; +import * as Stdlib_Int from "@rescript/runtime/lib/es6/Stdlib_Int.mjs"; function f(x) { return x; } function u(x, y) { - let y$1 = Belt_Int.fromString(y); + let y$1 = Stdlib_Int.fromString(y); if (y$1 !== undefined) { return x + y$1 | 0; } diff --git a/tests/tests/src/label_uncurry.res b/tests/tests/src/label_uncurry.res index 31f14ca885e..e27ecd80592 100644 --- a/tests/tests/src/label_uncurry.res +++ b/tests/tests/src/label_uncurry.res @@ -5,7 +5,7 @@ type u = (~x: int, ~y: string) => option let f = (x: t): u => x let u: u = (~x, ~y) => - switch Belt.Int.fromString(y) { + switch Int.fromString(y) { | Some(y) => Some(x + y) | None => None } diff --git a/tests/tests/src/loop_control_test.mjs b/tests/tests/src/loop_control_test.mjs index 958900b465f..cc06a3a4751 100644 --- a/tests/tests/src/loop_control_test.mjs +++ b/tests/tests/src/loop_control_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; Mocha.describe("Loop_control_test", () => { Mocha.test("while loop break and continue", () => { @@ -25,7 +25,7 @@ Mocha.describe("Loop_control_test", () => { 1, 3, 4 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("switch inside while targets the loop", () => { let values = /* [] */0; @@ -50,7 +50,7 @@ Mocha.describe("Loop_control_test", () => { 1, 3, 4 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("string switch inside while targets the loop via JS switch", () => { let values = /* [] */0; @@ -77,7 +77,7 @@ Mocha.describe("Loop_control_test", () => { 1, 3, 4 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("for loop break and continue", () => { let values = /* [] */0; @@ -97,7 +97,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("braced break expression in value position compiles", () => { let reached = false; @@ -121,7 +121,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("switch inside for targets the loop", () => { let values = /* [] */0; @@ -143,7 +143,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("string switch inside for targets the loop via JS switch", () => { let values = /* [] */0; @@ -167,7 +167,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("for..of loop break and continue", () => { let values = /* [] */0; @@ -194,7 +194,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("switch inside for..of targets the loop", () => { let values = /* [] */0; @@ -223,7 +223,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); Mocha.test("string switch inside for..of targets the loop via JS switch", () => { let values = /* [] */0; @@ -254,7 +254,7 @@ Mocha.describe("Loop_control_test", () => { 0, 2, 3 - ], Belt_List.toArray(Belt_List.reverse(values))); + ], Stdlib_List.toArray(Stdlib_List.reverse(values))); }); }); diff --git a/tests/tests/src/loop_control_test.res b/tests/tests/src/loop_control_test.res index 715b32f446b..45e26aa028e 100644 --- a/tests/tests/src/loop_control_test.res +++ b/tests/tests/src/loop_control_test.res @@ -20,7 +20,7 @@ describe(__MODULE__, () => { values := list{i.contents, ...values.contents} } - eq(__LOC__, [1, 3, 4], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [1, 3, 4], values.contents->List.reverse->List.toArray) }) test("switch inside while targets the loop", () => { @@ -37,7 +37,7 @@ describe(__MODULE__, () => { } } - eq(__LOC__, [1, 3, 4], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [1, 3, 4], values.contents->List.reverse->List.toArray) }) // Keep a JS `switch` in the generated output so this exercises labeled loop control. @@ -61,7 +61,7 @@ describe(__MODULE__, () => { } } - eq(__LOC__, [1, 3, 4], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [1, 3, 4], values.contents->List.reverse->List.toArray) }) test("for loop break and continue", () => { @@ -79,7 +79,7 @@ describe(__MODULE__, () => { values := list{i, ...values.contents} } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) test("braced break expression in value position compiles", () => { @@ -108,7 +108,7 @@ describe(__MODULE__, () => { values := list{i, ...values.contents} } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) test("switch inside for targets the loop", () => { @@ -122,7 +122,7 @@ describe(__MODULE__, () => { } } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) // Keep a JS `switch` in the generated output so this exercises labeled loop control. @@ -143,7 +143,7 @@ describe(__MODULE__, () => { } } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) test("for..of loop break and continue", () => { @@ -161,7 +161,7 @@ describe(__MODULE__, () => { values := list{i, ...values.contents} } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) test("switch inside for..of targets the loop", () => { @@ -175,7 +175,7 @@ describe(__MODULE__, () => { } } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) // Keep a JS `switch` in the generated output so this exercises labeled loop control. @@ -196,6 +196,6 @@ describe(__MODULE__, () => { } } - eq(__LOC__, [0, 2, 3], values.contents->Belt.List.reverse->Belt.List.toArray) + eq(__LOC__, [0, 2, 3], values.contents->List.reverse->List.toArray) }) }) diff --git a/tests/tests/src/mario_game.mjs b/tests/tests/src/mario_game.mjs index 4866cc80030..1f175463ad5 100644 --- a/tests/tests/src/mario_game.mjs +++ b/tests/tests/src/mario_game.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_int from "@rescript/runtime/lib/es6/Primitive_int.mjs"; import * as Primitive_float from "@rescript/runtime/lib/es6/Primitive_float.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; @@ -951,7 +951,7 @@ function update_player(player, keys, context) { let prev_jumping = player.jumping; let prev_dir = player.dir; let prev_vx = Math.abs(player.vel.x); - Belt_List.forEach(keys, extra => { + Stdlib_List.forEach(keys, extra => { let lr_acc = player.vel.x * 0.2; switch (extra) { case "CLeft" : @@ -1463,8 +1463,8 @@ function clear_canvas(canvas) { } function hud(canvas, score, coins) { - let score_string = String(score); - let coin_string = String(coins); + let score_string = score.toString(); + let coin_string = coins.toString(); let context = canvas.getContext("2d"); context.font = "10px 'Press Start 2P'"; context.fillText("Score: " + score_string, canvas.width - 140, 18); @@ -2073,7 +2073,7 @@ function process_collision(dir, c1, c2, state) { function broad_phase(collid, all_collids, state) { let obj = collid._2; - return Belt_List.filter(all_collids, c => { + return Stdlib_List.filter(all_collids, c => { if (in_viewport(state.vpt, obj.pos) || is_player(collid)) { return true; } else { @@ -2193,7 +2193,7 @@ function translate_keys() { hd: ctrls_0, tl: ctrls_1 }; - return Belt_List.reduceReverse(ctrls, /* [] */0, (a, x) => { + return Stdlib_List.reduceReverse(ctrls, /* [] */0, (a, x) => { if (x[0]) { return { hd: x[1], @@ -2287,10 +2287,10 @@ function update_loop(canvas, param, map_dim) { multiplier: state.multiplier, game_over: state.game_over }; - Belt_List.forEach(objs, obj => { + Stdlib_List.forEach(objs, obj => { run_update_collid(state$1, obj, objs); }); - Belt_List.forEach(parts, part => { + Stdlib_List.forEach(parts, part => { process(part); let x = part.pos.x - state$1.vpt.pos.x; let y = part.pos.y - state$1.vpt.pos.y; @@ -3264,7 +3264,7 @@ function inc_counter(param) { } function preload(param) { - return Belt_List.map({ + return Stdlib_List.map({ hd: "blocks.png", tl: { hd: "items.png", diff --git a/tests/tests/src/mario_game.res b/tests/tests/src/mario_game.res index 098fe281542..7d8c205e458 100644 --- a/tests/tests/src/mario_game.res +++ b/tests/tests/src/mario_game.res @@ -1,7 +1,5 @@ @@config({flags: ["-w", "a", "-bs-no-bin-annot"]}) -open Belt - module Random = { let self_init = () => () diff --git a/tests/tests/src/module_alias_test.mjs b/tests/tests/src/module_alias_test.mjs index 21a38d9a583..e4bfaf7004a 100644 --- a/tests/tests/src/module_alias_test.mjs +++ b/tests/tests/src/module_alias_test.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function f(x) { console.log(x); - console.log(Belt_List.length(x)); - return Belt_List; + console.log(Stdlib_List.length(x)); + return Stdlib_List; } let h = f(/* [] */0); @@ -23,10 +23,10 @@ let a = h.length({ } }); -Test_utils.eq("File \"module_alias_test.res\", line 26, characters 3-10", a, 3); +Test_utils.eq("File \"module_alias_test.res\", line 25, characters 3-10", a, 3); Mocha.describe("Module_alias_test", () => { - Mocha.test("module_alias_test", () => Test_utils.eq("File \"module_alias_test.res\", line 29, characters 7-14", a, 3)); + Mocha.test("module_alias_test", () => Test_utils.eq("File \"module_alias_test.res\", line 28, characters 7-14", a, 3)); }); let N; diff --git a/tests/tests/src/module_alias_test.res b/tests/tests/src/module_alias_test.res index d454669c4ab..8c3b3401cdb 100644 --- a/tests/tests/src/module_alias_test.res +++ b/tests/tests/src/module_alias_test.res @@ -1,6 +1,5 @@ open Mocha open Test_utils -open Belt module N = List diff --git a/tests/tests/src/module_missing_conversion.mjs b/tests/tests/src/module_missing_conversion.mjs index e5218fccdb2..e45e16d66bc 100644 --- a/tests/tests/src/module_missing_conversion.mjs +++ b/tests/tests/src/module_missing_conversion.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; import * as Stdlib_String from "@rescript/runtime/lib/es6/Stdlib_String.mjs"; function f(x) { @@ -8,80 +8,31 @@ function f(x) { } let XX = { - get: Belt_Array.get, - getExn: Belt_Array.getExn, - getOrThrow: Belt_Array.getOrThrow, - set: Belt_Array.set, - setExn: Belt_Array.setExn, - setOrThrow: Belt_Array.setOrThrow, - shuffleInPlace: Belt_Array.shuffleInPlace, - shuffle: Belt_Array.shuffle, - reverseInPlace: Belt_Array.reverseInPlace, - reverse: Belt_Array.reverse, - make: Belt_Array.make, - range: Belt_Array.range, - rangeBy: Belt_Array.rangeBy, - makeByU: Belt_Array.makeByU, - makeBy: Belt_Array.makeBy, - makeByAndShuffleU: Belt_Array.makeByAndShuffleU, - makeByAndShuffle: Belt_Array.makeByAndShuffle, - zip: Belt_Array.zip, - zipByU: Belt_Array.zipByU, - zipBy: Belt_Array.zipBy, - unzip: Belt_Array.unzip, - concat: Belt_Array.concat, - concatMany: Belt_Array.concatMany, - slice: Belt_Array.slice, - sliceToEnd: Belt_Array.sliceToEnd, - fill: Belt_Array.fill, - blit: Belt_Array.blit, - blitUnsafe: Belt_Array.blitUnsafe, - forEachU: Belt_Array.forEachU, - forEach: Belt_Array.forEach, - mapU: Belt_Array.mapU, - map: Belt_Array.map, - flatMapU: Belt_Array.flatMapU, - flatMap: Belt_Array.flatMap, - getByU: Belt_Array.getByU, - getBy: Belt_Array.getBy, - getIndexByU: Belt_Array.getIndexByU, - getIndexBy: Belt_Array.getIndexBy, - keepU: Belt_Array.keepU, - keep: Belt_Array.keep, - keepWithIndexU: Belt_Array.keepWithIndexU, - keepWithIndex: Belt_Array.keepWithIndex, - keepMapU: Belt_Array.keepMapU, - keepMap: Belt_Array.keepMap, - forEachWithIndexU: Belt_Array.forEachWithIndexU, - forEachWithIndex: Belt_Array.forEachWithIndex, - mapWithIndexU: Belt_Array.mapWithIndexU, - mapWithIndex: Belt_Array.mapWithIndex, - partitionU: Belt_Array.partitionU, - partition: Belt_Array.partition, - reduceU: Belt_Array.reduceU, - reduce: Belt_Array.reduce, - reduceReverseU: Belt_Array.reduceReverseU, - reduceReverse: Belt_Array.reduceReverse, - reduceReverse2U: Belt_Array.reduceReverse2U, - reduceReverse2: Belt_Array.reduceReverse2, - reduceWithIndexU: Belt_Array.reduceWithIndexU, - reduceWithIndex: Belt_Array.reduceWithIndex, - joinWithU: Belt_Array.joinWithU, - joinWith: Belt_Array.joinWith, - someU: Belt_Array.someU, - some: Belt_Array.some, - everyU: Belt_Array.everyU, - every: Belt_Array.every, - every2U: Belt_Array.every2U, - every2: Belt_Array.every2, - some2U: Belt_Array.some2U, - some2: Belt_Array.some2, - cmpU: Belt_Array.cmpU, - cmp: Belt_Array.cmp, - eqU: Belt_Array.eqU, - eq: Belt_Array.eq, - initU: Belt_Array.initU, - init: Belt_Array.init, + make: Stdlib_Array.make, + fromInitializer: Stdlib_Array.fromInitializer, + equal: Stdlib_Array.equal, + compare: Stdlib_Array.compare, + isEmpty: Stdlib_Array.isEmpty, + concatAll: Stdlib_Array.concatAll, + indexOfOpt: Stdlib_Array.indexOfOpt, + lastIndexOfOpt: Stdlib_Array.lastIndexOfOpt, + reduce: Stdlib_Array.reduce, + reduceWithIndex: Stdlib_Array.reduceWithIndex, + reduceRight: Stdlib_Array.reduceRight, + reduceRightWithIndex: Stdlib_Array.reduceRightWithIndex, + findIndexOpt: Stdlib_Array.findIndexOpt, + findLastIndexOpt: Stdlib_Array.findLastIndexOpt, + filterMap: Stdlib_Array.filterMap, + filterMapWithIndex: Stdlib_Array.filterMapWithIndex, + keepSome: Stdlib_Array.keepSome, + toShuffled: Stdlib_Array.toShuffled, + shuffle: Stdlib_Array.shuffle, + findMap: Stdlib_Array.findMap, + zip: Stdlib_Array.zip, + zipBy: Stdlib_Array.zipBy, + partition: Stdlib_Array.partition, + unzip: Stdlib_Array.unzip, + last: Stdlib_Array.last, f: f }; diff --git a/tests/tests/src/module_missing_conversion.res b/tests/tests/src/module_missing_conversion.res index 728fdb345f5..8c80eb177cf 100644 --- a/tests/tests/src/module_missing_conversion.res +++ b/tests/tests/src/module_missing_conversion.res @@ -1,7 +1,7 @@ module type S = module type of String module XX = { - include Belt.Array + include Array let f = x => x } let u = [module(String: S)] diff --git a/tests/tests/src/module_test.mjs b/tests/tests/src/module_test.mjs index 25600fa5efa..ccbf81e6072 100644 --- a/tests/tests/src/module_test.mjs +++ b/tests/tests/src/module_test.mjs @@ -1,15 +1,15 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function length(param) { return 3; } Mocha.describe("Module_test", () => { - Mocha.test("list_length", () => Test_utils.eq("File \"module_test.res\", line 8, characters 31-38", 2, Belt_List.length({ + Mocha.test("list_length", () => Test_utils.eq("File \"module_test.res\", line 8, characters 31-38", 2, Stdlib_List.length({ hd: 1, tl: { hd: 2, diff --git a/tests/tests/src/module_test.res b/tests/tests/src/module_test.res index 3304314d331..80c4c19239d 100644 --- a/tests/tests/src/module_test.res +++ b/tests/tests/src/module_test.res @@ -5,6 +5,6 @@ let length = _ => 3 /* Test name collision */ describe(__MODULE__, () => { - test("list_length", () => eq(__LOC__, 2, Belt.List.length(list{1, 2}))) + test("list_length", () => eq(__LOC__, 2, List.length(list{1, 2}))) test("length", () => eq(__LOC__, 3, length(list{1, 2}))) }) diff --git a/tests/tests/src/nested_module_alias.mjs b/tests/tests/src/nested_module_alias.mjs index b4bf3587a15..c01e3e625e3 100644 --- a/tests/tests/src/nested_module_alias.mjs +++ b/tests/tests/src/nested_module_alias.mjs @@ -1,11 +1,11 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function v(x) { return [ - Belt_List.length(x), - Belt_List.length(x) + Stdlib_List.length(x), + Stdlib_List.length(x) ]; } diff --git a/tests/tests/src/nested_module_alias.res b/tests/tests/src/nested_module_alias.res index 38010d1b575..56992831fd5 100644 --- a/tests/tests/src/nested_module_alias.res +++ b/tests/tests/src/nested_module_alias.res @@ -1,7 +1,7 @@ -module L = Belt.List +module L = List let v = x => { - module H = Belt.List + module H = List module U = L (H.length(x), U.length(x)) } diff --git a/tests/tests/src/obj_literal_ppx.res b/tests/tests/src/obj_literal_ppx.res index 16487495d8d..50b30a939bd 100644 --- a/tests/tests/src/obj_literal_ppx.res +++ b/tests/tests/src/obj_literal_ppx.res @@ -2,7 +2,7 @@ let a = {"x": 3, "y": [1]} let b = {"x": 3, "y": [1], "z": 3, "u": (x, y) => x + y} -let f = obj => obj["x"] + Belt.Array.length(obj["y"]) +let f = obj => obj["x"] + Array.length(obj["y"]) let u = f(a) diff --git a/tests/tests/src/offset.res b/tests/tests/src/offset.res index c6ed1f247b3..98eb315ae4c 100644 --- a/tests/tests/src/offset.res +++ b/tests/tests/src/offset.res @@ -16,7 +16,7 @@ module M = { let x = 0 let x = 1 - module Set = Belt.Set.String + module Set = Stdlib.Set } include M diff --git a/tests/tests/src/option_repr_test.mjs b/tests/tests/src/option_repr_test.mjs index 02163e984e5..5ef9b6b614c 100644 --- a/tests/tests/src/option_repr_test.mjs +++ b/tests/tests/src/option_repr_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.mjs"; @@ -88,12 +88,12 @@ function f12(x) { return x; } -let length_8_id = Belt_List.makeBy(8, x => x); +let length_8_id = Stdlib_List.fromInitializer(8, x => x); -let length_10_id = Belt_List.makeBy(10, x => x); +let length_10_id = Stdlib_List.fromInitializer(10, x => x); function f13$1() { - return Primitive_object.equal(Belt_List.take(length_10_id, 8), { + return Primitive_object.equal(Stdlib_List.take(length_10_id, 8), { hd: 1, tl: { hd: 2, @@ -140,7 +140,7 @@ function neqx(a, b) { } function all_true(xs) { - return Belt_List.every(xs, x => x); + return Stdlib_List.every(xs, x => x); } Mocha.describe("Option_repr_test", () => { @@ -157,7 +157,7 @@ Mocha.describe("Option_repr_test", () => { hd: xs_0, tl: /* [] */0 }; - Test_utils.ok("File \"option_repr_test.res\", line 125, characters 7-14", Belt_List.every(xs, x => x)); + Test_utils.ok("File \"option_repr_test.res\", line 125, characters 7-14", Stdlib_List.every(xs, x => x)); }); Mocha.test("option less than operations", () => { let xs_0 = Primitive_object.lessthan(Primitive_option.some(undefined), 3) && Primitive_object.greaterthan(3, Primitive_option.some(undefined)); @@ -196,7 +196,7 @@ Mocha.describe("Option_repr_test", () => { hd: xs_0, tl: xs_1 }; - Test_utils.ok("File \"option_repr_test.res\", line 130, characters 6-13", Belt_List.every(xs, x => x)); + Test_utils.ok("File \"option_repr_test.res\", line 130, characters 6-13", Stdlib_List.every(xs, x => x)); }); Mocha.test("option equality operations", () => { let xs_1 = { @@ -216,7 +216,7 @@ Mocha.describe("Option_repr_test", () => { hd: true, tl: xs_1 }; - Test_utils.ok("File \"option_repr_test.res\", line 149, characters 6-13", Belt_List.every(xs, x => x)); + Test_utils.ok("File \"option_repr_test.res\", line 149, characters 6-13", Stdlib_List.every(xs, x => x)); }); }); diff --git a/tests/tests/src/option_repr_test.res b/tests/tests/src/option_repr_test.res index 1d27812cea4..9d3cb9eb298 100644 --- a/tests/tests/src/option_repr_test.res +++ b/tests/tests/src/option_repr_test.res @@ -77,10 +77,10 @@ let a = f13(~x=2, ()) let f12 = (x: list<_>) => Some(x) -module N = Belt.List +module N = List -let length_8_id: list = N.makeBy(8, x => x) -let length_10_id: list = N.makeBy(10, x => x) +let length_8_id: list = N.fromInitializer(~length=8, x => x) +let length_10_id: list = N.fromInitializer(~length=10, x => x) type xx<'a> = option<'a> = | None @@ -110,7 +110,7 @@ let gtx = (a, b) => a > b && b < a let eqx = (a, b) => a == b && b == a let neqx = (a, b) => a != b && b != a -let all_true = xs => Belt.List.every(xs, x => x) +let all_true = xs => List.every(xs, x => x) describe(__MODULE__, () => { test("option comparison operations", () => { diff --git a/tests/tests/src/raw_pure_test.mjs b/tests/tests/src/raw_pure_test.mjs index e1a1881c8da..9d102167dad 100644 --- a/tests/tests/src/raw_pure_test.mjs +++ b/tests/tests/src/raw_pure_test.mjs @@ -4,7 +4,7 @@ */ // hello -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let x0 = null; @@ -22,7 +22,7 @@ function f(x) { return x; } -let hh = Belt_List.length; +let hh = Stdlib_List.length; export { x0, diff --git a/tests/tests/src/raw_pure_test.res b/tests/tests/src/raw_pure_test.res index 7f5617c6a74..4dca38755be 100644 --- a/tests/tests/src/raw_pure_test.res +++ b/tests/tests/src/raw_pure_test.res @@ -22,7 +22,7 @@ let x3 = %raw(`/ghoghos/`) `) let f = %raw("/*hello*/ 0 ") -let hh = Belt.List.length +let hh = List.length let f = x => { ignore( %raw("//eslint-disable diff --git a/tests/tests/src/record_extension_test.mjs b/tests/tests/src/record_extension_test.mjs index 8672e74e208..16b6161f820 100644 --- a/tests/tests/src/record_extension_test.mjs +++ b/tests/tests/src/record_extension_test.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Int from "@rescript/belt/src/Belt_Int.mjs"; +import * as Stdlib_Int from "@rescript/runtime/lib/es6/Stdlib_Int.mjs"; import * as Test_utils from "./test_utils.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; @@ -13,7 +13,7 @@ let TuplePayload = /* @__PURE__ */Primitive_exceptions.create("Record_extension_ function f(x) { if (x.RE_EXN_ID === Inline_record) { - let y = Belt_Int.fromString(x.y); + let y = Stdlib_Int.fromString(x.y); if (y !== undefined) { return x.x + y | 0; } else { @@ -21,12 +21,12 @@ function f(x) { } } if (x.RE_EXN_ID === SinglePayload) { - return Belt_Int.fromString(x._1); + return Stdlib_Int.fromString(x._1); } if (x.RE_EXN_ID !== TuplePayload) { return; } - let v1 = Belt_Int.fromString(x._2); + let v1 = Stdlib_Int.fromString(x._2); if (v1 !== undefined) { return x._1 + v1 | 0; } diff --git a/tests/tests/src/record_extension_test.res b/tests/tests/src/record_extension_test.res index ebcd0fba29b..18a11b99222 100644 --- a/tests/tests/src/record_extension_test.res +++ b/tests/tests/src/record_extension_test.res @@ -9,13 +9,13 @@ type t0 += SinglePayload(string) | TuplePayload(int, string) let f = x => switch x { | Inline_record({x, y}) => - switch Belt.Int.fromString(y) { + switch Int.fromString(y) { | Some(y) => Some(x + y) | _ => None } - | SinglePayload(v) => Belt.Int.fromString(v) + | SinglePayload(v) => Int.fromString(v) | TuplePayload(v0, v1) => - switch Belt.Int.fromString(v1) { + switch Int.fromString(v1) { | Some(v1) => Some(v0 + v1) | _ => None } diff --git a/tests/tests/src/recursive_records_test.mjs b/tests/tests/src/recursive_records_test.mjs index 98f3b447b51..088596f1404 100644 --- a/tests/tests/src/recursive_records_test.mjs +++ b/tests/tests/src/recursive_records_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; let rec_cell = {}; @@ -89,9 +89,9 @@ Mocha.describe("Recursive_records_test", () => { Test_utils.eq("File \"recursive_records_test.res\", line 63, characters 7-14", (hd(rec_cell2$1) + hd(tl_exn(rec_cell2$1)) | 0) + hd(tl_exn(tl_exn(rec_cell2$1))) | 0, 9); }); Mocha.test("recursive variant list operations", () => { - Test_utils.eq("File \"recursive_records_test.res\", line 69, characters 7-14", (Belt_List.headExn(rec_cell3) + Belt_List.headExn(Belt_List.tailExn(rec_cell3)) | 0) + Belt_List.headExn(Belt_List.tailExn(Belt_List.tailExn(rec_cell3))) | 0, 9); + Test_utils.eq("File \"recursive_records_test.res\", line 69, characters 7-14", (Stdlib_List.headExn(rec_cell3) + Stdlib_List.headExn(Stdlib_List.tailExn(rec_cell3)) | 0) + Stdlib_List.headExn(Stdlib_List.tailExn(Stdlib_List.tailExn(rec_cell3))) | 0, 9); let rec_cell3$1 = f3(3); - Test_utils.eq("File \"recursive_records_test.res\", line 71, characters 7-14", (Belt_List.headExn(rec_cell3$1) + Belt_List.headExn(Belt_List.tailExn(rec_cell3$1)) | 0) + Belt_List.headExn(Belt_List.tailExn(Belt_List.tailExn(rec_cell3$1))) | 0, 9); + Test_utils.eq("File \"recursive_records_test.res\", line 71, characters 7-14", (Stdlib_List.headExn(rec_cell3$1) + Stdlib_List.headExn(Stdlib_List.tailExn(rec_cell3$1)) | 0) + Stdlib_List.headExn(Stdlib_List.tailExn(Stdlib_List.tailExn(rec_cell3$1))) | 0, 9); }); }); diff --git a/tests/tests/src/recursive_records_test.res b/tests/tests/src/recursive_records_test.res index 9f4a7d7b135..fe70c1784b6 100644 --- a/tests/tests/src/recursive_records_test.res +++ b/tests/tests/src/recursive_records_test.res @@ -64,8 +64,8 @@ describe(__MODULE__, () => { }) test("recursive variant list operations", () => { - let hd = Belt.List.headExn - let tl = Belt.List.tailExn + let hd = List.headExn + let tl = List.tailExn eq(__LOC__, hd(rec_cell3) + hd(tl(rec_cell3)) + hd(tl(tl(rec_cell3))), 9) let rec_cell3 = f3(3) eq(__LOC__, hd(rec_cell3) + hd(tl(rec_cell3)) + hd(tl(tl(rec_cell3))), 9) diff --git a/tests/tests/src/set_gen.mjs b/tests/tests/src/set_gen.mjs index 7f975ad2d83..62e5d2de7e4 100644 --- a/tests/tests/src/set_gen.mjs +++ b/tests/tests/src/set_gen.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; function cons_enum(_s, _e) { @@ -527,7 +527,7 @@ function of_sorted_list(l) { Error: new Error() }; }; - return sub(Belt_List.length(l), l)[0]; + return sub(Stdlib_List.length(l), l)[0]; } function of_sorted_array(l) { diff --git a/tests/tests/src/set_gen.res b/tests/tests/src/set_gen.res index d9c0a898f09..3701a5db8d8 100644 --- a/tests/tests/src/set_gen.res +++ b/tests/tests/src/set_gen.res @@ -451,7 +451,7 @@ let of_sorted_list = l => { } } - fst(sub(Belt.List.length(l), l)) + fst(sub(List.length(l), l)) } let of_sorted_array = l => { @@ -459,27 +459,27 @@ let of_sorted_array = l => { if n == 0 { Empty } else if n == 1 { - let x0 = Belt.Array.getUnsafe(l, start) + let x0 = Array.getUnsafe(l, start) Node(Empty, x0, Empty, 1) } else if n == 2 { - let x0 = Belt.Array.getUnsafe(l, start) - let x1 = Belt.Array.getUnsafe(l, start + 1) + let x0 = Array.getUnsafe(l, start) + let x1 = Array.getUnsafe(l, start + 1) Node(Node(Empty, x0, Empty, 1), x1, Empty, 2) } else if n == 3 { - let x0 = Belt.Array.getUnsafe(l, start) - let x1 = Belt.Array.getUnsafe(l, start + 1) - let x2 = Belt.Array.getUnsafe(l, start + 2) + let x0 = Array.getUnsafe(l, start) + let x1 = Array.getUnsafe(l, start + 1) + let x2 = Array.getUnsafe(l, start + 2) Node(Node(Empty, x0, Empty, 1), x1, Node(Empty, x2, Empty, 1), 2) } else { let nl = n / 2 let left = sub(start, nl, l) let mid = start + nl - let v = Belt.Array.getUnsafe(l, mid) + let v = Array.getUnsafe(l, mid) let right = sub(mid + 1, n - nl - 1, l) create(left, v, right) } - sub(0, Belt.Array.length(l), l) + sub(0, Array.length(l), l) } let is_ordered = (cmp, tree) => { diff --git a/tests/tests/src/side_effect2.mjs b/tests/tests/src/side_effect2.mjs index 294afc61e16..68c19570e01 100644 --- a/tests/tests/src/side_effect2.mjs +++ b/tests/tests/src/side_effect2.mjs @@ -1,8 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; -let a = Belt_Array.map([1], x => x); +let a = [1].map(x => x); export { a, diff --git a/tests/tests/src/side_effect2.res b/tests/tests/src/side_effect2.res index 6d45776b597..8a1ea82ea7f 100644 --- a/tests/tests/src/side_effect2.res +++ b/tests/tests/src/side_effect2.res @@ -1 +1 @@ -let a = Belt.Array.map([1], x => x) +let a = Array.map([1], x => x) diff --git a/tests/tests/src/splice_test.mjs b/tests/tests/src/splice_test.mjs index e828c96ca8f..96351acc4b3 100644 --- a/tests/tests/src/splice_test.mjs +++ b/tests/tests/src/splice_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; let Caml_splice_call = {}; @@ -15,7 +15,7 @@ function f00(a, b) { Mocha.test("splice_test_static", () => { let a = []; a.push(1, 2, 3, 4); - Test_utils.eq("File \"splice_test.res\", line 23, characters 5-12", a, [ + Test_utils.eq("File \"splice_test.res\", line 22, characters 5-12", a, [ 1, 2, 3, @@ -26,7 +26,7 @@ Mocha.test("splice_test_static", () => { function dynamic(arr) { let a = []; a.push(1, ...arr); - Test_utils.eq("File \"splice_test.res\", line 29, characters 5-12", a, Belt_Array.concatMany([ + Test_utils.eq("File \"splice_test.res\", line 28, characters 5-12", a, Stdlib_Array.concatAll([ [1], arr ])); @@ -48,7 +48,7 @@ dynamic([ Mocha.test("splice_test_newArr_static", () => { let a = new Array(1, 2, 3, 4); - Test_utils.eq("File \"splice_test.res\", line 44, characters 5-12", a, [ + Test_utils.eq("File \"splice_test.res\", line 43, characters 5-12", a, [ 1, 2, 3, @@ -58,7 +58,7 @@ Mocha.test("splice_test_newArr_static", () => { function dynamicNew(arr) { let a = new Array(1, 2, ...arr); - Test_utils.eq("File \"splice_test.res\", line 49, characters 5-12", a, Belt_Array.concatMany([ + Test_utils.eq("File \"splice_test.res\", line 48, characters 5-12", a, Stdlib_Array.concatAll([ [ 1, 2 @@ -88,7 +88,7 @@ class Foo { Mocha.test("splice_test_foo_static", () => { let f = new Foo("a", "b", "c"); - Test_utils.eq("File \"splice_test.res\", line 71, characters 5-12", f.names, [ + Test_utils.eq("File \"splice_test.res\", line 70, characters 5-12", f.names, [ "a", "b", "c" @@ -97,7 +97,7 @@ Mocha.test("splice_test_foo_static", () => { function dynamicFoo(arr) { let f = new Foo(...arr); - Test_utils.eq("File \"splice_test.res\", line 76, characters 5-12", f.names, arr); + Test_utils.eq("File \"splice_test.res\", line 75, characters 5-12", f.names, arr); } dynamicFoo([]); @@ -114,7 +114,7 @@ let a = []; a.push(1, 2, 3, 4); -Test_utils.eq("File \"splice_test.res\", line 93, characters 7-14", a, [ +Test_utils.eq("File \"splice_test.res\", line 92, characters 7-14", a, [ 1, 2, 3, @@ -124,7 +124,7 @@ Test_utils.eq("File \"splice_test.res\", line 93, characters 7-14", a, [ function dynamic$1(arr) { let a = []; a.push(1, ...arr); - Test_utils.eq("File \"splice_test.res\", line 99, characters 7-14", a, Belt_Array.concatMany([ + Test_utils.eq("File \"splice_test.res\", line 98, characters 7-14", a, Stdlib_Array.concatAll([ [1], arr ])); @@ -153,9 +153,9 @@ function f1(c) { } Mocha.describe("splice_test.res", () => { - Mocha.test("f1 with [2, 3]", () => Test_utils.eq("File \"splice_test.res\", line 110, characters 34-41", 3, Math.max(1, 2, 3))); - Mocha.test("f1 with empty", () => Test_utils.eq("File \"splice_test.res\", line 111, characters 33-40", 1, Math.max(1))); - Mocha.test("f1 with many values", () => Test_utils.eq("File \"splice_test.res\", line 112, characters 39-46", 5, Math.max(1, 1, 2, 3, 4, 5, 2, 3))); + Mocha.test("f1 with [2, 3]", () => Test_utils.eq("File \"splice_test.res\", line 109, characters 34-41", 3, Math.max(1, 2, 3))); + Mocha.test("f1 with empty", () => Test_utils.eq("File \"splice_test.res\", line 110, characters 33-40", 1, Math.max(1))); + Mocha.test("f1 with many values", () => Test_utils.eq("File \"splice_test.res\", line 111, characters 39-46", 5, Math.max(1, 1, 2, 3, 4, 5, 2, 3))); }); export { diff --git a/tests/tests/src/splice_test.res b/tests/tests/src/splice_test.res index 79ec33af1d4..4f64cfe9442 100644 --- a/tests/tests/src/splice_test.res +++ b/tests/tests/src/splice_test.res @@ -1,6 +1,5 @@ open Mocha open Test_utils -open Belt module Caml_splice_call = {} @variadic @val external f: (int, array) => int = "Math.max" @@ -26,7 +25,7 @@ test("splice_test_static", () => { let dynamic = arr => { let a = [] a->push(1, arr) - eq(__LOC__, a, Array.concatMany([[1], arr])) + eq(__LOC__, a, Array.concatAll([[1], arr])) } dynamic([2, 3, 4]) @@ -46,7 +45,7 @@ test("splice_test_newArr_static", () => { let dynamicNew = arr => { let a = newArr(1, 2, arr) - eq(__LOC__, a, Array.concatMany([[1, 2], arr])) + eq(__LOC__, a, Array.concatAll([[1, 2], arr])) } dynamicNew([3, 4]) @@ -96,7 +95,7 @@ module Pipe = { let dynamic = arr => { let a = [] a->push(1, arr) - eq(__LOC__, a, Array.concatMany([[1], arr])) + eq(__LOC__, a, Array.concatAll([[1], arr])) } dynamic([2, 3, 4]) diff --git a/tests/tests/src/string_set.mjs b/tests/tests/src/string_set.mjs index 7258875071d..1aead4864ec 100644 --- a/tests/tests/src/string_set.mjs +++ b/tests/tests/src/string_set.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Set_gen from "./set_gen.mjs"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; import * as Primitive_string from "@rescript/runtime/lib/es6/Primitive_string.mjs"; function compare_elt(a, b) { @@ -263,7 +263,7 @@ function of_list(l) { let x3 = match$2.hd; if (match$3 !== 0) { if (match$3.tl !== 0) { - return Set_gen.of_sorted_list(Belt_List.sort(l, compare_elt)); + return Set_gen.of_sorted_list(Stdlib_List.sort(l, (a, b) => Primitive_string.compare(a, b) | 0)); } else { return add(match$3.hd, add(x3, add(x2, add(x1, Set_gen.singleton(x0))))); } @@ -273,7 +273,7 @@ function of_list(l) { } function of_array(l) { - return Belt_Array.reduceReverse(l, Set_gen.empty, (acc, x) => add(x, acc)); + return Stdlib_Array.reduceRight(l, Set_gen.empty, (acc, x) => add(x, acc)); } function invariant(t) { diff --git a/tests/tests/src/string_set.res b/tests/tests/src/string_set.res index 6804a07abd2..43e592a7edc 100644 --- a/tests/tests/src/string_set.res +++ b/tests/tests/src/string_set.res @@ -192,10 +192,10 @@ let of_list = l => | list{x0, x1, x2} => add(x2, add(x1, singleton(x0))) | list{x0, x1, x2, x3} => add(x3, add(x2, add(x1, singleton(x0)))) | list{x0, x1, x2, x3, x4} => add(x4, add(x3, add(x2, add(x1, singleton(x0))))) - | _ => of_sorted_list(l->Belt.List.sort(compare_elt)) + | _ => of_sorted_list(l->List.sort((a, b) => compare_elt(a, b)->Int.toFloat)) } -let of_array = l => l->Belt.Array.reduceReverse(empty, (acc, x) => add(x, acc)) +let of_array = l => l->Array.reduceRight(empty, (acc, x) => add(x, acc)) /* also check order */ let invariant = t => { diff --git a/tests/tests/src/tailcall_inline_test.mjs b/tests/tests/src/tailcall_inline_test.mjs index fb3a797eda4..52e0888949f 100644 --- a/tests/tests/src/tailcall_inline_test.mjs +++ b/tests/tests/src/tailcall_inline_test.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE import * as Mocha from "mocha"; -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; import * as Test_utils from "./test_utils.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function f() { let f$1 = (_acc, _n) => { @@ -17,7 +17,7 @@ function f() { continue; }; }; - let v = Belt_Array.make(10, 0); + let v = Stdlib_Array.make(10, 0); for (let i = 0; i <= 9; ++i) { v[i] = f$1(0, i); } diff --git a/tests/tests/src/tailcall_inline_test.res b/tests/tests/src/tailcall_inline_test.res index 9c73d7ab80a..7f31d3b79ce 100644 --- a/tests/tests/src/tailcall_inline_test.res +++ b/tests/tests/src/tailcall_inline_test.res @@ -6,7 +6,7 @@ let f = () => { acc } let len = 10 - let v = Belt.Array.make(len, 0) + let v = Array.make(~length=len, 0) for i in 0 to len - 1 { v[i] = f(0, i) } diff --git a/tests/tests/src/test_ari.mjs b/tests/tests/src/test_ari.mjs index 6360448af81..64f2fa23b66 100644 --- a/tests/tests/src/test_ari.mjs +++ b/tests/tests/src/test_ari.mjs @@ -2,7 +2,7 @@ import * as U from "U"; import * as VV from "VV"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function f(x, y) { return x + y | 0; @@ -41,187 +41,125 @@ function length_aux(_len, _x) { }; } -let length = Belt_List.length; +let length = Stdlib_List.length; -let size = Belt_List.size; +let size = Stdlib_List.size; -let head = Belt_List.head; +let head = Stdlib_List.head; -let headExn = Belt_List.headExn; +let headExn = Stdlib_List.headExn; -let headOrThrow = Belt_List.headOrThrow; +let headOrThrow = Stdlib_List.headOrThrow; -let tail = Belt_List.tail; +let tail = Stdlib_List.tail; -let tailExn = Belt_List.tailExn; +let tailExn = Stdlib_List.tailExn; -let tailOrThrow = Belt_List.tailOrThrow; +let tailOrThrow = Stdlib_List.tailOrThrow; -let add = Belt_List.add; +let add = Stdlib_List.add; -let get = Belt_List.get; +let get = Stdlib_List.get; -let getExn = Belt_List.getExn; +let getExn = Stdlib_List.getExn; -let getOrThrow = Belt_List.getOrThrow; +let getOrThrow = Stdlib_List.getOrThrow; -let make = Belt_List.make; +let make = Stdlib_List.make; -let makeByU = Belt_List.makeByU; +let fromInitializer = Stdlib_List.fromInitializer; -let makeBy = Belt_List.makeBy; +let shuffle = Stdlib_List.shuffle; -let shuffle = Belt_List.shuffle; +let toShuffled = Stdlib_List.toShuffled; -let drop = Belt_List.drop; +let drop = Stdlib_List.drop; -let take = Belt_List.take; +let take = Stdlib_List.take; -let splitAt = Belt_List.splitAt; +let splitAt = Stdlib_List.splitAt; -let concat = Belt_List.concat; +let concat = Stdlib_List.concat; -let concatMany = Belt_List.concatMany; +let concatMany = Stdlib_List.concatMany; -let reverseConcat = Belt_List.reverseConcat; +let reverseConcat = Stdlib_List.reverseConcat; -let flatten = Belt_List.flatten; +let flat = Stdlib_List.flat; -let mapU = Belt_List.mapU; +let map = Stdlib_List.map; -let map = Belt_List.map; +let zip = Stdlib_List.zip; -let zip = Belt_List.zip; +let zipBy = Stdlib_List.zipBy; -let zipByU = Belt_List.zipByU; +let mapWithIndex = Stdlib_List.mapWithIndex; -let zipBy = Belt_List.zipBy; +let fromArray = Stdlib_List.fromArray; -let mapWithIndexU = Belt_List.mapWithIndexU; +let toArray = Stdlib_List.toArray; -let mapWithIndex = Belt_List.mapWithIndex; +let reverse = Stdlib_List.reverse; -let fromArray = Belt_List.fromArray; +let mapReverse = Stdlib_List.mapReverse; -let toArray = Belt_List.toArray; +let forEach = Stdlib_List.forEach; -let reverse = Belt_List.reverse; +let forEachWithIndex = Stdlib_List.forEachWithIndex; -let mapReverseU = Belt_List.mapReverseU; +let reduce = Stdlib_List.reduce; -let mapReverse = Belt_List.mapReverse; +let reduceWithIndex = Stdlib_List.reduceWithIndex; -let forEachU = Belt_List.forEachU; +let reduceReverse = Stdlib_List.reduceReverse; -let forEach = Belt_List.forEach; +let mapReverse2 = Stdlib_List.mapReverse2; -let forEachWithIndexU = Belt_List.forEachWithIndexU; +let forEach2 = Stdlib_List.forEach2; -let forEachWithIndex = Belt_List.forEachWithIndex; +let reduce2 = Stdlib_List.reduce2; -let reduceU = Belt_List.reduceU; +let reduceReverse2 = Stdlib_List.reduceReverse2; -let reduce = Belt_List.reduce; +let every = Stdlib_List.every; -let reduceWithIndexU = Belt_List.reduceWithIndexU; +let some = Stdlib_List.some; -let reduceWithIndex = Belt_List.reduceWithIndex; +let every2 = Stdlib_List.every2; -let reduceReverseU = Belt_List.reduceReverseU; +let some2 = Stdlib_List.some2; -let reduceReverse = Belt_List.reduceReverse; +let compareLength = Stdlib_List.compareLength; -let mapReverse2U = Belt_List.mapReverse2U; +let compare = Stdlib_List.compare; -let mapReverse2 = Belt_List.mapReverse2; +let equal = Stdlib_List.equal; -let forEach2U = Belt_List.forEach2U; +let has = Stdlib_List.has; -let forEach2 = Belt_List.forEach2; +let includes = Stdlib_List.includes; -let reduce2U = Belt_List.reduce2U; +let find = Stdlib_List.find; -let reduce2 = Belt_List.reduce2; +let filter = Stdlib_List.filter; -let reduceReverse2U = Belt_List.reduceReverse2U; +let filterWithIndex = Stdlib_List.filterWithIndex; -let reduceReverse2 = Belt_List.reduceReverse2; +let filterMap = Stdlib_List.filterMap; -let everyU = Belt_List.everyU; +let partition = Stdlib_List.partition; -let every = Belt_List.every; +let unzip = Stdlib_List.unzip; -let someU = Belt_List.someU; +let getAssoc = Stdlib_List.getAssoc; -let some = Belt_List.some; +let hasAssoc = Stdlib_List.hasAssoc; -let every2U = Belt_List.every2U; +let removeAssoc = Stdlib_List.removeAssoc; -let every2 = Belt_List.every2; +let setAssoc = Stdlib_List.setAssoc; -let some2U = Belt_List.some2U; - -let some2 = Belt_List.some2; - -let cmpByLength = Belt_List.cmpByLength; - -let cmpU = Belt_List.cmpU; - -let cmp = Belt_List.cmp; - -let eqU = Belt_List.eqU; - -let eq = Belt_List.eq; - -let hasU = Belt_List.hasU; - -let has = Belt_List.has; - -let getByU = Belt_List.getByU; - -let getBy = Belt_List.getBy; - -let keepU = Belt_List.keepU; - -let keep = Belt_List.keep; - -let filter = Belt_List.filter; - -let keepWithIndexU = Belt_List.keepWithIndexU; - -let keepWithIndex = Belt_List.keepWithIndex; - -let filterWithIndex = Belt_List.filterWithIndex; - -let keepMapU = Belt_List.keepMapU; - -let keepMap = Belt_List.keepMap; - -let partitionU = Belt_List.partitionU; - -let partition = Belt_List.partition; - -let unzip = Belt_List.unzip; - -let getAssocU = Belt_List.getAssocU; - -let getAssoc = Belt_List.getAssoc; - -let hasAssocU = Belt_List.hasAssocU; - -let hasAssoc = Belt_List.hasAssoc; - -let removeAssocU = Belt_List.removeAssocU; - -let removeAssoc = Belt_List.removeAssoc; - -let setAssocU = Belt_List.setAssocU; - -let setAssoc = Belt_List.setAssoc; - -let sortU = Belt_List.sortU; - -let sort = Belt_List.sort; +let sort = Stdlib_List.sort; export { f, @@ -245,83 +183,52 @@ export { getExn, getOrThrow, make, - makeByU, - makeBy, + fromInitializer, shuffle, + toShuffled, drop, take, splitAt, concat, concatMany, reverseConcat, - flatten, - mapU, + flat, map, zip, - zipByU, zipBy, - mapWithIndexU, mapWithIndex, fromArray, toArray, reverse, - mapReverseU, mapReverse, - forEachU, forEach, - forEachWithIndexU, forEachWithIndex, - reduceU, reduce, - reduceWithIndexU, reduceWithIndex, - reduceReverseU, reduceReverse, - mapReverse2U, mapReverse2, - forEach2U, forEach2, - reduce2U, reduce2, - reduceReverse2U, reduceReverse2, - everyU, every, - someU, some, - every2U, every2, - some2U, some2, - cmpByLength, - cmpU, - cmp, - eqU, - eq, - hasU, + compareLength, + compare, + equal, has, - getByU, - getBy, - keepU, - keep, + includes, + find, filter, - keepWithIndexU, - keepWithIndex, filterWithIndex, - keepMapU, - keepMap, - partitionU, + filterMap, partition, unzip, - getAssocU, getAssoc, - hasAssocU, hasAssoc, - removeAssocU, removeAssoc, - setAssocU, setAssoc, - sortU, sort, } /* fff Not a pure module */ diff --git a/tests/tests/src/test_ari.res b/tests/tests/src/test_ari.res index 8d970ef3019..6fbf8ef5410 100644 --- a/tests/tests/src/test_ari.res +++ b/tests/tests/src/test_ari.res @@ -31,4 +31,4 @@ let rec length_aux = (len, x) => | list{a, ...l} => length_aux(len + 1, l) } -include Belt.List +include List diff --git a/tests/tests/src/test_array_append.mjs b/tests/tests/src/test_array_append.mjs index 970cd99738b..df0687ae042 100644 --- a/tests/tests/src/test_array_append.mjs +++ b/tests/tests/src/test_array_append.mjs @@ -1,11 +1,10 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; -let const_v = Belt_Array.concat([ +let const_v = [ 1, 2 -], [3]); +].concat([3]); export { const_v, diff --git a/tests/tests/src/test_array_append.res b/tests/tests/src/test_array_append.res index e48887f99a9..b37df5118e0 100644 --- a/tests/tests/src/test_array_append.res +++ b/tests/tests/src/test_array_append.res @@ -1 +1 @@ -let const_v = Belt.Array.concat([1, 2], [3]) +let const_v = Array.concat([1, 2], [3]) diff --git a/tests/tests/src/test_bool_equal.res b/tests/tests/src/test_bool_equal.res index 304644a39ae..5264d2073f7 100644 --- a/tests/tests/src/test_bool_equal.res +++ b/tests/tests/src/test_bool_equal.res @@ -70,14 +70,14 @@ let f6 = x => } let f7 = x => - if Belt.Array.length(x) > 0 { + if Array.length(x) > 0 { 1 } else { 2 } let f8 = x => - if Belt.Array.length(x) >= 0 { + if Array.length(x) >= 0 { 1 } else { 2 diff --git a/tests/tests/src/test_closure.mjs b/tests/tests/src/test_closure.mjs index a0b7605d2b4..eefaa61d4f2 100644 --- a/tests/tests/src/test_closure.mjs +++ b/tests/tests/src/test_closure.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; let v = { contents: 0 }; function f() { - let arr = Belt_Array.make(10, param => {}); + let arr = Stdlib_Array.make(10, param => {}); for (let i = 0; i <= 9; ++i) { arr[i] = param => { v.contents = v.contents + i | 0; @@ -18,7 +18,7 @@ function f() { let u = f(); -Belt_Array.forEach(u, x => x()); +u.forEach(x => x()); if (v.contents !== 45) { throw { diff --git a/tests/tests/src/test_closure.res b/tests/tests/src/test_closure.res index 240102d95eb..7976bc34028 100644 --- a/tests/tests/src/test_closure.res +++ b/tests/tests/src/test_closure.res @@ -39,7 +39,7 @@ This means inline is tricky in javascript, here we try to inline [_loop]? */ let f = () => { let n = 10 - let arr = Belt.Array.make(10, _ => ()) + let arr = Array.make(~length=10, _ => ()) for i in 0 to n - 1 { arr[i] = _ => v := v.contents + i } @@ -48,6 +48,6 @@ let f = () => { let () = { let u = f() - u->Belt.Array.forEach(x => x()) + u->Array.forEach(x => x()) assert(v.contents == 45) } diff --git a/tests/tests/src/test_cps.mjs b/tests/tests/src/test_cps.mjs index 919b39aaf94..877ee495e3a 100644 --- a/tests/tests/src/test_cps.mjs +++ b/tests/tests/src/test_cps.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function f(_n, _acc) { while (true) { @@ -19,7 +19,7 @@ function f(_n, _acc) { } function test_closure() { - let arr = Belt_Array.make(6, x => x); + let arr = Stdlib_Array.make(6, x => x); for (let i = 0; i <= 6; ++i) { arr[i] = param => i; } diff --git a/tests/tests/src/test_cps.res b/tests/tests/src/test_cps.res index 5f0dc482709..0ad655c14bc 100644 --- a/tests/tests/src/test_cps.res +++ b/tests/tests/src/test_cps.res @@ -90,7 +90,7 @@ let rec f = (n, acc) => */ let test_closure = () => { let n = 6 - let arr = Belt.Array.make(n, x => x) + let arr = Array.make(~length=n, x => x) for i in 0 to n { arr[i] = _ => i } diff --git a/tests/tests/src/test_demo.mjs b/tests/tests/src/test_demo.mjs index 108f652c511..948ecd410a1 100644 --- a/tests/tests/src/test_demo.mjs +++ b/tests/tests/src/test_demo.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function fib(x) { if (x !== 2 && x !== 1) { @@ -63,7 +63,7 @@ function v(extra) { let nil = "Nil"; -let len = Belt_List.length; +let len = Stdlib_List.length; export { fib, diff --git a/tests/tests/src/test_demo.res b/tests/tests/src/test_demo.res index 2783d1a94e0..5da073c69a8 100644 --- a/tests/tests/src/test_demo.res +++ b/tests/tests/src/test_demo.res @@ -26,7 +26,7 @@ let sum = n => { v.contents } -let len = Belt.List.length +let len = List.length let f = (g, x) => { let u = switch g(x) { diff --git a/tests/tests/src/test_for_loop.mjs b/tests/tests/src/test_for_loop.mjs index 5fece155b1a..4ec5550047d 100644 --- a/tests/tests/src/test_for_loop.mjs +++ b/tests/tests/src/test_for_loop.mjs @@ -1,6 +1,5 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; function for_(x) { for (let i = 0, i_finish = (console.log("hi"), x.length); i <= i_finish; ++i) { @@ -18,14 +17,14 @@ function for_3(x) { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); arr[i] = () => { v.contents = v.contents + j | 0; }; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; } @@ -33,7 +32,7 @@ function for_4(x) { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let j = (i << 1); let k = (j << 1); @@ -41,7 +40,7 @@ function for_4(x) { v.contents = v.contents + k | 0; }; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; } @@ -49,14 +48,14 @@ function for_5(x, u) { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); for (let i = 0, i_finish = x.length; i <= i_finish; ++i) { let k = (u << 1) * u | 0; arr[i] = () => { v.contents = v.contents + k | 0; }; } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; } @@ -64,7 +63,7 @@ function for_6(x, u) { let v = { contents: 0 }; - let arr = Belt_Array.map(x, param => (() => {})); + let arr = x.map(param => (() => {})); let v4 = { contents: 0 }; @@ -86,7 +85,7 @@ function for_6(x, u) { }; } } - Belt_Array.forEach(arr, x => x()); + arr.forEach(x => x()); return v.contents; } diff --git a/tests/tests/src/test_for_loop.res b/tests/tests/src/test_for_loop.res index 7f17eada1f5..a30681c48f6 100644 --- a/tests/tests/src/test_for_loop.res +++ b/tests/tests/src/test_for_loop.res @@ -2,54 +2,54 @@ let for_ = x => for i in 0 to { Console.log("hi") ignore(3) - Belt.Array.length(x) + Array.length(x) } { Console.log(x[i]) } let for_2 = x => - for i in 0 to Belt.Array.length(x) { + for i in 0 to Array.length(x) { Console.log(x[i]) } let for_3 = x => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) - for i in 0 to Belt.Array.length(x) { + let arr = x->Array.map(_ => _ => ()) + for i in 0 to Array.length(x) { let j = i * 2 arr[i] = _ => v := v.contents + j } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } let for_4 = x => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) - for i in 0 to Belt.Array.length(x) { + let arr = x->Array.map(_ => _ => ()) + for i in 0 to Array.length(x) { let j = i * 2 let k = 2 * j arr[i] = _ => v := v.contents + k } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } let for_5 = (x, u) => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) - for i in 0 to Belt.Array.length(x) { + let arr = x->Array.map(_ => _ => ()) + for i in 0 to Array.length(x) { let _j = i * 2 let k = 2 * u * u arr[i] = _ => v := v.contents + k } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } let for_6 = (x, u) => { let v = ref(0) - let arr = x->Belt.Array.map(_ => _ => ()) + let arr = x->Array.map(_ => _ => ()) let v4 = ref(0) let v5 = ref(0) incr(v4) @@ -57,7 +57,7 @@ let for_6 = (x, u) => { incr(v5) let v2 = ref(0) let v3 = u - for i in 0 to Belt.Array.length(x) { + for i in 0 to Array.length(x) { let _j = i * 2 let k = 2 * u * u let h = 2 * v5.contents @@ -65,6 +65,6 @@ let for_6 = (x, u) => { arr[i] = _ => v := v.contents + k + v2.contents + v3 + v4.contents + v5.contents + h } } - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents } diff --git a/tests/tests/src/test_functor_dead_code.mjs b/tests/tests/src/test_functor_dead_code.mjs index 9b187d675eb..b31d05f067f 100644 --- a/tests/tests/src/test_functor_dead_code.mjs +++ b/tests/tests/src/test_functor_dead_code.mjs @@ -1,8 +1,8 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_MapString from "@rescript/belt/src/Belt_MapString.mjs"; +import * as Stdlib_Map from "@rescript/runtime/lib/es6/Stdlib_Map.mjs"; -let v = Belt_MapString.isEmpty(undefined); +let v = Stdlib_Map.isEmpty(new Map()); export { v, diff --git a/tests/tests/src/test_functor_dead_code.res b/tests/tests/src/test_functor_dead_code.res index 70ccee01c5b..22432c9a52d 100644 --- a/tests/tests/src/test_functor_dead_code.res +++ b/tests/tests/src/test_functor_dead_code.res @@ -1,7 +1,7 @@ include ( { - module M = Belt.Map.String - let v = M.isEmpty(M.empty) + module M = Map + let v = M.isEmpty(M.make()) }: { let v: bool } diff --git a/tests/tests/src/test_google_closure.mjs b/tests/tests/src/test_google_closure.mjs index 6775a67e986..bbe794b0526 100644 --- a/tests/tests/src/test_google_closure.mjs +++ b/tests/tests/src/test_google_closure.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; function f(a, b, param) { return a + b | 0; @@ -18,7 +18,7 @@ function f3(extra) { let b = f3(2); -let arr = Belt_Array.init(2, param => 0); +let arr = Stdlib_Array.fromInitializer(2, param => 0); for (let i = 0; i <= 1; ++i) { let f3$1 = extra => i + 1 | 0; diff --git a/tests/tests/src/test_google_closure.res b/tests/tests/src/test_google_closure.res index 3884927cdd4..ad4063412e2 100644 --- a/tests/tests/src/test_google_closure.res +++ b/tests/tests/src/test_google_closure.res @@ -9,7 +9,7 @@ let (a, b, c) = ( f3(2) }, { - let arr = Belt.Array.init(2, _ => 0) + let arr = Array.fromInitializer(~length=2, _ => 0) for i in 0 to 1 { let f3 = f2(i) arr[i] = f3(2) diff --git a/tests/tests/src/test_include.mjs b/tests/tests/src/test_include.mjs index e17c0edeb6a..54748ab8254 100644 --- a/tests/tests/src/test_include.mjs +++ b/tests/tests/src/test_include.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Test_order from "./test_order.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function Make(U) { return { @@ -15,7 +15,7 @@ let U = { let N; -let v = Belt_List.length; +let v = Stdlib_List.length; let N0; @@ -31,187 +31,125 @@ let N5; let N6; -let length = Belt_List.length; +let length = Stdlib_List.length; -let size = Belt_List.size; +let size = Stdlib_List.size; -let head = Belt_List.head; +let head = Stdlib_List.head; -let headExn = Belt_List.headExn; +let headExn = Stdlib_List.headExn; -let headOrThrow = Belt_List.headOrThrow; +let headOrThrow = Stdlib_List.headOrThrow; -let tail = Belt_List.tail; +let tail = Stdlib_List.tail; -let tailExn = Belt_List.tailExn; +let tailExn = Stdlib_List.tailExn; -let tailOrThrow = Belt_List.tailOrThrow; +let tailOrThrow = Stdlib_List.tailOrThrow; -let add = Belt_List.add; +let add = Stdlib_List.add; -let get = Belt_List.get; +let get = Stdlib_List.get; -let getExn = Belt_List.getExn; +let getExn = Stdlib_List.getExn; -let getOrThrow = Belt_List.getOrThrow; +let getOrThrow = Stdlib_List.getOrThrow; -let make = Belt_List.make; +let make = Stdlib_List.make; -let makeByU = Belt_List.makeByU; +let fromInitializer = Stdlib_List.fromInitializer; -let makeBy = Belt_List.makeBy; +let shuffle = Stdlib_List.shuffle; -let shuffle = Belt_List.shuffle; +let toShuffled = Stdlib_List.toShuffled; -let drop = Belt_List.drop; +let drop = Stdlib_List.drop; -let take = Belt_List.take; +let take = Stdlib_List.take; -let splitAt = Belt_List.splitAt; +let splitAt = Stdlib_List.splitAt; -let concat = Belt_List.concat; +let concat = Stdlib_List.concat; -let concatMany = Belt_List.concatMany; +let concatMany = Stdlib_List.concatMany; -let reverseConcat = Belt_List.reverseConcat; +let reverseConcat = Stdlib_List.reverseConcat; -let flatten = Belt_List.flatten; +let flat = Stdlib_List.flat; -let mapU = Belt_List.mapU; +let map = Stdlib_List.map; -let map = Belt_List.map; +let zip = Stdlib_List.zip; -let zip = Belt_List.zip; +let zipBy = Stdlib_List.zipBy; -let zipByU = Belt_List.zipByU; +let mapWithIndex = Stdlib_List.mapWithIndex; -let zipBy = Belt_List.zipBy; +let fromArray = Stdlib_List.fromArray; -let mapWithIndexU = Belt_List.mapWithIndexU; +let toArray = Stdlib_List.toArray; -let mapWithIndex = Belt_List.mapWithIndex; +let reverse = Stdlib_List.reverse; -let fromArray = Belt_List.fromArray; +let mapReverse = Stdlib_List.mapReverse; -let toArray = Belt_List.toArray; +let forEach = Stdlib_List.forEach; -let reverse = Belt_List.reverse; +let forEachWithIndex = Stdlib_List.forEachWithIndex; -let mapReverseU = Belt_List.mapReverseU; +let reduce = Stdlib_List.reduce; -let mapReverse = Belt_List.mapReverse; +let reduceWithIndex = Stdlib_List.reduceWithIndex; -let forEachU = Belt_List.forEachU; +let reduceReverse = Stdlib_List.reduceReverse; -let forEach = Belt_List.forEach; +let mapReverse2 = Stdlib_List.mapReverse2; -let forEachWithIndexU = Belt_List.forEachWithIndexU; +let forEach2 = Stdlib_List.forEach2; -let forEachWithIndex = Belt_List.forEachWithIndex; +let reduce2 = Stdlib_List.reduce2; -let reduceU = Belt_List.reduceU; +let reduceReverse2 = Stdlib_List.reduceReverse2; -let reduce = Belt_List.reduce; +let every = Stdlib_List.every; -let reduceWithIndexU = Belt_List.reduceWithIndexU; +let some = Stdlib_List.some; -let reduceWithIndex = Belt_List.reduceWithIndex; +let every2 = Stdlib_List.every2; -let reduceReverseU = Belt_List.reduceReverseU; +let some2 = Stdlib_List.some2; -let reduceReverse = Belt_List.reduceReverse; +let compareLength = Stdlib_List.compareLength; -let mapReverse2U = Belt_List.mapReverse2U; +let compare = Stdlib_List.compare; -let mapReverse2 = Belt_List.mapReverse2; +let equal = Stdlib_List.equal; -let forEach2U = Belt_List.forEach2U; +let has = Stdlib_List.has; -let forEach2 = Belt_List.forEach2; +let includes = Stdlib_List.includes; -let reduce2U = Belt_List.reduce2U; +let find = Stdlib_List.find; -let reduce2 = Belt_List.reduce2; +let filter = Stdlib_List.filter; -let reduceReverse2U = Belt_List.reduceReverse2U; +let filterWithIndex = Stdlib_List.filterWithIndex; -let reduceReverse2 = Belt_List.reduceReverse2; +let filterMap = Stdlib_List.filterMap; -let everyU = Belt_List.everyU; +let partition = Stdlib_List.partition; -let every = Belt_List.every; +let unzip = Stdlib_List.unzip; -let someU = Belt_List.someU; +let getAssoc = Stdlib_List.getAssoc; -let some = Belt_List.some; +let hasAssoc = Stdlib_List.hasAssoc; -let every2U = Belt_List.every2U; +let removeAssoc = Stdlib_List.removeAssoc; -let every2 = Belt_List.every2; +let setAssoc = Stdlib_List.setAssoc; -let some2U = Belt_List.some2U; - -let some2 = Belt_List.some2; - -let cmpByLength = Belt_List.cmpByLength; - -let cmpU = Belt_List.cmpU; - -let cmp = Belt_List.cmp; - -let eqU = Belt_List.eqU; - -let eq = Belt_List.eq; - -let hasU = Belt_List.hasU; - -let has = Belt_List.has; - -let getByU = Belt_List.getByU; - -let getBy = Belt_List.getBy; - -let keepU = Belt_List.keepU; - -let keep = Belt_List.keep; - -let filter = Belt_List.filter; - -let keepWithIndexU = Belt_List.keepWithIndexU; - -let keepWithIndex = Belt_List.keepWithIndex; - -let filterWithIndex = Belt_List.filterWithIndex; - -let keepMapU = Belt_List.keepMapU; - -let keepMap = Belt_List.keepMap; - -let partitionU = Belt_List.partitionU; - -let partition = Belt_List.partition; - -let unzip = Belt_List.unzip; - -let getAssocU = Belt_List.getAssocU; - -let getAssoc = Belt_List.getAssoc; - -let hasAssocU = Belt_List.hasAssocU; - -let hasAssoc = Belt_List.hasAssoc; - -let removeAssocU = Belt_List.removeAssocU; - -let removeAssoc = Belt_List.removeAssoc; - -let setAssocU = Belt_List.setAssocU; - -let setAssoc = Belt_List.setAssoc; - -let sortU = Belt_List.sortU; - -let sort = Belt_List.sort; +let sort = Stdlib_List.sort; export { N, @@ -238,83 +176,52 @@ export { getExn, getOrThrow, make, - makeByU, - makeBy, + fromInitializer, shuffle, + toShuffled, drop, take, splitAt, concat, concatMany, reverseConcat, - flatten, - mapU, + flat, map, zip, - zipByU, zipBy, - mapWithIndexU, mapWithIndex, fromArray, toArray, reverse, - mapReverseU, mapReverse, - forEachU, forEach, - forEachWithIndexU, forEachWithIndex, - reduceU, reduce, - reduceWithIndexU, reduceWithIndex, - reduceReverseU, reduceReverse, - mapReverse2U, mapReverse2, - forEach2U, forEach2, - reduce2U, reduce2, - reduceReverse2U, reduceReverse2, - everyU, every, - someU, some, - every2U, every2, - some2U, some2, - cmpByLength, - cmpU, - cmp, - eqU, - eq, - hasU, + compareLength, + compare, + equal, has, - getByU, - getBy, - keepU, - keep, + includes, + find, filter, - keepWithIndexU, - keepWithIndex, filterWithIndex, - keepMapU, - keepMap, - partitionU, + filterMap, partition, unzip, - getAssocU, getAssoc, - hasAssocU, hasAssoc, - removeAssocU, removeAssoc, - setAssocU, setAssoc, - sortU, sort, } /* No side effect */ diff --git a/tests/tests/src/test_include.res b/tests/tests/src/test_include.res index 632975fee3b..3bdef8ee995 100644 --- a/tests/tests/src/test_include.res +++ b/tests/tests/src/test_include.res @@ -1,6 +1,4 @@ -open Belt - -module N = Belt.List +module N = List let v = N.length module type OrderedType = { diff --git a/tests/tests/src/test_list.mjs b/tests/tests/src/test_list.mjs index 39b01c89aed..f0ebcad40e9 100644 --- a/tests/tests/src/test_list.mjs +++ b/tests/tests/src/test_list.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function length_aux(_len, _x) { while (true) { @@ -1407,7 +1407,7 @@ function isEmpty2(x) { return x === /* [] */0; } -let u = Belt_List.length; +let u = Stdlib_List.length; let append = Pervasives.$at; diff --git a/tests/tests/src/test_list.res b/tests/tests/src/test_list.res index 8de56dbec6b..47adfae7cc4 100644 --- a/tests/tests/src/test_list.res +++ b/tests/tests/src/test_list.res @@ -13,7 +13,7 @@ /* List operations */ -let u = Belt.List.length +let u = List.length let rec length_aux = (len, x) => switch x { | list{} => len diff --git a/tests/tests/src/test_pervasive.mjs b/tests/tests/src/test_pervasive.mjs index 65092465dc8..0014f94443b 100644 --- a/tests/tests/src/test_pervasive.mjs +++ b/tests/tests/src/test_pervasive.mjs @@ -1,100 +1,68 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let Pervasives$1 = { - length: Belt_List.length, - size: Belt_List.size, - head: Belt_List.head, - headExn: Belt_List.headExn, - headOrThrow: Belt_List.headOrThrow, - tail: Belt_List.tail, - tailExn: Belt_List.tailExn, - tailOrThrow: Belt_List.tailOrThrow, - add: Belt_List.add, - get: Belt_List.get, - getExn: Belt_List.getExn, - getOrThrow: Belt_List.getOrThrow, - make: Belt_List.make, - makeByU: Belt_List.makeByU, - makeBy: Belt_List.makeBy, - shuffle: Belt_List.shuffle, - drop: Belt_List.drop, - take: Belt_List.take, - splitAt: Belt_List.splitAt, - concat: Belt_List.concat, - concatMany: Belt_List.concatMany, - reverseConcat: Belt_List.reverseConcat, - flatten: Belt_List.flatten, - mapU: Belt_List.mapU, - map: Belt_List.map, - zip: Belt_List.zip, - zipByU: Belt_List.zipByU, - zipBy: Belt_List.zipBy, - mapWithIndexU: Belt_List.mapWithIndexU, - mapWithIndex: Belt_List.mapWithIndex, - fromArray: Belt_List.fromArray, - toArray: Belt_List.toArray, - reverse: Belt_List.reverse, - mapReverseU: Belt_List.mapReverseU, - mapReverse: Belt_List.mapReverse, - forEachU: Belt_List.forEachU, - forEach: Belt_List.forEach, - forEachWithIndexU: Belt_List.forEachWithIndexU, - forEachWithIndex: Belt_List.forEachWithIndex, - reduceU: Belt_List.reduceU, - reduce: Belt_List.reduce, - reduceWithIndexU: Belt_List.reduceWithIndexU, - reduceWithIndex: Belt_List.reduceWithIndex, - reduceReverseU: Belt_List.reduceReverseU, - reduceReverse: Belt_List.reduceReverse, - mapReverse2U: Belt_List.mapReverse2U, - mapReverse2: Belt_List.mapReverse2, - forEach2U: Belt_List.forEach2U, - forEach2: Belt_List.forEach2, - reduce2U: Belt_List.reduce2U, - reduce2: Belt_List.reduce2, - reduceReverse2U: Belt_List.reduceReverse2U, - reduceReverse2: Belt_List.reduceReverse2, - everyU: Belt_List.everyU, - every: Belt_List.every, - someU: Belt_List.someU, - some: Belt_List.some, - every2U: Belt_List.every2U, - every2: Belt_List.every2, - some2U: Belt_List.some2U, - some2: Belt_List.some2, - cmpByLength: Belt_List.cmpByLength, - cmpU: Belt_List.cmpU, - cmp: Belt_List.cmp, - eqU: Belt_List.eqU, - eq: Belt_List.eq, - hasU: Belt_List.hasU, - has: Belt_List.has, - getByU: Belt_List.getByU, - getBy: Belt_List.getBy, - keepU: Belt_List.keepU, - keep: Belt_List.keep, - filter: Belt_List.filter, - keepWithIndexU: Belt_List.keepWithIndexU, - keepWithIndex: Belt_List.keepWithIndex, - filterWithIndex: Belt_List.filterWithIndex, - keepMapU: Belt_List.keepMapU, - keepMap: Belt_List.keepMap, - partitionU: Belt_List.partitionU, - partition: Belt_List.partition, - unzip: Belt_List.unzip, - getAssocU: Belt_List.getAssocU, - getAssoc: Belt_List.getAssoc, - hasAssocU: Belt_List.hasAssocU, - hasAssoc: Belt_List.hasAssoc, - removeAssocU: Belt_List.removeAssocU, - removeAssoc: Belt_List.removeAssoc, - setAssocU: Belt_List.setAssocU, - setAssoc: Belt_List.setAssoc, - sortU: Belt_List.sortU, - sort: Belt_List.sort, + length: Stdlib_List.length, + size: Stdlib_List.size, + head: Stdlib_List.head, + headExn: Stdlib_List.headExn, + headOrThrow: Stdlib_List.headOrThrow, + tail: Stdlib_List.tail, + tailExn: Stdlib_List.tailExn, + tailOrThrow: Stdlib_List.tailOrThrow, + add: Stdlib_List.add, + get: Stdlib_List.get, + getExn: Stdlib_List.getExn, + getOrThrow: Stdlib_List.getOrThrow, + make: Stdlib_List.make, + fromInitializer: Stdlib_List.fromInitializer, + shuffle: Stdlib_List.shuffle, + toShuffled: Stdlib_List.toShuffled, + drop: Stdlib_List.drop, + take: Stdlib_List.take, + splitAt: Stdlib_List.splitAt, + concat: Stdlib_List.concat, + concatMany: Stdlib_List.concatMany, + reverseConcat: Stdlib_List.reverseConcat, + flat: Stdlib_List.flat, + map: Stdlib_List.map, + zip: Stdlib_List.zip, + zipBy: Stdlib_List.zipBy, + mapWithIndex: Stdlib_List.mapWithIndex, + fromArray: Stdlib_List.fromArray, + toArray: Stdlib_List.toArray, + reverse: Stdlib_List.reverse, + mapReverse: Stdlib_List.mapReverse, + forEach: Stdlib_List.forEach, + forEachWithIndex: Stdlib_List.forEachWithIndex, + reduce: Stdlib_List.reduce, + reduceWithIndex: Stdlib_List.reduceWithIndex, + reduceReverse: Stdlib_List.reduceReverse, + mapReverse2: Stdlib_List.mapReverse2, + forEach2: Stdlib_List.forEach2, + reduce2: Stdlib_List.reduce2, + reduceReverse2: Stdlib_List.reduceReverse2, + every: Stdlib_List.every, + some: Stdlib_List.some, + every2: Stdlib_List.every2, + some2: Stdlib_List.some2, + compareLength: Stdlib_List.compareLength, + equal: Stdlib_List.equal, + has: Stdlib_List.has, + includes: Stdlib_List.includes, + find: Stdlib_List.find, + filter: Stdlib_List.filter, + filterWithIndex: Stdlib_List.filterWithIndex, + filterMap: Stdlib_List.filterMap, + partition: Stdlib_List.partition, + unzip: Stdlib_List.unzip, + getAssoc: Stdlib_List.getAssoc, + hasAssoc: Stdlib_List.hasAssoc, + removeAssoc: Stdlib_List.removeAssoc, + setAssoc: Stdlib_List.setAssoc, + sort: Stdlib_List.sort, failwith: Pervasives.failwith, invalid_arg: Pervasives.invalid_arg, Exit: Pervasives.Exit, diff --git a/tests/tests/src/test_pervasive.res b/tests/tests/src/test_pervasive.res index f280901a486..7463c6d4267 100644 --- a/tests/tests/src/test_pervasive.res +++ b/tests/tests/src/test_pervasive.res @@ -1,5 +1,5 @@ module Pervasives = { - include Belt.List + include List include Pervasives } diff --git a/tests/tests/src/test_pervasives3.mjs b/tests/tests/src/test_pervasives3.mjs index 9de7cc3fc94..2170f649e5a 100644 --- a/tests/tests/src/test_pervasives3.mjs +++ b/tests/tests/src/test_pervasives3.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; let Pervasives$1 = { failwith: Pervasives.failwith, @@ -22,97 +22,66 @@ let Pervasives$1 = { bool_of_string_opt: Pervasives.bool_of_string_opt, int_of_string_opt: Pervasives.int_of_string_opt, $at: Pervasives.$at, - length: Belt_List.length, - size: Belt_List.size, - head: Belt_List.head, - headExn: Belt_List.headExn, - headOrThrow: Belt_List.headOrThrow, - tail: Belt_List.tail, - tailExn: Belt_List.tailExn, - tailOrThrow: Belt_List.tailOrThrow, - add: Belt_List.add, - get: Belt_List.get, - getExn: Belt_List.getExn, - getOrThrow: Belt_List.getOrThrow, - make: Belt_List.make, - makeByU: Belt_List.makeByU, - makeBy: Belt_List.makeBy, - shuffle: Belt_List.shuffle, - drop: Belt_List.drop, - take: Belt_List.take, - splitAt: Belt_List.splitAt, - concat: Belt_List.concat, - concatMany: Belt_List.concatMany, - reverseConcat: Belt_List.reverseConcat, - flatten: Belt_List.flatten, - mapU: Belt_List.mapU, - map: Belt_List.map, - zip: Belt_List.zip, - zipByU: Belt_List.zipByU, - zipBy: Belt_List.zipBy, - mapWithIndexU: Belt_List.mapWithIndexU, - mapWithIndex: Belt_List.mapWithIndex, - fromArray: Belt_List.fromArray, - toArray: Belt_List.toArray, - reverse: Belt_List.reverse, - mapReverseU: Belt_List.mapReverseU, - mapReverse: Belt_List.mapReverse, - forEachU: Belt_List.forEachU, - forEach: Belt_List.forEach, - forEachWithIndexU: Belt_List.forEachWithIndexU, - forEachWithIndex: Belt_List.forEachWithIndex, - reduceU: Belt_List.reduceU, - reduce: Belt_List.reduce, - reduceWithIndexU: Belt_List.reduceWithIndexU, - reduceWithIndex: Belt_List.reduceWithIndex, - reduceReverseU: Belt_List.reduceReverseU, - reduceReverse: Belt_List.reduceReverse, - mapReverse2U: Belt_List.mapReverse2U, - mapReverse2: Belt_List.mapReverse2, - forEach2U: Belt_List.forEach2U, - forEach2: Belt_List.forEach2, - reduce2U: Belt_List.reduce2U, - reduce2: Belt_List.reduce2, - reduceReverse2U: Belt_List.reduceReverse2U, - reduceReverse2: Belt_List.reduceReverse2, - everyU: Belt_List.everyU, - every: Belt_List.every, - someU: Belt_List.someU, - some: Belt_List.some, - every2U: Belt_List.every2U, - every2: Belt_List.every2, - some2U: Belt_List.some2U, - some2: Belt_List.some2, - cmpByLength: Belt_List.cmpByLength, - cmpU: Belt_List.cmpU, - cmp: Belt_List.cmp, - eqU: Belt_List.eqU, - eq: Belt_List.eq, - hasU: Belt_List.hasU, - has: Belt_List.has, - getByU: Belt_List.getByU, - getBy: Belt_List.getBy, - keepU: Belt_List.keepU, - keep: Belt_List.keep, - filter: Belt_List.filter, - keepWithIndexU: Belt_List.keepWithIndexU, - keepWithIndex: Belt_List.keepWithIndex, - filterWithIndex: Belt_List.filterWithIndex, - keepMapU: Belt_List.keepMapU, - keepMap: Belt_List.keepMap, - partitionU: Belt_List.partitionU, - partition: Belt_List.partition, - unzip: Belt_List.unzip, - getAssocU: Belt_List.getAssocU, - getAssoc: Belt_List.getAssoc, - hasAssocU: Belt_List.hasAssocU, - hasAssoc: Belt_List.hasAssoc, - removeAssocU: Belt_List.removeAssocU, - removeAssoc: Belt_List.removeAssoc, - setAssocU: Belt_List.setAssocU, - setAssoc: Belt_List.setAssoc, - sortU: Belt_List.sortU, - sort: Belt_List.sort + length: Stdlib_List.length, + size: Stdlib_List.size, + head: Stdlib_List.head, + headExn: Stdlib_List.headExn, + headOrThrow: Stdlib_List.headOrThrow, + tail: Stdlib_List.tail, + tailExn: Stdlib_List.tailExn, + tailOrThrow: Stdlib_List.tailOrThrow, + add: Stdlib_List.add, + get: Stdlib_List.get, + getExn: Stdlib_List.getExn, + getOrThrow: Stdlib_List.getOrThrow, + make: Stdlib_List.make, + fromInitializer: Stdlib_List.fromInitializer, + shuffle: Stdlib_List.shuffle, + toShuffled: Stdlib_List.toShuffled, + drop: Stdlib_List.drop, + take: Stdlib_List.take, + splitAt: Stdlib_List.splitAt, + concat: Stdlib_List.concat, + concatMany: Stdlib_List.concatMany, + reverseConcat: Stdlib_List.reverseConcat, + flat: Stdlib_List.flat, + map: Stdlib_List.map, + zip: Stdlib_List.zip, + zipBy: Stdlib_List.zipBy, + mapWithIndex: Stdlib_List.mapWithIndex, + fromArray: Stdlib_List.fromArray, + toArray: Stdlib_List.toArray, + reverse: Stdlib_List.reverse, + mapReverse: Stdlib_List.mapReverse, + forEach: Stdlib_List.forEach, + forEachWithIndex: Stdlib_List.forEachWithIndex, + reduce: Stdlib_List.reduce, + reduceWithIndex: Stdlib_List.reduceWithIndex, + reduceReverse: Stdlib_List.reduceReverse, + mapReverse2: Stdlib_List.mapReverse2, + forEach2: Stdlib_List.forEach2, + reduce2: Stdlib_List.reduce2, + reduceReverse2: Stdlib_List.reduceReverse2, + every: Stdlib_List.every, + some: Stdlib_List.some, + every2: Stdlib_List.every2, + some2: Stdlib_List.some2, + compareLength: Stdlib_List.compareLength, + compare: Stdlib_List.compare, + equal: Stdlib_List.equal, + has: Stdlib_List.has, + includes: Stdlib_List.includes, + find: Stdlib_List.find, + filter: Stdlib_List.filter, + filterWithIndex: Stdlib_List.filterWithIndex, + filterMap: Stdlib_List.filterMap, + partition: Stdlib_List.partition, + unzip: Stdlib_List.unzip, + getAssoc: Stdlib_List.getAssoc, + hasAssoc: Stdlib_List.hasAssoc, + removeAssoc: Stdlib_List.removeAssoc, + setAssoc: Stdlib_List.setAssoc, + sort: Stdlib_List.sort }; let v = Pervasives.$at; diff --git a/tests/tests/src/test_pervasives3.res b/tests/tests/src/test_pervasives3.res index a56aae6ad57..d9118e4a6c9 100644 --- a/tests/tests/src/test_pervasives3.res +++ b/tests/tests/src/test_pervasives3.res @@ -1,5 +1,5 @@ module Pervasives = { include Pervasives - include Belt.List + include List } let v = Pervasives.\"@" diff --git a/tests/tests/src/test_set.mjs b/tests/tests/src/test_set.mjs index 855e18b60ef..328c6613914 100644 --- a/tests/tests/src/test_set.mjs +++ b/tests/tests/src/test_set.mjs @@ -1,7 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; function Make(Ord) { let height = x => { @@ -643,7 +643,7 @@ function Make(Ord) { Error: new Error() }; }; - return sub(Belt_List.length(l), l)[0]; + return sub(Stdlib_List.length(l), l)[0]; }; let of_list = l => { if (l === 0) { @@ -668,7 +668,7 @@ function Make(Ord) { let x3 = match$2.hd; if (match$3 !== 0) { if (match$3.tl !== 0) { - return of_sorted_list(Belt_List.sort(l, Ord.compare)); + return of_sorted_list(Stdlib_List.sort(l, (a, b) => Ord.compare(a, b))); } else { return add(match$3.hd, add(x3, add(x2, add(x1, singleton(x0))))); } diff --git a/tests/tests/src/test_set.res b/tests/tests/src/test_set.res index a4831097083..852f1f40e9c 100644 --- a/tests/tests/src/test_set.res +++ b/tests/tests/src/test_set.res @@ -501,7 +501,7 @@ module Make = (Ord: OrderedType) => { } } - fst(sub(Belt.List.length(l), l)) + fst(sub(List.length(l), l)) } let of_list = l => @@ -512,7 +512,7 @@ module Make = (Ord: OrderedType) => { | list{x0, x1, x2} => add(x2, add(x1, singleton(x0))) | list{x0, x1, x2, x3} => add(x3, add(x2, add(x1, singleton(x0)))) | list{x0, x1, x2, x3, x4} => add(x4, add(x3, add(x2, add(x1, singleton(x0))))) - | _ => of_sorted_list(l->Belt.List.sort(Ord.compare)) + | _ => of_sorted_list(l->List.sort((a, b) => Ord.compare(a, b)->Int.toFloat)) } } module N = { diff --git a/tests/tests/src/test_simple_include.mjs b/tests/tests/src/test_simple_include.mjs index 0fecfa9b33b..426c7d4306d 100644 --- a/tests/tests/src/test_simple_include.mjs +++ b/tests/tests/src/test_simple_include.mjs @@ -1,6 +1,6 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; let v = { contents: 32 @@ -22,231 +22,84 @@ let NN = { v: v$1 }; -let get = Belt_Array.get; +let make = Stdlib_Array.make; -let getExn = Belt_Array.getExn; +let fromInitializer = Stdlib_Array.fromInitializer; -let getOrThrow = Belt_Array.getOrThrow; +let equal = Stdlib_Array.equal; -let set = Belt_Array.set; +let compare = Stdlib_Array.compare; -let setExn = Belt_Array.setExn; +let isEmpty = Stdlib_Array.isEmpty; -let setOrThrow = Belt_Array.setOrThrow; +let concatAll = Stdlib_Array.concatAll; -let shuffleInPlace = Belt_Array.shuffleInPlace; +let indexOfOpt = Stdlib_Array.indexOfOpt; -let shuffle = Belt_Array.shuffle; +let lastIndexOfOpt = Stdlib_Array.lastIndexOfOpt; -let reverseInPlace = Belt_Array.reverseInPlace; +let reduce = Stdlib_Array.reduce; -let reverse = Belt_Array.reverse; +let reduceWithIndex = Stdlib_Array.reduceWithIndex; -let make = Belt_Array.make; +let reduceRight = Stdlib_Array.reduceRight; -let range = Belt_Array.range; +let reduceRightWithIndex = Stdlib_Array.reduceRightWithIndex; -let rangeBy = Belt_Array.rangeBy; +let findIndexOpt = Stdlib_Array.findIndexOpt; -let makeByU = Belt_Array.makeByU; +let findLastIndexOpt = Stdlib_Array.findLastIndexOpt; -let makeBy = Belt_Array.makeBy; +let filterMap = Stdlib_Array.filterMap; -let makeByAndShuffleU = Belt_Array.makeByAndShuffleU; +let filterMapWithIndex = Stdlib_Array.filterMapWithIndex; -let makeByAndShuffle = Belt_Array.makeByAndShuffle; +let keepSome = Stdlib_Array.keepSome; -let zip = Belt_Array.zip; +let toShuffled = Stdlib_Array.toShuffled; -let zipByU = Belt_Array.zipByU; +let shuffle = Stdlib_Array.shuffle; -let zipBy = Belt_Array.zipBy; +let findMap = Stdlib_Array.findMap; -let unzip = Belt_Array.unzip; +let zip = Stdlib_Array.zip; -let concat = Belt_Array.concat; +let zipBy = Stdlib_Array.zipBy; -let concatMany = Belt_Array.concatMany; +let partition = Stdlib_Array.partition; -let slice = Belt_Array.slice; +let unzip = Stdlib_Array.unzip; -let sliceToEnd = Belt_Array.sliceToEnd; - -let fill = Belt_Array.fill; - -let blit = Belt_Array.blit; - -let blitUnsafe = Belt_Array.blitUnsafe; - -let forEachU = Belt_Array.forEachU; - -let forEach = Belt_Array.forEach; - -let mapU = Belt_Array.mapU; - -let map = Belt_Array.map; - -let flatMapU = Belt_Array.flatMapU; - -let flatMap = Belt_Array.flatMap; - -let getByU = Belt_Array.getByU; - -let getBy = Belt_Array.getBy; - -let getIndexByU = Belt_Array.getIndexByU; - -let getIndexBy = Belt_Array.getIndexBy; - -let keepU = Belt_Array.keepU; - -let keep = Belt_Array.keep; - -let keepWithIndexU = Belt_Array.keepWithIndexU; - -let keepWithIndex = Belt_Array.keepWithIndex; - -let keepMapU = Belt_Array.keepMapU; - -let keepMap = Belt_Array.keepMap; - -let forEachWithIndexU = Belt_Array.forEachWithIndexU; - -let forEachWithIndex = Belt_Array.forEachWithIndex; - -let mapWithIndexU = Belt_Array.mapWithIndexU; - -let mapWithIndex = Belt_Array.mapWithIndex; - -let partitionU = Belt_Array.partitionU; - -let partition = Belt_Array.partition; - -let reduceU = Belt_Array.reduceU; - -let reduce = Belt_Array.reduce; - -let reduceReverseU = Belt_Array.reduceReverseU; - -let reduceReverse = Belt_Array.reduceReverse; - -let reduceReverse2U = Belt_Array.reduceReverse2U; - -let reduceReverse2 = Belt_Array.reduceReverse2; - -let reduceWithIndexU = Belt_Array.reduceWithIndexU; - -let reduceWithIndex = Belt_Array.reduceWithIndex; - -let joinWithU = Belt_Array.joinWithU; - -let joinWith = Belt_Array.joinWith; - -let someU = Belt_Array.someU; - -let some = Belt_Array.some; - -let everyU = Belt_Array.everyU; - -let every = Belt_Array.every; - -let every2U = Belt_Array.every2U; - -let every2 = Belt_Array.every2; - -let some2U = Belt_Array.some2U; - -let some2 = Belt_Array.some2; - -let cmpU = Belt_Array.cmpU; - -let cmp = Belt_Array.cmp; - -let eqU = Belt_Array.eqU; - -let eq = Belt_Array.eq; - -let initU = Belt_Array.initU; - -let init = Belt_Array.init; +let last = Stdlib_Array.last; let a = 3; export { - get, - getExn, - getOrThrow, - set, - setExn, - setOrThrow, - shuffleInPlace, - shuffle, - reverseInPlace, - reverse, make, - range, - rangeBy, - makeByU, - makeBy, - makeByAndShuffleU, - makeByAndShuffle, + fromInitializer, + equal, + compare, + isEmpty, + concatAll, + indexOfOpt, + lastIndexOfOpt, + reduce, + reduceWithIndex, + reduceRight, + reduceRightWithIndex, + findIndexOpt, + findLastIndexOpt, + filterMap, + filterMapWithIndex, + keepSome, + toShuffled, + shuffle, + findMap, zip, - zipByU, zipBy, - unzip, - concat, - concatMany, - slice, - sliceToEnd, - fill, - blit, - blitUnsafe, - forEachU, - forEach, - mapU, - map, - flatMapU, - flatMap, - getByU, - getBy, - getIndexByU, - getIndexBy, - keepU, - keep, - keepWithIndexU, - keepWithIndex, - keepMapU, - keepMap, - forEachWithIndexU, - forEachWithIndex, - mapWithIndexU, - mapWithIndex, - partitionU, partition, - reduceU, - reduce, - reduceReverseU, - reduceReverse, - reduceReverse2U, - reduceReverse2, - reduceWithIndexU, - reduceWithIndex, - joinWithU, - joinWith, - someU, - some, - everyU, - every, - every2U, - every2, - some2U, - some2, - cmpU, - cmp, - eqU, - eq, - initU, - init, + unzip, + last, N, NN, a, diff --git a/tests/tests/src/test_simple_include.res b/tests/tests/src/test_simple_include.res index 6586d3401dd..d6325f00631 100644 --- a/tests/tests/src/test_simple_include.res +++ b/tests/tests/src/test_simple_include.res @@ -1,4 +1,4 @@ -include Belt.Array +include Array include { assert(1 + 2 == 3) diff --git a/tests/tests/src/test_while_closure.mjs b/tests/tests/src/test_while_closure.mjs index 33161bada01..7f248c947eb 100644 --- a/tests/tests/src/test_while_closure.mjs +++ b/tests/tests/src/test_while_closure.mjs @@ -1,12 +1,12 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_Array from "@rescript/belt/src/Belt_Array.mjs"; +import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.mjs"; let v = { contents: 0 }; -let arr = Belt_Array.make(10, () => {}); +let arr = Stdlib_Array.make(10, () => {}); function f() { let n = 0; @@ -21,7 +21,7 @@ function f() { f(); -Belt_Array.forEach(arr, x => x()); +arr.forEach(x => x()); console.log(v.contents.toString()); diff --git a/tests/tests/src/test_while_closure.res b/tests/tests/src/test_while_closure.res index 61cd24cadd4..0d31a9f0aec 100644 --- a/tests/tests/src/test_while_closure.res +++ b/tests/tests/src/test_while_closure.res @@ -38,7 +38,7 @@ This means inline is tricky in javascript, here we try to inline [_loop]? let v = ref(0) let count = 10 -let arr = Belt.Array.make(count, _ => ()) +let arr = Array.make(~length=count, _ => ()) let f = () => { let n = ref(0) while n.contents < count { @@ -50,7 +50,7 @@ let f = () => { let () = { f() - arr->Belt.Array.forEach(x => x()) + arr->Array.forEach(x => x()) v.contents->Int.toString->Console.log assert(v.contents == 45) } diff --git a/tests/tests/src/topsort_test.mjs b/tests/tests/src/topsort_test.mjs index 7d49c09e919..d75ea6233a8 100644 --- a/tests/tests/src/topsort_test.mjs +++ b/tests/tests/src/topsort_test.mjs @@ -1,8 +1,7 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; import * as Pervasives from "@rescript/runtime/lib/es6/Pervasives.mjs"; -import * as Belt_SetString from "@rescript/belt/src/Belt_SetString.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_object from "@rescript/runtime/lib/es6/Primitive_object.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; @@ -57,7 +56,7 @@ let graph = { }; function nexts(x, g) { - return Belt_List.reduce(g, /* [] */0, (acc, param) => { + return Stdlib_List.reduce(g, /* [] */0, (acc, param) => { if (param[0] === x) { return { hd: param[1], @@ -74,11 +73,11 @@ function dfs1(_nodes, graph, _visited) { let visited = _visited; let nodes = _nodes; if (nodes === 0) { - return Belt_List.reverse(visited); + return Stdlib_List.reverse(visited); } let xs = nodes.tl; let x = nodes.hd; - if (Belt_List.has(visited, x, (prim0, prim1) => prim0 === prim1)) { + if (Stdlib_List.has(visited, x, (prim0, prim1) => prim0 === prim1)) { _nodes = xs; continue; } @@ -121,7 +120,7 @@ if (!Primitive_object.equal(dfs1({ RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 38, + 36, 2 ], Error: new Error() @@ -159,7 +158,7 @@ if (!Primitive_object.equal(dfs1({ RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 41, + 39, 2 ], Error: new Error() @@ -176,7 +175,7 @@ function dfs2(nodes, graph, visited) { } let xs = nodes.tl; let x = nodes.hd; - if (Belt_List.has(visited, x, (prim0, prim1) => prim0 === prim1)) { + if (Stdlib_List.has(visited, x, (prim0, prim1) => prim0 === prim1)) { _nodes = xs; continue; } @@ -188,7 +187,7 @@ function dfs2(nodes, graph, visited) { continue; }; }; - return Belt_List.reverse(aux(nodes, graph, visited)); + return Stdlib_List.reverse(aux(nodes, graph, visited)); } if (!Primitive_object.equal(dfs2({ @@ -220,7 +219,7 @@ if (!Primitive_object.equal(dfs2({ RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 60, + 58, 2 ], Error: new Error() @@ -256,7 +255,7 @@ if (!Primitive_object.equal(dfs2({ RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 61, + 59, 2 ], Error: new Error() @@ -268,16 +267,16 @@ function dfs3(nodes, graph) { contents: /* [] */0 }; let aux = (node, graph) => { - if (!Belt_List.has(visited.contents, node, (prim0, prim1) => prim0 === prim1)) { + if (!Stdlib_List.has(visited.contents, node, (prim0, prim1) => prim0 === prim1)) { visited.contents = { hd: node, tl: visited.contents }; - return Belt_List.forEach(nexts(node, graph), x => aux(x, graph)); + return Stdlib_List.forEach(nexts(node, graph), x => aux(x, graph)); } }; - Belt_List.forEach(nodes, node => aux(node, graph)); - return Belt_List.reverse(visited.contents); + Stdlib_List.forEach(nodes, node => aux(node, graph)); + return Stdlib_List.reverse(visited.contents); } if (!Primitive_object.equal(dfs3({ @@ -309,7 +308,7 @@ if (!Primitive_object.equal(dfs3({ RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 77, + 75, 2 ], Error: new Error() @@ -345,7 +344,7 @@ if (!Primitive_object.equal(dfs3({ RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 78, + 76, 2 ], Error: new Error() @@ -395,17 +394,17 @@ function unsafe_topsort(graph) { contents: /* [] */0 }; let sort_node = node => { - if (Belt_List.has(visited.contents, node, (prim0, prim1) => prim0 === prim1)) { + if (Stdlib_List.has(visited.contents, node, (prim0, prim1) => prim0 === prim1)) { return; } let nodes = nexts(node, graph); - Belt_List.forEach(nodes, sort_node); + Stdlib_List.forEach(nodes, sort_node); visited.contents = { hd: node, tl: visited.contents }; }; - Belt_List.forEach(graph, param => sort_node(param[0])); + Stdlib_List.forEach(graph, param => sort_node(param[0])); return visited.contents; } @@ -432,7 +431,7 @@ if (!Primitive_object.equal(unsafe_topsort(grwork), { RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 115, + 113, 9 ], Error: new Error() @@ -445,34 +444,25 @@ function pathsort(graph) { let visited = { contents: /* [] */0 }; - let empty_path = [ - undefined, - /* [] */0 - ]; - let $plus$great = (node, param) => { - let stack = param[1]; - let set = param[0]; - if (Belt_SetString.has(set, node)) { + let $plus$great = (node, path) => { + if (Stdlib_List.has(path, node, (prim0, prim1) => prim0 === prim1)) { throw { RE_EXN_ID: Cycle, _1: { hd: node, - tl: stack + tl: path }, Error: new Error() }; } - return [ - Belt_SetString.add(set, node), - { - hd: node, - tl: stack - } - ]; + return { + hd: node, + tl: path + }; }; - let sort_nodes = (path, nodes) => Belt_List.forEach(nodes, node => sort_node(path, node)); + let sort_nodes = (path, nodes) => Stdlib_List.forEach(nodes, node => sort_node(path, node)); let sort_node = (path, node) => { - if (!Belt_List.has(visited.contents, node, (prim0, prim1) => prim0 === prim1)) { + if (!Stdlib_List.has(visited.contents, node, (prim0, prim1) => prim0 === prim1)) { sort_nodes($plus$great(node, path), nexts(node, graph)); visited.contents = { hd: node, @@ -481,7 +471,7 @@ function pathsort(graph) { return; } }; - Belt_List.forEach(graph, param => sort_node(empty_path, param[0])); + Stdlib_List.forEach(graph, param => sort_node(/* [] */0, param[0])); return visited.contents; } @@ -508,7 +498,7 @@ if (!Primitive_object.equal(pathsort(grwork), { RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 147, + 141, 9 ], Error: new Error() @@ -527,7 +517,7 @@ try { RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 151, + 145, 2 ], Error: new Error() @@ -563,7 +553,7 @@ try { RE_EXN_ID: "Assert_failure", _1: [ "topsort_test.res", - 154, + 148, 7 ], Error: new Error() @@ -571,8 +561,6 @@ try { } } -let String_set; - export { graph, nexts, @@ -581,7 +569,6 @@ export { dfs3, grwork, unsafe_topsort, - String_set, Cycle, pathsort, } diff --git a/tests/tests/src/topsort_test.res b/tests/tests/src/topsort_test.res index 06866b785a9..a7bd936d148 100644 --- a/tests/tests/src/topsort_test.res +++ b/tests/tests/src/topsort_test.res @@ -1,5 +1,3 @@ -open Belt - type graph = list<(string, string)> let graph: graph = list{ @@ -114,21 +112,17 @@ let unsafe_topsort = graph => { let () = assert(unsafe_topsort(grwork) == list{"wake", "shower", "dress", "eat", "washup", "go"}) -module String_set = Belt.Set.String exception Cycle(list) let pathsort = graph => { let visited = ref(list{}) - let empty_path = (String_set.empty, list{}) - let \"+>" = (node, (set, stack)) => - if String_set.has(set, node) { - throw(Cycle(list{node, ...stack})) + let empty_path = list{} + let \"+>" = (node, path) => + if List.has(path, node, \"==") { + throw(Cycle(list{node, ...path})) } else { - (String_set.add(set, node), list{node, ...stack}) + list{node, ...path} } - /* let check node (set,stack) = - if String_set.mem node set then - raise (Cycle (node::stack)) in */ let rec sort_nodes = (path, nodes) => nodes->List.forEach(node => sort_node(path, node)) and sort_node = (path, node) => if !List.has(visited.contents, node, \"==") { diff --git a/tests/tests/src/uncurried_cast.mjs b/tests/tests/src/uncurried_cast.mjs index 665d834a34b..6b69ccb0ef7 100644 --- a/tests/tests/src/uncurried_cast.mjs +++ b/tests/tests/src/uncurried_cast.mjs @@ -1,13 +1,13 @@ // Generated by ReScript, PLEASE EDIT WITH CARE -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as Primitive_exceptions from "@rescript/runtime/lib/es6/Primitive_exceptions.mjs"; function raise(e) { throw e; } -let map = Belt_List.map; +let map = Stdlib_List.map; let List = { map: map @@ -27,7 +27,7 @@ function testRaise() { }; } -let l = Belt_List.map({ +let l = Stdlib_List.map({ hd: 1, tl: { hd: 2, @@ -36,7 +36,7 @@ let l = Belt_List.map({ }, x => x + 1 | 0); function partial(x) { - return Belt_List.map({ + return Stdlib_List.map({ hd: 1, tl: { hd: 2, @@ -68,7 +68,7 @@ function testRaise$1() { }; } -let l$1 = Belt_List.map({ +let l$1 = Stdlib_List.map({ hd: 1, tl: { hd: 2, @@ -77,7 +77,7 @@ let l$1 = Belt_List.map({ }, x => x + 1 | 0); function partial$1(extra) { - return Belt_List.map({ + return Stdlib_List.map({ hd: 1, tl: { hd: 2, diff --git a/tests/tests/src/uncurried_cast.res b/tests/tests/src/uncurried_cast.res index f7244ec081f..a44083c404e 100644 --- a/tests/tests/src/uncurried_cast.res +++ b/tests/tests/src/uncurried_cast.res @@ -2,7 +2,7 @@ module Uncurried = { let raise = e => throw(e) module List = { - let map = (l, f) => Belt.List.map(l, f) + let map = (l, f) => List.map(l, f) } } diff --git a/tests/tests/src/webpack_config.mjs b/tests/tests/src/webpack_config.mjs index 73ee64d0607..3249828cfda 100644 --- a/tests/tests/src/webpack_config.mjs +++ b/tests/tests/src/webpack_config.mjs @@ -4,7 +4,7 @@ import * as List from "List"; import * as List$1 from "reactV"; import * as List$2 from "reactX"; import * as Local from "./local"; -import * as Belt_List from "@rescript/belt/src/Belt_List.mjs"; +import * as Stdlib_List from "@rescript/runtime/lib/es6/Stdlib_List.mjs"; import * as WebpackConfigJs from "../../../webpack.config.js"; import * as WebpackMiddlewareConfigJs from "../../../webpack.middleware.config.js"; @@ -55,7 +55,7 @@ function f() { List.xx(); -Belt_List.length({ +Stdlib_List.length({ hd: 1, tl: { hd: 2, @@ -63,7 +63,7 @@ Belt_List.length({ } }); -Belt_List.length(/* [] */0); +Stdlib_List.length(/* [] */0); function ff(prim) { return Local.ff(); diff --git a/tests/tests/src/webpack_config.res b/tests/tests/src/webpack_config.res index 6928a298c87..81d3a589f62 100644 --- a/tests/tests/src/webpack_config.res +++ b/tests/tests/src/webpack_config.res @@ -1,5 +1,3 @@ -open Belt - module type Config = { let configx: JSON.t } diff --git a/yarn.lock b/yarn.lock index 065f2d755c4..98ef9346e17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -511,7 +511,7 @@ __metadata: languageName: node linkType: hard -"@rescript/runtime@workspace:packages/@rescript/runtime": +"@rescript/runtime@workspace:^, @rescript/runtime@workspace:packages/@rescript/runtime": version: 0.0.0-use.local resolution: "@rescript/runtime@workspace:packages/@rescript/runtime" dependencies: @@ -867,6 +867,17 @@ __metadata: languageName: unknown linkType: soft +"@tests/belt@workspace:tests/belt_tests": + version: 0.0.0-use.local + resolution: "@tests/belt@workspace:tests/belt_tests" + dependencies: + "@rescript/belt": "workspace:^" + "@rescript/runtime": "workspace:^" + mocha: "npm:11.7.6" + rescript: "workspace:^" + languageName: unknown + linkType: soft + "@tests/docstring-tests@workspace:^, @tests/docstring-tests@workspace:tests/docstring_tests": version: 0.0.0-use.local resolution: "@tests/docstring-tests@workspace:tests/docstring_tests" @@ -929,7 +940,6 @@ __metadata: version: 0.0.0-use.local resolution: "@tests/reanalyze-benchmark@workspace:tests/analysis_tests/tests-reanalyze/deadcode-benchmark" dependencies: - "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -1040,7 +1050,6 @@ __metadata: version: 0.0.0-use.local resolution: "@utils/scripts@workspace:scripts/res" dependencies: - "@rescript/belt": "workspace:^" "@tests/docstring-tests": "workspace:^" rescript: "workspace:^" languageName: unknown @@ -2753,7 +2762,6 @@ __metadata: version: 0.0.0-use.local resolution: "rescript-tests@workspace:tests/tests" dependencies: - "@rescript/belt": "workspace:^" "@rescript/react": "workspace:^" rescript: "workspace:^" languageName: unknown From 84d9b8e5353b492e75fb8ddf4777ee77db545742 Mon Sep 17 00:00:00 2001 From: Christoph Knittel Date: Sun, 9 Aug 2026 21:01:27 +0200 Subject: [PATCH 06/14] Keep Belt available in the playground Signed-off-by: Christoph Knittel --- CONTRIBUTING.md | 3 ++- docs/JSXV4.md | 4 ++-- packages/@rescript/runtime/Stdlib_Map.resi | 3 ++- packages/@rescript/runtime/Stdlib_Set.resi | 3 ++- packages/dev-playground/src/CompilerApi.res | 15 +++++++++++++-- packages/playground/README.md | 7 +++++-- packages/playground/package.json | 1 + packages/playground/playground_test.cjs | 3 ++- packages/playground/rescript.json | 1 + yarn.lock | 1 + 10 files changed, 31 insertions(+), 10 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c278f90b626..eb9b33f116b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -325,7 +325,8 @@ Note that building the cmijs is based on the dependencies defined in `packages/p After a successful compilation, you will find following files in your project: - `packages/playground/compiler.js` -> This is the ReScript compiler, which binds the ReScript API to the `window` object. -- `packages/playground/packages/compiler-builtins` -> The compiler base cmij containing all the relevant core modules (`Js`, `Belt`, `Pervasives`, etc.) +- `packages/playground/packages/compiler-builtins` -> The compiler base cmij containing the runtime and standard-library modules +- `packages/playground/packages/@rescript/belt` -> The Belt cmij, packaged separately from the compiler built-ins - `packages/playground/packages/*` -> Contains third party deps with cmij.js files (as defined in `packages/playground/rescript.json`) You can now use the `compiler.js` file either directly by using a `