@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.
Files changed (88) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/package.json +5 -12
  3. package/rescript.json +0 -1
  4. package/src/JestBind.res +21 -22
  5. package/src/JestBind.res.mjs +15 -11
  6. package/src/RunnerHook.res +38 -0
  7. package/src/RunnerHook.res.mjs +26 -0
  8. package/bin/reventless-dev.mjs +0 -21
  9. package/src/Bind.res +0 -29
  10. package/src/Bind.res.mjs +0 -22
  11. package/src/BuildClassifier.res +0 -147
  12. package/src/BuildClassifier.res.mjs +0 -136
  13. package/src/Cancellation.res +0 -37
  14. package/src/Cancellation.res.mjs +0 -46
  15. package/src/ChildProcess.res +0 -102
  16. package/src/ChildProcess.res.mjs +0 -107
  17. package/src/Cli.res +0 -905
  18. package/src/Cli.res.mjs +0 -952
  19. package/src/Collector.res +0 -212
  20. package/src/Collector.res.mjs +0 -218
  21. package/src/ComponentMeta.res +0 -77
  22. package/src/ComponentMeta.res.mjs +0 -91
  23. package/src/ComponentScan.res +0 -103
  24. package/src/ComponentScan.res.mjs +0 -105
  25. package/src/Discovery.res +0 -105
  26. package/src/Discovery.res.mjs +0 -99
  27. package/src/DomainDeadCode.res +0 -98
  28. package/src/DomainDeadCode.res.mjs +0 -72
  29. package/src/DomainGraph.res +0 -0
  30. package/src/DomainGraph.res.mjs +0 -0
  31. package/src/Filter.res +0 -45
  32. package/src/Filter.res.mjs +0 -47
  33. package/src/FormatterHuman.res +0 -109
  34. package/src/FormatterHuman.res.mjs +0 -115
  35. package/src/FormatterJson.res +0 -264
  36. package/src/FormatterJson.res.mjs +0 -322
  37. package/src/FormatterJunit.res +0 -93
  38. package/src/FormatterJunit.res.mjs +0 -90
  39. package/src/FormatterTap.res +0 -100
  40. package/src/FormatterTap.res.mjs +0 -131
  41. package/src/FormatterVsCode.res +0 -352
  42. package/src/FormatterVsCode.res.mjs +0 -546
  43. package/src/Loader.res +0 -24
  44. package/src/Loader.res.mjs +0 -23
  45. package/src/PackageScan.res +0 -80
  46. package/src/PackageScan.res.mjs +0 -81
  47. package/src/PlatformRunner.res +0 -191
  48. package/src/PlatformRunner.res.mjs +0 -178
  49. package/src/PlatformScan.res +0 -142
  50. package/src/PlatformScan.res.mjs +0 -132
  51. package/src/ProcessManager.res +0 -135
  52. package/src/ProcessManager.res.mjs +0 -119
  53. package/src/RunWorker.res +0 -24
  54. package/src/RunWorker.res.mjs +0 -16
  55. package/src/RunnerTypes.res +0 -68
  56. package/src/RunnerTypes.res.mjs +0 -60
  57. package/src/Watch.res +0 -108
  58. package/src/Watch.res.mjs +0 -85
  59. package/src/WatcherProbe.res +0 -56
  60. package/src/WatcherProbe.res.mjs +0 -59
  61. package/src/Worker.res +0 -24
  62. package/src/Worker.res.mjs +0 -9
  63. package/tests/BuildClassifierTest.res +0 -133
  64. package/tests/BuildClassifierTest.res.mjs +0 -176
  65. package/tests/CliRunEntryTest.res +0 -57
  66. package/tests/CliRunEntryTest.res.mjs +0 -65
  67. package/tests/CliWatchScopeTest.res +0 -62
  68. package/tests/CliWatchScopeTest.res.mjs +0 -95
  69. package/tests/ComponentMetaTest.res +0 -67
  70. package/tests/ComponentMetaTest.res.mjs +0 -71
  71. package/tests/DiscoveryTest.res +0 -42
  72. package/tests/DiscoveryTest.res.mjs +0 -43
  73. package/tests/DomainDeadCodeTest.res +0 -119
  74. package/tests/DomainDeadCodeTest.res.mjs +0 -158
  75. package/tests/DomainGraphTest.res +0 -448
  76. package/tests/DomainGraphTest.res.mjs +0 -505
  77. package/tests/FormatterGoldenTest.res +0 -125
  78. package/tests/FormatterGoldenTest.res.mjs +0 -162
  79. package/tests/FormatterVsCodeMessageTest.res +0 -41
  80. package/tests/FormatterVsCodeMessageTest.res.mjs +0 -42
  81. package/tests/PlatformRunnerTest.res +0 -66
  82. package/tests/PlatformRunnerTest.res.mjs +0 -85
  83. package/tests/PlatformScanTest.res +0 -61
  84. package/tests/PlatformScanTest.res.mjs +0 -56
  85. package/tests/RunnerUnitTest.res +0 -219
  86. package/tests/RunnerUnitTest.res.mjs +0 -244
  87. package/tests/WatchDebounceTest.res +0 -106
  88. package/tests/WatchDebounceTest.res.mjs +0 -128
@@ -1,93 +0,0 @@
1
- // JUnit XML emitter — one `<testsuite>` per file, one `<testcase>` per test.
2
- // Failures carry the human-readable mismatch + hint inside `<failure>` so
3
- // CI tools like Jenkins surface the ReScript-rendered expected/actual in
4
- // their test report UI.
5
-
6
- @val external processStdout: {"write": string => unit} = "process.stdout"
7
- let write = (s: string) => processStdout["write"](s)
8
- let writeLine = (s: string) => write(s ++ "\n")
9
-
10
- let escapeXml = (s: string) =>
11
- s
12
- ->String.replaceAll("&", "&amp;")
13
- ->String.replaceAll("<", "&lt;")
14
- ->String.replaceAll(">", "&gt;")
15
- ->String.replaceAll("\"", "&quot;")
16
- ->String.replaceAll("'", "&apos;")
17
-
18
- let emitFile = (f: RunnerTypes.fileResult) => {
19
- let tests = f.tests->Array.length
20
- let failures = ref(0)
21
- let skipped = ref(0)
22
- f.tests->Array.forEach(t =>
23
- switch t.status {
24
- | Fail => failures := failures.contents + 1
25
- | Skip => skipped := skipped.contents + 1
26
- | Pass => ()
27
- }
28
- )
29
- let totalTime = f.tests->Array.reduce(0.0, (a, t) => a +. t.durationMs) /. 1000.0
30
- writeLine(
31
- ` <testsuite name="${escapeXml(f.path)}" tests="${Int.toString(
32
- tests,
33
- )}" failures="${Int.toString(failures.contents)}" skipped="${Int.toString(
34
- skipped.contents,
35
- )}" time="${Float.toString(totalTime)}">`,
36
- )
37
- f.tests->Array.forEach(t => {
38
- let name = t.describePath->Array.join(" > ")
39
- let classname = name == "" ? f.path : name
40
- let time = t.durationMs /. 1000.0
41
- write(
42
- ` <testcase name="${escapeXml(t.name)}" classname="${escapeXml(
43
- classname,
44
- )}" time="${Float.toString(time)}"`,
45
- )
46
- switch t.status {
47
- | Pass => writeLine(" />")
48
- | Skip => {
49
- writeLine(">")
50
- writeLine(
51
- ` <skipped message="${escapeXml(t.skipReason->Option.getOr("skipped"))}" />`,
52
- )
53
- writeLine(` </testcase>`)
54
- }
55
- | Fail => {
56
- writeLine(">")
57
- switch t.mismatch {
58
- | Some(m) => {
59
- let hint = Hint.forMismatch(~slice=?t.slice, m)
60
- let msg =
61
- escapeXml(Outcome.kindName(m)) ++
62
- ": " ++
63
- escapeXml(Outcome.format(m)) ++
64
- "\n\n" ++
65
- escapeXml(Hint.format(hint))
66
- writeLine(
67
- ` <failure type="${escapeXml(Outcome.kindName(m))}" message="${escapeXml(
68
- Outcome.format(m),
69
- )}">${msg}</failure>`,
70
- )
71
- }
72
- | None =>
73
- writeLine(` <failure message="failed" type="unknown">failed</failure>`)
74
- }
75
- writeLine(` </testcase>`)
76
- }
77
- }
78
- })
79
- writeLine(` </testsuite>`)
80
- }
81
-
82
- let emit = (r: RunnerTypes.runResult) => {
83
- writeLine(`<?xml version="1.0" encoding="UTF-8"?>`)
84
- writeLine(
85
- `<testsuites name="reventless-gwt" tests="${Int.toString(
86
- r.summary.total,
87
- )}" failures="${Int.toString(r.summary.failed)}" skipped="${Int.toString(
88
- r.summary.skipped,
89
- )}" time="${Float.toString(r.summary.durationMs /. 1000.0)}">`,
90
- )
91
- r.files->Array.forEach(emitFile)
92
- writeLine(`</testsuites>`)
93
- }
@@ -1,90 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Stdlib_Array from "@rescript/runtime/lib/es6/Stdlib_Array.js";
4
- import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
5
- import * as Hint$ReventlessGwt from "./Hint.res.mjs";
6
- import * as Outcome$ReventlessGwt from "./Outcome.res.mjs";
7
-
8
- function write(s) {
9
- process.stdout.write(s);
10
- }
11
-
12
- function writeLine(s) {
13
- process.stdout.write(s + "\n");
14
- }
15
-
16
- function escapeXml(s) {
17
- return s.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll("\"", "&quot;").replaceAll("'", "&apos;");
18
- }
19
-
20
- function emitFile(f) {
21
- let tests = f.tests.length;
22
- let failures = {
23
- contents: 0
24
- };
25
- let skipped = {
26
- contents: 0
27
- };
28
- f.tests.forEach(t => {
29
- let match = t.status;
30
- switch (match) {
31
- case "Pass" :
32
- return;
33
- case "Fail" :
34
- failures.contents = failures.contents + 1 | 0;
35
- return;
36
- case "Skip" :
37
- skipped.contents = skipped.contents + 1 | 0;
38
- return;
39
- }
40
- });
41
- let totalTime = Stdlib_Array.reduce(f.tests, 0.0, (a, t) => a + t.durationMs) / 1000.0;
42
- let s = ` <testsuite name="` + escapeXml(f.path) + `" tests="` + tests.toString() + `" failures="` + failures.contents.toString() + `" skipped="` + skipped.contents.toString() + `" time="` + totalTime.toString() + `">`;
43
- process.stdout.write(s + "\n");
44
- f.tests.forEach(t => {
45
- let name = t.describePath.join(" > ");
46
- let classname = name === "" ? f.path : name;
47
- let time = t.durationMs / 1000.0;
48
- process.stdout.write(` <testcase name="` + escapeXml(t.name) + `" classname="` + escapeXml(classname) + `" time="` + time.toString() + `"`);
49
- let match = t.status;
50
- switch (match) {
51
- case "Pass" :
52
- return process.stdout.write(" />\n");
53
- case "Fail" :
54
- process.stdout.write(">\n");
55
- let m = t.mismatch;
56
- if (m !== undefined) {
57
- let hint = Hint$ReventlessGwt.forMismatch(t.slice, m);
58
- let msg = escapeXml(Outcome$ReventlessGwt.kindName(m)) + ": " + escapeXml(Outcome$ReventlessGwt.format(m)) + "\n\n" + escapeXml(Hint$ReventlessGwt.format(hint));
59
- let s = ` <failure type="` + escapeXml(Outcome$ReventlessGwt.kindName(m)) + `" message="` + escapeXml(Outcome$ReventlessGwt.format(m)) + `">` + msg + `</failure>`;
60
- process.stdout.write(s + "\n");
61
- } else {
62
- process.stdout.write(` <failure message="failed" type="unknown">failed</failure>` + "\n");
63
- }
64
- return process.stdout.write(` </testcase>` + "\n");
65
- case "Skip" :
66
- process.stdout.write(">\n");
67
- let s$1 = ` <skipped message="` + escapeXml(Stdlib_Option.getOr(t.skipReason, "skipped")) + `" />`;
68
- process.stdout.write(s$1 + "\n");
69
- return process.stdout.write(` </testcase>` + "\n");
70
- }
71
- });
72
- process.stdout.write(` </testsuite>` + "\n");
73
- }
74
-
75
- function emit(r) {
76
- process.stdout.write(`<?xml version="1.0" encoding="UTF-8"?>` + "\n");
77
- let s = `<testsuites name="reventless-gwt" tests="` + r.summary.total.toString() + `" failures="` + r.summary.failed.toString() + `" skipped="` + r.summary.skipped.toString() + `" time="` + (r.summary.durationMs / 1000.0).toString() + `">`;
78
- process.stdout.write(s + "\n");
79
- r.files.forEach(emitFile);
80
- process.stdout.write(`</testsuites>` + "\n");
81
- }
82
-
83
- export {
84
- write,
85
- writeLine,
86
- escapeXml,
87
- emitFile,
88
- emit,
89
- }
90
- /* No side effect */
@@ -1,100 +0,0 @@
1
- // TAP 14 emitter with YAML diagnostic blocks on failure. Streamed line-by-line
2
- // so `tap-spec` and GitHub Actions' `actions/test-reporter` can consume the
3
- // output live.
4
-
5
- @val external processStdout: {"write": string => unit} = "process.stdout"
6
- let write = (s: string) => processStdout["write"](s)
7
- let writeLine = (s: string) => write(s ++ "\n")
8
-
9
- let escapeYamlString = (s: string) =>
10
- s
11
- ->String.replaceAll("\\", "\\\\")
12
- ->String.replaceAll("\"", "\\\"")
13
- ->String.replaceAll("\n", "\\n")
14
-
15
- let yamlString = (s: string) => "\"" ++ escapeYamlString(s) ++ "\""
16
-
17
- let yamlLine = (~indent=2, key: string, value: string) =>
18
- String.repeat(" ", indent) ++ key ++ ": " ++ value
19
-
20
- let renderMismatchYaml = (m: Outcome.mismatch) => {
21
- let n = MismatchRender.normalize(m)
22
- let lines = [yamlLine("kind", yamlString(n.kind))]
23
- // `ExpectedNoEvents` is a Human-only literal (TAP simply omits `expected`);
24
- // every other field maps to one yaml `key: "escaped-value"` line.
25
- n.fields->Array.forEach(f =>
26
- switch f {
27
- | Expected(v) => lines->Array.push(yamlLine("expected", yamlString(v)))
28
- | Actual(v) => lines->Array.push(yamlLine("actual", yamlString(v)))
29
- | Key(k) => lines->Array.push(yamlLine("key", yamlString(k)))
30
- | Error(e) => lines->Array.push(yamlLine("error", yamlString(e)))
31
- | Stack(s) => lines->Array.push(yamlLine("stack", yamlString(s)))
32
- | ExpectedNoEvents => ()
33
- }
34
- )
35
- lines->Array.join("\n")
36
- }
37
-
38
- let emit = (r: RunnerTypes.runResult) => {
39
- writeLine("TAP version 14")
40
- writeLine(`1..${Int.toString(r.summary.total)}`)
41
- let index = ref(0)
42
- r.files->Array.forEach(f => {
43
- writeLine("")
44
- writeLine(`# ${f.path}`)
45
- f.tests->Array.forEach(t => {
46
- index := index.contents + 1
47
- let n = index.contents
48
- let path = t.describePath->Array.join(" > ")
49
- let title = path == "" ? t.name : `${path} > ${t.name}`
50
- let ms = ` # time=${Float.toString(t.durationMs)}ms`
51
- switch t.status {
52
- | Pass => writeLine(`ok ${Int.toString(n)} - ${title}${ms}`)
53
- | Skip => {
54
- let reason = t.skipReason->Option.getOr("skipped")
55
- writeLine(`ok ${Int.toString(n)} - ${title} # SKIP ${reason}`)
56
- }
57
- | Fail => {
58
- writeLine(`not ok ${Int.toString(n)} - ${title}${ms}`)
59
- writeLine(" ---")
60
- switch t.location {
61
- | Some(loc) =>
62
- writeLine(
63
- yamlLine(
64
- "location",
65
- `{ file: "${loc.file}", line: ${Int.toString(loc.line)} }`,
66
- ),
67
- )
68
- | None => ()
69
- }
70
- switch t.mismatch {
71
- | Some(m) => writeLine(renderMismatchYaml(m))
72
- | None => ()
73
- }
74
- switch t.mismatch {
75
- | Some(m) => {
76
- let hint = Hint.forMismatch(~slice=?t.slice, m)
77
- writeLine(yamlLine("hint", ""))
78
- writeLine(yamlLine(~indent=4, "locus", yamlString(hint.locus)))
79
- writeLine(
80
- yamlLine(
81
- ~indent=4,
82
- "branch",
83
- yamlString(hint.branch->Option.getOr("(none)")),
84
- ),
85
- )
86
- writeLine(yamlLine(~indent=4, "message", yamlString(hint.message)))
87
- }
88
- | None => ()
89
- }
90
- writeLine(" ...")
91
- }
92
- }
93
- })
94
- })
95
- writeLine("")
96
- writeLine(`# tests ${Int.toString(r.summary.total)}`)
97
- writeLine(`# pass ${Int.toString(r.summary.passed)}`)
98
- writeLine(`# fail ${Int.toString(r.summary.failed)}`)
99
- writeLine(`# skip ${Int.toString(r.summary.skipped)}`)
100
- }
@@ -1,131 +0,0 @@
1
- // Generated by ReScript, PLEASE EDIT WITH CARE
2
-
3
- import * as Stdlib_Option from "@rescript/runtime/lib/es6/Stdlib_Option.js";
4
- import * as Hint$ReventlessGwt from "./Hint.res.mjs";
5
- import * as MismatchRender$ReventlessGwt from "./MismatchRender.res.mjs";
6
-
7
- function write(s) {
8
- process.stdout.write(s);
9
- }
10
-
11
- function writeLine(s) {
12
- process.stdout.write(s + "\n");
13
- }
14
-
15
- function escapeYamlString(s) {
16
- return s.replaceAll("\\", "\\\\").replaceAll("\"", "\\\"").replaceAll("\n", "\\n");
17
- }
18
-
19
- function yamlString(s) {
20
- return "\"" + escapeYamlString(s) + "\"";
21
- }
22
-
23
- function yamlLine(indentOpt, key, value) {
24
- let indent = indentOpt !== undefined ? indentOpt : 2;
25
- return " ".repeat(indent) + key + ": " + value;
26
- }
27
-
28
- function renderMismatchYaml(m) {
29
- let n = MismatchRender$ReventlessGwt.normalize(m);
30
- let lines = [yamlLine(undefined, "kind", yamlString(n.kind))];
31
- n.fields.forEach(f => {
32
- if (typeof f !== "object") {
33
- return;
34
- }
35
- switch (f.TAG) {
36
- case "Expected" :
37
- lines.push(yamlLine(undefined, "expected", yamlString(f._0)));
38
- return;
39
- case "Actual" :
40
- lines.push(yamlLine(undefined, "actual", yamlString(f._0)));
41
- return;
42
- case "Key" :
43
- lines.push(yamlLine(undefined, "key", yamlString(f._0)));
44
- return;
45
- case "Error" :
46
- lines.push(yamlLine(undefined, "error", yamlString(f._0)));
47
- return;
48
- case "Stack" :
49
- lines.push(yamlLine(undefined, "stack", yamlString(f._0)));
50
- return;
51
- }
52
- });
53
- return lines.join("\n");
54
- }
55
-
56
- function emit(r) {
57
- process.stdout.write("TAP version 14\n");
58
- let s = `1..` + r.summary.total.toString();
59
- process.stdout.write(s + "\n");
60
- let index = {
61
- contents: 0
62
- };
63
- r.files.forEach(f => {
64
- process.stdout.write("\n");
65
- process.stdout.write(`# ` + f.path + "\n");
66
- f.tests.forEach(t => {
67
- index.contents = index.contents + 1 | 0;
68
- let n = index.contents;
69
- let path = t.describePath.join(" > ");
70
- let title = path === "" ? t.name : path + ` > ` + t.name;
71
- let ms = ` # time=` + t.durationMs.toString() + `ms`;
72
- let match = t.status;
73
- switch (match) {
74
- case "Pass" :
75
- let s = `ok ` + n.toString() + ` - ` + title + ms;
76
- return process.stdout.write(s + "\n");
77
- case "Fail" :
78
- let s$1 = `not ok ` + n.toString() + ` - ` + title + ms;
79
- process.stdout.write(s$1 + "\n");
80
- process.stdout.write(" ---\n");
81
- let loc = t.location;
82
- if (loc !== undefined) {
83
- let s$2 = yamlLine(undefined, "location", `{ file: "` + loc.file + `", line: ` + loc.line.toString() + ` }`);
84
- process.stdout.write(s$2 + "\n");
85
- }
86
- let m = t.mismatch;
87
- if (m !== undefined) {
88
- let s$3 = renderMismatchYaml(m);
89
- process.stdout.write(s$3 + "\n");
90
- }
91
- let m$1 = t.mismatch;
92
- if (m$1 !== undefined) {
93
- let hint = Hint$ReventlessGwt.forMismatch(t.slice, m$1);
94
- let s$4 = yamlLine(undefined, "hint", "");
95
- process.stdout.write(s$4 + "\n");
96
- let s$5 = yamlLine(4, "locus", yamlString(hint.locus));
97
- process.stdout.write(s$5 + "\n");
98
- let s$6 = yamlLine(4, "branch", yamlString(Stdlib_Option.getOr(hint.branch, "(none)")));
99
- process.stdout.write(s$6 + "\n");
100
- let s$7 = yamlLine(4, "message", yamlString(hint.message));
101
- process.stdout.write(s$7 + "\n");
102
- }
103
- return process.stdout.write(" ...\n");
104
- case "Skip" :
105
- let reason = Stdlib_Option.getOr(t.skipReason, "skipped");
106
- let s$8 = `ok ` + n.toString() + ` - ` + title + ` # SKIP ` + reason;
107
- return process.stdout.write(s$8 + "\n");
108
- }
109
- });
110
- });
111
- process.stdout.write("\n");
112
- let s$1 = `# tests ` + r.summary.total.toString();
113
- process.stdout.write(s$1 + "\n");
114
- let s$2 = `# pass ` + r.summary.passed.toString();
115
- process.stdout.write(s$2 + "\n");
116
- let s$3 = `# fail ` + r.summary.failed.toString();
117
- process.stdout.write(s$3 + "\n");
118
- let s$4 = `# skip ` + r.summary.skipped.toString();
119
- process.stdout.write(s$4 + "\n");
120
- }
121
-
122
- export {
123
- write,
124
- writeLine,
125
- escapeYamlString,
126
- yamlString,
127
- yamlLine,
128
- renderMismatchYaml,
129
- emit,
130
- }
131
- /* No side effect */