@tellahq/rescript 10.1.0-alpha.2 → 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.
Files changed (410) hide show
  1. package/CHANGELOG.md +204 -2
  2. package/README.md +1 -1
  3. package/darwinarm64/bsb_helper.exe +0 -0
  4. package/darwinarm64/bsc.exe +0 -0
  5. package/darwinarm64/rescript.exe +0 -0
  6. package/docs/docson/build-schema.json +497 -516
  7. package/lib/4.06.1/bsb_helper.ml +6 -1
  8. package/lib/4.06.1/rescript.ml +1414 -1191
  9. package/lib/4.06.1/whole_compiler.ml +69844 -69069
  10. package/lib/es6/belt_internalBuckets.js +13 -13
  11. package/lib/es6/caml_float.js +5 -5
  12. package/lib/es6/caml_format.js +1 -1
  13. package/lib/es6/caml_int64.js +1 -1
  14. package/lib/es6/caml_obj.js +26 -6
  15. package/lib/es6/complex.js +4 -4
  16. package/lib/es6/js.js +3 -0
  17. package/lib/es6/js_promise2.js +16 -0
  18. package/lib/es6/jsxPPXReactSupport.js +26 -0
  19. package/lib/js/belt_internalBuckets.js +13 -13
  20. package/lib/js/caml_float.js +5 -5
  21. package/lib/js/caml_format.js +1 -1
  22. package/lib/js/caml_int64.js +1 -1
  23. package/lib/js/caml_obj.js +26 -6
  24. package/lib/js/complex.js +4 -4
  25. package/lib/js/js.js +3 -0
  26. package/lib/js/js_promise2.js +14 -0
  27. package/lib/js/jsxPPXReactSupport.js +24 -0
  28. package/lib/ocaml/arg.cmi +0 -0
  29. package/lib/ocaml/arg.cmt +0 -0
  30. package/lib/ocaml/arg.cmti +0 -0
  31. package/lib/ocaml/arg.ml +2 -2
  32. package/lib/ocaml/array.cmi +0 -0
  33. package/lib/ocaml/array.cmt +0 -0
  34. package/lib/ocaml/array.cmti +0 -0
  35. package/lib/ocaml/arrayLabels.cmi +0 -0
  36. package/lib/ocaml/arrayLabels.cmt +0 -0
  37. package/lib/ocaml/arrayLabels.cmti +0 -0
  38. package/lib/ocaml/belt.cmt +0 -0
  39. package/lib/ocaml/belt_Array.cmi +0 -0
  40. package/lib/ocaml/belt_Array.cmt +0 -0
  41. package/lib/ocaml/belt_Array.cmti +0 -0
  42. package/lib/ocaml/belt_Float.cmt +0 -0
  43. package/lib/ocaml/belt_Float.cmti +0 -0
  44. package/lib/ocaml/belt_HashMap.cmi +0 -0
  45. package/lib/ocaml/belt_HashMap.cmt +0 -0
  46. package/lib/ocaml/belt_HashMap.cmti +0 -0
  47. package/lib/ocaml/belt_HashMapInt.cmi +0 -0
  48. package/lib/ocaml/belt_HashMapInt.cmt +0 -0
  49. package/lib/ocaml/belt_HashMapInt.cmti +0 -0
  50. package/lib/ocaml/belt_HashMapString.cmi +0 -0
  51. package/lib/ocaml/belt_HashMapString.cmt +0 -0
  52. package/lib/ocaml/belt_HashMapString.cmti +0 -0
  53. package/lib/ocaml/belt_HashSet.cmi +0 -0
  54. package/lib/ocaml/belt_HashSet.cmt +0 -0
  55. package/lib/ocaml/belt_HashSet.cmti +0 -0
  56. package/lib/ocaml/belt_HashSetInt.cmi +0 -0
  57. package/lib/ocaml/belt_HashSetInt.cmt +0 -0
  58. package/lib/ocaml/belt_HashSetInt.cmti +0 -0
  59. package/lib/ocaml/belt_HashSetString.cmi +0 -0
  60. package/lib/ocaml/belt_HashSetString.cmt +0 -0
  61. package/lib/ocaml/belt_HashSetString.cmti +0 -0
  62. package/lib/ocaml/belt_Id.cmi +0 -0
  63. package/lib/ocaml/belt_Id.cmt +0 -0
  64. package/lib/ocaml/belt_Id.cmti +0 -0
  65. package/lib/ocaml/belt_Int.cmt +0 -0
  66. package/lib/ocaml/belt_Int.cmti +0 -0
  67. package/lib/ocaml/belt_List.cmi +0 -0
  68. package/lib/ocaml/belt_List.cmt +0 -0
  69. package/lib/ocaml/belt_List.cmti +0 -0
  70. package/lib/ocaml/belt_Map.cmi +0 -0
  71. package/lib/ocaml/belt_Map.cmt +0 -0
  72. package/lib/ocaml/belt_Map.cmti +0 -0
  73. package/lib/ocaml/belt_MapDict.cmi +0 -0
  74. package/lib/ocaml/belt_MapDict.cmt +0 -0
  75. package/lib/ocaml/belt_MapDict.cmti +0 -0
  76. package/lib/ocaml/belt_MapInt.cmi +0 -0
  77. package/lib/ocaml/belt_MapInt.cmt +0 -0
  78. package/lib/ocaml/belt_MapInt.cmti +0 -0
  79. package/lib/ocaml/belt_MapString.cmi +0 -0
  80. package/lib/ocaml/belt_MapString.cmt +0 -0
  81. package/lib/ocaml/belt_MapString.cmti +0 -0
  82. package/lib/ocaml/belt_MutableMap.cmi +0 -0
  83. package/lib/ocaml/belt_MutableMap.cmt +0 -0
  84. package/lib/ocaml/belt_MutableMap.cmti +0 -0
  85. package/lib/ocaml/belt_MutableMapInt.cmi +0 -0
  86. package/lib/ocaml/belt_MutableMapInt.cmt +0 -0
  87. package/lib/ocaml/belt_MutableMapInt.cmti +0 -0
  88. package/lib/ocaml/belt_MutableMapString.cmi +0 -0
  89. package/lib/ocaml/belt_MutableMapString.cmt +0 -0
  90. package/lib/ocaml/belt_MutableMapString.cmti +0 -0
  91. package/lib/ocaml/belt_MutableQueue.cmi +0 -0
  92. package/lib/ocaml/belt_MutableQueue.cmt +0 -0
  93. package/lib/ocaml/belt_MutableQueue.cmti +0 -0
  94. package/lib/ocaml/belt_MutableSet.cmi +0 -0
  95. package/lib/ocaml/belt_MutableSet.cmt +0 -0
  96. package/lib/ocaml/belt_MutableSet.cmti +0 -0
  97. package/lib/ocaml/belt_MutableSetInt.cmi +0 -0
  98. package/lib/ocaml/belt_MutableSetInt.cmt +0 -0
  99. package/lib/ocaml/belt_MutableSetInt.cmti +0 -0
  100. package/lib/ocaml/belt_MutableSetString.cmi +0 -0
  101. package/lib/ocaml/belt_MutableSetString.cmt +0 -0
  102. package/lib/ocaml/belt_MutableSetString.cmti +0 -0
  103. package/lib/ocaml/belt_MutableStack.cmi +0 -0
  104. package/lib/ocaml/belt_MutableStack.cmt +0 -0
  105. package/lib/ocaml/belt_MutableStack.cmti +0 -0
  106. package/lib/ocaml/belt_Option.cmi +0 -0
  107. package/lib/ocaml/belt_Option.cmt +0 -0
  108. package/lib/ocaml/belt_Option.cmti +0 -0
  109. package/lib/ocaml/belt_Range.cmi +0 -0
  110. package/lib/ocaml/belt_Range.cmt +0 -0
  111. package/lib/ocaml/belt_Range.cmti +0 -0
  112. package/lib/ocaml/belt_Result.cmi +0 -0
  113. package/lib/ocaml/belt_Result.cmt +0 -0
  114. package/lib/ocaml/belt_Result.cmti +0 -0
  115. package/lib/ocaml/belt_Set.cmi +0 -0
  116. package/lib/ocaml/belt_Set.cmt +0 -0
  117. package/lib/ocaml/belt_Set.cmti +0 -0
  118. package/lib/ocaml/belt_SetDict.cmi +0 -0
  119. package/lib/ocaml/belt_SetDict.cmt +0 -0
  120. package/lib/ocaml/belt_SetDict.cmti +0 -0
  121. package/lib/ocaml/belt_SetInt.cmi +0 -0
  122. package/lib/ocaml/belt_SetInt.cmt +0 -0
  123. package/lib/ocaml/belt_SetInt.cmti +0 -0
  124. package/lib/ocaml/belt_SetString.cmi +0 -0
  125. package/lib/ocaml/belt_SetString.cmt +0 -0
  126. package/lib/ocaml/belt_SetString.cmti +0 -0
  127. package/lib/ocaml/belt_SortArray.cmi +0 -0
  128. package/lib/ocaml/belt_SortArray.cmt +0 -0
  129. package/lib/ocaml/belt_SortArray.cmti +0 -0
  130. package/lib/ocaml/belt_SortArrayInt.cmt +0 -0
  131. package/lib/ocaml/belt_SortArrayInt.cmti +0 -0
  132. package/lib/ocaml/belt_SortArrayString.cmt +0 -0
  133. package/lib/ocaml/belt_SortArrayString.cmti +0 -0
  134. package/lib/ocaml/belt_internalAVLset.cmt +0 -0
  135. package/lib/ocaml/belt_internalAVLset.cmti +0 -0
  136. package/lib/ocaml/belt_internalAVLtree.cmt +0 -0
  137. package/lib/ocaml/belt_internalAVLtree.cmti +0 -0
  138. package/lib/ocaml/belt_internalBuckets.cmt +0 -0
  139. package/lib/ocaml/belt_internalBuckets.cmti +0 -0
  140. package/lib/ocaml/belt_internalBucketsType.cmt +0 -0
  141. package/lib/ocaml/belt_internalBucketsType.cmti +0 -0
  142. package/lib/ocaml/belt_internalMapInt.cmt +0 -0
  143. package/lib/ocaml/belt_internalMapString.cmt +0 -0
  144. package/lib/ocaml/belt_internalSetBuckets.cmt +0 -0
  145. package/lib/ocaml/belt_internalSetBuckets.cmti +0 -0
  146. package/lib/ocaml/belt_internalSetInt.cmt +0 -0
  147. package/lib/ocaml/belt_internalSetString.cmt +0 -0
  148. package/lib/ocaml/belt_internals.cmti +0 -0
  149. package/lib/ocaml/buffer.cmi +0 -0
  150. package/lib/ocaml/buffer.cmt +0 -0
  151. package/lib/ocaml/buffer.cmti +0 -0
  152. package/lib/ocaml/bytes.cmi +0 -0
  153. package/lib/ocaml/bytes.cmt +0 -0
  154. package/lib/ocaml/bytes.cmti +0 -0
  155. package/lib/ocaml/bytesLabels.cmi +0 -0
  156. package/lib/ocaml/bytesLabels.cmt +0 -0
  157. package/lib/ocaml/bytesLabels.cmti +0 -0
  158. package/lib/ocaml/callback.cmi +0 -0
  159. package/lib/ocaml/callback.cmt +0 -0
  160. package/lib/ocaml/callback.cmti +0 -0
  161. package/lib/ocaml/camlinternalLazy.cmi +0 -0
  162. package/lib/ocaml/camlinternalLazy.cmt +0 -0
  163. package/lib/ocaml/camlinternalLazy.cmti +0 -0
  164. package/lib/ocaml/camlinternalMod.cmi +0 -0
  165. package/lib/ocaml/camlinternalMod.cmt +0 -0
  166. package/lib/ocaml/camlinternalMod.cmti +0 -0
  167. package/lib/ocaml/char.cmi +0 -0
  168. package/lib/ocaml/char.cmt +0 -0
  169. package/lib/ocaml/char.cmti +0 -0
  170. package/lib/ocaml/complex.cmi +0 -0
  171. package/lib/ocaml/complex.cmt +0 -0
  172. package/lib/ocaml/complex.cmti +0 -0
  173. package/lib/ocaml/digest.cmi +0 -0
  174. package/lib/ocaml/digest.cmt +0 -0
  175. package/lib/ocaml/digest.cmti +0 -0
  176. package/lib/ocaml/dom.cmt +0 -0
  177. package/lib/ocaml/dom_storage.cmt +0 -0
  178. package/lib/ocaml/dom_storage2.cmt +0 -0
  179. package/lib/ocaml/filename.cmi +0 -0
  180. package/lib/ocaml/filename.cmt +0 -0
  181. package/lib/ocaml/filename.cmti +0 -0
  182. package/lib/ocaml/genlex.cmi +0 -0
  183. package/lib/ocaml/genlex.cmt +0 -0
  184. package/lib/ocaml/genlex.cmti +0 -0
  185. package/lib/ocaml/hashtbl.cmi +0 -0
  186. package/lib/ocaml/hashtbl.cmt +0 -0
  187. package/lib/ocaml/hashtbl.cmti +0 -0
  188. package/lib/ocaml/hashtblLabels.cmi +0 -0
  189. package/lib/ocaml/hashtblLabels.cmt +0 -0
  190. package/lib/ocaml/int32.cmi +0 -0
  191. package/lib/ocaml/int32.cmt +0 -0
  192. package/lib/ocaml/int32.cmti +0 -0
  193. package/lib/ocaml/int64.cmi +0 -0
  194. package/lib/ocaml/int64.cmt +0 -0
  195. package/lib/ocaml/int64.cmti +0 -0
  196. package/lib/ocaml/js.cmi +0 -0
  197. package/lib/ocaml/js.cmt +0 -0
  198. package/lib/ocaml/js.ml +3 -0
  199. package/lib/ocaml/js_OO.cmt +0 -0
  200. package/lib/ocaml/js_array.cmt +0 -0
  201. package/lib/ocaml/js_array2.cmt +0 -0
  202. package/lib/ocaml/js_bigint.cmt +0 -0
  203. package/lib/ocaml/js_cast.cmt +0 -0
  204. package/lib/ocaml/js_cast.cmti +0 -0
  205. package/lib/ocaml/js_console.cmt +0 -0
  206. package/lib/ocaml/js_date.cmt +0 -0
  207. package/lib/ocaml/js_dict.cmi +0 -0
  208. package/lib/ocaml/js_dict.cmt +0 -0
  209. package/lib/ocaml/js_dict.cmti +0 -0
  210. package/lib/ocaml/js_exn.cmt +0 -0
  211. package/lib/ocaml/js_exn.cmti +0 -0
  212. package/lib/ocaml/js_float.cmt +0 -0
  213. package/lib/ocaml/js_global.cmt +0 -0
  214. package/lib/ocaml/js_int.cmt +0 -0
  215. package/lib/ocaml/js_json.cmi +0 -0
  216. package/lib/ocaml/js_json.cmt +0 -0
  217. package/lib/ocaml/js_json.cmti +0 -0
  218. package/lib/ocaml/js_list.cmi +0 -0
  219. package/lib/ocaml/js_list.cmt +0 -0
  220. package/lib/ocaml/js_list.cmti +0 -0
  221. package/lib/ocaml/js_map.cmt +0 -0
  222. package/lib/ocaml/js_mapperRt.cmt +0 -0
  223. package/lib/ocaml/js_mapperRt.cmti +0 -0
  224. package/lib/ocaml/js_math.cmi +0 -0
  225. package/lib/ocaml/js_math.cmt +0 -0
  226. package/lib/ocaml/js_math.ml +1 -1
  227. package/lib/ocaml/js_null.cmi +0 -0
  228. package/lib/ocaml/js_null.cmt +0 -0
  229. package/lib/ocaml/js_null.cmti +0 -0
  230. package/lib/ocaml/js_null_undefined.cmi +0 -0
  231. package/lib/ocaml/js_null_undefined.cmt +0 -0
  232. package/lib/ocaml/js_null_undefined.cmti +0 -0
  233. package/lib/ocaml/js_obj.cmt +0 -0
  234. package/lib/ocaml/js_option.cmi +0 -0
  235. package/lib/ocaml/js_option.cmt +0 -0
  236. package/lib/ocaml/js_option.cmti +0 -0
  237. package/lib/ocaml/js_promise.cmi +0 -0
  238. package/lib/ocaml/js_promise.cmt +0 -0
  239. package/lib/ocaml/js_promise.ml +19 -19
  240. package/lib/ocaml/js_promise2.cmi +0 -0
  241. package/lib/ocaml/js_promise2.cmt +0 -0
  242. package/lib/ocaml/js_promise2.res +58 -0
  243. package/lib/ocaml/js_re.cmi +0 -0
  244. package/lib/ocaml/js_re.cmt +0 -0
  245. package/lib/ocaml/js_result.cmt +0 -0
  246. package/lib/ocaml/js_result.cmti +0 -0
  247. package/lib/ocaml/js_set.cmt +0 -0
  248. package/lib/ocaml/js_string.cmi +0 -0
  249. package/lib/ocaml/js_string.cmt +0 -0
  250. package/lib/ocaml/js_string2.cmi +0 -0
  251. package/lib/ocaml/js_string2.cmt +0 -0
  252. package/lib/ocaml/js_typed_array.cmi +0 -0
  253. package/lib/ocaml/js_typed_array.cmt +0 -0
  254. package/lib/ocaml/js_typed_array2.cmi +0 -0
  255. package/lib/ocaml/js_typed_array2.cmt +0 -0
  256. package/lib/ocaml/js_types.cmt +0 -0
  257. package/lib/ocaml/js_types.cmti +0 -0
  258. package/lib/ocaml/js_undefined.cmi +0 -0
  259. package/lib/ocaml/js_undefined.cmt +0 -0
  260. package/lib/ocaml/js_undefined.cmti +0 -0
  261. package/lib/ocaml/js_vector.cmi +0 -0
  262. package/lib/ocaml/js_vector.cmt +0 -0
  263. package/lib/ocaml/js_vector.cmti +0 -0
  264. package/lib/ocaml/js_weakmap.cmt +0 -0
  265. package/lib/ocaml/js_weakset.cmt +0 -0
  266. package/lib/ocaml/jsx.cmi +0 -0
  267. package/lib/ocaml/jsx.cmt +0 -0
  268. package/lib/ocaml/{jsx.ml → jsx.res} +13 -12
  269. package/lib/ocaml/jsxDOM.cmi +0 -0
  270. package/lib/ocaml/jsxDOM.cmt +0 -0
  271. package/lib/ocaml/jsxDOM.res +620 -0
  272. package/lib/ocaml/jsxDOMStyle.cmi +0 -0
  273. package/lib/ocaml/jsxDOMStyle.cmt +0 -0
  274. package/lib/ocaml/jsxDOMStyle.ml +4 -0
  275. package/lib/ocaml/jsxEvent.cmt +0 -0
  276. package/lib/ocaml/jsxPPXReactSupport.cmi +0 -0
  277. package/lib/ocaml/jsxPPXReactSupport.cmt +0 -0
  278. package/{scripts/LICENSE.ml → lib/ocaml/jsxPPXReactSupport.res} +25 -4
  279. package/lib/ocaml/lazy.cmi +0 -0
  280. package/lib/ocaml/lazy.cmt +0 -0
  281. package/lib/ocaml/lazy.cmti +0 -0
  282. package/lib/ocaml/lexing.cmi +0 -0
  283. package/lib/ocaml/lexing.cmt +0 -0
  284. package/lib/ocaml/lexing.cmti +0 -0
  285. package/lib/ocaml/list.cmi +0 -0
  286. package/lib/ocaml/list.cmt +0 -0
  287. package/lib/ocaml/list.cmti +0 -0
  288. package/lib/ocaml/listLabels.cmi +0 -0
  289. package/lib/ocaml/listLabels.cmt +0 -0
  290. package/lib/ocaml/listLabels.cmti +0 -0
  291. package/lib/ocaml/map.cmi +0 -0
  292. package/lib/ocaml/map.cmt +0 -0
  293. package/lib/ocaml/map.cmti +0 -0
  294. package/lib/ocaml/mapLabels.cmi +0 -0
  295. package/lib/ocaml/mapLabels.cmt +0 -0
  296. package/lib/ocaml/moreLabels.cmi +0 -0
  297. package/lib/ocaml/moreLabels.cmt +0 -0
  298. package/lib/ocaml/moreLabels.cmti +0 -0
  299. package/lib/ocaml/node.cmi +0 -0
  300. package/lib/ocaml/node.cmt +0 -0
  301. package/lib/ocaml/node_buffer.cmi +0 -0
  302. package/lib/ocaml/node_buffer.cmt +0 -0
  303. package/lib/ocaml/node_child_process.cmi +0 -0
  304. package/lib/ocaml/node_child_process.cmt +0 -0
  305. package/lib/ocaml/node_fs.cmi +0 -0
  306. package/lib/ocaml/node_fs.cmt +0 -0
  307. package/lib/ocaml/node_module.cmi +0 -0
  308. package/lib/ocaml/node_module.cmt +0 -0
  309. package/lib/ocaml/node_path.cmt +0 -0
  310. package/lib/ocaml/node_process.cmi +0 -0
  311. package/lib/ocaml/node_process.cmt +0 -0
  312. package/lib/ocaml/node_process.cmti +0 -0
  313. package/lib/ocaml/obj.cmi +0 -0
  314. package/lib/ocaml/obj.cmt +0 -0
  315. package/lib/ocaml/obj.cmti +0 -0
  316. package/lib/ocaml/parsing.cmi +0 -0
  317. package/lib/ocaml/parsing.cmt +0 -0
  318. package/lib/ocaml/parsing.cmti +0 -0
  319. package/lib/ocaml/pervasives.cmi +0 -0
  320. package/lib/ocaml/pervasives.cmt +0 -0
  321. package/lib/ocaml/pervasives.cmti +0 -0
  322. package/lib/ocaml/printexc.cmi +0 -0
  323. package/lib/ocaml/printexc.cmt +0 -0
  324. package/lib/ocaml/printexc.cmti +0 -0
  325. package/lib/ocaml/printexc.ml +28 -32
  326. package/lib/ocaml/queue.cmi +0 -0
  327. package/lib/ocaml/queue.cmt +0 -0
  328. package/lib/ocaml/queue.cmti +0 -0
  329. package/lib/ocaml/random.cmi +0 -0
  330. package/lib/ocaml/random.cmt +0 -0
  331. package/lib/ocaml/random.cmti +0 -0
  332. package/lib/ocaml/set.cmi +0 -0
  333. package/lib/ocaml/set.cmt +0 -0
  334. package/lib/ocaml/set.cmti +0 -0
  335. package/lib/ocaml/setLabels.cmi +0 -0
  336. package/lib/ocaml/setLabels.cmt +0 -0
  337. package/lib/ocaml/sort.cmi +0 -0
  338. package/lib/ocaml/sort.cmt +0 -0
  339. package/lib/ocaml/sort.cmti +0 -0
  340. package/lib/ocaml/stack.cmi +0 -0
  341. package/lib/ocaml/stack.cmt +0 -0
  342. package/lib/ocaml/stack.cmti +0 -0
  343. package/lib/ocaml/stdLabels.cmi +0 -0
  344. package/lib/ocaml/stdLabels.cmt +0 -0
  345. package/lib/ocaml/stdLabels.cmti +0 -0
  346. package/lib/ocaml/stream.cmi +0 -0
  347. package/lib/ocaml/stream.cmt +0 -0
  348. package/lib/ocaml/stream.cmti +0 -0
  349. package/lib/ocaml/string.cmi +0 -0
  350. package/lib/ocaml/string.cmt +0 -0
  351. package/lib/ocaml/string.cmti +0 -0
  352. package/lib/ocaml/stringLabels.cmi +0 -0
  353. package/lib/ocaml/stringLabels.cmt +0 -0
  354. package/lib/ocaml/stringLabels.cmti +0 -0
  355. package/lib/ocaml/sys.cmi +0 -0
  356. package/lib/ocaml/sys.cmt +0 -0
  357. package/lib/ocaml/sys.cmti +0 -0
  358. package/lib/ocaml/uchar.cmi +0 -0
  359. package/lib/ocaml/uchar.cmt +0 -0
  360. package/lib/ocaml/uchar.cmti +0 -0
  361. package/package.json +2 -1
  362. package/scripts/buildNinjaBinary.js +29 -0
  363. package/scripts/install.js +7 -3
  364. package/scripts/installUtils.js +9 -1
  365. package/scripts/rescript_arg.js +2 -4
  366. package/scripts/rescript_format.js +73 -39
  367. package/win32/refmt.exe +0 -0
  368. package/darwin/bsb_helper.exe +0 -0
  369. package/darwin/bsc.exe +0 -0
  370. package/darwin/ninja.COPYING +0 -202
  371. package/darwin/ninja.exe +0 -0
  372. package/darwin/rescript.exe +0 -0
  373. package/darwinarm64/ninja.COPYING +0 -202
  374. package/freebsd/ninja.COPYING +0 -202
  375. package/lib/ocaml/jsxDOM.ml +0 -2087
  376. package/linux/bsb_helper.exe +0 -0
  377. package/linux/bsc.exe +0 -0
  378. package/linux/ninja.COPYING +0 -202
  379. package/linux/ninja.exe +0 -0
  380. package/linux/rescript.exe +0 -0
  381. package/openbsd/.keep +0 -0
  382. package/scripts/buckle_lto.js +0 -55
  383. package/scripts/build_sorted.ml +0 -233
  384. package/scripts/caml_oo_curry_gen.ml +0 -71
  385. package/scripts/checkUnused.js +0 -63
  386. package/scripts/ciTest.js +0 -172
  387. package/scripts/cover.sh +0 -3
  388. package/scripts/curry_gen.ml +0 -167
  389. package/scripts/dbg +0 -13
  390. package/scripts/dedupe.js +0 -44
  391. package/scripts/doc_gen.js +0 -117
  392. package/scripts/js_internal_gen.js +0 -135
  393. package/scripts/jsconfig.json +0 -12
  394. package/scripts/littlecase.js +0 -21
  395. package/scripts/ninja.js +0 -1980
  396. package/scripts/pack.js +0 -107
  397. package/scripts/prebuilt.js +0 -99
  398. package/scripts/release.js +0 -41
  399. package/scripts/repl.js +0 -151
  400. package/scripts/shake.js +0 -138
  401. package/scripts/tasks.js +0 -149
  402. package/scripts/test.sh +0 -3
  403. package/scripts/tmp.js +0 -98
  404. package/scripts/validate.js +0 -41
  405. package/vendor/ninja.tar.gz +0 -0
  406. package/win32/bsb_helper.exe +0 -0
  407. package/win32/bsc.exe +0 -0
  408. package/win32/ninja.COPYING +0 -202
  409. package/win32/ninja.exe +0 -0
  410. package/win32/rescript.exe +0 -0
@@ -1,5 +1,5 @@
1
- (* Copyright (C) 2015-2016 Bloomberg Finance L.P.
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)
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/lib/ocaml/map.cmi CHANGED
Binary file
package/lib/ocaml/map.cmt CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/lib/ocaml/obj.cmi CHANGED
Binary file
package/lib/ocaml/obj.cmt CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -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
- {j|File "$(s)", line $(linum), characters $(start)-$(finish): $(msg)|j}
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 = [%raw{|function(x){
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
- (match try hd x with _ -> None with
48
- | Some s -> s
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
- let constructor =
60
- exn_slot_name x in
61
- constructor ^ fields x in
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
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/lib/ocaml/set.cmi CHANGED
Binary file
package/lib/ocaml/set.cmt CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
package/lib/ocaml/sys.cmi CHANGED
Binary file
package/lib/ocaml/sys.cmt CHANGED
Binary file
Binary file
Binary file
Binary file
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tellahq/rescript",
3
- "version": "10.1.0-alpha.2",
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);
@@ -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
- console.log(`ninja.tar.gz not availble in CI mode`);
63
- require("../ninja/snapshot").build();
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
@@ -45,7 +45,15 @@ function install() {
45
45
  });
46
46
 
47
47
  // for merlin or other IDE
48
- var installed_suffixes = [".ml", ".mli", ".cmi", ".cmt", ".cmti"];
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") {
@@ -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
- if (i < specs.length - 1) {
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
- var hasError = false;
99
- for (let arg of files) {
100
- if (isSupportedFile(arg)) {
101
- // console.log(`processing ${arg}`);
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 exetnsion ${use_stdin}`);
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
- var hasError = false;
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
Binary file