@systemfsoftware/effect-spec-runtime 1.3.0 → 1.3.2
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 +6 -2
- package/dist/index.d.ts +17 -20
- package/dist/index.mjs +9 -15
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/package.json +13 -13
- package/dist/rolldown-runtime-D7D4PA-g.mjs +0 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @systemfsoftware/effect-spec-runtime
|
|
2
2
|
|
|
3
|
-
# @systemfsoftware/effect-spec-runtime@1.3.
|
|
3
|
+
# @systemfsoftware/effect-spec-runtime@1.3.2
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Dev dependency bump (@types/node) only; the packed tarball is unchanged.
|
|
6
|
+
|
|
7
|
+
No consumer-visible package changes.
|
|
8
|
+
|
|
9
|
+
Rebuilt with tsdown 0.23.7 against the updated dev dependencies: the bundled `dist/` files carry a different hashed runtime chunk name and comment markers, and the declared devDependency ranges move. The public API and runtime behaviour are unchanged.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { Context, Effect, Layer, Scope, Tracer } from "effect";
|
|
1
|
+
import { Context, Effect, Layer, Scope as Scope$1, Tracer } from "effect";
|
|
2
2
|
import { Expect, Vitest } from "@systemfsoftware/vitest";
|
|
3
3
|
import { Asserted } from "@systemfsoftware/vitest/integration";
|
|
4
4
|
import { TestOptions } from "vitest";
|
|
5
|
-
import * as Scope
|
|
5
|
+
import * as Scope from "effect/Scope";
|
|
6
6
|
declare namespace KernelCase_d_exports {
|
|
7
7
|
export { LiveCase, announceLive, caseProgram, explore, exploreOnce, liveCase };
|
|
8
8
|
}
|
|
@@ -20,8 +20,8 @@ interface LiveCase {
|
|
|
20
20
|
* zero-preemption schedule), the scenario body runs after it.
|
|
21
21
|
*/
|
|
22
22
|
declare const caseProgram: {
|
|
23
|
-
<B, E, R, RIn extends Scope
|
|
24
|
-
<B, E, R, RIn extends Scope
|
|
23
|
+
<B, E, R, RIn extends Scope.Scope>(env: Layer.Layer<R, never, RIn>): (body: Effect.Effect<B, E, R | RIn | Scope.Scope>) => Effect.Effect<B, E>;
|
|
24
|
+
<B, E, R, RIn extends Scope.Scope>(body: Effect.Effect<B, E, R | RIn | Scope.Scope>, env: Layer.Layer<R, never, RIn>): Effect.Effect<B, E>;
|
|
25
25
|
};
|
|
26
26
|
/** Announces a live case with its reason, which is how the run report lists it. */
|
|
27
27
|
declare const announceLive: (reason: string) => Effect.Effect<void>;
|
|
@@ -31,8 +31,8 @@ declare const announceLive: (reason: string) => Effect.Effect<void>;
|
|
|
31
31
|
* provides the case scope.
|
|
32
32
|
*/
|
|
33
33
|
declare const liveCase: {
|
|
34
|
-
<B, E, R, RIn extends Scope
|
|
35
|
-
<B, E, R, RIn extends Scope
|
|
34
|
+
<B, E, R, RIn extends Scope.Scope>(env: Layer.Layer<R, never, RIn>, reason: string): (body: Effect.Effect<B, E, R | RIn | Scope.Scope>) => Effect.Effect<B, E, Scope.Scope>;
|
|
35
|
+
<B, E, R, RIn extends Scope.Scope>(body: Effect.Effect<B, E, R | RIn | Scope.Scope>, env: Layer.Layer<R, never, RIn>, reason: string): Effect.Effect<B, E, Scope.Scope>;
|
|
36
36
|
};
|
|
37
37
|
declare const explore: <A, E>(program: Effect.Effect<A, E>) => Promise<void>;
|
|
38
38
|
/** An explored case's leak-check second run: its first run already took every seeded schedule. */
|
|
@@ -50,18 +50,16 @@ interface SpanRecorder {
|
|
|
50
50
|
readonly spans: ReadonlyArray<Tracer.NativeSpan>;
|
|
51
51
|
}
|
|
52
52
|
declare const make: () => SpanRecorder;
|
|
53
|
-
//#endregion
|
|
54
|
-
//#region src/Register.d.ts
|
|
55
53
|
type RegisterMode = 'run' | 'skip' | 'only';
|
|
56
54
|
type DescribeMode = 'describe' | 'skip' | 'only';
|
|
57
55
|
declare namespace Suite_d_exports {
|
|
58
|
-
export { Bindings, CaseLive, Config
|
|
56
|
+
export { Bindings, CaseLive, Config, DescribeMode, LiveCase, Options, RegisterFn, RegisterMode, Scenario, Shared, open, openCase, openShared, openSharedCase };
|
|
59
57
|
}
|
|
60
58
|
type Options = Pick<TestOptions, 'tags'> & Partial<TestOptions>;
|
|
61
59
|
interface Bindings {
|
|
62
60
|
readonly it: Vitest.Methods;
|
|
63
61
|
}
|
|
64
|
-
interface Config
|
|
62
|
+
interface Config {
|
|
65
63
|
readonly name: string;
|
|
66
64
|
readonly describe: DescribeMode;
|
|
67
65
|
readonly options: Options | undefined;
|
|
@@ -75,7 +73,7 @@ interface Shared<R> {
|
|
|
75
73
|
* steps check through the test's callback rather than an import. `R` is what the case's layer
|
|
76
74
|
* provides; every marked step needs the runner's scope and check service beside it.
|
|
77
75
|
*/
|
|
78
|
-
type Scenario<B, E, R> = (expect: Expect) => Effect.Effect<B, E, R | Scope.Scope | Asserted>;
|
|
76
|
+
type Scenario<B, E, R> = (expect: Expect) => Effect.Effect<B, E, R | Scope$1.Scope | Asserted>;
|
|
79
77
|
/**
|
|
80
78
|
* A case's own live declaration. A live case's first run may hang on an act that happens once, such
|
|
81
79
|
* as a person approving in a browser; `rerun` is then the scenario the second run on fresh services
|
|
@@ -88,20 +86,20 @@ interface RegisterFn<B, E, R> {
|
|
|
88
86
|
(name: string, scenario: Scenario<B, E, R>, mode: RegisterMode, live?: CaseLive<B, E, R>): void;
|
|
89
87
|
}
|
|
90
88
|
declare const open: {
|
|
91
|
-
<B, E, C>(config: Config
|
|
92
|
-
<B, E, C>(bindings: Bindings, config: Config
|
|
89
|
+
<B, E, C>(config: Config, use: (register: RegisterFn<B, E, Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): (bindings: Bindings) => void;
|
|
90
|
+
<B, E, C>(bindings: Bindings, config: Config, use: (register: RegisterFn<B, E, Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): void;
|
|
93
91
|
};
|
|
94
92
|
declare const openShared: {
|
|
95
|
-
<B, E, RShared, C>(config: Config
|
|
96
|
-
<B, E, RShared, C>(bindings: Bindings, config: Config
|
|
93
|
+
<B, E, RShared, C>(config: Config, shared: Shared<RShared>, use: (register: RegisterFn<B, E, RShared | Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): (bindings: Bindings) => void;
|
|
94
|
+
<B, E, RShared, C>(bindings: Bindings, config: Config, shared: Shared<RShared>, use: (register: RegisterFn<B, E, RShared | Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): void;
|
|
97
95
|
};
|
|
98
96
|
declare const openCase: {
|
|
99
|
-
<B, E, RFresh, RFreshReq extends Scope.Scope, C>(config: Config
|
|
100
|
-
<B, E, RFresh, RFreshReq extends Scope.Scope, C>(bindings: Bindings, config: Config
|
|
97
|
+
<B, E, RFresh, RFreshReq extends Scope$1.Scope, C>(config: Config, caseLayer: Layer.Layer<RFresh, never, RFreshReq>, use: (register: RegisterFn<B, E, RFresh | RFreshReq | Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): (bindings: Bindings) => void;
|
|
98
|
+
<B, E, RFresh, RFreshReq extends Scope$1.Scope, C>(bindings: Bindings, config: Config, caseLayer: Layer.Layer<RFresh, never, RFreshReq>, use: (register: RegisterFn<B, E, RFresh | RFreshReq | Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): void;
|
|
101
99
|
};
|
|
102
100
|
declare const openSharedCase: {
|
|
103
|
-
<B, E, RShared, RFresh, RFreshReq extends RShared, C>(config: Config
|
|
104
|
-
<B, E, RShared, RFresh, RFreshReq extends RShared, C>(bindings: Bindings, config: Config
|
|
101
|
+
<B, E, RShared, RFresh, RFreshReq extends RShared, C>(config: Config, shared: Shared<RShared>, caseLayer: Layer.Layer<RFresh, never, RFreshReq>, use: (register: RegisterFn<B, E, RShared | RFresh | Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): (bindings: Bindings) => void;
|
|
102
|
+
<B, E, RShared, RFresh, RFreshReq extends RShared, C>(bindings: Bindings, config: Config, shared: Shared<RShared>, caseLayer: Layer.Layer<RFresh, never, RFreshReq>, use: (register: RegisterFn<B, E, RShared | RFresh | Scope$1.Scope>, propIt: Vitest.MethodsNonLive<never>) => C): void;
|
|
105
103
|
};
|
|
106
104
|
declare namespace TaskRef_service_d_exports {
|
|
107
105
|
export { RawVitestTaskRef, VitestTaskContext, VitestTaskRef, provideTaskRef };
|
|
@@ -122,5 +120,4 @@ declare const provideTaskRef: {
|
|
|
122
120
|
<Ctx>(ctx: Ctx): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
123
121
|
<A, E, R, Ctx>(effect: Effect.Effect<A, E, R>, ctx: Ctx): Effect.Effect<A, E, R>;
|
|
124
122
|
};
|
|
125
|
-
//#endregion
|
|
126
123
|
export { KernelCase_d_exports as KernelCase, SpanRecorder_d_exports as SpanRecorder, Suite_d_exports as Suite, TaskRef_service_d_exports as TaskRef };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as __exportAll } from "./rolldown-runtime-
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
2
|
import { Kernel } from "@systemfsoftware/effect-sim-kernel";
|
|
3
3
|
import { createSpanRecorder, providedWorkspaceRoot, replayOfText, testIdentityOf, throwFailureRecord } from "@systemfsoftware/vitest/failure";
|
|
4
4
|
import { Cause, Config, Context, Effect, Exit, Layer, Match, Option, Schema, Scope, Tracer } from "effect";
|
|
@@ -6,7 +6,7 @@ import { dual } from "effect/Function";
|
|
|
6
6
|
import { VitestTestContext, vitestTestContextKey } from "@systemfsoftware/vitest";
|
|
7
7
|
import { captureRunBinding } from "@systemfsoftware/vitest/integration";
|
|
8
8
|
import { afterAll, describe } from "vitest";
|
|
9
|
-
|
|
9
|
+
// src/KernelFailure.schema.ts
|
|
10
10
|
/**
|
|
11
11
|
* The kernel's own failure — a deadlock, an escape, a wait it cannot observe, or a runaway run — as a failure
|
|
12
12
|
* value carrying the message the record's headline shows (R1, R2). It is a value, not a formatted string, so the
|
|
@@ -17,8 +17,7 @@ var KernelFailure = class extends Schema.TaggedError()("KernelFailure", { detail
|
|
|
17
17
|
return this.detail;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
//#region src/TaskRef.service.ts
|
|
20
|
+
// src/TaskRef.service.ts
|
|
22
21
|
var TaskRef_service_exports = /* @__PURE__ */ __exportAll({
|
|
23
22
|
RawVitestTaskRef: () => RawVitestTaskRef,
|
|
24
23
|
VitestTaskRef: () => VitestTaskRef,
|
|
@@ -36,8 +35,7 @@ const readTaskContext = (ctx) => Option.getOrNull(Option.liftPredicate(ctx, isPl
|
|
|
36
35
|
const readRawTaskContext = (ctx) => Option.getOrNull(Option.liftPredicate(ctx, isTaskContext));
|
|
37
36
|
const provideTaskRefImpl = (effect, ctx) => effect.pipe(Effect.provideService(VitestTaskRef, readTaskContext(ctx)), Effect.provideService(RawVitestTaskRef, readRawTaskContext(ctx)));
|
|
38
37
|
const provideTaskRef = dual(2, provideTaskRefImpl);
|
|
39
|
-
|
|
40
|
-
//#region src/KernelCase.ts
|
|
38
|
+
// src/KernelCase.ts
|
|
41
39
|
var KernelCase_exports = /* @__PURE__ */ __exportAll({
|
|
42
40
|
announceLive: () => announceLive,
|
|
43
41
|
caseProgram: () => caseProgram,
|
|
@@ -101,7 +99,7 @@ const describeSuspended = (fiber) => {
|
|
|
101
99
|
if (first === void 0) return `fiber ${fiber.id}`;
|
|
102
100
|
return `fiber ${fiber.id} at ${first}`;
|
|
103
101
|
};
|
|
104
|
-
const describeKernelFailure = (failure) => Match.value(failure).pipe(Match.when({ _tag: "Escape" }, (escape) => `escaped the controlled schedule through the ${escape.timer} timer at ${escape.site}`), Match.when({ _tag: "Blocked" }, (blocked) => `waited on a resource the kernel cannot observe: ${blocked.resources.join(", ")}`), Match.when({ _tag: "Deadlock" }, (deadlock) => `deadlocked with ${deadlock.suspended.length} suspended fibers: ${deadlock.suspended.map(describeSuspended).join("; ")}`), Match.when({ _tag: "Runaway" }, (runaway) => `ran past ${runaway.steps} steps with ${runaway.pending} fibers pending`), Match.exhaustive);
|
|
102
|
+
const describeKernelFailure = (failure) => Match.value(failure).pipe(Match.when({ _tag: "Escape" }, (escape) => `escaped the controlled schedule through the ${escape.timer} timer at ${escape.site}`), Match.when({ _tag: "Blocked" }, (blocked) => `waited on a resource the kernel cannot observe: ${blocked.resources.join(", ")}`), Match.when({ _tag: "Deadlock" }, (deadlock) => `deadlocked with ${deadlock.suspended.length} suspended fibers: ${deadlock.suspended.map(describeSuspended).join("; ")}`), Match.when({ _tag: "Runaway" }, (runaway) => `ran past ${runaway.steps} steps with ${runaway.pending} fibers pending`), Match.when({ _tag: "ReplayTraceDiverged" }, (diverged) => `the replayed trace diverged at step ${diverged.atStep}: expected ${JSON.stringify(diverged.expected)}, got ${JSON.stringify(diverged.actual)}`), Match.exhaustive);
|
|
105
103
|
/** One run with its own recorder: the record is rendered from exactly the spans this run opened (KTD2). */
|
|
106
104
|
const recorded = (program) => {
|
|
107
105
|
const recorder = createSpanRecorder();
|
|
@@ -124,7 +122,7 @@ const throwRecord = (failure, schedule, recorder) => throwFailureRecord({
|
|
|
124
122
|
schedule: scheduleNoteOf(schedule),
|
|
125
123
|
root: providedWorkspaceRoot()
|
|
126
124
|
});
|
|
127
|
-
const throwKernelFailure = (failure, schedule, recorder) => throwRecord(
|
|
125
|
+
const throwKernelFailure = (failure, schedule, recorder) => throwRecord(KernelFailure.make({ detail: describeKernelFailure(failure) }), schedule, recorder);
|
|
128
126
|
const throwExitFailure = (exit, schedule, recorder) => throwRecord(Cause.squash(exit.cause), schedule, recorder);
|
|
129
127
|
const isKernelFailure = (observed) => "failure" in observed;
|
|
130
128
|
const throwIfExitFailed = (observed, schedule, recorder) => {
|
|
@@ -192,8 +190,7 @@ const exploreOnce = (program) => readReplayValue().then((value) => {
|
|
|
192
190
|
if (value === void 0) return baselineRun(program).then(() => {});
|
|
193
191
|
return replayOrBaseline(program, replayOfText(value));
|
|
194
192
|
});
|
|
195
|
-
|
|
196
|
-
//#region src/SpanRecorder.ts
|
|
193
|
+
// src/SpanRecorder.ts
|
|
197
194
|
var SpanRecorder_exports = /* @__PURE__ */ __exportAll({ make: () => make });
|
|
198
195
|
const make = () => {
|
|
199
196
|
const spans = [];
|
|
@@ -206,8 +203,7 @@ const make = () => {
|
|
|
206
203
|
spans
|
|
207
204
|
};
|
|
208
205
|
};
|
|
209
|
-
|
|
210
|
-
//#region src/Register.ts
|
|
206
|
+
// src/Register.ts
|
|
211
207
|
const selectDescribe = (mode) => ({
|
|
212
208
|
skip: describe.skip,
|
|
213
209
|
only: describe.only,
|
|
@@ -273,8 +269,7 @@ const exploredOnceProgram = (program) => exploredWith(exploreOnce, program);
|
|
|
273
269
|
*/
|
|
274
270
|
const selectCaseRunnerImpl = (methodsIt, mode, live) => pickLane(caseLanes(methodsIt, live), mode);
|
|
275
271
|
const selectCaseRunner = dual(3, selectCaseRunnerImpl);
|
|
276
|
-
|
|
277
|
-
//#region src/Suite.ts
|
|
272
|
+
// src/Suite.ts
|
|
278
273
|
var Suite_exports = /* @__PURE__ */ __exportAll({
|
|
279
274
|
open: () => open,
|
|
280
275
|
openCase: () => openCase,
|
|
@@ -366,5 +361,4 @@ const openSharedCaseImpl = (bindings, config, shared, caseLayer, use) => {
|
|
|
366
361
|
});
|
|
367
362
|
};
|
|
368
363
|
const openSharedCase = dual(5, openSharedCaseImpl);
|
|
369
|
-
//#endregion
|
|
370
364
|
export { KernelCase_exports as KernelCase, SpanRecorder_exports as SpanRecorder, Suite_exports as Suite, TaskRef_service_exports as TaskRef };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __exportAll = (all, flags) => {
|
|
4
|
+
let target = Object.setPrototypeOf({}, null);
|
|
5
|
+
for (var name in all) __defProp(target, name, {
|
|
6
|
+
get: all[name],
|
|
7
|
+
enumerable: true
|
|
8
|
+
});
|
|
9
|
+
if (!(flags & 1)) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
+
return flags & 2 ? target : Object.preventExtensions(target);
|
|
11
|
+
};
|
|
12
|
+
export { __exportAll as t };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/effect-spec-runtime",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.2",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -32,28 +32,28 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@systemfsoftware/effect-sim-kernel": "^2.0
|
|
35
|
+
"@systemfsoftware/effect-sim-kernel": "^2.1.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@microsoft/api-extractor": "^7.
|
|
38
|
+
"@microsoft/api-extractor": "^7.60.1",
|
|
39
39
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
40
|
-
"@systemfsoftware/oxlint-config-recommended": "^8.0.
|
|
40
|
+
"@systemfsoftware/oxlint-config-recommended": "^8.0.4",
|
|
41
41
|
"@systemfsoftware/tsconfig": "^2.1.0",
|
|
42
|
-
"@systemfsoftware/tsdown-config": "^0.1.
|
|
43
|
-
"@systemfsoftware/vitest": "^4.
|
|
44
|
-
"@systemfsoftware/vitest-config": "^0.1.
|
|
45
|
-
"@types/node": "^26.6.
|
|
46
|
-
"effect": "^4.1.
|
|
42
|
+
"@systemfsoftware/tsdown-config": "^0.1.3",
|
|
43
|
+
"@systemfsoftware/vitest": "^4.2.0",
|
|
44
|
+
"@systemfsoftware/vitest-config": "^0.1.4",
|
|
45
|
+
"@types/node": "^26.6.6",
|
|
46
|
+
"effect": "^4.1.4",
|
|
47
47
|
"fast-check": "^4.10.2",
|
|
48
48
|
"oxlint": "~1.93.0",
|
|
49
|
-
"rimraf": "^6.1.
|
|
50
|
-
"tsdown": "^0.23.
|
|
49
|
+
"rimraf": "^6.1.4",
|
|
50
|
+
"tsdown": "^0.23.7",
|
|
51
51
|
"tstyche": "^7.2.5",
|
|
52
52
|
"vitest": "^5.1.0"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
|
-
"@systemfsoftware/vitest": "^4.
|
|
56
|
-
"effect": "^4.1.
|
|
55
|
+
"@systemfsoftware/vitest": "^4.2.0",
|
|
56
|
+
"effect": "^4.1.4",
|
|
57
57
|
"vitest": "^5.1.0"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __exportAll = (all, no_symbols) => {
|
|
4
|
-
let target = {};
|
|
5
|
-
for (var name in all) __defProp(target, name, {
|
|
6
|
-
get: all[name],
|
|
7
|
-
enumerable: true
|
|
8
|
-
});
|
|
9
|
-
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
10
|
-
return target;
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { __exportAll as t };
|