@reventlessdev/reventless-seed 1.0.0-alpha.22 → 1.0.0-alpha.23

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.23 (2026-09-17)
7
+
8
+ ### Features
9
+
10
+ * **seed:** let a data set refuse to start before anything is sent ([6fc5135](https://github.com/ReventlessDev/reventless-core/commit/6fc5135107f9af3016a48423cfee625216babca1))
11
+
12
+
6
13
  # 1.0.0-alpha.22 (2026-09-16)
7
14
 
8
15
  ### Bug Fixes
@@ -1,2 +1,2 @@
1
- #Start(1789592211625)
2
- #Done(1789592211686)
1
+ #Start(1789645504278)
2
+ #Done(1789645504316)
@@ -4,5 +4,5 @@
4
4
  "bsc_hash": "75e3a59c95cc953608fd3dd6ea6ed68141bba4414a20a52f114261b8a48385fa",
5
5
  "rescript_config_hash": "25cfff836d200084949fdfdfec2f6875901bfee1f04d84634eca252ef1ca1ef1",
6
6
  "runtime_path": "/home/runner/work/reventless-core/reventless-core/node_modules/@rescript/runtime",
7
- "generated_at": "1789592211689"
7
+ "generated_at": "1789645504318"
8
8
  }
Binary file
Binary file
Binary file
@@ -36,6 +36,7 @@ type dataSet = Seed_Runner.dataSet = {
36
36
  label: string,
37
37
  seed: connection => promise<unit>,
38
38
  probeViews?: array<string>,
39
+ preflight?: connection => promise<unit>,
39
40
  }
40
41
 
41
42
  type rec value = Seed_Types.value =
Binary file
@@ -151,6 +151,10 @@ type dataSet = {
151
151
  // View names probed by the fresh-store guard before any command is sent; a
152
152
  // non-empty one aborts the run at startup. Omit to skip the guard.
153
153
  probeViews?: array<string>,
154
+ // Any other check that must pass before a command is sent — a set that adds to
155
+ // an existing store refuses an empty one here. Throw `Failed` to refuse; the
156
+ // run then reports that nothing was written.
157
+ preflight?: Seed_Connect.connection => promise<unit>,
154
158
  }
155
159
 
156
160
  /**
@@ -205,6 +209,10 @@ let seed = (~sets: array<dataSet>, ~connect: unit => promise<Seed_Connect.connec
205
209
  // Runs inside this pre-seed `try`, so refusing a non-empty store (or a
206
210
  // failed probe query) is reported as "did not start", not "half-seeded".
207
211
  await assertStoreEmpty(connection.client, ~probeViews=chosen.probeViews->Option.getOr([]))
212
+ switch chosen.preflight {
213
+ | Some(check) => await check(connection)
214
+ | None => ()
215
+ }
208
216
  Some((chosen, connection))
209
217
  } catch {
210
218
  | Failed(message) =>
@@ -163,6 +163,10 @@ function seed(sets, connect) {
163
163
  let connection = await connect();
164
164
  Seed_Prompt$ReventlessSeed.close();
165
165
  await assertStoreEmpty(connection.client, Stdlib_Option.getOr(chosen.probeViews, []));
166
+ let check = chosen.preflight;
167
+ if (check !== undefined) {
168
+ await check(connection);
169
+ }
166
170
  started = [
167
171
  chosen,
168
172
  connection
@@ -1,2 +1,2 @@
1
- #Start(1789592211625)
2
- #Done(1789592211686)
1
+ #Start(1789645504278)
2
+ #Done(1789645504316)
Binary file
Binary file
Binary file
@@ -36,6 +36,7 @@ type dataSet = Seed_Runner.dataSet = {
36
36
  label: string,
37
37
  seed: connection => promise<unit>,
38
38
  probeViews?: array<string>,
39
+ preflight?: connection => promise<unit>,
39
40
  }
40
41
 
41
42
  type rec value = Seed_Types.value =
Binary file
@@ -151,6 +151,10 @@ type dataSet = {
151
151
  // View names probed by the fresh-store guard before any command is sent; a
152
152
  // non-empty one aborts the run at startup. Omit to skip the guard.
153
153
  probeViews?: array<string>,
154
+ // Any other check that must pass before a command is sent — a set that adds to
155
+ // an existing store refuses an empty one here. Throw `Failed` to refuse; the
156
+ // run then reports that nothing was written.
157
+ preflight?: Seed_Connect.connection => promise<unit>,
154
158
  }
155
159
 
156
160
  /**
@@ -205,6 +209,10 @@ let seed = (~sets: array<dataSet>, ~connect: unit => promise<Seed_Connect.connec
205
209
  // Runs inside this pre-seed `try`, so refusing a non-empty store (or a
206
210
  // failed probe query) is reported as "did not start", not "half-seeded".
207
211
  await assertStoreEmpty(connection.client, ~probeViews=chosen.probeViews->Option.getOr([]))
212
+ switch chosen.preflight {
213
+ | Some(check) => await check(connection)
214
+ | None => ()
215
+ }
208
216
  Some((chosen, connection))
209
217
  } catch {
210
218
  | Failed(message) =>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reventlessdev/reventless-seed",
3
- "version": "1.0.0-alpha.22",
3
+ "version": "1.0.0-alpha.23",
4
4
  "description": "Reusable harness for seeding a Reventless platform through its public GraphQL command API",
5
5
  "license": "Apache-2.0",
6
6
  "dependencies": {
package/src/Seed.res CHANGED
@@ -36,6 +36,7 @@ type dataSet = Seed_Runner.dataSet = {
36
36
  label: string,
37
37
  seed: connection => promise<unit>,
38
38
  probeViews?: array<string>,
39
+ preflight?: connection => promise<unit>,
39
40
  }
40
41
 
41
42
  type rec value = Seed_Types.value =
@@ -151,6 +151,10 @@ type dataSet = {
151
151
  // View names probed by the fresh-store guard before any command is sent; a
152
152
  // non-empty one aborts the run at startup. Omit to skip the guard.
153
153
  probeViews?: array<string>,
154
+ // Any other check that must pass before a command is sent — a set that adds to
155
+ // an existing store refuses an empty one here. Throw `Failed` to refuse; the
156
+ // run then reports that nothing was written.
157
+ preflight?: Seed_Connect.connection => promise<unit>,
154
158
  }
155
159
 
156
160
  /**
@@ -205,6 +209,10 @@ let seed = (~sets: array<dataSet>, ~connect: unit => promise<Seed_Connect.connec
205
209
  // Runs inside this pre-seed `try`, so refusing a non-empty store (or a
206
210
  // failed probe query) is reported as "did not start", not "half-seeded".
207
211
  await assertStoreEmpty(connection.client, ~probeViews=chosen.probeViews->Option.getOr([]))
212
+ switch chosen.preflight {
213
+ | Some(check) => await check(connection)
214
+ | None => ()
215
+ }
208
216
  Some((chosen, connection))
209
217
  } catch {
210
218
  | Failed(message) =>
@@ -163,6 +163,10 @@ function seed(sets, connect) {
163
163
  let connection = await connect();
164
164
  Seed_Prompt$ReventlessSeed.close();
165
165
  await assertStoreEmpty(connection.client, Stdlib_Option.getOr(chosen.probeViews, []));
166
+ let check = chosen.preflight;
167
+ if (check !== undefined) {
168
+ await check(connection);
169
+ }
166
170
  started = [
167
171
  chosen,
168
172
  connection