@reventlessdev/rescript-node 2.0.0-alpha.16 → 2.0.0-alpha.18
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 +15 -0
- package/package.json +1 -1
- package/rescript.json +1 -0
- package/src/NodeChildProcess.res +4 -0
- package/src/NodeProcess.res +5 -0
- package/src/NodeReadline.res +37 -0
- package/src/NodeReadline.res.mjs +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,21 @@
|
|
|
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.18 (2026-09-28)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **node:** readline's line and close events, and its own prompt ([ce2d0fa](https://github.com/ReventlessDev/reventless-core/commit/ce2d0faf929d44c88705e20009674254a49f15d7))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 2.0.0-alpha.17 (2026-09-28)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **node:** bind node:test and node:assert, lstatSync, execPath and base64 decoding ([c067e39](https://github.com/ReventlessDev/reventless-core/commit/c067e39ce3a5979f3a18c4761e4673baa6c11ffd))
|
|
18
|
+
* **node:** bind readline's promise API, process.platform and spawnSync's shell option ([c166726](https://github.com/ReventlessDev/reventless-core/commit/c166726008a08bb8b4b3e7b9d33dabde02389bad))
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
# 2.0.0-alpha.16 (2026-09-27)
|
|
7
22
|
|
|
8
23
|
### Features
|
package/package.json
CHANGED
package/rescript.json
CHANGED
package/src/NodeChildProcess.res
CHANGED
|
@@ -8,6 +8,10 @@ type execOptions = {
|
|
|
8
8
|
maxBuffer?: int,
|
|
9
9
|
/** Written to the child's stdin, which is then closed. */
|
|
10
10
|
input?: string,
|
|
11
|
+
/** Runs the command through a shell. Needed on Windows to start a `.cmd` shim
|
|
12
|
+
such as `pnpm`, and for a shell builtin such as `command -v`; otherwise
|
|
13
|
+
leave it off, since a shell re-splits the arguments. */
|
|
14
|
+
shell?: bool,
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
@module("node:child_process")
|
package/src/NodeProcess.res
CHANGED
|
@@ -29,6 +29,11 @@ external pid: int = "pid"
|
|
|
29
29
|
@val @scope("process")
|
|
30
30
|
external execPath: string = "execPath"
|
|
31
31
|
|
|
32
|
+
/** The operating system Node was built for: `"darwin"`, `"linux"`, `"win32"`, …
|
|
33
|
+
A string rather than a variant because the set is Node's to extend. */
|
|
34
|
+
@val @scope("process")
|
|
35
|
+
external platform: string = "platform"
|
|
36
|
+
|
|
32
37
|
/** `versions["node"]` is the running Node's version, without the leading `v`. */
|
|
33
38
|
@val @scope("process")
|
|
34
39
|
external versions: dict<string> = "versions"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** Bindings for [`node:readline/promises`](https://nodejs.org/api/readline.html#promises-api):
|
|
2
|
+
asking a question on a terminal and awaiting the answer.
|
|
3
|
+
|
|
4
|
+
The promise form, for a prompt that reads one answer at a time. A stream read
|
|
5
|
+
line by line is {!NodeStreams.Readline}. The interface holds stdin open, so
|
|
6
|
+
close it once the last answer is in or the process will not exit. */
|
|
7
|
+
type t
|
|
8
|
+
|
|
9
|
+
type options = {input: NodeProcess.stream, output: NodeProcess.stream}
|
|
10
|
+
|
|
11
|
+
@module("node:readline/promises")
|
|
12
|
+
external createInterface: options => t = "createInterface"
|
|
13
|
+
|
|
14
|
+
/** Writes the question to `output` and resolves with the line typed in reply,
|
|
15
|
+
without its line ending. */
|
|
16
|
+
@send
|
|
17
|
+
external question: (t, string) => promise<string> = "question"
|
|
18
|
+
|
|
19
|
+
/** The prompt {!prompt} writes, and redraws when a terminal refreshes the line. */
|
|
20
|
+
@send
|
|
21
|
+
external setPrompt: (t, string) => unit = "setPrompt"
|
|
22
|
+
|
|
23
|
+
@send
|
|
24
|
+
external prompt: t => unit = "prompt"
|
|
25
|
+
|
|
26
|
+
/** Every line read, as it arrives, whether or not a {!question} is waiting for it.
|
|
27
|
+
Piped input arrives all at once, before a second question could listen, so a
|
|
28
|
+
prompt that asks several questions reads them from here. */
|
|
29
|
+
@send
|
|
30
|
+
external onLine: (t, @as("line") _, string => unit) => unit = "on"
|
|
31
|
+
|
|
32
|
+
/** Input has ended (the pipe closed, or Ctrl-D), or the interface was closed. */
|
|
33
|
+
@send
|
|
34
|
+
external onClose: (t, @as("close") _, unit => unit) => unit = "on"
|
|
35
|
+
|
|
36
|
+
@send
|
|
37
|
+
external close: t => unit = "close"
|