@reventlessdev/rescript-node 2.0.0-alpha.5 → 2.0.0-alpha.7
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 +14 -0
- package/package.json +1 -1
- package/src/NodeFs.res +28 -0
- package/src/NodeProcess.res +24 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
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.7 (2026-08-15)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **local:** serve ui-hints.json edits without restarting the platform ([b29b104](https://github.com/ReventlessDev/reventless-core/commit/b29b1044f31f620071423c618486daef9692c614))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 2.0.0-alpha.6 (2026-08-14)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **local:** let the seed tools address a platform, not a guessed file ([98862ad](https://github.com/ReventlessDev/reventless-core/commit/98862adaa4111f605553e4a78bc52a8a488a4ef3))
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
# 2.0.0-alpha.5 (2026-08-13)
|
|
7
21
|
|
|
8
22
|
### Features
|
package/package.json
CHANGED
package/src/NodeFs.res
CHANGED
|
@@ -38,6 +38,34 @@ external writeFileSync: (string, string, @as("utf8") _) => unit = "writeFileSync
|
|
|
38
38
|
@module("node:fs")
|
|
39
39
|
external writeFileSyncBuffer: (string, Uint8Array.t) => unit = "writeFileSync"
|
|
40
40
|
|
|
41
|
+
// ── Watching ─────────────────────────────────────────────────────────────────
|
|
42
|
+
|
|
43
|
+
/** A handle from {!watch}. Held so it can be closed, and so it can be `unref`ed
|
|
44
|
+
— an active watcher keeps the event loop alive, which turns a stray watch in
|
|
45
|
+
a test into a run that never exits. */
|
|
46
|
+
type watcher
|
|
47
|
+
|
|
48
|
+
/** Stop watching. */
|
|
49
|
+
@send external watcherClose: watcher => unit = "close"
|
|
50
|
+
|
|
51
|
+
/** Take the watcher off the event loop's reference count, so it never by itself
|
|
52
|
+
keeps the process running. Returns the same watcher, as Node does. */
|
|
53
|
+
@send external watcherUnref: watcher => watcher = "unref"
|
|
54
|
+
|
|
55
|
+
/** [`fs.watch`](https://nodejs.org/api/fs.html#fswatchfilename-options-listener).
|
|
56
|
+
|
|
57
|
+
The listener takes the event type (`"rename"` or `"change"`) and the
|
|
58
|
+
basename, which Node may report as null on some platforms — hence
|
|
59
|
+
`Nullable.t`.
|
|
60
|
+
|
|
61
|
+
**Watch the directory, not the file**, when the file is one an editor
|
|
62
|
+
writes: a save that replaces rather than rewrites (write-temp-then-rename,
|
|
63
|
+
which is how most editors save atomically) gives the path a new inode, and a
|
|
64
|
+
watcher registered on the old one goes silent with no error. Watching the
|
|
65
|
+
containing directory and filtering on the basename survives that. */
|
|
66
|
+
@module("node:fs")
|
|
67
|
+
external watch: (string, (string, Nullable.t<string>) => unit) => watcher = "watch"
|
|
68
|
+
|
|
41
69
|
// ── Directories ──────────────────────────────────────────────────────────────
|
|
42
70
|
|
|
43
71
|
type dirent
|
package/src/NodeProcess.res
CHANGED
|
@@ -21,6 +21,30 @@ external chdir: string => unit = "chdir"
|
|
|
21
21
|
@val @scope("process")
|
|
22
22
|
external exit: int => unit = "exit"
|
|
23
23
|
|
|
24
|
+
@val @scope("process")
|
|
25
|
+
external pid: int = "pid"
|
|
26
|
+
|
|
27
|
+
/** Signalling another process — or, with signal `0`, asking whether it is still
|
|
28
|
+
there without disturbing it. Throws when the pid is gone (`ESRCH`) or not
|
|
29
|
+
ours to signal (`EPERM`), so a liveness check is a `try`. */
|
|
30
|
+
@val @scope("process")
|
|
31
|
+
external kill: (int, int) => unit = "kill"
|
|
32
|
+
|
|
33
|
+
/** `process.on` for the two shutdown paths a CLI has to clean up on.
|
|
34
|
+
|
|
35
|
+
Split into an `exit` binding and a signal binding because the handlers are
|
|
36
|
+
not interchangeable: `exit` fires with the exit code and may only do
|
|
37
|
+
synchronous work, while a signal handler receives the signal name and fires
|
|
38
|
+
*before* the process is committed to leaving — code that registers one and
|
|
39
|
+
expects the other's timing gets a cleanup that never runs. Signals are a
|
|
40
|
+
polyvariant so a typo is a compile error rather than a handler that is never
|
|
41
|
+
called. */
|
|
42
|
+
@val @scope("process")
|
|
43
|
+
external onExit: (@as("exit") _, int => unit) => unit = "on"
|
|
44
|
+
|
|
45
|
+
@val @scope("process")
|
|
46
|
+
external onSignal: ([#SIGINT | #SIGTERM | #SIGHUP], unit => unit) => unit = "on"
|
|
47
|
+
|
|
24
48
|
/** The standard streams. `write`, `isTTY`, `pause` and `unref` are what the
|
|
25
49
|
interactive prompts in this repository reach for; the type is abstract so it
|
|
26
50
|
can also be handed to `readline.createInterface`. */
|