@reventlessdev/reventless-gwt 1.0.0-alpha.127 → 1.0.0-alpha.129

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,22 @@
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.129 (2026-07-26)
7
+
8
+ **Note:** Version bump only for package @reventlessdev/reventless-gwt
9
+
10
+
11
+
12
+
13
+
14
+ # 1.0.0-alpha.128 (2026-07-26)
15
+
16
+ **Note:** Version bump only for package @reventlessdev/reventless-gwt
17
+
18
+
19
+
20
+
21
+
6
22
  # 1.0.0-alpha.127 (2026-07-24)
7
23
 
8
24
  **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.127",
3
+ "version": "1.0.0-alpha.129",
4
4
  "description": "Given-When-Then DSLs and test harness for Reventless slice testing",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -14,16 +14,16 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "sury": "11.0.0-alpha.4",
17
- "@reventlessdev/rescript-effect": "0.1.0-alpha.30",
18
17
  "@reventlessdev/rescript-jest": "1.0.0-alpha.9",
19
- "@reventlessdev/reventless-core": "3.0.0-alpha.180",
20
- "@reventlessdev/reventless-infra": "3.0.0-alpha.104",
21
- "@reventlessdev/reventless-spec": "3.0.0-alpha.80"
18
+ "@reventlessdev/reventless-core": "3.0.0-alpha.182",
19
+ "@reventlessdev/reventless-spec": "3.0.0-alpha.81",
20
+ "@reventlessdev/rescript-effect": "0.1.0-alpha.31",
21
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.105"
22
22
  },
23
23
  "devDependencies": {
24
24
  "rescript": "12.3.0",
25
25
  "sury-ppx": "11.0.0-alpha.2",
26
- "@reventlessdev/reventless-ppx": "1.0.0-alpha.54"
26
+ "@reventlessdev/reventless-ppx": "1.0.0-alpha.56"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "rescript": "12.3.0"
@@ -30,7 +30,9 @@ module type Spec = {
30
30
  module type Projection = {
31
31
  module Spec: Spec
32
32
 
33
- let project: Spec.consumedEvent => array<Reventless.Projection.action<string, Spec.state>>
33
+ let project: Reventless.StateViewSlice.consumed<Spec.consumedEvent> => array<
34
+ Reventless.Projection.action<string, Spec.state>,
35
+ >
34
36
  }
35
37
 
36
38
  module type T = {
@@ -163,10 +165,18 @@ module Make = (
163
165
 
164
166
  let update = async (store, events) => {
165
167
  // Projection.project produces an array of actions per event — flatten and
166
- // feed them through handleActions against the dict store.
168
+ // feed them through handleActions against the dict store. Each bare event is
169
+ // wrapped in the `consumed` envelope with the deterministic test `meta` /
170
+ // `recordedAt` so a projection reading `meta.time` asserts a fixed value.
167
171
  let actions =
168
172
  events
169
- ->Array.map(ev => ev->Projection.project)
173
+ ->Array.map(ev =>
174
+ {
175
+ Reventless.StateViewSlice.event: ev,
176
+ meta: TestFixtures.meta,
177
+ recordedAt: TestFixtures.recordedAt,
178
+ }->Projection.project
179
+ )
170
180
  ->Array.flat
171
181
  await actions->runActions({
172
182
  load: load(store, ...),
@@ -61,7 +61,11 @@ function Make(Spec) {
61
61
  };
62
62
  let runActions = (actions, operations) => Projection$ReventlessCore.handleActions(undefined, actions, operations, Spec.subIdConfig);
63
63
  let update = async (store, events) => {
64
- let actions = events.map(ev => Projection.project(ev)).flat();
64
+ let actions = events.map(ev => Projection.project({
65
+ event: ev,
66
+ meta: TestFixtures$ReventlessGwt.meta,
67
+ recordedAt: TestFixtures$ReventlessGwt.recordedAt
68
+ })).flat();
65
69
  await runActions(actions, {
66
70
  load: extra => Promise.resolve({
67
71
  TAG: "Ok",
@@ -8,6 +8,11 @@ let meta = {
8
8
  correlationId: "correlationId",
9
9
  }
10
10
 
11
+ // Deterministic storage timestamp for StateViewSlice projection envelopes
12
+ // (`consumed.recordedAt`). Distinct from `meta.time` (producer time) so a test
13
+ // projecting either clock asserts against an unambiguous fixed value.
14
+ let recordedAt = "recordedAt"
15
+
11
16
  let context = {Reventless.Message.meta, id}
12
17
 
13
18
  let statusChange = {
@@ -25,9 +25,12 @@ let statusChange = {
25
25
  by: statusChange_by
26
26
  };
27
27
 
28
+ let recordedAt = "recordedAt";
29
+
28
30
  export {
29
31
  id,
30
32
  meta,
33
+ recordedAt,
31
34
  context,
32
35
  statusChange,
33
36
  }
@@ -138,7 +138,7 @@ module OrdersViewProjection = {
138
138
  module Spec = OrdersViewSlice
139
139
  open Reventless.Projection
140
140
 
141
- let project = (event: OrdersViewSlice.consumedEvent) =>
141
+ let project = ({event}: Reventless.StateViewSlice.consumed<OrdersViewSlice.consumedEvent>) =>
142
142
  switch event {
143
143
  | OrderPlaced({orderId, item}) => [
144
144
  Set(orderId, ({orderId, item, status: "Placed"}: OrdersViewSlice.state)),
@@ -254,7 +254,8 @@ let OrdersViewSlice = {
254
254
  visibility: "Public"
255
255
  };
256
256
 
257
- function project(event) {
257
+ function project(param) {
258
+ let event = param.event;
258
259
  if (event.TAG !== "OrderPlaced") {
259
260
  return [{
260
261
  TAG: "Update",
@@ -123,7 +123,7 @@ module OrdersView = {
123
123
  @schema
124
124
  type consumedEvent = OrderPlaced({orderId: string, customerId: string, total: int})
125
125
 
126
- let project = event =>
126
+ let project = ({event}: Reventless.StateViewSlice.consumed<consumedEvent>) =>
127
127
  switch event {
128
128
  | OrderPlaced({orderId, customerId, total}) => [
129
129
  Reventless.Projection.Set(orderId, {orderId, customerId, total}),
@@ -220,7 +220,8 @@ let consumedEventSchema = S.schema(s => ({
220
220
  total: s.m(S.int)
221
221
  }));
222
222
 
223
- function project(event) {
223
+ function project(param) {
224
+ let event = param.event;
224
225
  let orderId = event.orderId;
225
226
  return [{
226
227
  TAG: "Set",
@@ -29,7 +29,7 @@ module CategoriesViewProjection = {
29
29
  module Spec = CategoriesView
30
30
  open CategoriesView
31
31
 
32
- let project = (event: consumedEvent) =>
32
+ let project = ({event}: Reventless.StateViewSlice.consumed<consumedEvent>) =>
33
33
  switch event {
34
34
  | CategoryAdded({categoryId, name}) => [
35
35
  Set(categoryId, {categoryId, name, archived: false}),
@@ -35,7 +35,8 @@ let CategoriesView = {
35
35
  visibility: "Public"
36
36
  };
37
37
 
38
- function project(event) {
38
+ function project(param) {
39
+ let event = param.event;
39
40
  switch (event.TAG) {
40
41
  case "CategoryAdded" :
41
42
  let categoryId = event.categoryId;