@reventlessdev/reventless-gwt 1.0.0-alpha.205 → 1.0.0-alpha.206
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 +8 -0
- package/package.json +4 -4
- package/src/MultiSourceProjection_GWT.res +10 -1
- package/src/MultiSourceProjection_GWT.res.mjs +1 -1
- package/src/Projection_GWT.res +8 -1
- package/src/Projection_GWT.res.mjs +1 -1
- package/src/TestFixtures.res +4 -1
- package/src/TestFixtures.res.mjs +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.206 (2026-09-08)
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* **core:** a state view records when it reached each state ([5216f71](https://github.com/ReventlessDev/reventless-core/commit/5216f71b8dcafcb2f0c991923ebcf2438b27e347))
|
|
11
|
+
* **spec:** an instant is a type, and a calendar day is a different one ([a60bebc](https://github.com/ReventlessDev/reventless-core/commit/a60bebc20fe5f3413f9252be36f94ba2a9fb620d))
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# 1.0.0-alpha.205 (2026-09-07)
|
|
7
15
|
|
|
8
16
|
**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.206",
|
|
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.0.0-rc.2",
|
|
17
17
|
"@reventlessdev/rescript-effect": "0.1.0-alpha.32",
|
|
18
18
|
"@reventlessdev/rescript-jest": "1.0.0-alpha.10",
|
|
19
|
+
"@reventlessdev/reventless-core": "3.0.0-alpha.259",
|
|
20
|
+
"@reventlessdev/reventless-infra": "3.0.0-alpha.160",
|
|
19
21
|
"@reventlessdev/rescript-node": "2.0.0-alpha.9",
|
|
20
|
-
"@reventlessdev/reventless-
|
|
21
|
-
"@reventlessdev/reventless-infra": "3.0.0-alpha.159",
|
|
22
|
-
"@reventlessdev/reventless-spec": "3.0.0-alpha.131"
|
|
22
|
+
"@reventlessdev/reventless-spec": "3.0.0-alpha.132"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"rescript": "12.3.0",
|
|
@@ -124,8 +124,17 @@ module Make = (Projection: Reventless.Projection.Mapping): (
|
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
let update = async (store, events') => {
|
|
127
|
+
// Rewritten the way both runtimes rewrite: a lifecycle trail is filled by
|
|
128
|
+
// the machinery, so a harness that skipped this would assert an empty one.
|
|
127
129
|
await events'
|
|
128
|
-
->Array.map(event' =>
|
|
130
|
+
->Array.map(event' =>
|
|
131
|
+
event'
|
|
132
|
+
->Projection.project
|
|
133
|
+
->ReventlessCore.Projection.rewriteTrail(
|
|
134
|
+
~at=event'.meta.time,
|
|
135
|
+
Projection.targetStateSchema,
|
|
136
|
+
)
|
|
137
|
+
)
|
|
129
138
|
->handleActions({
|
|
130
139
|
load: load(store, ...),
|
|
131
140
|
loadStream: id => store->states(id)->Stream.fromIterable,
|
|
@@ -45,7 +45,7 @@ function Make(Projection) {
|
|
|
45
45
|
};
|
|
46
46
|
let handleActions = (actions, operations) => Projection$ReventlessCore.handleActions(undefined, actions, operations, Projection.subIdConfig);
|
|
47
47
|
let update = async (store, events$p) => {
|
|
48
|
-
await handleActions(events$p.map(event$p => Projection.project(event$p)), {
|
|
48
|
+
await handleActions(events$p.map(event$p => Projection$ReventlessCore.rewriteTrail(Projection.project(event$p), event$p.meta.time, Projection.targetStateSchema)), {
|
|
49
49
|
load: extra => Promise.resolve({
|
|
50
50
|
TAG: "Ok",
|
|
51
51
|
_0: states(store, extra)
|
package/src/Projection_GWT.res
CHANGED
|
@@ -167,6 +167,9 @@ module Make = (
|
|
|
167
167
|
// feed them through handleActions against the dict store. Each bare event is
|
|
168
168
|
// wrapped in the `consumed` envelope with the deterministic test `meta` /
|
|
169
169
|
// `recordedAt` so a projection reading `meta.time` asserts a fixed value.
|
|
170
|
+
//
|
|
171
|
+
// Rewritten the way both runtimes rewrite: a lifecycle trail is filled by
|
|
172
|
+
// the machinery, so a harness that skipped this would assert an empty one.
|
|
170
173
|
let actions =
|
|
171
174
|
events
|
|
172
175
|
->Array.map(ev =>
|
|
@@ -174,7 +177,11 @@ module Make = (
|
|
|
174
177
|
Reventless.StateViewSlice.event: ev,
|
|
175
178
|
meta: TestFixtures.meta,
|
|
176
179
|
recordedAt: TestFixtures.recordedAt,
|
|
177
|
-
}
|
|
180
|
+
}
|
|
181
|
+
->Projection.project
|
|
182
|
+
->Array.map(
|
|
183
|
+
ReventlessCore.Projection.rewriteTrail(_, ~at=TestFixtures.meta.time, Spec.stateSchema),
|
|
184
|
+
)
|
|
178
185
|
)
|
|
179
186
|
->Array.flat
|
|
180
187
|
await actions->runActions({
|
|
@@ -63,7 +63,7 @@ function Make(Spec) {
|
|
|
63
63
|
event: ev,
|
|
64
64
|
meta: TestFixtures$ReventlessGwt.meta,
|
|
65
65
|
recordedAt: TestFixtures$ReventlessGwt.recordedAt
|
|
66
|
-
})).flat();
|
|
66
|
+
}).map(__x => Projection$ReventlessCore.rewriteTrail(__x, TestFixtures$ReventlessGwt.meta.time, Spec.stateSchema))).flat();
|
|
67
67
|
await runActions(actions, {
|
|
68
68
|
load: extra => Promise.resolve({
|
|
69
69
|
TAG: "Ok",
|
package/src/TestFixtures.res
CHANGED
|
@@ -3,7 +3,10 @@ let meta = {
|
|
|
3
3
|
Reventless.Message.service: "service",
|
|
4
4
|
user: "ProjectionTest",
|
|
5
5
|
ip: "ip",
|
|
6
|
-
|
|
6
|
+
// A real instant, not the word: a projection stamping this into a `DateTime`
|
|
7
|
+
// field writes it through that field's grammar, and `"time"` is not one.
|
|
8
|
+
// Matches `StubRuntime.meta`, so the two harnesses agree on the producer clock.
|
|
9
|
+
time: "1970-01-01T00:00:00Z",
|
|
7
10
|
msgId: "msgId",
|
|
8
11
|
correlationId: "correlationId",
|
|
9
12
|
}
|
package/src/TestFixtures.res.mjs
CHANGED
|
@@ -6,7 +6,7 @@ let id = "id";
|
|
|
6
6
|
|
|
7
7
|
let meta = {
|
|
8
8
|
service: "service",
|
|
9
|
-
time: "
|
|
9
|
+
time: "1970-01-01T00:00:00Z",
|
|
10
10
|
ip: "ip",
|
|
11
11
|
user: "ProjectionTest",
|
|
12
12
|
msgId: "msgId",
|
|
@@ -21,7 +21,7 @@ let context = {
|
|
|
21
21
|
let statusChange_by = Stdlib_Option.getOr("ProjectionTest", "");
|
|
22
22
|
|
|
23
23
|
let statusChange = {
|
|
24
|
-
at: "
|
|
24
|
+
at: "1970-01-01T00:00:00Z",
|
|
25
25
|
by: statusChange_by
|
|
26
26
|
};
|
|
27
27
|
|