@reventlessdev/reventless-gwt 1.0.0-alpha.151 → 1.0.0-alpha.153
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 +6 -6
- package/src/Flow_GWT.res +5 -1
- package/src/Flow_GWT.res.mjs +1 -1
- package/src/OutboundTranslation_GWT.res +7 -3
- package/src/OutboundTranslation_GWT.res.mjs +4 -1
- package/tests/FlowGwtTest.res +1 -1
- package/tests/FlowGwtTest.res.mjs +1 -1
- package/tests/OutboundTranslationGwtTest.res +1 -1
- package/tests/OutboundTranslationGwtTest.res.mjs +2 -2
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
|
+
# 1.0.0-alpha.153 (2026-08-03)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **outbound:** let an outbound slice read an aggregate, and geocode addresses with it ([867e63e](https://github.com/ReventlessDev/reventless-core/commit/867e63e774ebc8b78b2b19c78645c8a12a8d06f6))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
# 1.0.0-alpha.152 (2026-08-02)
|
|
14
|
+
|
|
15
|
+
**Note:** Version bump only for package @reventlessdev/reventless-gwt
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
6
21
|
# 1.0.0-alpha.151 (2026-08-02)
|
|
7
22
|
|
|
8
23
|
**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.
|
|
3
|
+
"version": "1.0.0-alpha.153",
|
|
4
4
|
"description": "Given-When-Then DSLs and test harness for Reventless slice testing",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"jest": {
|
|
@@ -14,17 +14,17 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"sury": "11.0.0-alpha.4",
|
|
17
|
-
"@reventlessdev/
|
|
17
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.206",
|
|
18
18
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
19
|
+
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
19
20
|
"@reventlessdev/rescript-node": "2.0.0-alpha.1",
|
|
20
|
-
"@reventlessdev/reventless-
|
|
21
|
-
"@reventlessdev/reventless-
|
|
22
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.96"
|
|
21
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.123",
|
|
22
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.98"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"rescript": "12.3.0",
|
|
26
26
|
"sury-ppx": "11.0.0-alpha.2",
|
|
27
|
-
"@reventlessdev/reventless-ppx": "1.0.0-alpha.
|
|
27
|
+
"@reventlessdev/reventless-ppx": "1.0.0-alpha.62"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"rescript": "12.3.0"
|
package/src/Flow_GWT.res
CHANGED
|
@@ -505,7 +505,11 @@ module OutboundStep = (Spec: OutboundTranslation_GWT.SliceSpec) => {
|
|
|
505
505
|
let thenOutbound = async (flowP: flow, expected: array<(string, Spec.outboundItem)>) => {
|
|
506
506
|
let s = await flowP
|
|
507
507
|
let events = decodeMatching(s.log, consumedDecoder, [])
|
|
508
|
-
|
|
508
|
+
// The flow log carries decoded events, not their envelopes, so there is no
|
|
509
|
+
// entity id to thread here. A collect that keys off `~sourceId` (an
|
|
510
|
+
// aggregate source) should be exercised by the dedicated
|
|
511
|
+
// `OutboundTranslation_GWT`, which can supply one.
|
|
512
|
+
let collected = events->Array.map(e => e->Spec.collect(~sourceId=""))->Array.flat
|
|
509
513
|
let actual = encItems(collected)
|
|
510
514
|
let expectedJson = encItems(expected)
|
|
511
515
|
let o =
|
package/src/Flow_GWT.res.mjs
CHANGED
|
@@ -428,7 +428,7 @@ function OutboundStep(Spec) {
|
|
|
428
428
|
let thenOutbound = async (flowP, expected) => {
|
|
429
429
|
let s = await flowP;
|
|
430
430
|
let events = decodeMatching(s.log, consumedDecoder, []);
|
|
431
|
-
let collected = events.map(e => Spec.collect(e)).flat();
|
|
431
|
+
let collected = events.map(e => Spec.collect(e, "")).flat();
|
|
432
432
|
let actual = encItems(collected);
|
|
433
433
|
let expectedJson = encItems(expected);
|
|
434
434
|
let o = Primitive_object.equal(actual, expectedJson) ? Outcome$ReventlessGwt.pass : Outcome$ReventlessGwt.fail({
|
|
@@ -16,7 +16,7 @@ module type SliceSpec = {
|
|
|
16
16
|
@schema
|
|
17
17
|
type inboundCommand
|
|
18
18
|
|
|
19
|
-
let collect: consumedEvent => array<(string, outboundItem)>
|
|
19
|
+
let collect: (consumedEvent, ~sourceId: string) => array<(string, outboundItem)>
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
// Status enum reflecting how the slice's runtime labels a TODO after a
|
|
@@ -48,7 +48,7 @@ module type T = {
|
|
|
48
48
|
|
|
49
49
|
// Unit — collect
|
|
50
50
|
let givenEvent: Spec.consumedEvent => Spec.consumedEvent
|
|
51
|
-
let whenCollect: Spec.consumedEvent => array<(string, Spec.outboundItem)>
|
|
51
|
+
let whenCollect: (Spec.consumedEvent, ~sourceId: string=?) => array<(string, Spec.outboundItem)>
|
|
52
52
|
let thenTodos: (
|
|
53
53
|
array<(string, Spec.outboundItem)>,
|
|
54
54
|
array<(string, Spec.outboundItem)>,
|
|
@@ -105,8 +105,12 @@ module Make = (Spec: SliceSpec): (T with module Spec = Spec) => {
|
|
|
105
105
|
c->Message.encode(Spec.inboundCommandSchema)
|
|
106
106
|
|
|
107
107
|
// Unit: collect
|
|
108
|
+
//
|
|
109
|
+
// `~sourceId` defaults so a DCB-source test — whose event names its own subject
|
|
110
|
+
// in the payload — reads exactly as it did before this argument existed. An
|
|
111
|
+
// aggregate-source test passes the entity id it is exercising.
|
|
108
112
|
let givenEvent = e => e
|
|
109
|
-
let whenCollect = e => e->Spec.collect
|
|
113
|
+
let whenCollect = (e, ~sourceId="") => e->Spec.collect(~sourceId)
|
|
110
114
|
let thenTodos = (actual, expected) =>
|
|
111
115
|
if actual == expected {
|
|
112
116
|
Outcome.pass
|
|
@@ -15,7 +15,10 @@ function Make(Spec) {
|
|
|
15
15
|
Message$ReventlessCore.encode(param[1], Spec.outboundItemSchema)
|
|
16
16
|
]);
|
|
17
17
|
let givenEvent = e => e;
|
|
18
|
-
let whenCollect = e =>
|
|
18
|
+
let whenCollect = (e, sourceIdOpt) => {
|
|
19
|
+
let sourceId = sourceIdOpt !== undefined ? sourceIdOpt : "";
|
|
20
|
+
return Spec.collect(e, sourceId);
|
|
21
|
+
};
|
|
19
22
|
let thenTodos = (actual, expected) => {
|
|
20
23
|
if (Primitive_object.equal(actual, expected)) {
|
|
21
24
|
return Outcome$ReventlessGwt.pass;
|
package/tests/FlowGwtTest.res
CHANGED
|
@@ -16,7 +16,7 @@ let outboundItemSchema = S.schema(s => ({
|
|
|
16
16
|
|
|
17
17
|
let inboundCommandSchema = S.literal("NoOp");
|
|
18
18
|
|
|
19
|
-
function collect(event) {
|
|
19
|
+
function collect(event, param) {
|
|
20
20
|
let orderId = event.orderId;
|
|
21
21
|
return [[
|
|
22
22
|
orderId,
|
|
@@ -63,7 +63,7 @@ describe("SendTrackingEmail OutboundTranslationSlice", () => {
|
|
|
63
63
|
TAG: "OrderShipped",
|
|
64
64
|
orderId: "o1",
|
|
65
65
|
email: "x@y"
|
|
66
|
-
})), [[
|
|
66
|
+
}), undefined), [[
|
|
67
67
|
"o1",
|
|
68
68
|
{
|
|
69
69
|
orderId: "o1",
|