@reventlessdev/reventless-gwt 1.0.0-alpha.254 → 1.0.0-alpha.255

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,13 @@
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.255 (2026-10-23)
7
+
8
+ ### Bug Fixes
9
+
10
+ * **gwt:** a recorded sidecar is written only when it says something new ([a8f3cb9](https://github.com/ReventlessDev/reventless-core/commit/a8f3cb926d779f6a0c763196f73da5df102ca31e))
11
+
12
+
6
13
  # 1.0.0-alpha.254 (2026-10-22)
7
14
 
8
15
  **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.254",
3
+ "version": "1.0.0-alpha.255",
4
4
  "description": "Given-When-Then DSLs and test harness for Reventless slice testing",
5
5
  "license": "Apache-2.0",
6
6
  "jest": {
@@ -14,11 +14,11 @@
14
14
  },
15
15
  "dependencies": {
16
16
  "sury": "11.0.0",
17
- "@reventlessdev/rescript-node": "2.0.0-alpha.23",
18
- "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
19
- "@reventlessdev/reventless-core": "3.0.0-alpha.306",
20
- "@reventlessdev/reventless-infra": "3.0.0-alpha.203",
21
17
  "@reventlessdev/rescript-effect": "1.0.0-alpha.1",
18
+ "@reventlessdev/rescript-jest": "1.0.0-alpha.13",
19
+ "@reventlessdev/rescript-node": "2.0.0-alpha.23",
20
+ "@reventlessdev/reventless-core": "3.0.0-alpha.307",
21
+ "@reventlessdev/reventless-infra": "3.0.0-alpha.204",
22
22
  "@reventlessdev/reventless-spec": "3.0.0-alpha.175"
23
23
  },
24
24
  "devDependencies": {
@@ -120,7 +120,16 @@ let write = (~path: string, ~file: string, ~spec: string, scenarios: array<scena
120
120
  ),
121
121
  ]),
122
122
  )
123
- NodeFs.writeFileSync(path, JSON.stringifyAny(json, ~space=2)->Option.getOr("{}") ++ "\n")
123
+ let text = JSON.stringifyAny(json, ~space=2)->Option.getOr("{}") ++ "\n"
124
+ // Written only when it says something new: a watch reacts to the write, and the same run
125
+ // records the same scenarios each time.
126
+ let same = switch NodeFs.readFileSync(path) {
127
+ | old => old == text
128
+ | exception _ => false
129
+ }
130
+ if !same {
131
+ NodeFs.writeFileSync(path, text)
132
+ }
124
133
  }
125
134
 
126
135
  /** Runs one test's `body`, recording its steps when recording is on, and adds the scenario to
@@ -161,7 +161,23 @@ function write(path, file, spec, scenarios) {
161
161
  ])))
162
162
  ]
163
163
  ]);
164
- Nodefs.writeFileSync(path, Stdlib_Option.getOr(JSON.stringify(json, undefined, 2), "{}") + "\n", "utf8");
164
+ let text = Stdlib_Option.getOr(JSON.stringify(json, undefined, 2), "{}") + "\n";
165
+ let same;
166
+ let exit = 0;
167
+ let old;
168
+ try {
169
+ old = Nodefs.readFileSync(path, "utf8");
170
+ exit = 1;
171
+ } catch (exn) {
172
+ same = false;
173
+ }
174
+ if (exit === 1) {
175
+ same = old === text;
176
+ }
177
+ if (!same) {
178
+ Nodefs.writeFileSync(path, text, "utf8");
179
+ return;
180
+ }
165
181
  }
166
182
 
167
183
  function around(spec, title, body) {