@tellahq/rescript 10.1.0-alpha.1 → 10.1.4-republish-1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +204 -2
- package/README.md +1 -1
- package/darwinarm64/bsb_helper.exe +0 -0
- package/darwinarm64/bsc.exe +0 -0
- package/darwinarm64/rescript.exe +0 -0
- package/docs/docson/build-schema.json +497 -516
- package/lib/4.06.1/bsb_helper.ml +6 -1
- package/lib/4.06.1/rescript.ml +1414 -1191
- package/lib/4.06.1/whole_compiler.ml +69871 -69087
- package/lib/es6/belt_internalBuckets.js +13 -13
- package/lib/es6/caml_float.js +5 -5
- package/lib/es6/caml_format.js +1 -1
- package/lib/es6/caml_int64.js +1 -1
- package/lib/es6/caml_obj.js +26 -6
- package/lib/es6/complex.js +4 -4
- package/lib/es6/js.js +3 -0
- package/lib/es6/js_promise2.js +16 -0
- package/lib/es6/jsxPPXReactSupport.js +26 -0
- package/lib/js/belt_internalBuckets.js +13 -13
- package/lib/js/caml_float.js +5 -5
- package/lib/js/caml_format.js +1 -1
- package/lib/js/caml_int64.js +1 -1
- package/lib/js/caml_obj.js +26 -6
- package/lib/js/complex.js +4 -4
- package/lib/js/js.js +3 -0
- package/lib/js/js_promise2.js +14 -0
- package/lib/js/jsxPPXReactSupport.js +24 -0
- package/lib/ocaml/arg.cmi +0 -0
- package/lib/ocaml/arg.cmt +0 -0
- package/lib/ocaml/arg.cmti +0 -0
- package/lib/ocaml/arg.ml +2 -2
- package/lib/ocaml/array.cmi +0 -0
- package/lib/ocaml/array.cmt +0 -0
- package/lib/ocaml/array.cmti +0 -0
- package/lib/ocaml/arrayLabels.cmi +0 -0
- package/lib/ocaml/arrayLabels.cmt +0 -0
- package/lib/ocaml/arrayLabels.cmti +0 -0
- package/lib/ocaml/belt.cmt +0 -0
- package/lib/ocaml/belt_Array.cmi +0 -0
- package/lib/ocaml/belt_Array.cmt +0 -0
- package/lib/ocaml/belt_Array.cmti +0 -0
- package/lib/ocaml/belt_Float.cmt +0 -0
- package/lib/ocaml/belt_Float.cmti +0 -0
- package/lib/ocaml/belt_HashMap.cmi +0 -0
- package/lib/ocaml/belt_HashMap.cmt +0 -0
- package/lib/ocaml/belt_HashMap.cmti +0 -0
- package/lib/ocaml/belt_HashMapInt.cmi +0 -0
- package/lib/ocaml/belt_HashMapInt.cmt +0 -0
- package/lib/ocaml/belt_HashMapInt.cmti +0 -0
- package/lib/ocaml/belt_HashMapString.cmi +0 -0
- package/lib/ocaml/belt_HashMapString.cmt +0 -0
- package/lib/ocaml/belt_HashMapString.cmti +0 -0
- package/lib/ocaml/belt_HashSet.cmi +0 -0
- package/lib/ocaml/belt_HashSet.cmt +0 -0
- package/lib/ocaml/belt_HashSet.cmti +0 -0
- package/lib/ocaml/belt_HashSetInt.cmi +0 -0
- package/lib/ocaml/belt_HashSetInt.cmt +0 -0
- package/lib/ocaml/belt_HashSetInt.cmti +0 -0
- package/lib/ocaml/belt_HashSetString.cmi +0 -0
- package/lib/ocaml/belt_HashSetString.cmt +0 -0
- package/lib/ocaml/belt_HashSetString.cmti +0 -0
- package/lib/ocaml/belt_Id.cmi +0 -0
- package/lib/ocaml/belt_Id.cmt +0 -0
- package/lib/ocaml/belt_Id.cmti +0 -0
- package/lib/ocaml/belt_Int.cmt +0 -0
- package/lib/ocaml/belt_Int.cmti +0 -0
- package/lib/ocaml/belt_List.cmi +0 -0
- package/lib/ocaml/belt_List.cmt +0 -0
- package/lib/ocaml/belt_List.cmti +0 -0
- package/lib/ocaml/belt_Map.cmi +0 -0
- package/lib/ocaml/belt_Map.cmt +0 -0
- package/lib/ocaml/belt_Map.cmti +0 -0
- package/lib/ocaml/belt_MapDict.cmi +0 -0
- package/lib/ocaml/belt_MapDict.cmt +0 -0
- package/lib/ocaml/belt_MapDict.cmti +0 -0
- package/lib/ocaml/belt_MapInt.cmi +0 -0
- package/lib/ocaml/belt_MapInt.cmt +0 -0
- package/lib/ocaml/belt_MapInt.cmti +0 -0
- package/lib/ocaml/belt_MapString.cmi +0 -0
- package/lib/ocaml/belt_MapString.cmt +0 -0
- package/lib/ocaml/belt_MapString.cmti +0 -0
- package/lib/ocaml/belt_MutableMap.cmi +0 -0
- package/lib/ocaml/belt_MutableMap.cmt +0 -0
- package/lib/ocaml/belt_MutableMap.cmti +0 -0
- package/lib/ocaml/belt_MutableMapInt.cmi +0 -0
- package/lib/ocaml/belt_MutableMapInt.cmt +0 -0
- package/lib/ocaml/belt_MutableMapInt.cmti +0 -0
- package/lib/ocaml/belt_MutableMapString.cmi +0 -0
- package/lib/ocaml/belt_MutableMapString.cmt +0 -0
- package/lib/ocaml/belt_MutableMapString.cmti +0 -0
- package/lib/ocaml/belt_MutableQueue.cmi +0 -0
- package/lib/ocaml/belt_MutableQueue.cmt +0 -0
- package/lib/ocaml/belt_MutableQueue.cmti +0 -0
- package/lib/ocaml/belt_MutableSet.cmi +0 -0
- package/lib/ocaml/belt_MutableSet.cmt +0 -0
- package/lib/ocaml/belt_MutableSet.cmti +0 -0
- package/lib/ocaml/belt_MutableSetInt.cmi +0 -0
- package/lib/ocaml/belt_MutableSetInt.cmt +0 -0
- package/lib/ocaml/belt_MutableSetInt.cmti +0 -0
- package/lib/ocaml/belt_MutableSetString.cmi +0 -0
- package/lib/ocaml/belt_MutableSetString.cmt +0 -0
- package/lib/ocaml/belt_MutableSetString.cmti +0 -0
- package/lib/ocaml/belt_MutableStack.cmi +0 -0
- package/lib/ocaml/belt_MutableStack.cmt +0 -0
- package/lib/ocaml/belt_MutableStack.cmti +0 -0
- package/lib/ocaml/belt_Option.cmi +0 -0
- package/lib/ocaml/belt_Option.cmt +0 -0
- package/lib/ocaml/belt_Option.cmti +0 -0
- package/lib/ocaml/belt_Range.cmi +0 -0
- package/lib/ocaml/belt_Range.cmt +0 -0
- package/lib/ocaml/belt_Range.cmti +0 -0
- package/lib/ocaml/belt_Result.cmi +0 -0
- package/lib/ocaml/belt_Result.cmt +0 -0
- package/lib/ocaml/belt_Result.cmti +0 -0
- package/lib/ocaml/belt_Set.cmi +0 -0
- package/lib/ocaml/belt_Set.cmt +0 -0
- package/lib/ocaml/belt_Set.cmti +0 -0
- package/lib/ocaml/belt_SetDict.cmi +0 -0
- package/lib/ocaml/belt_SetDict.cmt +0 -0
- package/lib/ocaml/belt_SetDict.cmti +0 -0
- package/lib/ocaml/belt_SetInt.cmi +0 -0
- package/lib/ocaml/belt_SetInt.cmt +0 -0
- package/lib/ocaml/belt_SetInt.cmti +0 -0
- package/lib/ocaml/belt_SetString.cmi +0 -0
- package/lib/ocaml/belt_SetString.cmt +0 -0
- package/lib/ocaml/belt_SetString.cmti +0 -0
- package/lib/ocaml/belt_SortArray.cmi +0 -0
- package/lib/ocaml/belt_SortArray.cmt +0 -0
- package/lib/ocaml/belt_SortArray.cmti +0 -0
- package/lib/ocaml/belt_SortArrayInt.cmt +0 -0
- package/lib/ocaml/belt_SortArrayInt.cmti +0 -0
- package/lib/ocaml/belt_SortArrayString.cmt +0 -0
- package/lib/ocaml/belt_SortArrayString.cmti +0 -0
- package/lib/ocaml/belt_internalAVLset.cmt +0 -0
- package/lib/ocaml/belt_internalAVLset.cmti +0 -0
- package/lib/ocaml/belt_internalAVLtree.cmt +0 -0
- package/lib/ocaml/belt_internalAVLtree.cmti +0 -0
- package/lib/ocaml/belt_internalBuckets.cmt +0 -0
- package/lib/ocaml/belt_internalBuckets.cmti +0 -0
- package/lib/ocaml/belt_internalBucketsType.cmt +0 -0
- package/lib/ocaml/belt_internalBucketsType.cmti +0 -0
- package/lib/ocaml/belt_internalMapInt.cmt +0 -0
- package/lib/ocaml/belt_internalMapString.cmt +0 -0
- package/lib/ocaml/belt_internalSetBuckets.cmt +0 -0
- package/lib/ocaml/belt_internalSetBuckets.cmti +0 -0
- package/lib/ocaml/belt_internalSetInt.cmt +0 -0
- package/lib/ocaml/belt_internalSetString.cmt +0 -0
- package/lib/ocaml/belt_internals.cmti +0 -0
- package/lib/ocaml/buffer.cmi +0 -0
- package/lib/ocaml/buffer.cmt +0 -0
- package/lib/ocaml/buffer.cmti +0 -0
- package/lib/ocaml/bytes.cmi +0 -0
- package/lib/ocaml/bytes.cmt +0 -0
- package/lib/ocaml/bytes.cmti +0 -0
- package/lib/ocaml/bytesLabels.cmi +0 -0
- package/lib/ocaml/bytesLabels.cmt +0 -0
- package/lib/ocaml/bytesLabels.cmti +0 -0
- package/lib/ocaml/callback.cmi +0 -0
- package/lib/ocaml/callback.cmt +0 -0
- package/lib/ocaml/callback.cmti +0 -0
- package/lib/ocaml/camlinternalLazy.cmi +0 -0
- package/lib/ocaml/camlinternalLazy.cmt +0 -0
- package/lib/ocaml/camlinternalLazy.cmti +0 -0
- package/lib/ocaml/camlinternalMod.cmi +0 -0
- package/lib/ocaml/camlinternalMod.cmt +0 -0
- package/lib/ocaml/camlinternalMod.cmti +0 -0
- package/lib/ocaml/char.cmi +0 -0
- package/lib/ocaml/char.cmt +0 -0
- package/lib/ocaml/char.cmti +0 -0
- package/lib/ocaml/complex.cmi +0 -0
- package/lib/ocaml/complex.cmt +0 -0
- package/lib/ocaml/complex.cmti +0 -0
- package/lib/ocaml/digest.cmi +0 -0
- package/lib/ocaml/digest.cmt +0 -0
- package/lib/ocaml/digest.cmti +0 -0
- package/lib/ocaml/dom.cmt +0 -0
- package/lib/ocaml/dom_storage.cmt +0 -0
- package/lib/ocaml/dom_storage2.cmt +0 -0
- package/lib/ocaml/filename.cmi +0 -0
- package/lib/ocaml/filename.cmt +0 -0
- package/lib/ocaml/filename.cmti +0 -0
- package/lib/ocaml/genlex.cmi +0 -0
- package/lib/ocaml/genlex.cmt +0 -0
- package/lib/ocaml/genlex.cmti +0 -0
- package/lib/ocaml/hashtbl.cmi +0 -0
- package/lib/ocaml/hashtbl.cmt +0 -0
- package/lib/ocaml/hashtbl.cmti +0 -0
- package/lib/ocaml/hashtblLabels.cmi +0 -0
- package/lib/ocaml/hashtblLabels.cmt +0 -0
- package/lib/ocaml/int32.cmi +0 -0
- package/lib/ocaml/int32.cmt +0 -0
- package/lib/ocaml/int32.cmti +0 -0
- package/lib/ocaml/int64.cmi +0 -0
- package/lib/ocaml/int64.cmt +0 -0
- package/lib/ocaml/int64.cmti +0 -0
- package/lib/ocaml/js.cmi +0 -0
- package/lib/ocaml/js.cmt +0 -0
- package/lib/ocaml/js.ml +3 -0
- package/lib/ocaml/js_OO.cmt +0 -0
- package/lib/ocaml/js_array.cmt +0 -0
- package/lib/ocaml/js_array2.cmt +0 -0
- package/lib/ocaml/js_bigint.cmt +0 -0
- package/lib/ocaml/js_cast.cmt +0 -0
- package/lib/ocaml/js_cast.cmti +0 -0
- package/lib/ocaml/js_console.cmt +0 -0
- package/lib/ocaml/js_date.cmt +0 -0
- package/lib/ocaml/js_dict.cmi +0 -0
- package/lib/ocaml/js_dict.cmt +0 -0
- package/lib/ocaml/js_dict.cmti +0 -0
- package/lib/ocaml/js_exn.cmt +0 -0
- package/lib/ocaml/js_exn.cmti +0 -0
- package/lib/ocaml/js_float.cmt +0 -0
- package/lib/ocaml/js_global.cmt +0 -0
- package/lib/ocaml/js_int.cmt +0 -0
- package/lib/ocaml/js_json.cmi +0 -0
- package/lib/ocaml/js_json.cmt +0 -0
- package/lib/ocaml/js_json.cmti +0 -0
- package/lib/ocaml/js_list.cmi +0 -0
- package/lib/ocaml/js_list.cmt +0 -0
- package/lib/ocaml/js_list.cmti +0 -0
- package/lib/ocaml/js_map.cmt +0 -0
- package/lib/ocaml/js_mapperRt.cmt +0 -0
- package/lib/ocaml/js_mapperRt.cmti +0 -0
- package/lib/ocaml/js_math.cmi +0 -0
- package/lib/ocaml/js_math.cmt +0 -0
- package/lib/ocaml/js_math.ml +1 -1
- package/lib/ocaml/js_null.cmi +0 -0
- package/lib/ocaml/js_null.cmt +0 -0
- package/lib/ocaml/js_null.cmti +0 -0
- package/lib/ocaml/js_null_undefined.cmi +0 -0
- package/lib/ocaml/js_null_undefined.cmt +0 -0
- package/lib/ocaml/js_null_undefined.cmti +0 -0
- package/lib/ocaml/js_obj.cmt +0 -0
- package/lib/ocaml/js_option.cmi +0 -0
- package/lib/ocaml/js_option.cmt +0 -0
- package/lib/ocaml/js_option.cmti +0 -0
- package/lib/ocaml/js_promise.cmi +0 -0
- package/lib/ocaml/js_promise.cmt +0 -0
- package/lib/ocaml/js_promise.ml +19 -19
- package/lib/ocaml/js_promise2.cmi +0 -0
- package/lib/ocaml/js_promise2.cmt +0 -0
- package/lib/ocaml/js_promise2.res +58 -0
- package/lib/ocaml/js_re.cmi +0 -0
- package/lib/ocaml/js_re.cmt +0 -0
- package/lib/ocaml/js_result.cmt +0 -0
- package/lib/ocaml/js_result.cmti +0 -0
- package/lib/ocaml/js_set.cmt +0 -0
- package/lib/ocaml/js_string.cmi +0 -0
- package/lib/ocaml/js_string.cmt +0 -0
- package/lib/ocaml/js_string2.cmi +0 -0
- package/lib/ocaml/js_string2.cmt +0 -0
- package/lib/ocaml/js_typed_array.cmi +0 -0
- package/lib/ocaml/js_typed_array.cmt +0 -0
- package/lib/ocaml/js_typed_array2.cmi +0 -0
- package/lib/ocaml/js_typed_array2.cmt +0 -0
- package/lib/ocaml/js_types.cmt +0 -0
- package/lib/ocaml/js_types.cmti +0 -0
- package/lib/ocaml/js_undefined.cmi +0 -0
- package/lib/ocaml/js_undefined.cmt +0 -0
- package/lib/ocaml/js_undefined.cmti +0 -0
- package/lib/ocaml/js_vector.cmi +0 -0
- package/lib/ocaml/js_vector.cmt +0 -0
- package/lib/ocaml/js_vector.cmti +0 -0
- package/lib/ocaml/js_weakmap.cmt +0 -0
- package/lib/ocaml/js_weakset.cmt +0 -0
- package/lib/ocaml/jsx.cmi +0 -0
- package/lib/ocaml/jsx.cmt +0 -0
- package/lib/ocaml/{jsx.ml → jsx.res} +13 -12
- package/lib/ocaml/jsxDOM.cmi +0 -0
- package/lib/ocaml/jsxDOM.cmt +0 -0
- package/lib/ocaml/jsxDOM.res +620 -0
- package/lib/ocaml/jsxDOMStyle.cmi +0 -0
- package/lib/ocaml/jsxDOMStyle.cmt +0 -0
- package/lib/ocaml/jsxDOMStyle.ml +4 -0
- package/lib/ocaml/jsxEvent.cmt +0 -0
- package/lib/ocaml/jsxPPXReactSupport.cmi +0 -0
- package/lib/ocaml/jsxPPXReactSupport.cmt +0 -0
- package/{scripts/LICENSE.ml → lib/ocaml/jsxPPXReactSupport.res} +25 -4
- package/lib/ocaml/lazy.cmi +0 -0
- package/lib/ocaml/lazy.cmt +0 -0
- package/lib/ocaml/lazy.cmti +0 -0
- package/lib/ocaml/lexing.cmi +0 -0
- package/lib/ocaml/lexing.cmt +0 -0
- package/lib/ocaml/lexing.cmti +0 -0
- package/lib/ocaml/list.cmi +0 -0
- package/lib/ocaml/list.cmt +0 -0
- package/lib/ocaml/list.cmti +0 -0
- package/lib/ocaml/listLabels.cmi +0 -0
- package/lib/ocaml/listLabels.cmt +0 -0
- package/lib/ocaml/listLabels.cmti +0 -0
- package/lib/ocaml/map.cmi +0 -0
- package/lib/ocaml/map.cmt +0 -0
- package/lib/ocaml/map.cmti +0 -0
- package/lib/ocaml/mapLabels.cmi +0 -0
- package/lib/ocaml/mapLabels.cmt +0 -0
- package/lib/ocaml/moreLabels.cmi +0 -0
- package/lib/ocaml/moreLabels.cmt +0 -0
- package/lib/ocaml/moreLabels.cmti +0 -0
- package/lib/ocaml/node.cmi +0 -0
- package/lib/ocaml/node.cmt +0 -0
- package/lib/ocaml/node_buffer.cmi +0 -0
- package/lib/ocaml/node_buffer.cmt +0 -0
- package/lib/ocaml/node_child_process.cmi +0 -0
- package/lib/ocaml/node_child_process.cmt +0 -0
- package/lib/ocaml/node_fs.cmi +0 -0
- package/lib/ocaml/node_fs.cmt +0 -0
- package/lib/ocaml/node_module.cmi +0 -0
- package/lib/ocaml/node_module.cmt +0 -0
- package/lib/ocaml/node_path.cmt +0 -0
- package/lib/ocaml/node_process.cmi +0 -0
- package/lib/ocaml/node_process.cmt +0 -0
- package/lib/ocaml/node_process.cmti +0 -0
- package/lib/ocaml/obj.cmi +0 -0
- package/lib/ocaml/obj.cmt +0 -0
- package/lib/ocaml/obj.cmti +0 -0
- package/lib/ocaml/parsing.cmi +0 -0
- package/lib/ocaml/parsing.cmt +0 -0
- package/lib/ocaml/parsing.cmti +0 -0
- package/lib/ocaml/pervasives.cmi +0 -0
- package/lib/ocaml/pervasives.cmt +0 -0
- package/lib/ocaml/pervasives.cmti +0 -0
- package/lib/ocaml/printexc.cmi +0 -0
- package/lib/ocaml/printexc.cmt +0 -0
- package/lib/ocaml/printexc.cmti +0 -0
- package/lib/ocaml/printexc.ml +28 -32
- package/lib/ocaml/queue.cmi +0 -0
- package/lib/ocaml/queue.cmt +0 -0
- package/lib/ocaml/queue.cmti +0 -0
- package/lib/ocaml/random.cmi +0 -0
- package/lib/ocaml/random.cmt +0 -0
- package/lib/ocaml/random.cmti +0 -0
- package/lib/ocaml/set.cmi +0 -0
- package/lib/ocaml/set.cmt +0 -0
- package/lib/ocaml/set.cmti +0 -0
- package/lib/ocaml/setLabels.cmi +0 -0
- package/lib/ocaml/setLabels.cmt +0 -0
- package/lib/ocaml/sort.cmi +0 -0
- package/lib/ocaml/sort.cmt +0 -0
- package/lib/ocaml/sort.cmti +0 -0
- package/lib/ocaml/stack.cmi +0 -0
- package/lib/ocaml/stack.cmt +0 -0
- package/lib/ocaml/stack.cmti +0 -0
- package/lib/ocaml/stdLabels.cmi +0 -0
- package/lib/ocaml/stdLabels.cmt +0 -0
- package/lib/ocaml/stdLabels.cmti +0 -0
- package/lib/ocaml/stream.cmi +0 -0
- package/lib/ocaml/stream.cmt +0 -0
- package/lib/ocaml/stream.cmti +0 -0
- package/lib/ocaml/string.cmi +0 -0
- package/lib/ocaml/string.cmt +0 -0
- package/lib/ocaml/string.cmti +0 -0
- package/lib/ocaml/stringLabels.cmi +0 -0
- package/lib/ocaml/stringLabels.cmt +0 -0
- package/lib/ocaml/stringLabels.cmti +0 -0
- package/lib/ocaml/sys.cmi +0 -0
- package/lib/ocaml/sys.cmt +0 -0
- package/lib/ocaml/sys.cmti +0 -0
- package/lib/ocaml/uchar.cmi +0 -0
- package/lib/ocaml/uchar.cmt +0 -0
- package/lib/ocaml/uchar.cmti +0 -0
- package/package.json +2 -1
- package/scripts/buildNinjaBinary.js +29 -0
- package/scripts/install.js +7 -3
- package/scripts/installUtils.js +9 -1
- package/scripts/rescript_arg.js +2 -4
- package/scripts/rescript_format.js +73 -39
- package/win32/refmt.exe +0 -0
- package/darwin/bsb_helper.exe +0 -0
- package/darwin/bsc.exe +0 -0
- package/darwin/ninja.COPYING +0 -202
- package/darwin/ninja.exe +0 -0
- package/darwin/rescript.exe +0 -0
- package/darwinarm64/ninja.COPYING +0 -202
- package/freebsd/ninja.COPYING +0 -202
- package/lib/ocaml/jsxDOM.ml +0 -2087
- package/linux/bsb_helper.exe +0 -0
- package/linux/bsc.exe +0 -0
- package/linux/ninja.COPYING +0 -202
- package/linux/ninja.exe +0 -0
- package/linux/rescript.exe +0 -0
- package/openbsd/.keep +0 -0
- package/scripts/buckle_lto.js +0 -55
- package/scripts/build_sorted.ml +0 -233
- package/scripts/caml_oo_curry_gen.ml +0 -71
- package/scripts/checkUnused.js +0 -63
- package/scripts/ciTest.js +0 -172
- package/scripts/cover.sh +0 -3
- package/scripts/curry_gen.ml +0 -167
- package/scripts/dbg +0 -13
- package/scripts/dedupe.js +0 -44
- package/scripts/doc_gen.js +0 -117
- package/scripts/js_internal_gen.js +0 -135
- package/scripts/jsconfig.json +0 -12
- package/scripts/littlecase.js +0 -21
- package/scripts/ninja.js +0 -1980
- package/scripts/pack.js +0 -107
- package/scripts/prebuilt.js +0 -99
- package/scripts/release.js +0 -41
- package/scripts/repl.js +0 -151
- package/scripts/shake.js +0 -138
- package/scripts/tasks.js +0 -149
- package/scripts/test.sh +0 -3
- package/scripts/tmp.js +0 -98
- package/scripts/validate.js +0 -41
- package/vendor/ninja.tar.gz +0 -0
- package/win32/bsb_helper.exe +0 -0
- package/win32/bsc.exe +0 -0
- package/win32/ninja.COPYING +0 -202
- package/win32/ninja.exe +0 -0
- package/win32/rescript.exe +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
*
|
|
1
|
+
/* Copyright (C) 2022- Authors of ReScript
|
|
2
|
+
*
|
|
3
3
|
* This program is free software: you can redistribute it and/or modify
|
|
4
4
|
* it under the terms of the GNU Lesser General Public License as published by
|
|
5
5
|
* the Free Software Foundation, either version 3 of the License, or
|
|
@@ -17,11 +17,32 @@
|
|
|
17
17
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
18
18
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
19
19
|
* GNU Lesser General Public License for more details.
|
|
20
|
-
*
|
|
20
|
+
*
|
|
21
21
|
* You should have received a copy of the GNU Lesser General Public License
|
|
22
22
|
* along with this program; if not, write to the Free Software
|
|
23
|
-
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
23
|
+
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */
|
|
24
|
+
|
|
25
|
+
%%private(
|
|
26
|
+
@val
|
|
27
|
+
external propsWithKey: (@as(json`{}`) _, 'props, {"key": string}) => 'props = "Object.assign"
|
|
28
|
+
|
|
29
|
+
@inline
|
|
30
|
+
let addKeyProp = (~key: option<string>=?, p: 'props): 'props =>
|
|
31
|
+
switch key {
|
|
32
|
+
| Some(key) => propsWithKey(p, {"key": key})
|
|
33
|
+
| None => p
|
|
34
|
+
}
|
|
35
|
+
)
|
|
24
36
|
|
|
37
|
+
@module("react")
|
|
38
|
+
external createElement: (Jsx.component<'props>, 'props) => Jsx.element = "createElement"
|
|
25
39
|
|
|
40
|
+
@variadic @module("react")
|
|
41
|
+
external createElementVariadic: (Jsx.component<'props>, 'props, array<Jsx.element>) => Jsx.element =
|
|
42
|
+
"createElement"
|
|
26
43
|
|
|
44
|
+
let createElementWithKey = (~key=?, component, props) =>
|
|
45
|
+
createElement(component, addKeyProp(~key?, props))
|
|
27
46
|
|
|
47
|
+
let createElementVariadicWithKey = (~key=?, component, props, elements) =>
|
|
48
|
+
createElementVariadic(component, addKeyProp(~key?, props), elements)
|
package/lib/ocaml/lazy.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/lazy.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/lazy.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/lexing.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/lexing.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/lexing.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/list.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/list.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/list.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/listLabels.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/listLabels.cmt
CHANGED
|
Binary file
|
|
Binary file
|
package/lib/ocaml/map.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/map.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/map.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/mapLabels.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/mapLabels.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/moreLabels.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/moreLabels.cmt
CHANGED
|
Binary file
|
|
Binary file
|
package/lib/ocaml/node.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/node.cmt
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/node_fs.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/node_fs.cmt
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/node_path.cmt
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/obj.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/obj.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/obj.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/parsing.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/parsing.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/parsing.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/pervasives.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/pervasives.cmt
CHANGED
|
Binary file
|
|
Binary file
|
package/lib/ocaml/printexc.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/printexc.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/printexc.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/printexc.ml
CHANGED
|
@@ -12,16 +12,21 @@
|
|
|
12
12
|
(* special exception on linking described in the file LICENSE. *)
|
|
13
13
|
(* *)
|
|
14
14
|
(**************************************************************************)
|
|
15
|
-
[@@@bs.config { flags = [|"-bs-no-cross-module-opt" |]}]
|
|
16
|
-
|
|
15
|
+
[@@@bs.config { flags = [| "-bs-no-cross-module-opt" |] }]
|
|
17
16
|
|
|
18
17
|
let printers = ref []
|
|
19
18
|
|
|
20
|
-
let locfmt s (linum : int) (start : int) (finish : int) msg =
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
let locfmt s (linum : int) (start : int) (finish : int) msg =
|
|
20
|
+
(((((((("File \"" ^ s) ^ "\", line ") ^ __unsafe_cast linum) ^ ", characters ")
|
|
21
|
+
^ __unsafe_cast start)
|
|
22
|
+
^ "-")
|
|
23
|
+
^ __unsafe_cast finish)
|
|
24
|
+
^ ": ")
|
|
25
|
+
^ msg
|
|
23
26
|
|
|
24
|
-
let fields : exn -> string =
|
|
27
|
+
let fields : exn -> string =
|
|
28
|
+
[%raw
|
|
29
|
+
{|function(x){
|
|
25
30
|
var s = ""
|
|
26
31
|
var index = 1
|
|
27
32
|
while ("_"+index in x){
|
|
@@ -33,47 +38,38 @@ let fields : exn -> string = [%raw{|function(x){
|
|
|
33
38
|
}
|
|
34
39
|
return "(" + s + ")"
|
|
35
40
|
}
|
|
36
|
-
|}]
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
|}]
|
|
41
42
|
|
|
42
43
|
external exn_slot_name : exn -> string = "?exn_slot_name"
|
|
43
44
|
|
|
44
|
-
let to_string x =
|
|
45
|
+
let to_string x =
|
|
45
46
|
let rec conv = function
|
|
46
|
-
| hd :: tl ->
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
| None -> conv tl)
|
|
50
|
-
| [] ->
|
|
47
|
+
| hd :: tl -> (
|
|
48
|
+
match try hd x with _ -> None with Some s -> s | None -> conv tl)
|
|
49
|
+
| [] -> (
|
|
51
50
|
match x with
|
|
52
|
-
| Match_failure(file, line, char) ->
|
|
53
|
-
locfmt file line char (char+5) "Pattern matching failed"
|
|
54
|
-
| Assert_failure(file, line, char) ->
|
|
55
|
-
locfmt file line char (char+6) "Assertion failed"
|
|
56
|
-
| Undefined_recursive_module(file, line, char) ->
|
|
57
|
-
locfmt file line char (char+6) "Undefined recursive module"
|
|
51
|
+
| Match_failure (file, line, char) ->
|
|
52
|
+
locfmt file line char (char + 5) "Pattern matching failed"
|
|
53
|
+
| Assert_failure (file, line, char) ->
|
|
54
|
+
locfmt file line char (char + 6) "Assertion failed"
|
|
55
|
+
| Undefined_recursive_module (file, line, char) ->
|
|
56
|
+
locfmt file line char (char + 6) "Undefined recursive module"
|
|
58
57
|
| _ ->
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
58
|
+
let constructor = exn_slot_name x in
|
|
59
|
+
constructor ^ fields x)
|
|
60
|
+
in
|
|
62
61
|
conv !printers
|
|
63
62
|
|
|
64
63
|
let print fct arg =
|
|
65
|
-
try
|
|
66
|
-
fct arg
|
|
64
|
+
try fct arg
|
|
67
65
|
with x ->
|
|
68
66
|
Js.log ("Uncaught exception: " ^ to_string x);
|
|
69
67
|
raise x
|
|
70
68
|
|
|
71
69
|
let catch fct arg =
|
|
72
|
-
try
|
|
73
|
-
fct arg
|
|
70
|
+
try fct arg
|
|
74
71
|
with x ->
|
|
75
72
|
Js.log ("Uncaught exception: " ^ to_string x);
|
|
76
73
|
exit 2
|
|
77
74
|
|
|
78
|
-
let register_printer fn =
|
|
79
|
-
printers := fn :: !printers
|
|
75
|
+
let register_printer fn = printers := fn :: !printers
|
package/lib/ocaml/queue.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/queue.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/queue.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/random.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/random.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/random.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/set.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/set.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/set.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/setLabels.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/setLabels.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/sort.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/sort.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/sort.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/stack.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/stack.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/stack.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/stdLabels.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/stdLabels.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/stdLabels.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/stream.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/stream.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/stream.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/string.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/string.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/string.cmti
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/lib/ocaml/sys.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/sys.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/sys.cmti
CHANGED
|
Binary file
|
package/lib/ocaml/uchar.cmi
CHANGED
|
Binary file
|
package/lib/ocaml/uchar.cmt
CHANGED
|
Binary file
|
package/lib/ocaml/uchar.cmti
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tellahq/rescript",
|
|
3
|
-
"version": "10.1.
|
|
3
|
+
"version": "10.1.4-republish-1",
|
|
4
4
|
"devDependencies": {
|
|
5
5
|
"mocha": "^7.2.0",
|
|
6
6
|
"nyc": "^15.0.0",
|
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
"files": [
|
|
28
28
|
"CHANGELOG.md",
|
|
29
29
|
"CREDITS.md",
|
|
30
|
+
"ninja.COPYING",
|
|
30
31
|
"bsc",
|
|
31
32
|
"bsrefmt",
|
|
32
33
|
"rescript",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const child_process = require("child_process");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const path = require("path");
|
|
6
|
+
|
|
7
|
+
const platform = process.platform;
|
|
8
|
+
const ninjaDir = path.join(__dirname, "..", "ninja");
|
|
9
|
+
const buildCommand = "python3 configure.py --bootstrap --verbose";
|
|
10
|
+
|
|
11
|
+
if (platform === "win32") {
|
|
12
|
+
// On Windows, the build uses the MSVC compiler which needs to be on the path.
|
|
13
|
+
child_process.execSync(buildCommand, { cwd: ninjaDir });
|
|
14
|
+
} else {
|
|
15
|
+
if (process.platform === "darwin") {
|
|
16
|
+
process.env["CXXFLAGS"] = "-flto";
|
|
17
|
+
}
|
|
18
|
+
child_process.execSync(buildCommand, { stdio: [0, 1, 2], cwd: ninjaDir });
|
|
19
|
+
child_process.execSync(`strip ninja`, { stdio: [0, 1, 2], cwd: ninjaDir });
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
const { absolutePath, ninja_exe } = require("./bin_path");
|
|
23
|
+
const src = path.join(ninjaDir, `ninja${platform === "win32" ? ".exe" : ""}`);
|
|
24
|
+
|
|
25
|
+
if (!fs.existsSync(absolutePath)) {
|
|
26
|
+
fs.mkdirSync(absolutePath);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
fs.copyFileSync(src, ninja_exe);
|
package/scripts/install.js
CHANGED
|
@@ -39,17 +39,21 @@ var force_lib_rebuild = process.argv.includes("-force-lib-rebuild");
|
|
|
39
39
|
function provideNinja() {
|
|
40
40
|
var vendor_ninja_version = "1.9.0.git";
|
|
41
41
|
var ninja_source_dir = path.join(root_dir, "vendor", "ninja");
|
|
42
|
+
|
|
42
43
|
function build_ninja() {
|
|
43
44
|
console.log(`building ninja`);
|
|
44
45
|
ensureExists(ninja_source_dir);
|
|
46
|
+
|
|
45
47
|
if (fs.existsSync(path.join(root_dir, "vendor", "ninja.tar.gz"))) {
|
|
48
|
+
// Build from source on installation of the npm package
|
|
49
|
+
// for platforms where we don't provide a pre-built binary.
|
|
46
50
|
console.log("Extracting ninja sources...");
|
|
47
51
|
child_process.execSync(`tar xzf ../ninja.tar.gz`, {
|
|
48
52
|
cwd: ninja_source_dir,
|
|
49
53
|
stdio: [0, 1, 2],
|
|
50
54
|
});
|
|
51
55
|
console.log("No prebuilt Ninja, building Ninja now");
|
|
52
|
-
var build_ninja_command = "./configure.py --bootstrap";
|
|
56
|
+
var build_ninja_command = "python3 ./configure.py --bootstrap";
|
|
53
57
|
child_process.execSync(build_ninja_command, {
|
|
54
58
|
cwd: ninja_source_dir,
|
|
55
59
|
stdio: [0, 1, 2],
|
|
@@ -59,8 +63,8 @@ function provideNinja() {
|
|
|
59
63
|
ninja_bin_output
|
|
60
64
|
);
|
|
61
65
|
} else {
|
|
62
|
-
|
|
63
|
-
require("../
|
|
66
|
+
// Build from source for "npm install" in local dev.
|
|
67
|
+
require("../scripts/buildNinjaBinary");
|
|
64
68
|
fs.copyFileSync(
|
|
65
69
|
path.join(root_dir, "ninja", ninja_bin_filename),
|
|
66
70
|
ninja_bin_output
|
package/scripts/installUtils.js
CHANGED
|
@@ -45,7 +45,15 @@ function install() {
|
|
|
45
45
|
});
|
|
46
46
|
|
|
47
47
|
// for merlin or other IDE
|
|
48
|
-
var installed_suffixes = [
|
|
48
|
+
var installed_suffixes = [
|
|
49
|
+
".ml",
|
|
50
|
+
".mli",
|
|
51
|
+
".res",
|
|
52
|
+
".resi",
|
|
53
|
+
".cmi",
|
|
54
|
+
".cmt",
|
|
55
|
+
".cmti",
|
|
56
|
+
];
|
|
49
57
|
installDirBy(others_dir, ocaml_dir, function (file) {
|
|
50
58
|
var y = path.parse(file);
|
|
51
59
|
if (y.ext === ".cmi") {
|
package/scripts/rescript_arg.js
CHANGED
|
@@ -26,7 +26,7 @@ function bad_arg(s) {
|
|
|
26
26
|
/**
|
|
27
27
|
* @typedef {{val : string}} stringref
|
|
28
28
|
* @typedef {{val : boolean}} boolref
|
|
29
|
-
* @typedef {{kind:"Unit_call",data : ()=>void } | {kind : "Unit_set", data : boolref}}unit_action
|
|
29
|
+
* @typedef {{kind:"Unit_call",data : ()=>void } | {kind : "Unit_set", data : boolref}} unit_action
|
|
30
30
|
* @typedef {{kind:"String_call",data:(s : string)=>void} | {kind : "String_set",data: stringref}} string_action
|
|
31
31
|
* @typedef {{kind:"Unit",data : unit_action } | {kind:"String", data: string_action}} action
|
|
32
32
|
* @typedef {Array<[string,action,string]>} specs
|
|
@@ -67,9 +67,7 @@ function usage_b(b, usage, specs) {
|
|
|
67
67
|
cur = i + 1;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
|
|
71
|
-
b.add("\n");
|
|
72
|
-
}
|
|
70
|
+
b.add("\n");
|
|
73
71
|
}
|
|
74
72
|
}
|
|
75
73
|
}
|
|
@@ -5,8 +5,11 @@ var format_usage = `Usage: rescript format <options> [files]
|
|
|
5
5
|
\`rescript format\` formats the current directory
|
|
6
6
|
`;
|
|
7
7
|
var child_process = require("child_process");
|
|
8
|
+
var util = require("node:util");
|
|
9
|
+
var asyncExecFile = util.promisify(child_process.execFile);
|
|
8
10
|
var path = require("path");
|
|
9
11
|
var fs = require("fs");
|
|
12
|
+
var asyncFs = fs.promises;
|
|
10
13
|
/**
|
|
11
14
|
* @type {arg.stringref}
|
|
12
15
|
*/
|
|
@@ -17,6 +20,11 @@ var stdin = { val: undefined };
|
|
|
17
20
|
*/
|
|
18
21
|
var format = { val: undefined };
|
|
19
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @type {arg.boolref}
|
|
25
|
+
*/
|
|
26
|
+
var check = { val: undefined };
|
|
27
|
+
|
|
20
28
|
/**
|
|
21
29
|
* @type{arg.specs}
|
|
22
30
|
*/
|
|
@@ -27,12 +35,16 @@ var specs = [
|
|
|
27
35
|
`[.res|.resi|.ml|.mli] Read the code from stdin and print
|
|
28
36
|
the formatted code to stdout in ReScript syntax`,
|
|
29
37
|
],
|
|
30
|
-
// ml|mli
|
|
31
38
|
[
|
|
32
39
|
"-all",
|
|
33
40
|
{ kind: "Unit", data: { kind: "Unit_set", data: format } },
|
|
34
41
|
"Format the whole project ",
|
|
35
42
|
],
|
|
43
|
+
[
|
|
44
|
+
"-check",
|
|
45
|
+
{ kind: "Unit", data: { kind: "Unit_set", data: check } },
|
|
46
|
+
"Check formatting for file or the whole project. Use `-all` to check the whole project",
|
|
47
|
+
],
|
|
36
48
|
];
|
|
37
49
|
var formattedStdExtensions = [".res", ".resi", ".ml", ".mli"];
|
|
38
50
|
var formattedFileExtensions = [".res", ".resi"];
|
|
@@ -55,12 +67,55 @@ async function readStdin() {
|
|
|
55
67
|
return Buffer.concat(chunks).toString("utf8");
|
|
56
68
|
}
|
|
57
69
|
|
|
70
|
+
/**
|
|
71
|
+
* @param {string[]} files
|
|
72
|
+
* @param {string} bsc_exe
|
|
73
|
+
* @param {(x: string) => boolean} isSupportedFile
|
|
74
|
+
* @param {boolean} checkFormatting
|
|
75
|
+
*/
|
|
76
|
+
async function formatFiles(files, bsc_exe, isSupportedFile, checkFormatting) {
|
|
77
|
+
var incorrectlyFormattedFiles = 0;
|
|
78
|
+
try {
|
|
79
|
+
const _promises = await Promise.all(
|
|
80
|
+
files.map(async file => {
|
|
81
|
+
if (isSupportedFile(file)) {
|
|
82
|
+
const flags = checkFormatting
|
|
83
|
+
? ["-format", file]
|
|
84
|
+
: ["-o", file, "-format", file];
|
|
85
|
+
const { stdout } = await asyncExecFile(bsc_exe, flags);
|
|
86
|
+
if (check.val) {
|
|
87
|
+
const original = await asyncFs.readFile(file, "utf-8");
|
|
88
|
+
if (original != stdout) {
|
|
89
|
+
console.error("[format check]", file);
|
|
90
|
+
incorrectlyFormattedFiles++;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return null;
|
|
95
|
+
})
|
|
96
|
+
);
|
|
97
|
+
} catch (err) {
|
|
98
|
+
console.error(err);
|
|
99
|
+
process.exit(2);
|
|
100
|
+
}
|
|
101
|
+
if (incorrectlyFormattedFiles > 0) {
|
|
102
|
+
if (incorrectlyFormattedFiles == 1) {
|
|
103
|
+
console.error("The file listed above needs formatting");
|
|
104
|
+
} else {
|
|
105
|
+
console.error(
|
|
106
|
+
`The ${incorrectlyFormattedFiles} files listed above need formatting`
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
process.exit(3);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
58
113
|
/**
|
|
59
114
|
* @param {string[]} argv
|
|
60
115
|
* @param {string} rescript_exe
|
|
61
116
|
* @param {string} bsc_exe
|
|
62
117
|
*/
|
|
63
|
-
function main(argv, rescript_exe, bsc_exe) {
|
|
118
|
+
async function main(argv, rescript_exe, bsc_exe) {
|
|
64
119
|
var isSupportedFile = hasExtension(formattedFileExtensions);
|
|
65
120
|
var isSupportedStd = hasExtension(formattedStdExtensions);
|
|
66
121
|
|
|
@@ -75,6 +130,16 @@ function main(argv, rescript_exe, bsc_exe) {
|
|
|
75
130
|
|
|
76
131
|
var format_project = format.val;
|
|
77
132
|
var use_stdin = stdin.val;
|
|
133
|
+
|
|
134
|
+
// Only -check arg
|
|
135
|
+
// Require: -all or path to a file
|
|
136
|
+
if (check.val && !format_project && files.length == 0) {
|
|
137
|
+
console.error(
|
|
138
|
+
"format check require path to a file or use `-all` to check the whole project"
|
|
139
|
+
);
|
|
140
|
+
process.exit(2);
|
|
141
|
+
}
|
|
142
|
+
|
|
78
143
|
if (format_project) {
|
|
79
144
|
if (use_stdin || files.length !== 0) {
|
|
80
145
|
console.error("format -all can not be in use with other flags");
|
|
@@ -95,26 +160,12 @@ function main(argv, rescript_exe, bsc_exe) {
|
|
|
95
160
|
process.exit(2);
|
|
96
161
|
}
|
|
97
162
|
files = output.stdout.split("\n").map(x => x.trim());
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
child_process.execFile(
|
|
103
|
-
bsc_exe,
|
|
104
|
-
["-o", arg, "-format", arg],
|
|
105
|
-
(error, _stdout, stderr) => {
|
|
106
|
-
if (error !== null) {
|
|
107
|
-
console.error(stderr);
|
|
108
|
-
hasError = true;
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
if (hasError) {
|
|
163
|
+
await formatFiles(files, bsc_exe, isSupportedFile, check.val);
|
|
164
|
+
} else if (use_stdin) {
|
|
165
|
+
if (check.val) {
|
|
166
|
+
console.error("format -stdin cannot be used with -check flag");
|
|
115
167
|
process.exit(2);
|
|
116
168
|
}
|
|
117
|
-
} else if (use_stdin) {
|
|
118
169
|
if (isSupportedStd(use_stdin)) {
|
|
119
170
|
var crypto = require("crypto");
|
|
120
171
|
var os = require("os");
|
|
@@ -144,7 +195,7 @@ function main(argv, rescript_exe, bsc_exe) {
|
|
|
144
195
|
);
|
|
145
196
|
})();
|
|
146
197
|
} else {
|
|
147
|
-
console.error(`Unsupported
|
|
198
|
+
console.error(`Unsupported extension ${use_stdin}`);
|
|
148
199
|
console.error(`Supported extensions: ${formattedStdExtensions} `);
|
|
149
200
|
process.exit(2);
|
|
150
201
|
}
|
|
@@ -163,24 +214,7 @@ function main(argv, rescript_exe, bsc_exe) {
|
|
|
163
214
|
process.exit(2);
|
|
164
215
|
}
|
|
165
216
|
}
|
|
166
|
-
|
|
167
|
-
files.forEach(file => {
|
|
168
|
-
var write = isSupportedFile(file);
|
|
169
|
-
var flags = write ? ["-o", file, "-format", file] : ["-format", file];
|
|
170
|
-
child_process.execFile(bsc_exe, flags, (error, stdout, stderr) => {
|
|
171
|
-
if (error === null) {
|
|
172
|
-
if (!write) {
|
|
173
|
-
process.stdout.write(stdout);
|
|
174
|
-
}
|
|
175
|
-
} else {
|
|
176
|
-
console.error(stderr);
|
|
177
|
-
hasError = true;
|
|
178
|
-
}
|
|
179
|
-
});
|
|
180
|
-
});
|
|
181
|
-
if (hasError) {
|
|
182
|
-
process.exit(2);
|
|
183
|
-
}
|
|
217
|
+
await formatFiles(files, bsc_exe, isSupportedFile, check.val);
|
|
184
218
|
}
|
|
185
219
|
} catch (e) {
|
|
186
220
|
if (e instanceof arg.ArgError) {
|
package/win32/refmt.exe
CHANGED
|
File without changes
|
package/darwin/bsb_helper.exe
DELETED
|
Binary file
|