@reventlessdev/reventless-gwt 1.0.0-alpha.283 → 1.0.0-alpha.285

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,26 @@
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
+ # 1.0.0-alpha.285 (2026-11-09)
7
+
8
+ **Note:** Version bump only for package @reventlessdev/reventless-gwt
9
+
10
+
11
+
12
+
13
+
14
+ # 1.0.0-alpha.284 (2026-11-08)
15
+
16
+ * feat(core)!: an automation or outbound translation hears that its command was refused ([8c9b4b6](https://github.com/ReventlessDev/reventless-core/commit/8c9b4b6c643a5a9e95c85f823fbc333638224346))
17
+
18
+ ### BREAKING CHANGES
19
+
20
+ * an AutomationSlice Automation module written outside an
21
+ @@reventless.automation file must declare onExhausted with ~lastError. External
22
+ consumers need the republished reventless-ppx for the injection.
23
+
24
+
25
+
6
26
  # 1.0.0-alpha.283 (2026-11-08)
7
27
 
8
28
  **Note:** Version bump only for package @reventlessdev/reventless-gwt
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-gwt",
3
- "version": "1.0.0-alpha.283",
3
+ "version": "1.0.0-alpha.285",
4
4
  "description": "Given-When-Then DSLs and test harness for Reventless slice testing",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -16,10 +16,10 @@
16
16
  "sury": "11.1.0",
17
17
  "@reventlessdev/rescript-effect": "1.0.0-alpha.3",
18
18
  "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
19
- "@reventlessdev/reventless-infra": "3.0.0-alpha.227",
20
- "@reventlessdev/reventless-core": "3.0.0-alpha.334",
21
- "@reventlessdev/rescript-node": "2.0.0-alpha.26",
22
- "@reventlessdev/reventless-spec": "3.0.0-alpha.196"
19
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.198",
20
+ "@reventlessdev/reventless-core": "3.0.0-alpha.336",
21
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.229",
22
+ "@reventlessdev/rescript-node": "2.0.0-alpha.26"
23
23
  },
24
24
  "devDependencies": {
25
25
  "rescript": "12.3.1",
@@ -278,7 +278,7 @@ module FromSlice = (
278
278
  // Unit: process and abandonment
279
279
  let givenTodo = (id: string, item: Spec.todoItem) => (id, item)
280
280
  let whenProcess = ((id, item), ~now=?) => Automation.process(id, item, ~now=nowOr(now))
281
- let whenExhausted = ((id, item)) => Automation.onExhausted(id, item)
281
+ let whenExhausted = ((id, item), ~lastError=?) => Automation.onExhausted(id, item, ~lastError)
282
282
  let thenCommand = (actual, expectedId, expectedCmd) =>
283
283
  switch actual {
284
284
  | Some((id, cmd)) if id == expectedId && cmd == expectedCmd => Outcome.pass
@@ -253,7 +253,7 @@ function FromSlice(Spec) {
253
253
  item
254
254
  ];
255
255
  let whenProcess = (param, now) => Automation.process(param[0], param[1], nowOr(now));
256
- let whenExhausted = param => Automation.onExhausted(param[0], param[1]);
256
+ let whenExhausted = (param, lastError) => Automation.onExhausted(param[0], param[1], lastError);
257
257
  let thenCommand = (actual, expectedId, expectedCmd) => {
258
258
  if (actual !== undefined && actual[0] === expectedId && Primitive_object.equal(actual[1], expectedCmd)) {
259
259
  return Outcome$ReventlessGwt.pass;
@@ -59,7 +59,7 @@ module CancelUnshipped_Automation = {
59
59
 
60
60
  let process = (id, item: CancelUnshipped.todoItem, ~now) =>
61
61
  now >= item.dueAt ? Some((id, CancelUnshipped.CancelOrder({orderId: item.orderId}))) : None
62
- let onExhausted = (_id, _item: CancelUnshipped.todoItem) => None
62
+ let onExhausted = (_id, _item: CancelUnshipped.todoItem, ~lastError as _) => None
63
63
  }
64
64
 
65
65
  open CancelUnshipped
@@ -119,7 +119,7 @@ function process(id, item, now) {
119
119
  }
120
120
  }
121
121
 
122
- function onExhausted(_id, _item) {
122
+ function onExhausted(_id, _item, param) {
123
123
 
124
124
  }
125
125
 
@@ -85,7 +85,10 @@ module ShipPaid_Automation = {
85
85
  id,
86
86
  ShipPaid.Ship({orderId: id}),
87
87
  ))
88
- let onExhausted = (id, _item: ShipPaid.todoItem) => Some((id, ShipPaid.GiveUp({orderId: id})))
88
+ let onExhausted = (id, _item: ShipPaid.todoItem, ~lastError as _) => Some((
89
+ id,
90
+ ShipPaid.GiveUp({orderId: id}),
91
+ ))
89
92
  }
90
93
 
91
94
  open ShipPaid
@@ -166,7 +166,7 @@ function process(id, _item, param) {
166
166
  ];
167
167
  }
168
168
 
169
- function onExhausted(id, _item) {
169
+ function onExhausted(id, _item, param) {
170
170
  return [
171
171
  id,
172
172
  {
@@ -258,7 +258,7 @@ describe("Automation_GWT.FromSlice", () => {
258
258
  }));
259
259
  test("exhausted: onExhausted is what the domain hears", () => thenCommand(whenExhausted(givenTodo("o1", {
260
260
  orderId: "o1"
261
- })), "o1", {
261
+ }), undefined), "o1", {
262
262
  TAG: "GiveUp",
263
263
  orderId: "o1"
264
264
  }));
@@ -35,7 +35,7 @@ module ShipOrderSlice = {
35
35
  item.orderId,
36
36
  CreateShipment({orderId: item.orderId, address: item.shippingAddress}),
37
37
  ))
38
- let onExhausted = (_id, _item) => None
38
+ let onExhausted = (_id, _item, ~lastError as _) => None
39
39
  }
40
40
 
41
41
  describe("ShipOrder AutomationSlice", () => {
@@ -60,7 +60,7 @@ function process(_id, item, param) {
60
60
  ];
61
61
  }
62
62
 
63
- function onExhausted(_id, _item) {
63
+ function onExhausted(_id, _item, param) {
64
64
 
65
65
  }
66
66
 
@@ -80,7 +80,7 @@ module MarketingDigest_Automation = {
80
80
  item.recipientId,
81
81
  MarketingDigest.RequestNotification({recipientId: item.recipientId, reference: id}),
82
82
  ))
83
- let onExhausted = (_id, _item: MarketingDigest.todoItem) => None
83
+ let onExhausted = (_id, _item: MarketingDigest.todoItem, ~lastError as _) => None
84
84
  }
85
85
 
86
86
  module Digest = {
@@ -216,7 +216,7 @@ module Reminder_Automation = {
216
216
  item.orderId,
217
217
  Reminder.RemindOrder({orderId: item.orderId}),
218
218
  ))
219
- let onExhausted = (_id, _item: Reminder.todoItem) => None
219
+ let onExhausted = (_id, _item: Reminder.todoItem, ~lastError as _) => None
220
220
  }
221
221
 
222
222
  module ReminderGwt = {
@@ -167,7 +167,7 @@ function process(id, item, param) {
167
167
  ];
168
168
  }
169
169
 
170
- function onExhausted(_id, _item) {
170
+ function onExhausted(_id, _item, param) {
171
171
 
172
172
  }
173
173
 
@@ -533,7 +533,7 @@ function process$1(_id, item, param) {
533
533
  ];
534
534
  }
535
535
 
536
- function onExhausted$1(_id, _item) {
536
+ function onExhausted$1(_id, _item, param) {
537
537
 
538
538
  }
539
539
 
@@ -74,7 +74,7 @@ module DemandReport_Automation = {
74
74
  id,
75
75
  DemandReport.RequestDemandReport({day: item.day}),
76
76
  ))
77
- let onExhausted = (_id, _item: DemandReport.todoItem) => None
77
+ let onExhausted = (_id, _item: DemandReport.todoItem, ~lastError as _) => None
78
78
  }
79
79
 
80
80
  open DemandReport
@@ -154,7 +154,7 @@ function process(id, item, param) {
154
154
  ];
155
155
  }
156
156
 
157
- function onExhausted(_id, _item) {
157
+ function onExhausted(_id, _item, param) {
158
158
 
159
159
  }
160
160
 
@@ -74,7 +74,7 @@ module AutoShipSlice = {
74
74
  }
75
75
 
76
76
  let process = (id, _todo, ~now as _) => Some((id, ShipOrder({orderId: id})))
77
- let onExhausted = (_id, _todo) => None
77
+ let onExhausted = (_id, _todo, ~lastError as _) => None
78
78
  }
79
79
 
80
80
  module ShipOrderSlice = {
@@ -132,7 +132,7 @@ function process(id, _todo, param) {
132
132
  ];
133
133
  }
134
134
 
135
- function onExhausted(_id, _todo) {
135
+ function onExhausted(_id, _todo, param) {
136
136
 
137
137
  }
138
138