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

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,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.8 (2026-08-18)
7
+
8
+ ### Features
9
+
10
+ * **core:** read a command's lifecycle guard off the GWT corpus, and check [@transition](https://github.com/transition) against it ([057c898](https://github.com/ReventlessDev/reventless-core/commit/057c898761917bd6fc5eb9ac6867c8125709eab4))
11
+
12
+
13
+ # 2.0.0-alpha.7 (2026-08-15)
14
+
15
+ ### Features
16
+
17
+ * **local:** serve ui-hints.json edits without restarting the platform ([b29b104](https://github.com/ReventlessDev/reventless-core/commit/b29b1044f31f620071423c618486daef9692c614))
18
+
19
+
6
20
  # 2.0.0-alpha.6 (2026-08-14)
7
21
 
8
22
  ### Features
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/rescript-node",
3
- "version": "2.0.0-alpha.6",
3
+ "version": "2.0.0-alpha.8",
4
4
  "description": "ReScript bindings for the Node.js standard library",
5
5
  "license": "Apache-2.0",
6
6
  "devDependencies": {
package/src/NodeFs.res CHANGED
@@ -17,6 +17,15 @@ external existsSync: string => bool = "existsSync"
17
17
  @module("node:fs")
18
18
  external realpathSync: string => string = "realpathSync"
19
19
 
20
+ /** Set a file's access and modification times, in seconds since the epoch.
21
+
22
+ The reason this exists here rather than as a shell-out to `touch`: a build
23
+ whose compiler caches on source mtime cannot be made to re-run a side effect
24
+ of compilation — emitting a sidecar, say — by any argument passed to it. The
25
+ input has to look newer. */
26
+ @module("node:fs")
27
+ external utimesSync: (string, float, float) => unit = "utimesSync"
28
+
20
29
  // ── Reading ──────────────────────────────────────────────────────────────────
21
30
 
22
31
  @module("node:fs")
@@ -38,6 +47,34 @@ external writeFileSync: (string, string, @as("utf8") _) => unit = "writeFileSync
38
47
  @module("node:fs")
39
48
  external writeFileSyncBuffer: (string, Uint8Array.t) => unit = "writeFileSync"
40
49
 
50
+ // ── Watching ─────────────────────────────────────────────────────────────────
51
+
52
+ /** A handle from {!watch}. Held so it can be closed, and so it can be `unref`ed
53
+ — an active watcher keeps the event loop alive, which turns a stray watch in
54
+ a test into a run that never exits. */
55
+ type watcher
56
+
57
+ /** Stop watching. */
58
+ @send external watcherClose: watcher => unit = "close"
59
+
60
+ /** Take the watcher off the event loop's reference count, so it never by itself
61
+ keeps the process running. Returns the same watcher, as Node does. */
62
+ @send external watcherUnref: watcher => watcher = "unref"
63
+
64
+ /** [`fs.watch`](https://nodejs.org/api/fs.html#fswatchfilename-options-listener).
65
+
66
+ The listener takes the event type (`"rename"` or `"change"`) and the
67
+ basename, which Node may report as null on some platforms — hence
68
+ `Nullable.t`.
69
+
70
+ **Watch the directory, not the file**, when the file is one an editor
71
+ writes: a save that replaces rather than rewrites (write-temp-then-rename,
72
+ which is how most editors save atomically) gives the path a new inode, and a
73
+ watcher registered on the old one goes silent with no error. Watching the
74
+ containing directory and filtering on the basename survives that. */
75
+ @module("node:fs")
76
+ external watch: (string, (string, Nullable.t<string>) => unit) => watcher = "watch"
77
+
41
78
  // ── Directories ──────────────────────────────────────────────────────────────
42
79
 
43
80
  type dirent