@yieldstar/runtime-conformance 0.6.1 → 0.7.0
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/dist/execution.d.ts.map +1 -1
- package/dist/index.js +12 -14
- package/package.json +2 -2
package/dist/execution.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,OAAO,EAGb,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;OAGG;IACH,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,2EAA2E;IAC3E,OAAO,CAAC,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CACJ,OAAO,EAAE,kCAAkC,GAC1C,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACvE,CAAC;AAwDF;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,IAAI,EACJ,MAAM,GACP,EAAE,2BAA2B,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"execution.d.ts","sourceRoot":"","sources":["../src/execution.ts"],"names":[],"mappings":"AAAA,OAAO,EASL,KAAK,OAAO,EAGb,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,kCAAkC,GAAG;IAC/C;;;OAGG;IACH,KAAK,EAAE,MAAM,MAAM,CAAC;CACrB,CAAC;AAEF,8DAA8D;AAC9D,MAAM,MAAM,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,UAAU,CAAC,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1C,2EAA2E;IAC3E,OAAO,CAAC,IAAI,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACvC;;;;OAIG;IACH,gBAAgB,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACxF,OAAO,CAAC,IAAI,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CACJ,OAAO,EAAE,kCAAkC,GAC1C,2BAA2B,GAAG,OAAO,CAAC,2BAA2B,CAAC,CAAC;CACvE,CAAC;AAwDF;;;GAGG;AACH,wBAAgB,kCAAkC,CAAC,EACjD,IAAI,EACJ,MAAM,GACP,EAAE,2BAA2B,GAAG,IAAI,CA8+DpC"}
|
package/dist/index.js
CHANGED
|
@@ -202,7 +202,7 @@ function registerEffectClientConformance({
|
|
|
202
202
|
["an empty effect ID", { effectId: "" }],
|
|
203
203
|
["an empty operation", { operation: "" }],
|
|
204
204
|
["array input", { input: [] }],
|
|
205
|
-
["
|
|
205
|
+
["an invalid Date in the input", { input: { at: new Date(Number.NaN) } }],
|
|
206
206
|
["a non-finite number in the input", { input: { amount: Number.NaN } }],
|
|
207
207
|
["an empty execution ID", { executionId: "" }],
|
|
208
208
|
["an empty step key", { stepKey: "" }]
|
|
@@ -379,7 +379,7 @@ function registerEffectClientConformance({
|
|
|
379
379
|
expect(await runtime.effects.getEffect("pay:unknown")).toBeUndefined();
|
|
380
380
|
await begin(runtime, "pay:invariant");
|
|
381
381
|
await expectInvariant(settle(runtime, "pay:invariant", "result", "charge-v2"));
|
|
382
|
-
await expectInvariant(settle(runtime, "pay:invariant", { at: new Date(
|
|
382
|
+
await expectInvariant(settle(runtime, "pay:invariant", { at: new Date(Number.NaN) }));
|
|
383
383
|
expect(await runtime.effects.getEffect("pay:invariant")).toMatchObject({
|
|
384
384
|
status: "pending"
|
|
385
385
|
});
|
|
@@ -956,16 +956,15 @@ function registerExecutionClientConformance({
|
|
|
956
956
|
const cyclic = {};
|
|
957
957
|
cyclic.self = cyclic;
|
|
958
958
|
const invalidEvents = [
|
|
959
|
-
["
|
|
959
|
+
["an invalid Date", { params: { at: new Date(NaN) }, context: new Map }],
|
|
960
960
|
["a class instance", { params: { point: new Point(1) }, context: new Map }],
|
|
961
961
|
["NaN", { params: { n: NaN }, context: new Map }],
|
|
962
962
|
["Infinity", { params: { n: Infinity }, context: new Map }],
|
|
963
|
-
["a bigint", { params: { n: 10n }, context: new Map }],
|
|
964
963
|
["a function", { params: { fn: () => 1 }, context: new Map }],
|
|
965
|
-
["a Map", { params: { map: new Map([["a", 1]]) }, context: new Map }],
|
|
964
|
+
["a function in a Map", { params: { map: new Map([["a", () => 1]]) }, context: new Map }],
|
|
966
965
|
["a sparse array", { params: { list: [1, , 3] }, context: new Map }],
|
|
967
966
|
["a cycle", { params: cyclic, context: new Map }],
|
|
968
|
-
["a
|
|
967
|
+
["a class instance in context", { params: {}, context: new Map([["at", new Point(1)]]) }],
|
|
969
968
|
["an object context key", { params: {}, context: new Map([[{}, 1]]) }],
|
|
970
969
|
["a number context key", { params: {}, context: new Map([[7, 1]]) }]
|
|
971
970
|
];
|
|
@@ -1405,7 +1404,7 @@ function registerExecutionClientConformance({
|
|
|
1405
1404
|
const lease = await claimOne(runtime, "invalid-result");
|
|
1406
1405
|
const acknowledged = await runtime.executions.acknowledge({
|
|
1407
1406
|
lease,
|
|
1408
|
-
outcome: { status: "completed", result: {
|
|
1407
|
+
outcome: { status: "completed", result: { point: new Point(1) } }
|
|
1409
1408
|
});
|
|
1410
1409
|
const record = await runtime.executions.get("invalid-result");
|
|
1411
1410
|
expect2(record.status).toBe("failed");
|
|
@@ -2211,17 +2210,16 @@ function registerExecutionClientConformance({
|
|
|
2211
2210
|
});
|
|
2212
2211
|
const hidden = Object.defineProperty({}, "value", { value: 1, enumerable: false });
|
|
2213
2212
|
const invalidParams = [
|
|
2214
|
-
["
|
|
2213
|
+
["an invalid Date", { at: new Date(NaN) }],
|
|
2215
2214
|
["a class instance", { point: new Point(1) }],
|
|
2216
2215
|
["NaN", { n: NaN }],
|
|
2217
2216
|
["Infinity", { n: Infinity }],
|
|
2218
|
-
["a bigint", { n: 10n }],
|
|
2219
2217
|
["a function", { fn: () => 1 }],
|
|
2220
2218
|
["a symbol", { s: Symbol("s") }],
|
|
2221
2219
|
["a symbol key", { [Symbol("s")]: 1 }],
|
|
2222
2220
|
["an accessor", { nested: accessor }],
|
|
2223
2221
|
["a non-enumerable property", { nested: hidden }],
|
|
2224
|
-
["a Map", { map: new Map([["a", 1]]) }],
|
|
2222
|
+
["a function in a Map", { map: new Map([["a", () => 1]]) }],
|
|
2225
2223
|
["a sparse array", { list: [1, , 3] }],
|
|
2226
2224
|
["a cycle", cyclic],
|
|
2227
2225
|
["an array as params", [1, 2]],
|
|
@@ -2558,7 +2556,7 @@ function registerStoreClientConformance({
|
|
|
2558
2556
|
const { stores } = harness.runtime;
|
|
2559
2557
|
const invalid = { code: "INVALID_STEP_VALUE", name: "WorkflowValueError" };
|
|
2560
2558
|
try {
|
|
2561
|
-
seed(Store, "never-created", { messages: [], unrelated: new Date(
|
|
2559
|
+
seed(Store, "never-created", { messages: [], unrelated: new Date(Number.NaN) });
|
|
2562
2560
|
await expect3(stores.getStore({ definition: Store, id: "never-created" })).rejects.toMatchObject(invalid);
|
|
2563
2561
|
await expect3(stores.updateStore({
|
|
2564
2562
|
definition: Store,
|
|
@@ -2579,14 +2577,14 @@ function registerStoreClientConformance({
|
|
|
2579
2577
|
stepId,
|
|
2580
2578
|
updater(draft) {
|
|
2581
2579
|
draft.messages.push({ id: "two" });
|
|
2582
|
-
draft.at = new
|
|
2580
|
+
draft.at = new Date(Number.NaN);
|
|
2583
2581
|
}
|
|
2584
2582
|
})).rejects.toMatchObject({ ...invalid, stepKey: "update" });
|
|
2585
2583
|
await expect3(stores.updateStoreFrom({
|
|
2586
2584
|
definition: Store,
|
|
2587
2585
|
id: "durable",
|
|
2588
2586
|
snapshot: created,
|
|
2589
|
-
updater: () => ({ messages: [], unrelated:
|
|
2587
|
+
updater: () => ({ messages: [], unrelated: Number.NaN })
|
|
2590
2588
|
})).rejects.toMatchObject(invalid);
|
|
2591
2589
|
expect3(await stores.getStore({ definition: Store, id: "durable" })).toMatchObject({
|
|
2592
2590
|
state: { messages: [{ id: "one" }] },
|
|
@@ -2600,7 +2598,7 @@ function registerStoreClientConformance({
|
|
|
2600
2598
|
await expect3(stores.takeFromStore({
|
|
2601
2599
|
definition: TakeStore,
|
|
2602
2600
|
id: "durable-take",
|
|
2603
|
-
selector: (state) => state.messages.length > 0 && new
|
|
2601
|
+
selector: (state) => state.messages.length > 0 && new Date(Number.NaN),
|
|
2604
2602
|
claim(draft) {
|
|
2605
2603
|
draft.messages = [];
|
|
2606
2604
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yieldstar/runtime-conformance",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Daniel Grant",
|
|
6
6
|
"repository": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"vitest": "^3.2.4",
|
|
33
|
-
"@yieldstar/core": "0.
|
|
33
|
+
"@yieldstar/core": "0.7.0"
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "bun build src/index.ts --outfile dist/index.js --target node --packages=external"
|