@reventlessdev/rescript-node 2.0.0-alpha.8 → 2.0.0-alpha.9

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 CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ # 2.0.0-alpha.9 (2026-09-04)
7
+
8
+ ### Features
9
+
10
+ * **local:** serve the event tap over a socket, on by default ([1babf96](https://github.com/ReventlessDev/reventless-core/commit/1babf960f032805418e3ac8f25d03ceb3dcd8d20))
11
+
12
+
6
13
  # 2.0.0-alpha.8 (2026-08-18)
7
14
 
8
15
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/rescript-node",
3
- "version": "2.0.0-alpha.8",
3
+ "version": "2.0.0-alpha.9",
4
4
  "description": "ReScript bindings for the Node.js standard library",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
@@ -0,0 +1,45 @@
1
+ /** Bindings for [`node:net`](https://nodejs.org/api/net.html) — TCP servers and
2
+ the sockets they accept. */
3
+
4
+ type socket
5
+ type server
6
+
7
+ /** A connected client. `write` returns the backpressure flag, which a caller
8
+ that only ever sends short lines can ignore. */
9
+ @send external write: (socket, string) => bool = "write"
10
+ @send external destroySocket: socket => unit = "destroy"
11
+
12
+ /** `setEncoding` makes the `data` frames arrive as strings rather than Buffers,
13
+ which is what a line-oriented consumer wants. */
14
+ @send external setEncoding: (socket, string) => unit = "setEncoding"
15
+
16
+ @send external onSocketData: (socket, @as("data") _, string => unit) => unit = "on"
17
+ @send external onSocketClose: (socket, @as("close") _, unit => unit) => unit = "on"
18
+
19
+ /** A socket that errors is gone; without a listener the error is thrown and
20
+ takes the process with it, so every accepted socket needs one. */
21
+ @send external onSocketError: (socket, @as("error") _, JsExn.t => unit) => unit = "on"
22
+
23
+ /** `keepAlive` is deliberately absent: a caller that wants it sets it per
24
+ socket, and defaulting it changes the behaviour of every consumer. */
25
+ @module("node:net")
26
+ external createServer: (socket => unit) => server = "createServer"
27
+
28
+ /** Binding to an explicit host is what keeps a server off every interface —
29
+ pass `"127.0.0.1"` for loopback-only. */
30
+ @send external listen: (server, int, string, unit => unit) => unit = "listen"
31
+
32
+ @send external onServerError: (server, @as("error") _, JsExn.t => unit) => unit = "on"
33
+ @send external closeServer: (server, unit => unit) => unit = "close"
34
+
35
+ /** The port actually bound — the only way to learn it after listening on `0`.
36
+ `Nullable`, because a server that is not listening reports `null`. */
37
+ @send external address: server => Nullable.t<{"port": int}> = "address"
38
+
39
+ /** Lets the process exit while the server is still listening — a diagnostic
40
+ listener must not be the reason a CLI hangs at the end of its work. */
41
+ @send external unref: server => unit = "unref"
42
+
43
+ /** Connect to a listening server. The callback fires once the connection is up. */
44
+ @module("node:net")
45
+ external connect: (int, string, unit => unit) => socket = "createConnection"
@@ -0,0 +1,2 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+ /* This output is empty. Its source's type definitions, externals and/or unused code got optimized away. */