Skip to content

Commit 41f31e0

Browse files
committed
latest RC, format and fix
1 parent 8467f64 commit 41f31e0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+559
-660
lines changed

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"license": "MIT",
2828
"devDependencies": {
2929
"@changesets/cli": "^2.29.5",
30-
"rescript": "12.0.0-beta.11"
30+
"rescript": "12.0.0-rc.3"
3131
},
3232
"peerDependencies": {
3333
"rescript": ">= 12.0.0-alpha.4"

src/Assert.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@ external doesNotThrow: (@uncurry (unit => 'a)) => unit = "doesNotThrow"
2020
external doesNotThrowError: (@uncurry (unit => 'a), 'e) => unit = "doesNotThrow"
2121
@module("node:assert") external ifError: 'a => unit = "ifError"
2222
@module("node:assert")
23-
external rejects: (@uncurry (unit => Js.Promise.t<'a>)) => unit = "rejects"
23+
external rejects: (@uncurry (unit => promise<'a>)) => unit = "rejects"
2424
@module("node:assert")
25-
external rejectsError: (@uncurry (unit => Js.Promise.t<'a>), 'e) => unit = "rejects"
25+
external rejectsError: (@uncurry (unit => promise<'a>), 'e) => unit = "rejects"
2626
@module("node:assert")
27-
external doesNotReject: (@uncurry (unit => Js.Promise.t<'a>)) => unit = "doesNotReject"
27+
external doesNotReject: (@uncurry (unit => promise<'a>)) => unit = "doesNotReject"
2828
@module("node:assert")
29-
external doesNotRejectError: (@uncurry (unit => Js.Promise.t<'a>), 'e) => unit = "doesNotReject"
29+
external doesNotRejectError: (@uncurry (unit => promise<'a>), 'e) => unit = "doesNotReject"
3030

3131
module AssertionError = Errors.AssertionError

src/AsyncHooks.res

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ module AsyncLocalStorage = {
5757
* @param fn The function to bind to the current execution context.
5858
* @return A new function that calls `fn` within the captured execution context.
5959
*/
60-
@module("node:async_hooks")
61-
@scope("AsyncLocalStorage")
60+
@module("node:async_hooks") @scope("AsyncLocalStorage")
6261
external bind: 'function => 'function = "bind"
6362

6463
// TODO: Snapshot

src/BinaryLike.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ module Impl: {
6464
let classify: t => case = x =>
6565
switch x {
6666
| BinaryLike(binaryLike) =>
67-
if Js.typeof(binaryLike) === "string" {
67+
if typeof(binaryLike) === #string {
6868
String(Obj.magic(binaryLike))
6969
} else if Buffer.isBuffer(binaryLike) {
7070
Buffer(Obj.magic(binaryLike))

src/Buffer.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ external readUintLE: (t, ~offset: int, ~length: int) => float = "readUintLE"
278278
@send external swap32: t => t = "swap32"
279279
@send external swap64: t => t = "swap64"
280280

281-
@send external toJSON: t => Js.Json.t = "toJSON"
281+
@send external toJSON: t => JSON.t = "toJSON"
282282

283283
@send external toString: t => string = "toString"
284284
@send

src/Bun.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -436,7 +436,7 @@ type genericServeOptions = {
436436
/*
437437
* Error handling function
438438
*/
439-
error?: (Server.t, Error.t) => option<Response.t>,
439+
error?: (Server.t, JsError.t) => option<Response.t>,
440440
/*
441441
* Uniquely identify a server instance with an ID
442442
*
@@ -1152,7 +1152,7 @@ module FileSink = {
11521152
* Close the file descriptor. This also flushes the internal buffer.
11531153
*/
11541154
@send
1155-
external end: (t, ~error: Error.t=?) => floatOrPromisedFloat = "end"
1155+
external end: (t, ~error: JsError.t=?) => floatOrPromisedFloat = "end"
11561156

11571157
type startOptions = {
11581158
/**

src/BunSqlite.res

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ module Database = {
4444
type dbOptions = {readonly?: bool, create?: bool, strict?: bool}
4545

4646
/** Creates a new database. */
47-
@module("bun:sqlite")
48-
@new
47+
@module("bun:sqlite") @new
4948
external make: (string, ~options: dbOptions=?) => t = "Database"
5049

5150
/**
@@ -57,8 +56,7 @@ module Database = {
5756
let db = Database.makeInMemory()
5857
```
5958
*/
60-
@module("bun:sqlite")
61-
@new
59+
@module("bun:sqlite") @new
6260
external makeInMemory: (@as(":memory:") _, ~options: dbOptions=?) => t = "Database"
6361

6462
/**

src/ChildProcess.res

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module Events = {
1111
@send
1212
external onDisconnect: (t, @as("disconnect") _, @uncurry unit => unit) => t = "on"
1313
@send
14-
external onError: (t, @as("error") _, @uncurry (Js.Exn.t => unit)) => t = "on"
14+
external onError: (t, @as("error") _, @uncurry (JsExn.t => unit)) => t = "on"
1515
@send
1616
external onExit: (t, @as("exit") _, @uncurry int => unit) => t = "on"
1717
@send
@@ -22,7 +22,7 @@ module Events = {
2222
@send
2323
external offDisconnect: (t, @as("disconnect") _, @uncurry unit => unit) => t = "off"
2424
@send
25-
external offError: (t, @as("error") _, @uncurry (Js.Exn.t => unit)) => t = "off"
25+
external offError: (t, @as("error") _, @uncurry (JsExn.t => unit)) => t = "off"
2626
@send
2727
external offExit: (t, @as("exit") _, @uncurry int => unit) => t = "off"
2828
@send
@@ -33,7 +33,7 @@ module Events = {
3333
@send
3434
external onDisconnectOnce: (t, @as("disconnect") _, @uncurry unit => unit) => t = "once"
3535
@send
36-
external onErrorOnce: (t, @as("error") _, @uncurry (Js.Exn.t => unit)) => t = "once"
36+
external onErrorOnce: (t, @as("error") _, @uncurry (JsExn.t => unit)) => t = "once"
3737
@send
3838
external onExitOnce: (t, @as("exit") _, @uncurry int => unit) => t = "once"
3939
@send
@@ -44,7 +44,7 @@ module Events = {
4444
@send
4545
external emitDisconnect: (t, @as("disconnect") _) => bool = "emit"
4646
@send
47-
external emitError: (t, @as("error") _, Js.Exn.t) => bool = "emit"
47+
external emitError: (t, @as("error") _, JsExn.t) => bool = "emit"
4848
@send external emitExit: (t, @as("exit") _, int) => bool = "emit"
4949
@send external emitClose: (t, @as("close") _, int) => bool = "emit"
5050

@@ -68,7 +68,7 @@ external stdout: t => option<Stream.Readable.t<Buffer.t>> = "stdout"
6868

6969
type execOptions = {
7070
cwd?: string,
71-
env?: Js.Dict.t<string>,
71+
env?: dict<string>,
7272
shell?: string,
7373
timeout?: int,
7474
maxBuffer?: int,
@@ -80,15 +80,15 @@ type execOptions = {
8080
}
8181

8282
@module("node:child_process") @val
83-
external exec: (string, (Js.nullable<Js.Exn.t>, Buffer.t, Buffer.t) => unit) => t = "exec"
83+
external exec: (string, (Nullable.t<JsExn.t>, Buffer.t, Buffer.t) => unit) => t = "exec"
8484

8585
@module("node:child_process") @val
86-
external execWith: (string, execOptions, (Js.nullable<Js.Exn.t>, Buffer.t, Buffer.t) => unit) => t =
86+
external execWith: (string, execOptions, (Nullable.t<JsExn.t>, Buffer.t, Buffer.t) => unit) => t =
8787
"exec"
8888

8989
type execFileOptions = {
9090
cwd?: string,
91-
env?: Js.Dict.t<string>,
91+
env?: dict<string>,
9292
timeout?: int,
9393
maxBuffer?: int,
9494
killSignal?: string,
@@ -99,24 +99,21 @@ type execFileOptions = {
9999
}
100100

101101
@module("node:child_process") @val
102-
external execFile: (
103-
string,
104-
array<string>,
105-
(Js.nullable<Js.Exn.t>, Buffer.t, Buffer.t) => unit,
106-
) => t = "execFile"
102+
external execFile: (string, array<string>, (Nullable.t<JsExn.t>, Buffer.t, Buffer.t) => unit) => t =
103+
"execFile"
107104

108105
@module("node:child_process") @val
109106
external execFileWith: (
110107
string,
111108
array<string>,
112109
execFileOptions,
113-
(Js.nullable<Js.Exn.t>, Buffer.t, Buffer.t) => unit,
110+
(Nullable.t<JsExn.t>, Buffer.t, Buffer.t) => unit,
114111
) => t = "execFile"
115112

116113
type forkOptions = {
117114
cwd?: string,
118115
detached?: bool,
119-
env?: Js.Dict.t<string>,
116+
env?: dict<string>,
120117
execPath?: string,
121118
execArgv?: array<string>,
122119
silent?: bool,
@@ -134,7 +131,7 @@ external forkWith: (string, array<string>, forkOptions) => t = "fork"
134131

135132
type spawnOptions = {
136133
cwd?: string,
137-
env?: Js.Dict.t<string>,
134+
env?: dict<string>,
138135
argv0?: string,
139136
stdio?: string,
140137
detached?: bool,
@@ -157,13 +154,13 @@ type spawnSyncResult<'a> = {
157154
stdout: Buffer.t,
158155
stderr: Buffer.t,
159156
status: int,
160-
signal: Js.nullable<string>,
161-
error: Js.nullable<Js.Exn.t>,
157+
signal: Nullable.t<string>,
158+
error: Nullable.t<JsExn.t>,
162159
}
163160

164161
type spawnSyncOptions = {
165162
cwd?: string,
166-
env?: Js.Dict.t<string>,
163+
env?: dict<string>,
167164
input?: Buffer.t,
168165
argv0?: string,
169166
stdio?: string,
@@ -184,7 +181,7 @@ external spawnSyncWith: (string, array<string>, spawnSyncOptions) => spawnSyncRe
184181

185182
type execSyncOptions = {
186183
cwd?: string,
187-
env?: Js.Dict.t<string>,
184+
env?: dict<string>,
188185
input?: Buffer.t,
189186
shell?: string,
190187
timeout?: int,
@@ -204,7 +201,7 @@ external execSyncWith: (string, execSyncOptions) => Buffer.t = "execSync"
204201

205202
type execFileSyncOptions = {
206203
cwd?: string,
207-
env?: Js.Dict.t<string>,
204+
env?: dict<string>,
208205
input?: Buffer.t,
209206
shell?: string,
210207
timeout?: int,

0 commit comments

Comments
 (0)