@reventlessdev/reventless-gwt 1.0.0-alpha.100

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 (184) hide show
  1. package/CHANGELOG.md +916 -0
  2. package/LICENSE +202 -0
  3. package/bin/reventless-dev.mjs +21 -0
  4. package/package.json +54 -0
  5. package/rescript.json +36 -0
  6. package/src/.gwtignore +10 -0
  7. package/src/Automation_GWT.res +207 -0
  8. package/src/Automation_GWT.res.mjs +160 -0
  9. package/src/Behavior_GWT.res +569 -0
  10. package/src/Behavior_GWT.res.mjs +523 -0
  11. package/src/Bind.res +29 -0
  12. package/src/Bind.res.mjs +22 -0
  13. package/src/BuildClassifier.res +147 -0
  14. package/src/BuildClassifier.res.mjs +136 -0
  15. package/src/Cancellation.res +37 -0
  16. package/src/Cancellation.res.mjs +46 -0
  17. package/src/ChildProcess.res +102 -0
  18. package/src/ChildProcess.res.mjs +107 -0
  19. package/src/Cli.res +905 -0
  20. package/src/Cli.res.mjs +952 -0
  21. package/src/Collector.res +212 -0
  22. package/src/Collector.res.mjs +218 -0
  23. package/src/ComponentMeta.res +77 -0
  24. package/src/ComponentMeta.res.mjs +91 -0
  25. package/src/ComponentScan.res +103 -0
  26. package/src/ComponentScan.res.mjs +105 -0
  27. package/src/Delegate_GWT.res +303 -0
  28. package/src/Delegate_GWT.res.mjs +372 -0
  29. package/src/Diff.res +91 -0
  30. package/src/Diff.res.mjs +98 -0
  31. package/src/Discovery.res +105 -0
  32. package/src/Discovery.res.mjs +99 -0
  33. package/src/DomainDeadCode.res +98 -0
  34. package/src/DomainDeadCode.res.mjs +72 -0
  35. package/src/DomainGraph.res +0 -0
  36. package/src/DomainGraph.res.mjs +0 -0
  37. package/src/EventMapping_GWT.res +29 -0
  38. package/src/EventMapping_GWT.res.mjs +44 -0
  39. package/src/Filter.res +45 -0
  40. package/src/Filter.res.mjs +47 -0
  41. package/src/Flow_GWT.res +664 -0
  42. package/src/Flow_GWT.res.mjs +604 -0
  43. package/src/FormatterHuman.res +109 -0
  44. package/src/FormatterHuman.res.mjs +115 -0
  45. package/src/FormatterJson.res +264 -0
  46. package/src/FormatterJson.res.mjs +322 -0
  47. package/src/FormatterJunit.res +93 -0
  48. package/src/FormatterJunit.res.mjs +90 -0
  49. package/src/FormatterTap.res +100 -0
  50. package/src/FormatterTap.res.mjs +131 -0
  51. package/src/FormatterVsCode.res +352 -0
  52. package/src/FormatterVsCode.res.mjs +546 -0
  53. package/src/Hint.res +119 -0
  54. package/src/Hint.res.mjs +124 -0
  55. package/src/InboundTranslation_GWT.res +83 -0
  56. package/src/InboundTranslation_GWT.res.mjs +94 -0
  57. package/src/JestBind.res +70 -0
  58. package/src/JestBind.res.mjs +63 -0
  59. package/src/Loader.res +24 -0
  60. package/src/Loader.res.mjs +23 -0
  61. package/src/LocalHost.res +119 -0
  62. package/src/LocalHost.res.mjs +99 -0
  63. package/src/Mapping_GWT.res +474 -0
  64. package/src/Mapping_GWT.res.mjs +322 -0
  65. package/src/MismatchRender.res +72 -0
  66. package/src/MismatchRender.res.mjs +127 -0
  67. package/src/MultiSourceProjection_GWT.res +316 -0
  68. package/src/MultiSourceProjection_GWT.res.mjs +354 -0
  69. package/src/OutboundTranslation_GWT.res +238 -0
  70. package/src/OutboundTranslation_GWT.res.mjs +186 -0
  71. package/src/Outcome.res +97 -0
  72. package/src/Outcome.res.mjs +93 -0
  73. package/src/PackageScan.res +80 -0
  74. package/src/PackageScan.res.mjs +81 -0
  75. package/src/PlatformRunner.res +181 -0
  76. package/src/PlatformRunner.res.mjs +176 -0
  77. package/src/PlatformScan.res +142 -0
  78. package/src/PlatformScan.res.mjs +132 -0
  79. package/src/ProcessManager.res +135 -0
  80. package/src/ProcessManager.res.mjs +119 -0
  81. package/src/Projection_GWT.res +312 -0
  82. package/src/Projection_GWT.res.mjs +332 -0
  83. package/src/Query_GWT.res +379 -0
  84. package/src/Query_GWT.res.mjs +367 -0
  85. package/src/RenderRescript.res +125 -0
  86. package/src/RenderRescript.res.mjs +141 -0
  87. package/src/RunWorker.res +24 -0
  88. package/src/RunWorker.res.mjs +16 -0
  89. package/src/RunnerTypes.res +68 -0
  90. package/src/RunnerTypes.res.mjs +60 -0
  91. package/src/SideEffect_GWT.res +157 -0
  92. package/src/SideEffect_GWT.res.mjs +113 -0
  93. package/src/StateChange/ExternalAddCategorySlice.res +25 -0
  94. package/src/StateChange/ExternalAddCategorySlice.res.mjs +34 -0
  95. package/src/StateChange/ExternalAddCategorySlice_Behavior.res +19 -0
  96. package/src/StateChange/ExternalAddCategorySlice_Behavior.res.mjs +46 -0
  97. package/src/StateChange/WithFixtures.res +22 -0
  98. package/src/StateChange/WithFixtures.res.mjs +31 -0
  99. package/src/StateChange/WithFixtures_Behavior.res +17 -0
  100. package/src/StateChange/WithFixtures_Behavior.res.mjs +37 -0
  101. package/src/StateChange/WithManualOpen.res +23 -0
  102. package/src/StateChange/WithManualOpen.res.mjs +31 -0
  103. package/src/StateChange/WithManualOpen_Behavior.res +17 -0
  104. package/src/StateChange/WithManualOpen_Behavior.res.mjs +37 -0
  105. package/src/StubRuntime.res +54 -0
  106. package/src/StubRuntime.res.mjs +55 -0
  107. package/src/TestFixtures.res +16 -0
  108. package/src/TestFixtures.res.mjs +34 -0
  109. package/src/Watch.res +108 -0
  110. package/src/Watch.res.mjs +85 -0
  111. package/src/WatcherProbe.res +56 -0
  112. package/src/WatcherProbe.res.mjs +59 -0
  113. package/src/Worker.res +24 -0
  114. package/src/Worker.res.mjs +9 -0
  115. package/tests/AutomationGwtTest.res +71 -0
  116. package/tests/AutomationGwtTest.res.mjs +189 -0
  117. package/tests/BuildClassifierTest.res +133 -0
  118. package/tests/BuildClassifierTest.res.mjs +176 -0
  119. package/tests/CliRunEntryTest.res +57 -0
  120. package/tests/CliRunEntryTest.res.mjs +65 -0
  121. package/tests/CliWatchScopeTest.res +62 -0
  122. package/tests/CliWatchScopeTest.res.mjs +95 -0
  123. package/tests/ComponentMetaTest.res +67 -0
  124. package/tests/ComponentMetaTest.res.mjs +71 -0
  125. package/tests/DelegateGwtTest.res +487 -0
  126. package/tests/DelegateGwtTest.res.mjs +891 -0
  127. package/tests/DiscoveryTest.res +42 -0
  128. package/tests/DiscoveryTest.res.mjs +43 -0
  129. package/tests/DomainDeadCodeTest.res +119 -0
  130. package/tests/DomainDeadCodeTest.res.mjs +158 -0
  131. package/tests/DomainGraphTest.res +448 -0
  132. package/tests/DomainGraphTest.res.mjs +505 -0
  133. package/tests/FlowAggregateGwtTest.res +171 -0
  134. package/tests/FlowAggregateGwtTest.res.mjs +273 -0
  135. package/tests/FlowCrossPluginGwtTest.res +340 -0
  136. package/tests/FlowCrossPluginGwtTest.res.mjs +798 -0
  137. package/tests/FlowGwtTest.res +222 -0
  138. package/tests/FlowGwtTest.res.mjs +433 -0
  139. package/tests/FormatterGoldenTest.res +125 -0
  140. package/tests/FormatterGoldenTest.res.mjs +162 -0
  141. package/tests/FormatterVsCodeMessageTest.res +41 -0
  142. package/tests/FormatterVsCodeMessageTest.res.mjs +42 -0
  143. package/tests/InboundTranslationGwtTest.res +34 -0
  144. package/tests/InboundTranslationGwtTest.res.mjs +99 -0
  145. package/tests/LocalHostIntegration.res +70 -0
  146. package/tests/LocalHostIntegration.res.mjs +64 -0
  147. package/tests/LocalHostTest.res +71 -0
  148. package/tests/LocalHostTest.res.mjs +63 -0
  149. package/tests/MappingGwtTest.res +350 -0
  150. package/tests/MappingGwtTest.res.mjs +596 -0
  151. package/tests/OutboundTranslationGwtTest.res +59 -0
  152. package/tests/OutboundTranslationGwtTest.res.mjs +139 -0
  153. package/tests/PlatformRunnerTest.res +66 -0
  154. package/tests/PlatformRunnerTest.res.mjs +85 -0
  155. package/tests/PlatformScanTest.res +61 -0
  156. package/tests/PlatformScanTest.res.mjs +56 -0
  157. package/tests/QueryGwtTest.res +161 -0
  158. package/tests/QueryGwtTest.res.mjs +314 -0
  159. package/tests/QueryResolverGwtTest.res +71 -0
  160. package/tests/QueryResolverGwtTest.res.mjs +136 -0
  161. package/tests/RunnerUnitTest.res +219 -0
  162. package/tests/RunnerUnitTest.res.mjs +244 -0
  163. package/tests/SideEffect/FakeOrderNotification.res +23 -0
  164. package/tests/SideEffect/FakeOrderNotification.res.mjs +36 -0
  165. package/tests/SideEffect/FakeOrderNotificationGwtTest.res +35 -0
  166. package/tests/SideEffect/FakeOrderNotificationGwtTest.res.mjs +73 -0
  167. package/tests/SideEffect/MockEmail.res +18 -0
  168. package/tests/SideEffect/MockEmail.res.mjs +47 -0
  169. package/tests/StateChange/ExternalAddCategorySlice_GWT.res +27 -0
  170. package/tests/StateChange/ExternalAddCategorySlice_GWT.res.mjs +70 -0
  171. package/tests/StateChange/WithFixtures_Fixtures.res +9 -0
  172. package/tests/StateChange/WithFixtures_Fixtures.res.mjs +20 -0
  173. package/tests/StateChange/WithFixtures_GWT.res +23 -0
  174. package/tests/StateChange/WithFixtures_GWT.res.mjs +56 -0
  175. package/tests/StateChange/WithManualOpen_Fixtures.res +7 -0
  176. package/tests/StateChange/WithManualOpen_Fixtures.res.mjs +20 -0
  177. package/tests/StateChange/WithManualOpen_GWT.res +17 -0
  178. package/tests/StateChange/WithManualOpen_GWT.res.mjs +56 -0
  179. package/tests/StateChangeSliceGwtTest.res +160 -0
  180. package/tests/StateChangeSliceGwtTest.res.mjs +280 -0
  181. package/tests/StateViewSliceGwtTest.res +64 -0
  182. package/tests/StateViewSliceGwtTest.res.mjs +161 -0
  183. package/tests/WatchDebounceTest.res +106 -0
  184. package/tests/WatchDebounceTest.res.mjs +128 -0
@@ -0,0 +1,95 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as Cli$ReventlessGwt from "../src/Cli.res.mjs";
4
+
5
+ globalThis.describe("Cli.mergeScope", () => {
6
+ globalThis.test("RunAll absorbs on the left", () => {
7
+ globalThis.expect(Cli$ReventlessGwt.mergeScope("RunAll", {
8
+ TAG: "RunPackages",
9
+ _0: ["/p/a"]
10
+ })).toEqual("RunAll");
11
+ });
12
+ globalThis.test("RunAll absorbs on the right", () => {
13
+ globalThis.expect(Cli$ReventlessGwt.mergeScope({
14
+ TAG: "RunPackages",
15
+ _0: ["/p/a"]
16
+ }, "RunAll")).toEqual("RunAll");
17
+ });
18
+ globalThis.test("two RunPackages union their dirs, deduplicated", () => {
19
+ globalThis.expect(Cli$ReventlessGwt.mergeScope({
20
+ TAG: "RunPackages",
21
+ _0: [
22
+ "/p/a",
23
+ "/p/b"
24
+ ]
25
+ }, {
26
+ TAG: "RunPackages",
27
+ _0: [
28
+ "/p/b",
29
+ "/p/c"
30
+ ]
31
+ })).toEqual({
32
+ TAG: "RunPackages",
33
+ _0: [
34
+ "/p/a",
35
+ "/p/b",
36
+ "/p/c"
37
+ ]
38
+ });
39
+ });
40
+ globalThis.test("RunAll merged with RunAll stays RunAll", () => {
41
+ globalThis.expect(Cli$ReventlessGwt.mergeScope("RunAll", "RunAll")).toEqual("RunAll");
42
+ });
43
+ });
44
+
45
+ globalThis.describe("Cli.pathUnderDir", () => {
46
+ globalThis.test("a file inside the dir is under it", () => {
47
+ globalThis.expect(Cli$ReventlessGwt.pathUnderDir("/p/pkgA/tests/FooGwt.res.mjs", "/p/pkgA")).toEqual(true);
48
+ });
49
+ globalThis.test("a sibling with a shared prefix is NOT under it", () => {
50
+ globalThis.expect(Cli$ReventlessGwt.pathUnderDir("/p/pkgABC/tests/FooGwt.res.mjs", "/p/pkgA")).toEqual(false);
51
+ });
52
+ globalThis.test("an unrelated path is not under it", () => {
53
+ globalThis.expect(Cli$ReventlessGwt.pathUnderDir("/p/pkgB/tests/BarGwt.res.mjs", "/p/pkgA")).toEqual(false);
54
+ });
55
+ globalThis.test("a trailing-slash dir still matches", () => {
56
+ globalThis.expect(Cli$ReventlessGwt.pathUnderDir("/p/pkgA/tests/FooGwt.res.mjs", "/p/pkgA/")).toEqual(true);
57
+ });
58
+ });
59
+
60
+ globalThis.describe("Cli.scopeSubset", () => {
61
+ let all = [
62
+ "/p/pkgA/tests/FooGwt.res.mjs",
63
+ "/p/pkgA/tests/BarGwt.res.mjs",
64
+ "/p/pkgB/tests/BazGwt.res.mjs"
65
+ ];
66
+ globalThis.test("RunAll returns every path", () => {
67
+ globalThis.expect(Cli$ReventlessGwt.scopeSubset("RunAll", all)).toEqual(all);
68
+ });
69
+ globalThis.test("RunPackages keeps only files under the given dirs", () => {
70
+ globalThis.expect(Cli$ReventlessGwt.scopeSubset({
71
+ TAG: "RunPackages",
72
+ _0: ["/p/pkgA"]
73
+ }, all)).toEqual([
74
+ "/p/pkgA/tests/FooGwt.res.mjs",
75
+ "/p/pkgA/tests/BarGwt.res.mjs"
76
+ ]);
77
+ });
78
+ globalThis.test("RunPackages over multiple dirs unions their files", () => {
79
+ globalThis.expect(Cli$ReventlessGwt.scopeSubset({
80
+ TAG: "RunPackages",
81
+ _0: [
82
+ "/p/pkgA",
83
+ "/p/pkgB"
84
+ ]
85
+ }, all)).toEqual(all);
86
+ });
87
+ globalThis.test("RunPackages with no matching dir yields no files", () => {
88
+ globalThis.expect(Cli$ReventlessGwt.scopeSubset({
89
+ TAG: "RunPackages",
90
+ _0: ["/p/pkgZ"]
91
+ }, all)).toEqual([]);
92
+ });
93
+ });
94
+
95
+ /* Not a pure module */
@@ -0,0 +1,67 @@
1
+ // Unit tests for ComponentMeta — the pure folder-convention → {kind, name}
2
+ // derivation behind the `component` field on file items and the `components`
3
+ // inventory. No I/O; path strings only.
4
+
5
+ open JestGlobals
6
+
7
+ describe("ComponentMeta.componentOfTestFile", () => {
8
+ testPromise("derives kind + name from a slice GWT test path", async () => {
9
+ let c = ComponentMeta.componentOfTestFile(
10
+ "/repo/catalog/tests/Product/StateChangeSlice/AddProduct_GWT.res.mjs",
11
+ )
12
+ expect(c)->toEqual(Some({ComponentMeta.kind: "StateChangeSlice", name: "AddProduct"}))
13
+ })
14
+
15
+ testPromise("derives a ReadModel component", async () => {
16
+ let c = ComponentMeta.componentOfTestFile(
17
+ "/repo/catalog/tests/CatalogActivity/ReadModel/CatalogActivity_GWT.res.mjs",
18
+ )
19
+ expect(c)->toEqual(Some({ComponentMeta.kind: "ReadModel", name: "CatalogActivity"}))
20
+ })
21
+
22
+ testPromise("strips the GwtTest marker shape too", async () => {
23
+ let c = ComponentMeta.componentOfTestFile("/repo/x/tests/Order/Aggregate/OrderGwtTest.res.mjs")
24
+ expect(c)->toEqual(Some({ComponentMeta.kind: "Aggregate", name: "Order"}))
25
+ })
26
+
27
+ testPromise("returns None outside a recognised kind folder", async () => {
28
+ let c = ComponentMeta.componentOfTestFile("/repo/x/tests/Helpers/Thing_GWT.res.mjs")
29
+ expect(c)->toEqual(None)
30
+ })
31
+
32
+ testPromise("recognises a plural folder spelling with the canonical kind (C2)", async () => {
33
+ // The generator accepts `Aggregates/`; previously the gwt discovery only knew
34
+ // the singular `Aggregate/` and silently returned None. Now it derives from
35
+ // the shared vocabulary and reports the canonical singular kind.
36
+ let c = ComponentMeta.componentOfTestFile("/repo/x/tests/Order/Aggregates/Order_GWT.res.mjs")
37
+ expect(c)->toEqual(Some({ComponentMeta.kind: "Aggregate", name: "Order"}))
38
+ })
39
+
40
+ testPromise("recognises a short slice folder spelling (StateChange) too (C2)", async () => {
41
+ let c = ComponentMeta.componentOfTestFile(
42
+ "/repo/catalog/tests/Product/StateChange/AddProduct_GWT.res.mjs",
43
+ )
44
+ expect(c)->toEqual(Some({ComponentMeta.kind: "StateChangeSlice", name: "AddProduct"}))
45
+ })
46
+ })
47
+
48
+ describe("ComponentMeta.componentOfSrcFile", () => {
49
+ testPromise("collapses a spec file to its component", async () => {
50
+ let c = ComponentMeta.componentOfSrcFile("/repo/catalog/src/Product/Aggregate/Product.res")
51
+ expect(c)->toEqual(Some({ComponentMeta.kind: "Aggregate", name: "Product"}))
52
+ })
53
+
54
+ testPromise("collapses a behavior body file to the same component", async () => {
55
+ let c = ComponentMeta.componentOfSrcFile(
56
+ "/repo/catalog/src/Product/Aggregate/Product_Behavior.res",
57
+ )
58
+ expect(c)->toEqual(Some({ComponentMeta.kind: "Aggregate", name: "Product"}))
59
+ })
60
+
61
+ testPromise("strips the longest body suffix first (ExtensionPointMapping)", async () => {
62
+ let c = ComponentMeta.componentOfSrcFile(
63
+ "/repo/catalog/src/Products/ExtensionPoint/Products_ExtensionPointMapping.res",
64
+ )
65
+ expect(c)->toEqual(Some({ComponentMeta.kind: "ExtensionPoint", name: "Products"}))
66
+ })
67
+ })
@@ -0,0 +1,71 @@
1
+ // Generated by ReScript, PLEASE EDIT WITH CARE
2
+
3
+ import * as ComponentMeta$ReventlessGwt from "../src/ComponentMeta.res.mjs";
4
+
5
+ globalThis.describe("ComponentMeta.componentOfTestFile", () => {
6
+ globalThis.test("derives kind + name from a slice GWT test path", async () => {
7
+ let c = ComponentMeta$ReventlessGwt.componentOfTestFile("/repo/catalog/tests/Product/StateChangeSlice/AddProduct_GWT.res.mjs");
8
+ globalThis.expect(c).toEqual({
9
+ kind: "StateChangeSlice",
10
+ name: "AddProduct"
11
+ });
12
+ });
13
+ globalThis.test("derives a ReadModel component", async () => {
14
+ let c = ComponentMeta$ReventlessGwt.componentOfTestFile("/repo/catalog/tests/CatalogActivity/ReadModel/CatalogActivity_GWT.res.mjs");
15
+ globalThis.expect(c).toEqual({
16
+ kind: "ReadModel",
17
+ name: "CatalogActivity"
18
+ });
19
+ });
20
+ globalThis.test("strips the GwtTest marker shape too", async () => {
21
+ let c = ComponentMeta$ReventlessGwt.componentOfTestFile("/repo/x/tests/Order/Aggregate/OrderGwtTest.res.mjs");
22
+ globalThis.expect(c).toEqual({
23
+ kind: "Aggregate",
24
+ name: "Order"
25
+ });
26
+ });
27
+ globalThis.test("returns None outside a recognised kind folder", async () => {
28
+ let c = ComponentMeta$ReventlessGwt.componentOfTestFile("/repo/x/tests/Helpers/Thing_GWT.res.mjs");
29
+ globalThis.expect(c).toEqual(undefined);
30
+ });
31
+ globalThis.test("recognises a plural folder spelling with the canonical kind (C2)", async () => {
32
+ let c = ComponentMeta$ReventlessGwt.componentOfTestFile("/repo/x/tests/Order/Aggregates/Order_GWT.res.mjs");
33
+ globalThis.expect(c).toEqual({
34
+ kind: "Aggregate",
35
+ name: "Order"
36
+ });
37
+ });
38
+ globalThis.test("recognises a short slice folder spelling (StateChange) too (C2)", async () => {
39
+ let c = ComponentMeta$ReventlessGwt.componentOfTestFile("/repo/catalog/tests/Product/StateChange/AddProduct_GWT.res.mjs");
40
+ globalThis.expect(c).toEqual({
41
+ kind: "StateChangeSlice",
42
+ name: "AddProduct"
43
+ });
44
+ });
45
+ });
46
+
47
+ globalThis.describe("ComponentMeta.componentOfSrcFile", () => {
48
+ globalThis.test("collapses a spec file to its component", async () => {
49
+ let c = ComponentMeta$ReventlessGwt.componentOfSrcFile("/repo/catalog/src/Product/Aggregate/Product.res");
50
+ globalThis.expect(c).toEqual({
51
+ kind: "Aggregate",
52
+ name: "Product"
53
+ });
54
+ });
55
+ globalThis.test("collapses a behavior body file to the same component", async () => {
56
+ let c = ComponentMeta$ReventlessGwt.componentOfSrcFile("/repo/catalog/src/Product/Aggregate/Product_Behavior.res");
57
+ globalThis.expect(c).toEqual({
58
+ kind: "Aggregate",
59
+ name: "Product"
60
+ });
61
+ });
62
+ globalThis.test("strips the longest body suffix first (ExtensionPointMapping)", async () => {
63
+ let c = ComponentMeta$ReventlessGwt.componentOfSrcFile("/repo/catalog/src/Products/ExtensionPoint/Products_ExtensionPointMapping.res");
64
+ globalThis.expect(c).toEqual({
65
+ kind: "ExtensionPoint",
66
+ name: "Products"
67
+ });
68
+ });
69
+ });
70
+
71
+ /* Not a pure module */