@systemfsoftware/effect-spec-runtime 1.2.0 → 1.3.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/CHANGELOG.md +2 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.mjs +16 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# @systemfsoftware/effect-spec-runtime
|
|
2
2
|
|
|
3
|
-
# @systemfsoftware/effect-spec-runtime@1.
|
|
3
|
+
# @systemfsoftware/effect-spec-runtime@1.3.0
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Adds `SpanRecorder`, a tracer that keeps every span a program opens, in the order they began. It is the span harness for a package below `@systemfsoftware/trace-spec` in the dependency graph whose published behaviour is the spans it emits. Use `SpanRecorder.make()` and run the program under `Effect.withTracer(program, recorder.tracer)`.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Context, Effect, Layer, Scope } from "effect";
|
|
1
|
+
import { Context, Effect, Layer, Scope, 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";
|
|
@@ -37,6 +37,19 @@ declare const liveCase: {
|
|
|
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. */
|
|
39
39
|
declare const exploreOnce: <A, E>(program: Effect.Effect<A, E>) => Promise<void>;
|
|
40
|
+
declare namespace SpanRecorder_d_exports {
|
|
41
|
+
export { SpanRecorder, make };
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A tracer that keeps every span a program opens, in the order they began. It is the tracing harness for a package
|
|
45
|
+
* that sits below `@systemfsoftware/trace-spec` in the dependency graph and whose published behaviour is the spans
|
|
46
|
+
* it emits; every other package asserts spans through a trace suite.
|
|
47
|
+
*/
|
|
48
|
+
interface SpanRecorder {
|
|
49
|
+
readonly tracer: Tracer.Tracer;
|
|
50
|
+
readonly spans: ReadonlyArray<Tracer.NativeSpan>;
|
|
51
|
+
}
|
|
52
|
+
declare const make: () => SpanRecorder;
|
|
40
53
|
//#endregion
|
|
41
54
|
//#region src/Register.d.ts
|
|
42
55
|
type RegisterMode = 'run' | 'skip' | 'only';
|
|
@@ -110,4 +123,4 @@ declare const provideTaskRef: {
|
|
|
110
123
|
<A, E, R, Ctx>(effect: Effect.Effect<A, E, R>, ctx: Ctx): Effect.Effect<A, E, R>;
|
|
111
124
|
};
|
|
112
125
|
//#endregion
|
|
113
|
-
export { KernelCase_d_exports as KernelCase, Suite_d_exports as Suite, TaskRef_service_d_exports as TaskRef };
|
|
126
|
+
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,7 +1,7 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { Kernel } from "@systemfsoftware/effect-sim-kernel";
|
|
3
3
|
import { createSpanRecorder, providedWorkspaceRoot, replayOfText, testIdentityOf, throwFailureRecord } from "@systemfsoftware/vitest/failure";
|
|
4
|
-
import { Cause, Config, Context, Effect, Exit, Layer, Match, Option, Schema, Scope } from "effect";
|
|
4
|
+
import { Cause, Config, Context, Effect, Exit, Layer, Match, Option, Schema, Scope, Tracer } from "effect";
|
|
5
5
|
import { dual } from "effect/Function";
|
|
6
6
|
import { VitestTestContext, vitestTestContextKey } from "@systemfsoftware/vitest";
|
|
7
7
|
import { captureRunBinding } from "@systemfsoftware/vitest/integration";
|
|
@@ -193,6 +193,20 @@ const exploreOnce = (program) => readReplayValue().then((value) => {
|
|
|
193
193
|
return replayOrBaseline(program, replayOfText(value));
|
|
194
194
|
});
|
|
195
195
|
//#endregion
|
|
196
|
+
//#region src/SpanRecorder.ts
|
|
197
|
+
var SpanRecorder_exports = /* @__PURE__ */ __exportAll({ make: () => make });
|
|
198
|
+
const make = () => {
|
|
199
|
+
const spans = [];
|
|
200
|
+
return {
|
|
201
|
+
tracer: Tracer.make({ span: (options) => {
|
|
202
|
+
const span = new Tracer.NativeSpan(options);
|
|
203
|
+
spans.push(span);
|
|
204
|
+
return span;
|
|
205
|
+
} }),
|
|
206
|
+
spans
|
|
207
|
+
};
|
|
208
|
+
};
|
|
209
|
+
//#endregion
|
|
196
210
|
//#region src/Register.ts
|
|
197
211
|
const selectDescribe = (mode) => ({
|
|
198
212
|
skip: describe.skip,
|
|
@@ -353,4 +367,4 @@ const openSharedCaseImpl = (bindings, config, shared, caseLayer, use) => {
|
|
|
353
367
|
};
|
|
354
368
|
const openSharedCase = dual(5, openSharedCaseImpl);
|
|
355
369
|
//#endregion
|
|
356
|
-
export { KernelCase_exports as KernelCase, Suite_exports as Suite, TaskRef_service_exports as TaskRef };
|
|
370
|
+
export { KernelCase_exports as KernelCase, SpanRecorder_exports as SpanRecorder, Suite_exports as Suite, TaskRef_service_exports as TaskRef };
|
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.
|
|
4
|
+
"version": "1.3.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@microsoft/api-extractor": "^7.59.4",
|
|
39
39
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
40
|
-
"@systemfsoftware/oxlint-config-recommended": "^
|
|
40
|
+
"@systemfsoftware/oxlint-config-recommended": "^8.0.1",
|
|
41
41
|
"@systemfsoftware/tsconfig": "^2.1.0",
|
|
42
42
|
"@systemfsoftware/tsdown-config": "^0.1.2",
|
|
43
43
|
"@systemfsoftware/vitest": "^4.1.2",
|