@systemfsoftware/storybook-gherkin 1.0.0 → 2.0.1
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 +30 -0
- package/dist/index.d.ts +9 -3
- package/dist/index.mjs +5 -3
- package/package.json +6 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @systemfsoftware/storybook-gherkin
|
|
2
2
|
|
|
3
|
+
## 2.0.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- The peer requirements for `effect` and for the Effect test-runner integration now accept any compatible `4.0.0-rc` release, instead of demanding one exact release candidate.
|
|
8
|
+
|
|
9
|
+
Installing alongside a newer release candidate no longer reports an unmet peer dependency or resolves a second copy of `effect` into the dependency tree.
|
|
10
|
+
|
|
11
|
+
## 2.0.0
|
|
12
|
+
|
|
13
|
+
### Major Changes
|
|
14
|
+
|
|
15
|
+
- Port the library to the effect v4 release candidate (`effect@^4.0.0-rc.108`). `feature(meta, { runtime })` is replaced by `feature(meta, { context })` — v4 removed the Runtime module; the play edge now runs through `Effect.runPromiseExitWith` with an optional `Context` (default `Context.empty()`). Internally: `Either` → `Result`, `Effect.catchAllCause` → `catchCause`, `Exit.isInterrupted` → `hasInterrupts`, `Schema.decodeUnknownEither` → `decodeEffect`, schema captures now type as `ConstraintDecoder` (the v4 no-context view), and tagged errors construct via `.make`.
|
|
16
|
+
|
|
17
|
+
BREAKING CHANGE: `FeatureOptions.runtime` is removed; pass `context` instead.
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- cut over to effect v4 (4.0.0-rc.108): public surface derives from effect types; peers flip effect ^3→^4
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- New version is published through npm trusted publishing, so it carries a provenance attestation you can verify.
|
|
26
|
+
|
|
27
|
+
- Each of these packages now has a README, so its registry page says what the package is, how
|
|
28
|
+
to install it, and what to import or register — previously the page was blank. The lint
|
|
29
|
+
plugins show the configuration line that enables what they recommend.
|
|
30
|
+
|
|
31
|
+
`@systemfsoftware/stryker-js-mutation-report` also carries its licence text
|
|
32
|
+
|
|
3
33
|
## 1.0.0
|
|
4
34
|
|
|
5
35
|
### Major Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,11 @@ import { Context, Effect, Schema } from "effect";
|
|
|
2
2
|
import { UserEventObject, screen, within } from "storybook/test";
|
|
3
3
|
import { Simplify, UnionToIntersection } from "type-fest";
|
|
4
4
|
//#region src/Capture.d.ts
|
|
5
|
-
|
|
5
|
+
declare const CaptureTag: {
|
|
6
6
|
readonly _tag: 'Capture';
|
|
7
|
+
};
|
|
8
|
+
type CaptureTag = typeof CaptureTag;
|
|
9
|
+
interface Capture<Name extends string = string, _A = unknown> extends CaptureTag {
|
|
7
10
|
readonly name: Name;
|
|
8
11
|
readonly schema: Schema.ConstraintDecoder<unknown> | undefined;
|
|
9
12
|
readonly default: string | undefined;
|
|
@@ -148,8 +151,11 @@ interface StepContext<TArgs = unknown> {
|
|
|
148
151
|
type Hole = Capture | string | number;
|
|
149
152
|
type CapsOf<THoles extends readonly Hole[]> = THoles extends readonly [] ? {} : Simplify<UnionToIntersection<{ [K in keyof THoles]: THoles[K] extends Capture<infer N, infer A> ? { [P in N]: A; } : {}; }[number]>>;
|
|
150
153
|
type StepHandler<TCaps, TArgs = unknown> = (ctx: StepContext<TArgs>, caps: TCaps) => void | Promise<void>;
|
|
151
|
-
|
|
152
|
-
readonly _tag:
|
|
154
|
+
declare const StepTag: {
|
|
155
|
+
readonly _tag: "Step";
|
|
156
|
+
};
|
|
157
|
+
type StepTag = typeof StepTag;
|
|
158
|
+
interface Step<TArgs = unknown> extends StepTag {
|
|
153
159
|
readonly model: StepModel;
|
|
154
160
|
readonly run: (values: Readonly<Record<string, string>>, ctx: StepContext<TArgs>) => Effect.Effect<void, CaptureDecodeFailed>;
|
|
155
161
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { Array as Array$1, Cause, Context, Deferred, Effect, Exit, Fiber, Match, Schema } from "effect";
|
|
2
2
|
import { screen } from "storybook/test";
|
|
3
3
|
//#region src/Capture.ts
|
|
4
|
+
const CaptureTag = { _tag: "Capture" };
|
|
4
5
|
function capture(name, options) {
|
|
5
6
|
return {
|
|
6
|
-
|
|
7
|
+
...CaptureTag,
|
|
7
8
|
name,
|
|
8
9
|
schema: options?.schema,
|
|
9
10
|
default: options?.default
|
|
@@ -80,6 +81,7 @@ const resolveKeywords = (steps) => {
|
|
|
80
81
|
})[1];
|
|
81
82
|
};
|
|
82
83
|
const STEP_TAG = "Step";
|
|
84
|
+
const StepTag = { _tag: STEP_TAG };
|
|
83
85
|
const buildModel = (keyword, statics, holes) => {
|
|
84
86
|
const parts = [];
|
|
85
87
|
const captures = [];
|
|
@@ -126,7 +128,7 @@ const makeStepCtor = (keyword) => {
|
|
|
126
128
|
return (handler) => {
|
|
127
129
|
const model = buildModel(keyword, statics, holes);
|
|
128
130
|
return {
|
|
129
|
-
|
|
131
|
+
...StepTag,
|
|
130
132
|
model,
|
|
131
133
|
run: (values, ctx) => Effect.forEach(model.captures, (cap) => decodeCapture(cap, values, model)).pipe(Effect.flatMap((decoded) => {
|
|
132
134
|
const caps = {};
|
|
@@ -344,7 +346,7 @@ const From = (story) => {
|
|
|
344
346
|
const play = story.play;
|
|
345
347
|
if (play === void 0) return [];
|
|
346
348
|
return [{
|
|
347
|
-
|
|
349
|
+
...StepTag,
|
|
348
350
|
model: {
|
|
349
351
|
keyword: "Given",
|
|
350
352
|
parts: ["the prior scenario completed"],
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/storybook-gherkin",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "2.0.1",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
8
8
|
"url": "git+https://github.com/systemfsoftware/systemfsoftware.git",
|
|
9
|
-
"directory": "packages/storybook
|
|
9
|
+
"directory": "packages/testing/specs/gherkin/storybook"
|
|
10
10
|
},
|
|
11
|
-
"homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/storybook
|
|
11
|
+
"homepage": "https://github.com/systemfsoftware/systemfsoftware/tree/main/packages/testing/specs/gherkin/storybook#readme",
|
|
12
12
|
"bugs": "https://github.com/systemfsoftware/systemfsoftware/issues",
|
|
13
13
|
"description": "Feature specs as Storybook stories — Gherkin Given/When/Then embedded in CSF with typed captures and scenario outlines, executing under Storybook's browser-mode play functions.",
|
|
14
14
|
"keywords": [
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"type-fest": "^5.8.0"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
|
-
"effect": "4.0.0-rc.
|
|
42
|
+
"effect": "^4.0.0-rc.111",
|
|
43
43
|
"storybook": ">=10.0.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"@types/react-dom": "^19.2.4",
|
|
52
52
|
"@vitest/browser": "^4",
|
|
53
53
|
"@vitest/browser-playwright": "^4",
|
|
54
|
-
"effect": "4.0.0-rc.
|
|
54
|
+
"effect": "4.0.0-rc.111",
|
|
55
55
|
"oxlint": "^1.77.0",
|
|
56
56
|
"playwright": "^1",
|
|
57
57
|
"react": "^19.2.8",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"typescript": "^7",
|
|
63
63
|
"vite": "^8",
|
|
64
64
|
"vitest": "^4.1.10",
|
|
65
|
-
"@systemfsoftware/tsconfig": "^1.3.
|
|
65
|
+
"@systemfsoftware/tsconfig": "^1.3.3",
|
|
66
66
|
"@systemfsoftware/oxlint-config": "^0.1.0"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|