@reventlessdev/reventless-gwt 1.0.0-alpha.114 → 1.0.0-alpha.116
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 +19 -0
- package/package.json +5 -12
- package/rescript.json +0 -1
- package/src/JestBind.res +21 -22
- package/src/JestBind.res.mjs +15 -11
- package/src/RunnerHook.res +38 -0
- package/src/RunnerHook.res.mjs +26 -0
- package/bin/reventless-dev.mjs +0 -21
- package/src/Bind.res +0 -29
- package/src/Bind.res.mjs +0 -22
- package/src/BuildClassifier.res +0 -147
- package/src/BuildClassifier.res.mjs +0 -136
- package/src/Cancellation.res +0 -37
- package/src/Cancellation.res.mjs +0 -46
- package/src/ChildProcess.res +0 -102
- package/src/ChildProcess.res.mjs +0 -107
- package/src/Cli.res +0 -905
- package/src/Cli.res.mjs +0 -952
- package/src/Collector.res +0 -212
- package/src/Collector.res.mjs +0 -218
- package/src/ComponentMeta.res +0 -77
- package/src/ComponentMeta.res.mjs +0 -91
- package/src/ComponentScan.res +0 -103
- package/src/ComponentScan.res.mjs +0 -105
- package/src/Discovery.res +0 -105
- package/src/Discovery.res.mjs +0 -99
- package/src/DomainDeadCode.res +0 -98
- package/src/DomainDeadCode.res.mjs +0 -72
- package/src/DomainGraph.res +0 -0
- package/src/DomainGraph.res.mjs +0 -0
- package/src/Filter.res +0 -45
- package/src/Filter.res.mjs +0 -47
- package/src/FormatterHuman.res +0 -109
- package/src/FormatterHuman.res.mjs +0 -115
- package/src/FormatterJson.res +0 -264
- package/src/FormatterJson.res.mjs +0 -322
- package/src/FormatterJunit.res +0 -93
- package/src/FormatterJunit.res.mjs +0 -90
- package/src/FormatterTap.res +0 -100
- package/src/FormatterTap.res.mjs +0 -131
- package/src/FormatterVsCode.res +0 -352
- package/src/FormatterVsCode.res.mjs +0 -546
- package/src/Loader.res +0 -24
- package/src/Loader.res.mjs +0 -23
- package/src/PackageScan.res +0 -80
- package/src/PackageScan.res.mjs +0 -81
- package/src/PlatformRunner.res +0 -191
- package/src/PlatformRunner.res.mjs +0 -178
- package/src/PlatformScan.res +0 -142
- package/src/PlatformScan.res.mjs +0 -132
- package/src/ProcessManager.res +0 -135
- package/src/ProcessManager.res.mjs +0 -119
- package/src/RunWorker.res +0 -24
- package/src/RunWorker.res.mjs +0 -16
- package/src/RunnerTypes.res +0 -68
- package/src/RunnerTypes.res.mjs +0 -60
- package/src/Watch.res +0 -108
- package/src/Watch.res.mjs +0 -85
- package/src/WatcherProbe.res +0 -56
- package/src/WatcherProbe.res.mjs +0 -59
- package/src/Worker.res +0 -24
- package/src/Worker.res.mjs +0 -9
- package/tests/BuildClassifierTest.res +0 -133
- package/tests/BuildClassifierTest.res.mjs +0 -176
- package/tests/CliRunEntryTest.res +0 -57
- package/tests/CliRunEntryTest.res.mjs +0 -65
- package/tests/CliWatchScopeTest.res +0 -62
- package/tests/CliWatchScopeTest.res.mjs +0 -95
- package/tests/ComponentMetaTest.res +0 -67
- package/tests/ComponentMetaTest.res.mjs +0 -71
- package/tests/DiscoveryTest.res +0 -42
- package/tests/DiscoveryTest.res.mjs +0 -43
- package/tests/DomainDeadCodeTest.res +0 -119
- package/tests/DomainDeadCodeTest.res.mjs +0 -158
- package/tests/DomainGraphTest.res +0 -448
- package/tests/DomainGraphTest.res.mjs +0 -505
- package/tests/FormatterGoldenTest.res +0 -125
- package/tests/FormatterGoldenTest.res.mjs +0 -162
- package/tests/FormatterVsCodeMessageTest.res +0 -41
- package/tests/FormatterVsCodeMessageTest.res.mjs +0 -42
- package/tests/PlatformRunnerTest.res +0 -66
- package/tests/PlatformRunnerTest.res.mjs +0 -85
- package/tests/PlatformScanTest.res +0 -61
- package/tests/PlatformScanTest.res.mjs +0 -56
- package/tests/RunnerUnitTest.res +0 -219
- package/tests/RunnerUnitTest.res.mjs +0 -244
- package/tests/WatchDebounceTest.res +0 -106
- package/tests/WatchDebounceTest.res.mjs +0 -128
package/src/Cancellation.res.mjs
DELETED
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
let cancelled = {
|
|
5
|
-
contents: false
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
let handlers = {
|
|
9
|
-
contents: []
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
function isCancelled() {
|
|
13
|
-
return cancelled.contents;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
function onCancel(handler) {
|
|
17
|
-
handlers.contents = handlers.contents.concat([handler]);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
function install() {
|
|
21
|
-
let handler = () => {
|
|
22
|
-
if (cancelled.contents) {
|
|
23
|
-
process.exit(130);
|
|
24
|
-
} else {
|
|
25
|
-
cancelled.contents = true;
|
|
26
|
-
handlers.contents.forEach(h => {
|
|
27
|
-
try {
|
|
28
|
-
return h();
|
|
29
|
-
} catch (exn) {
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
process.on("SIGINT", handler);
|
|
36
|
-
process.on("SIGTERM", handler);
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export {
|
|
40
|
-
cancelled,
|
|
41
|
-
handlers,
|
|
42
|
-
isCancelled,
|
|
43
|
-
onCancel,
|
|
44
|
-
install,
|
|
45
|
-
}
|
|
46
|
-
/* No side effect */
|
package/src/ChildProcess.res
DELETED
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
// Minimal `node:child_process` binding for the watch-mode build manager. The
|
|
2
|
-
// only consumer is ProcessManager, which spawns one `pnpm run start`
|
|
3
|
-
// (`rescript build -w`) per package. Children are spawned **detached** so each
|
|
4
|
-
// gets its own process group; killing the negative pid then tears down the whole
|
|
5
|
-
// tree (pnpm + the rescript watcher it spawns) — no orphaned compilers.
|
|
6
|
-
|
|
7
|
-
type t
|
|
8
|
-
type stream
|
|
9
|
-
|
|
10
|
-
type spawnOptions = {
|
|
11
|
-
cwd: string,
|
|
12
|
-
detached: bool,
|
|
13
|
-
env: Dict.t<string>,
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@module("node:child_process")
|
|
17
|
-
external _spawn: (string, array<string>, spawnOptions) => t = "spawn"
|
|
18
|
-
|
|
19
|
-
@val external _processEnv: Dict.t<string> = "process.env"
|
|
20
|
-
|
|
21
|
-
// Merge the current process env with optional overrides into a fresh dict — node's
|
|
22
|
-
// `spawn` replaces the whole env, so callers that pass `~env` still inherit PATH etc.
|
|
23
|
-
let mergeEnv = (overrides: option<Dict.t<string>>): Dict.t<string> => {
|
|
24
|
-
let m = Dict.make()
|
|
25
|
-
_processEnv->Dict.toArray->Array.forEach(((k, v)) => m->Dict.set(k, v))
|
|
26
|
-
switch overrides {
|
|
27
|
-
| Some(o) => o->Dict.toArray->Array.forEach(((k, v)) => m->Dict.set(k, v))
|
|
28
|
-
| None => ()
|
|
29
|
-
}
|
|
30
|
-
m
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
@get external _pid: t => Nullable.t<int> = "pid"
|
|
34
|
-
@get external _stdout: t => stream = "stdout"
|
|
35
|
-
@get external _stderr: t => stream = "stderr"
|
|
36
|
-
@send external _streamSetEncoding: (stream, string) => unit = "setEncoding"
|
|
37
|
-
@send external _streamOn: (stream, string, string => unit) => unit = "on"
|
|
38
|
-
@send external _streamOnEnd: (stream, string, unit => unit) => unit = "on"
|
|
39
|
-
@send external _procOnClose: (t, string, Nullable.t<int> => unit) => unit = "on"
|
|
40
|
-
@send external _procOnError: (t, string, JsExn.t => unit) => unit = "on"
|
|
41
|
-
@send external _kill: (t, string) => bool = "kill"
|
|
42
|
-
@val external _processKill: (int, string) => unit = "process.kill"
|
|
43
|
-
|
|
44
|
-
let spawn = (cmd: string, args: array<string>, ~cwd: string, ~env: option<Dict.t<string>>=?): t =>
|
|
45
|
-
_spawn(cmd, args, {cwd, detached: true, env: mergeEnv(env)})
|
|
46
|
-
|
|
47
|
-
let pid = (proc: t): option<int> => proc->_pid->Nullable.toOption
|
|
48
|
-
|
|
49
|
-
// Subscribe to a stream line-by-line (stdout or stderr), buffering partial
|
|
50
|
-
// chunks. Used to classify ReScript compiler markers in Phase 5. On stream
|
|
51
|
-
// `end` the final unterminated line is flushed — crash/panic messages
|
|
52
|
-
// typically lack a trailing newline, so without this the last (often most
|
|
53
|
-
// diagnostic) line was silently dropped.
|
|
54
|
-
let onLines = (s: stream, cb: string => unit): unit => {
|
|
55
|
-
_streamSetEncoding(s, "utf8")
|
|
56
|
-
let buf = ref("")
|
|
57
|
-
_streamOn(s, "data", chunk => {
|
|
58
|
-
buf := buf.contents ++ chunk
|
|
59
|
-
let rec drain = () =>
|
|
60
|
-
switch String.indexOf(buf.contents, "\n") {
|
|
61
|
-
| -1 => ()
|
|
62
|
-
| idx => {
|
|
63
|
-
let line = String.slice(buf.contents, ~start=0, ~end=idx)
|
|
64
|
-
buf := String.slice(buf.contents, ~start=idx + 1, ~end=String.length(buf.contents))
|
|
65
|
-
cb(line)
|
|
66
|
-
drain()
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
drain()
|
|
70
|
-
})
|
|
71
|
-
_streamOnEnd(s, "end", () =>
|
|
72
|
-
if buf.contents != "" {
|
|
73
|
-
let last = buf.contents
|
|
74
|
-
buf := ""
|
|
75
|
-
cb(last)
|
|
76
|
-
}
|
|
77
|
-
)
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
let onStdoutLine = (proc: t, cb: string => unit): unit => onLines(proc->_stdout, cb)
|
|
81
|
-
let onStderrLine = (proc: t, cb: string => unit): unit => onLines(proc->_stderr, cb)
|
|
82
|
-
let onClose = (proc: t, cb: option<int> => unit): unit =>
|
|
83
|
-
_procOnClose(proc, "close", code => cb(code->Nullable.toOption))
|
|
84
|
-
|
|
85
|
-
// A spawn failure (ENOENT for a missing binary, EACCES, …) emits `"error"` on
|
|
86
|
-
// the child, not `"close"`. Without a listener Node re-throws it as an uncaught
|
|
87
|
-
// exception and crashes the whole CLI. Route the message to the caller instead.
|
|
88
|
-
let onError = (proc: t, cb: string => unit): unit =>
|
|
89
|
-
_procOnError(proc, "error", e => cb(e->JsExn.message->Option.getOr("spawn failed")))
|
|
90
|
-
|
|
91
|
-
// Kill the child's whole process group (negative pid) so the rescript watcher
|
|
92
|
-
// pnpm spawned dies too. Falls back to a direct kill if the pid is gone.
|
|
93
|
-
let killTree = (proc: t, signal: string): unit =>
|
|
94
|
-
switch proc->pid {
|
|
95
|
-
| Some(p) =>
|
|
96
|
-
try {
|
|
97
|
-
_processKill(-p, signal)
|
|
98
|
-
} catch {
|
|
99
|
-
| _ => ignore(proc->_kill(signal))
|
|
100
|
-
}
|
|
101
|
-
| None => ignore(proc->_kill(signal))
|
|
102
|
-
}
|
package/src/ChildProcess.res.mjs
DELETED
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
// Generated by ReScript, PLEASE EDIT WITH CARE
|
|
2
|
-
|
|
3
|
-
import * as Stdlib_JsExn from "@rescript/runtime/lib/es6/Stdlib_JsExn.js";
|
|
4
|
-
import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
|
|
5
|
-
import * as Primitive_option from "@rescript/runtime/lib/es6/Primitive_option.js";
|
|
6
|
-
import * as Nodechild_process from "node:child_process";
|
|
7
|
-
|
|
8
|
-
function mergeEnv(overrides) {
|
|
9
|
-
let m = {};
|
|
10
|
-
Object.entries(process.env).forEach(param => {
|
|
11
|
-
m[param[0]] = param[1];
|
|
12
|
-
});
|
|
13
|
-
if (overrides !== undefined) {
|
|
14
|
-
Object.entries(overrides).forEach(param => {
|
|
15
|
-
m[param[0]] = param[1];
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
return m;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
function spawn(cmd, args, cwd, env) {
|
|
22
|
-
return Nodechild_process.spawn(cmd, args, {
|
|
23
|
-
cwd: cwd,
|
|
24
|
-
detached: true,
|
|
25
|
-
env: mergeEnv(env)
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function pid(proc) {
|
|
30
|
-
return Primitive_option.fromNullable(proc.pid);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function onLines(s, cb) {
|
|
34
|
-
s.setEncoding("utf8");
|
|
35
|
-
let buf = {
|
|
36
|
-
contents: ""
|
|
37
|
-
};
|
|
38
|
-
s.on("data", chunk => {
|
|
39
|
-
buf.contents = buf.contents + chunk;
|
|
40
|
-
let drain = () => {
|
|
41
|
-
while (true) {
|
|
42
|
-
let idx = buf.contents.indexOf("\n");
|
|
43
|
-
if (idx === -1) {
|
|
44
|
-
return;
|
|
45
|
-
}
|
|
46
|
-
let line = buf.contents.slice(0, idx);
|
|
47
|
-
buf.contents = buf.contents.slice(idx + 1 | 0, buf.contents.length);
|
|
48
|
-
cb(line);
|
|
49
|
-
continue;
|
|
50
|
-
};
|
|
51
|
-
};
|
|
52
|
-
drain();
|
|
53
|
-
});
|
|
54
|
-
s.on("end", () => {
|
|
55
|
-
if (buf.contents === "") {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
let last = buf.contents;
|
|
59
|
-
buf.contents = "";
|
|
60
|
-
cb(last);
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
function onStdoutLine(proc, cb) {
|
|
65
|
-
onLines(proc.stdout, cb);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
function onStderrLine(proc, cb) {
|
|
69
|
-
onLines(proc.stderr, cb);
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
function onClose(proc, cb) {
|
|
73
|
-
proc.on("close", code => cb((code == null) ? undefined : Primitive_option.some(code)));
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
function onError(proc, cb) {
|
|
77
|
-
proc.on("error", e => cb(Stdlib_Option.getOr(Stdlib_JsExn.message(e), "spawn failed")));
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
function killTree(proc, signal) {
|
|
81
|
-
let p = Primitive_option.fromNullable(proc.pid);
|
|
82
|
-
if (p !== undefined) {
|
|
83
|
-
try {
|
|
84
|
-
process.kill(-p | 0, signal);
|
|
85
|
-
return;
|
|
86
|
-
} catch (exn) {
|
|
87
|
-
proc.kill(signal);
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
} else {
|
|
91
|
-
proc.kill(signal);
|
|
92
|
-
return;
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
export {
|
|
97
|
-
mergeEnv,
|
|
98
|
-
spawn,
|
|
99
|
-
pid,
|
|
100
|
-
onLines,
|
|
101
|
-
onStdoutLine,
|
|
102
|
-
onStderrLine,
|
|
103
|
-
onClose,
|
|
104
|
-
onError,
|
|
105
|
-
killTree,
|
|
106
|
-
}
|
|
107
|
-
/* Stdlib_JsExn Not a pure module */
|