@systemfsoftware/effect-spec-runtime 0.1.0 → 0.2.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 +12 -0
- package/dist/index.d.ts +5 -1
- package/dist/index.mjs +11 -2
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @systemfsoftware/effect-spec-runtime
|
|
2
2
|
|
|
3
|
+
## 0.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- Requires `@systemfsoftware/vitest` installed under the `@effect/vitest` name (`"@effect/vitest": "npm:@systemfsoftware/vitest"`) in place of the upstream package. `TaskRef` reads the running test's context in property tests as well as in case tests.
|
|
8
|
+
|
|
9
|
+
## 0.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Update peer and runtime dependency on `effect` and companion packages to `4.0.0-rc.117`.
|
|
14
|
+
|
|
3
15
|
## 0.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Context, Effect, Layer } from "effect";
|
|
2
|
+
import { TestOptions } from "vitest";
|
|
2
3
|
import * as EffectVitest from "@effect/vitest";
|
|
3
4
|
import { Vitest } from "@effect/vitest";
|
|
4
5
|
import * as Scope from "effect/Scope";
|
|
5
|
-
import { TestOptions } from "vitest";
|
|
6
6
|
declare namespace Register_d_exports {
|
|
7
7
|
export { DescribeMode, RegisterMode, invokeDescribe, selectCaseRunner, selectLayeredRunner };
|
|
8
8
|
}
|
|
@@ -73,6 +73,10 @@ interface VitestTaskContext<Ann = unknown> {
|
|
|
73
73
|
} | undefined;
|
|
74
74
|
}
|
|
75
75
|
declare const VitestTaskRef: Context.Reference<VitestTaskContext | null>;
|
|
76
|
+
/**
|
|
77
|
+
* The task context as the fork's run provides it: built on the fork's own key, so a case lane that goes
|
|
78
|
+
* through `provideTaskRef` and a property lane the fork runs itself read the same context.
|
|
79
|
+
*/
|
|
76
80
|
declare const RawVitestTaskRef: Context.Reference<VitestTaskContext | null>;
|
|
77
81
|
declare const provideTaskRef: {
|
|
78
82
|
<Ctx>(ctx: Ctx): <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { Context, Effect, Layer, Match, Option } from "effect";
|
|
3
3
|
import { dual } from "effect/Function";
|
|
4
|
+
import { describe } from "vitest";
|
|
5
|
+
import { vitestTestContextKey } from "@effect/vitest";
|
|
4
6
|
//#region src/Register.ts
|
|
5
7
|
const selectDescribe = (mode) => ({
|
|
6
8
|
skip: describe.skip,
|
|
@@ -42,7 +44,11 @@ var TaskRef_service_exports = /* @__PURE__ */ __exportAll({
|
|
|
42
44
|
provideTaskRef: () => provideTaskRef
|
|
43
45
|
});
|
|
44
46
|
const VitestTaskRef = Context.Reference("@systemfsoftware/effect-spec-runtime/VitestTask", { defaultValue: () => null });
|
|
45
|
-
|
|
47
|
+
/**
|
|
48
|
+
* The task context as the fork's run provides it: built on the fork's own key, so a case lane that goes
|
|
49
|
+
* through `provideTaskRef` and a property lane the fork runs itself read the same context.
|
|
50
|
+
*/
|
|
51
|
+
const RawVitestTaskRef = Context.Reference(vitestTestContextKey, { defaultValue: () => null });
|
|
46
52
|
const isPlainTaskContext = (ctx) => typeof ctx === "object" && ctx !== null;
|
|
47
53
|
const isTaskContext = (ctx) => typeof ctx === "object" ? ctx !== null : typeof ctx === "function";
|
|
48
54
|
const readTaskContext = (ctx) => Option.getOrNull(Option.liftPredicate(ctx, isPlainTaskContext));
|
|
@@ -57,7 +63,10 @@ var Suite_exports = /* @__PURE__ */ __exportAll({
|
|
|
57
63
|
openShared: () => openShared,
|
|
58
64
|
openSharedCase: () => openSharedCase
|
|
59
65
|
});
|
|
60
|
-
const layerSetupOptions = (excludeTestServices, useLiveClock) => ({
|
|
66
|
+
const layerSetupOptions = (excludeTestServices, useLiveClock) => ({
|
|
67
|
+
excludeTestServices: excludeTestServices || useLiveClock,
|
|
68
|
+
shared: true
|
|
69
|
+
});
|
|
61
70
|
const unlayeredRegister = (methodsIt, config, caseLayer) => (name, body, mode) => {
|
|
62
71
|
selectCaseRunner(methodsIt, mode, config.liveClock)(name, (ctx) => provideTaskRef(body.pipe(Effect.provide(Layer.fresh(caseLayer))), ctx));
|
|
63
72
|
};
|
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": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@effect/vitest": "
|
|
35
|
+
"@effect/vitest": "npm:@systemfsoftware/vitest@0.0.0",
|
|
36
36
|
"@systemfsoftware/arethetypeswrong-cli": "^4.2.0",
|
|
37
|
-
"@systemfsoftware/oxlint-config-recommended": "^
|
|
38
|
-
"@systemfsoftware/tsconfig": "^2.0.
|
|
37
|
+
"@systemfsoftware/oxlint-config-recommended": "^3.0.0",
|
|
38
|
+
"@systemfsoftware/tsconfig": "^2.0.1",
|
|
39
39
|
"@systemfsoftware/tsdown-config": "^0.1.0",
|
|
40
40
|
"@systemfsoftware/vitest-config": "^0.1.0",
|
|
41
41
|
"@types/node": "^26",
|
|
42
|
-
"effect": "4.0.0-rc.
|
|
42
|
+
"effect": "4.0.0-rc.117",
|
|
43
43
|
"fast-check": "^4",
|
|
44
44
|
"oxlint": "~1.82.0",
|
|
45
45
|
"rimraf": "^6.1.3",
|
|
@@ -48,8 +48,8 @@
|
|
|
48
48
|
"vitest": "^5"
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
|
-
"@effect/vitest": "
|
|
52
|
-
"effect": "4.0.0-rc.
|
|
51
|
+
"@effect/vitest": "npm:@systemfsoftware/vitest@*",
|
|
52
|
+
"effect": "4.0.0-rc.117",
|
|
53
53
|
"vitest": "^5"
|
|
54
54
|
},
|
|
55
55
|
"publishConfig": {
|