Skip to content

Commit bd954e1

Browse files
committed
Migrate to rescript-zora v4
1 parent 3c29dcd commit bd954e1

File tree

7 files changed

+97
-134
lines changed

7 files changed

+97
-134
lines changed

bsconfig.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,7 @@
2525
],
2626
"suffix": ".bs.js",
2727
"bs-dependencies": [],
28-
"bs-dev-dependencies": [
29-
"@dusty-phillips/rescript-zora",
30-
"@ryyppy/rescript-promise"
31-
],
28+
"bs-dev-dependencies": ["@dusty-phillips/rescript-zora"],
3229
"warnings": {
3330
"number": "A-4-40-41-42-43-44+101-102-103",
3431
"error": "false"

lib/js/test/atomic/Fs.test.bs.js

Lines changed: 14 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/js/test/atomic/Stream.test.bs.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"description": "Node bindings for ReScript",
2727
"license": "MIT",
2828
"devDependencies": {
29-
"@dusty-phillips/rescript-zora": "^3.0.0",
29+
"@dusty-phillips/rescript-zora": "^4.0.0",
3030
"onchange": "^7.1.0",
31-
"pta": "^1.0.0",
31+
"pta": "^1.2.0",
3232
"rescript": "^11.0.0-beta.3",
33-
"zora": "^5.0.0"
33+
"zora": "^5.2.0"
3434
}
3535
}

test/atomic/Fs.test.res

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,22 @@
11
open Fs
22
open Zora
33

4-
zora("Fs", t => {
5-
t->test("readFile should read entire file", t => {
6-
open_(Global.filename, Flag.read)
7-
->then(fh =>
8-
FileHandle.readFile(fh)->then(buffer => FileHandle.close(fh)->then(_ => done(buffer)))
9-
)
10-
->then(buffer => {
11-
let needle = "Random string: Gh2e71pdHhPxU"
12-
t->ok(buffer->Buffer.indexOfString(needle) > 1, "buffer index was not greater than zero")
13-
done()
14-
})
4+
zora("Fs", async t => {
5+
t->test("readFile should read entire file", async t => {
6+
let fh = await open_(Global.filename, Flag.read)
7+
let buffer = await FileHandle.readFile(fh)
8+
let _ = await FileHandle.close(fh)
9+
10+
let needle = "Random string: Gh2e71pdHhPxU"
11+
t->ok(buffer->Buffer.indexOfString(needle) > 1, "buffer index was not greater than zero")
1512
})
1613

17-
t->test("readFileWith should read entire file as a string", t => {
18-
open_(Global.filename, Flag.read)
19-
->then(fh =>
20-
FileHandle.readFileWith(fh, readFileOptions(~encoding="UTF-8", ()))->then(buffer =>
21-
FileHandle.close(fh)->then(_ => done(buffer))
22-
)
23-
)
24-
->then(content => {
25-
let needle = "Random string: uCF6c5f3Arrq"
14+
t->test("readFileWith should read entire file as a string", async t => {
15+
let fh = await open_(Global.filename, Flag.read)
16+
let buffer = await FileHandle.readFileWith(fh, readFileOptions(~encoding="UTF-8", ()))
17+
let _ = await FileHandle.close(fh)
18+
let needle = "Random string: uCF6c5f3Arrq"
2619

27-
t->ok(
28-
Js.String.indexOf(needle, content) > 0,
29-
"buffer string indexOf was not greater than zero",
30-
)
31-
done()
32-
})
20+
t->ok(Js.String.indexOf(needle, buffer) > 0, "buffer string indexOf was not greater than zero")
3321
})
34-
done()
3522
})

test/atomic/Stream.test.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ zoraBlock("Stream.Readable", t => {
2121
t->test("'Stream.Readable.destroyWithError' should emit 'error' event", t => {
2222
open! Errors
2323
let dummyError = Error.make("Expected error: Stream destroyed")->Error.toJsExn
24-
Promise.make(
25-
(resolve, _reject) => {
24+
Js.Promise2.make(
25+
(~resolve, ~reject as _) => {
2626
let stream = StreamTestLib.makeReadableEmpty()->Stream.onError(
2727
err => {
2828
t->equal(err, dummyError, "")
@@ -71,8 +71,8 @@ zoraBlock("Stream.Writable", t => {
7171
(),
7272
)
7373

74-
Promise.make(
75-
(resolve, _reject) => {
74+
Js.Promise2.make(
75+
(~resolve, ~reject as _) => {
7676
let writeStream = Writable.makeObjMode(options)
7777

7878
Writable.writeWith(

yarn.lock

Lines changed: 59 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@
1212
resolved "https://registry.yarnpkg.com/@blakeembrey/template/-/template-1.0.0.tgz#bf8828bc3ae8004d97904d78f64e3cc2cd216438"
1313
integrity sha512-J6WGZqCLdRMHUkyRG6fBSIFJ0rL60/nsQNh5rQvsYZ5u0PsKw6XQcJcA3DWvd9cN3j/IQx5yB1fexhCafwwUUw==
1414

15-
"@dusty-phillips/rescript-zora@^3.0.0":
16-
version "3.0.0"
17-
resolved "https://registry.yarnpkg.com/@dusty-phillips/rescript-zora/-/rescript-zora-3.0.0.tgz#f5f2d626c7f4d6d4eb65a4c3c47e4702e7a8657a"
18-
integrity sha512-I3KQwmPB5Ezw9nVn0QxIyoOUY95/0SHfKmBA4OlzKwmTjRE1sNiziUeEuwuldULJo6/qX5xcDkTRYb2AtcM2RQ==
15+
"@dusty-phillips/rescript-zora@^4.0.0":
16+
version "4.0.0"
17+
resolved "https://registry.yarnpkg.com/@dusty-phillips/rescript-zora/-/rescript-zora-4.0.0.tgz#cf2c9c9240afa0cb74df2547f46ca5760664fd56"
18+
integrity sha512-Gs2rlIwmgMOQe2/nAbN6VREGA2mT/H0jsyvcvrBPcCuoATfZgL5yAjm9FZp3Obh3YKvY8PqJYy7tvD67ntp8qg==
1919
dependencies:
20-
"@ryyppy/rescript-promise" "^2.1.0"
21-
pta "^1.0.0"
22-
zora "^5.0.0"
20+
pta "^1.2.0"
21+
zora "^5.2.0"
2322

2423
"@nodelib/[email protected]":
2524
version "2.1.5"
@@ -42,11 +41,6 @@
4241
"@nodelib/fs.scandir" "2.1.5"
4342
fastq "^1.6.0"
4443

45-
"@ryyppy/rescript-promise@^2.1.0":
46-
version "2.1.0"
47-
resolved "https://registry.yarnpkg.com/@ryyppy/rescript-promise/-/rescript-promise-2.1.0.tgz#a33861274c41360cfbe872cf489f3dcb8dd526e6"
48-
integrity sha512-+dW6msBrj2Lr2hbEMX+HoWCvN89qVjl94RwbYWJgHQuj8jm/izdPC0YzxgpGoEFdeAEW2sOozoLcYHxT6o5WXQ==
49-
5044
anymatch@~3.1.2:
5145
version "3.1.2"
5246
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
@@ -60,15 +54,10 @@ arg@^4.1.3:
6054
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
6155
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
6256

63-
arg@~5.0.0:
64-
version "5.0.1"
65-
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.1.tgz#eb0c9a8f77786cad2af8ff2b862899842d7b6adb"
66-
integrity sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==
67-
68-
array-union@^2.1.0:
69-
version "2.1.0"
70-
resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d"
71-
integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==
57+
arg@~5.0.2:
58+
version "5.0.2"
59+
resolved "https://registry.yarnpkg.com/arg/-/arg-5.0.2.tgz#c81433cc427c92c4dcf4865142dbca6f15acd59c"
60+
integrity sha512-PYjyFOLKQ9y57JvQ6QLo8dAgNqswh8M1RMJYdQduT6xbWSgK36P/Z/v+p888pM69jMMfS8Xd8F6I1kQ/I9HUGg==
7261

7362
binary-extensions@^2.0.0:
7463
version "2.2.0"
@@ -97,10 +86,10 @@ chokidar@^3.3.1:
9786
optionalDependencies:
9887
fsevents "~2.3.2"
9988

100-
colorette@~1.2.2:
101-
version "1.2.2"
102-
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
103-
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
89+
colorette@2.0.17:
90+
version "2.0.17"
91+
resolved "https://registry.yarnpkg.com/colorette/-/colorette-2.0.17.tgz#5dd4c0d15e2984b7433cb4a9f2ead45063b80c47"
92+
integrity sha512-hJo+3Bkn0NCHybn9Tu35fIeoOKGOk5OCC32y4Hz2It+qlCO2Q3DeQ1hRn/tDDMQKRYUEzqsl7jbF6dYKjlE60g==
10493

10594
cross-spawn@^7.0.1:
10695
version "7.0.3"
@@ -111,10 +100,10 @@ cross-spawn@^7.0.1:
111100
shebang-command "^2.0.0"
112101
which "^2.0.1"
113102

114-
diff@~5.0.0:
115-
version "5.0.0"
116-
resolved "https://registry.yarnpkg.com/diff/-/diff-5.0.0.tgz#7ed6ad76d859d030787ec35855f5b1daf31d852b"
117-
integrity sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==
103+
diff@~5.1.0:
104+
version "5.1.0"
105+
resolved "https://registry.yarnpkg.com/diff/-/diff-5.1.0.tgz#bc52d298c5ea8df9194800224445ed43ffc87e40"
106+
integrity sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==
118107

119108
dir-glob@^3.0.1:
120109
version "3.0.1"
@@ -123,10 +112,10 @@ dir-glob@^3.0.1:
123112
dependencies:
124113
path-type "^4.0.0"
125114

126-
fast-glob@^3.1.1:
127-
version "3.2.7"
128-
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.7.tgz#fd6cb7a2d7e9aa7a7846111e85a196d6b2f766a1"
129-
integrity sha512-rYGMRwip6lUMvYD3BTScMwT1HtAs2d71SMv66Vrxs0IekGZEjhM0pcMfjQPnknBt2zeCwQMEupiN02ZP4DiT1Q==
115+
fast-glob@^3.2.11:
116+
version "3.3.0"
117+
resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.3.0.tgz#7c40cb491e1e2ed5664749e87bfb516dbe8727c0"
118+
integrity sha512-ChDuvbOypPuNjO8yIDf36x7BlZX1smcUMTTcyoIjycexOxd6DFsKsg21qVBzEmr3G7fUKIRy2/psii+CIUt7FA==
130119
dependencies:
131120
"@nodelib/fs.stat" "^2.0.2"
132121
"@nodelib/fs.walk" "^1.2.3"
@@ -160,23 +149,27 @@ glob-parent@^5.1.2, glob-parent@~5.1.2:
160149
dependencies:
161150
is-glob "^4.0.1"
162151

163-
globby@~11.0.4:
164-
version "11.0.4"
165-
resolved "https://registry.yarnpkg.com/globby/-/globby-11.0.4.tgz#2cbaff77c2f2a62e71e9b2813a67b97a3a3001a5"
166-
integrity sha512-9O4MVG9ioZJ08ffbcyVYyLOJLk5JQ688pJ4eMGLpdWLHq/Wr1D9BlriLQyL0E+jbkuePVZXYFj47QM/v093wHg==
152+
globby@~13.1.1:
153+
version "13.1.4"
154+
resolved "https://registry.yarnpkg.com/globby/-/globby-13.1.4.tgz#2f91c116066bcec152465ba36e5caa4a13c01317"
155+
integrity sha512-iui/IiiW+QrJ1X1hKH5qwlMQyv34wJAYwH1vrf8b9kBA4sNiif3gKsMHa+BrdnOpEudWjpotfa7LrTzB1ERS/g==
167156
dependencies:
168-
array-union "^2.1.0"
169157
dir-glob "^3.0.1"
170-
fast-glob "^3.1.1"
171-
ignore "^5.1.4"
172-
merge2 "^1.3.0"
173-
slash "^3.0.0"
158+
fast-glob "^3.2.11"
159+
ignore "^5.2.0"
160+
merge2 "^1.4.1"
161+
slash "^4.0.0"
174162

175163
ignore@^5.1.4:
176164
version "5.1.8"
177165
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.1.8.tgz#f150a8b50a34289b33e22f5889abd4d8016f0e57"
178166
integrity sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==
179167

168+
ignore@^5.2.0:
169+
version "5.2.4"
170+
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324"
171+
integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==
172+
180173
is-binary-path@~2.1.0:
181174
version "2.1.0"
182175
resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
@@ -206,7 +199,7 @@ isexe@^2.0.0:
206199
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
207200
integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=
208201

209-
merge2@^1.3.0:
202+
merge2@^1.3.0, merge2@^1.4.1:
210203
version "1.4.1"
211204
resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae"
212205
integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==
@@ -252,14 +245,14 @@ picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.3:
252245
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.0.tgz#f1f061de8f6a4bf022892e2d128234fb98302972"
253246
integrity sha512-lY1Q/PiJGC2zOv/z391WOTD+Z02bCgsFfvxoXXf6h7kv9o+WmsmzYqrAwY63sNgOxE4xEdq0WyUnXfKeBrSvYw==
254247

255-
pta@^1.0.0:
256-
version "1.0.0"
257-
resolved "https://registry.yarnpkg.com/pta/-/pta-1.0.0.tgz#8d17f72afb31a40243112f5c369fc0f280cd12da"
258-
integrity sha512-II8/5qNiBrFkEfOGDLGMWZygVIUIPk9roB321JX6YJqQta6aJXJOlqovPVCn/h/NiCwSIAhpg1BCyfJKXusQLw==
248+
pta@^1.2.0:
249+
version "1.2.0"
250+
resolved "https://registry.yarnpkg.com/pta/-/pta-1.2.0.tgz#52ce9e2140e2191ca1dbe2f7ef6d9507dd1ee31b"
251+
integrity sha512-vk2QidTwxQgkh5yz1MbBx99w8EGOOqO0lSI5ApR4ndYEos/AJfKNBXMt7vaU4l3u6f69NLXaZkcRDH4iMx1sxw==
259252
dependencies:
260-
arg "~5.0.0"
261-
globby "~11.0.4"
262-
zora-reporters "~1.0.0"
253+
arg "~5.0.2"
254+
globby "~13.1.1"
255+
zora-reporters "*"
263256

264257
queue-microtask@^1.2.2:
265258
version "1.2.3"
@@ -302,10 +295,10 @@ shebang-regex@^3.0.0:
302295
resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172"
303296
integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==
304297

305-
slash@^3.0.0:
306-
version "3.0.0"
307-
resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634"
308-
integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==
298+
slash@^4.0.0:
299+
version "4.0.0"
300+
resolved "https://registry.yarnpkg.com/slash/-/slash-4.0.0.tgz#2422372176c4c6c5addb5e2ada885af984b396a7"
301+
integrity sha512-3dOsAHXXUkQTpOYcoAxLIorMTp4gIQr5IW3iVb7A7lFIp0VHhnynm9izx6TssdrIcVIESAlVjtnO2K8bg+Coew==
309302

310303
to-regex-range@^5.0.1:
311304
version "5.0.1"
@@ -326,16 +319,16 @@ which@^2.0.1:
326319
dependencies:
327320
isexe "^2.0.0"
328321

329-
zora-reporters@~1.0.0:
330-
version "1.0.0"
331-
resolved "https://registry.yarnpkg.com/zora-reporters/-/zora-reporters-1.0.0.tgz#c5c83b7dc4df8e8d28a1a19a12e4de38527c894d"
332-
integrity sha512-r4leuN/tvUDvigrIyIBvNXxBTiG96khJzcHpNlcZoOsuI2XrkJwsONjoHPuSR7ojSpdn8U5m4950x7YVhlcmXw==
322+
zora-reporters@*:
323+
version "1.4.0"
324+
resolved "https://registry.yarnpkg.com/zora-reporters/-/zora-reporters-1.4.0.tgz#dd53b27e9c3e4034c18874b50866ab254da7c255"
325+
integrity sha512-RZy2zb/aT8YKUztELGjFWMb39LduCEB4SHoAH4w2HBWKE53V0lU385AAK2q097P7D5cdMLGJIYXpykxUdoyyig==
333326
dependencies:
334-
arg "~5.0.0"
335-
colorette "~1.2.2"
336-
diff "~5.0.0"
337-
338-
zora@^5.0.0:
339-
version "5.0.0"
340-
resolved "https://registry.yarnpkg.com/zora/-/zora-5.0.0.tgz#9f4a1e635524be1d8eac87f818ddcc1a75016bd5"
341-
integrity sha512-fA6RdNLtzcCxy4m+HsWYVBnme7Jt1Ez4OgEMo62i6LanJCHawAhZ0n57hetWO35M/057eLVFRbtq7JTBpFNybg==
327+
arg "~5.0.2"
328+
colorette "2.0.17"
329+
diff "~5.1.0"
330+
331+
zora@^5.2.0:
332+
version "5.2.0"
333+
resolved "https://registry.yarnpkg.com/zora/-/zora-5.2.0.tgz#50dac3f328b86ac9c1d7ba3a9c0666d038a046f8"
334+
integrity sha512-FSZOvfJVfMWhk/poictNsDBCXq/Z+2Zu2peWs6d8OhWWb9nY++czw95D47hdw06L/kfjasLevwrbUtnXyWLAJw==

0 commit comments

Comments
 (0)