@systemfsoftware/storybook-gherkin 2.0.1 → 3.0.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 +18 -4
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @systemfsoftware/storybook-gherkin
|
|
2
2
|
|
|
3
|
+
## 3.0.0
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- Scenario titles are now enforced as prose at the type level: `scenario` and `scenarioOutline` reject any title that either starts with "Should" (the `Should_[Behavior]_When_[Condition]` unit-test naming convention) or lacks an ASCII space between words (every concatenated-token shape — PascalCase, snake_case, CamelCase — that reads as a unit-test name rather than prose). A rejected title fails to type-check with the rule in the diagnostic. Titles that are not string literals are unaffected.
|
|
8
|
+
|
|
9
|
+
## 2.0.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Peer Effect requirement advances to 4.0.0-rc.112. No API changes.
|
|
14
|
+
|
|
3
15
|
## 2.0.1
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -195,16 +195,30 @@ interface FeatureOptions {
|
|
|
195
195
|
* `Steps(...)` / `From(...)`, or — in first position only — an options object.
|
|
196
196
|
*/
|
|
197
197
|
type StepArg<TArgs> = Step<TArgs> | readonly Step<TArgs>[];
|
|
198
|
+
/**
|
|
199
|
+
* A scenario title names a concrete situation in natural-language prose. Two
|
|
200
|
+
* shape checks keep DAMP `Should_[Behavior]_When_[Condition]` unit-test names —
|
|
201
|
+
* and every concatenated-token title shaped like one — out of the call site:
|
|
202
|
+
* 1. the literal must not start with `Should`;
|
|
203
|
+
* 2. the literal must contain at least one ASCII space (a single-word title is
|
|
204
|
+
* a test name, not prose).
|
|
205
|
+
* Either check failing maps to `ScenarioTitleRejected`, so the call fails to
|
|
206
|
+
* type-check with the rule in the diagnostic. Non-literal titles (widened
|
|
207
|
+
* `string`) pass through untouched — a runtime guard would catch those, but
|
|
208
|
+
* the brand is the contract this skill ships.
|
|
209
|
+
*/
|
|
210
|
+
type ScenarioTitleRejected<T extends string> = `Scenario titles are natural-language prose of a concrete situation, not DAMP Should_[Behavior]_When_[Condition] unit-test names. Got: ${T}` | `Scenario title must be natural-language prose (at least one space separates words); got: ${T}`;
|
|
211
|
+
type ScenarioTitle<T extends string> = T extends `Should${string}` ? ScenarioTitleRejected<T> : T extends `${string} ${string}` ? T : ScenarioTitleRejected<T>;
|
|
198
212
|
interface ScenarioFn<TArgs> {
|
|
199
|
-
(name:
|
|
200
|
-
(name:
|
|
213
|
+
<TName extends string>(name: ScenarioTitle<TName>, ...steps: readonly StepArg<TArgs>[]): StorySpec<TArgs>;
|
|
214
|
+
<TName extends string>(name: ScenarioTitle<TName>, options: ScenarioOptions, ...steps: readonly StepArg<TArgs>[]): StorySpec<TArgs>;
|
|
201
215
|
}
|
|
202
216
|
interface OutlineBuilder<TArgs> {
|
|
203
217
|
readonly examples: (rows: readonly ExampleRow[]) => Record<string, StorySpec<TArgs>>;
|
|
204
218
|
}
|
|
205
219
|
interface OutlineFn<TArgs> {
|
|
206
|
-
(name:
|
|
207
|
-
(name:
|
|
220
|
+
<TName extends string>(name: ScenarioTitle<TName>, ...steps: readonly StepArg<TArgs>[]): OutlineBuilder<TArgs>;
|
|
221
|
+
<TName extends string>(name: ScenarioTitle<TName>, options: ScenarioOptions, ...steps: readonly StepArg<TArgs>[]): OutlineBuilder<TArgs>;
|
|
208
222
|
}
|
|
209
223
|
interface RuleScope<TArgs> {
|
|
210
224
|
readonly scenario: ScenarioFn<TArgs>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@systemfsoftware/storybook-gherkin",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "3.0.0",
|
|
5
5
|
"author": "Ryan Lee <drdgvhbh@gmail.com>",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -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.112",
|
|
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.112",
|
|
55
55
|
"oxlint": "^1.77.0",
|
|
56
56
|
"playwright": "^1",
|
|
57
57
|
"react": "^19.2.8",
|
|
@@ -62,8 +62,8 @@
|
|
|
62
62
|
"typescript": "^7",
|
|
63
63
|
"vite": "^8",
|
|
64
64
|
"vitest": "^4.1.10",
|
|
65
|
-
"@systemfsoftware/
|
|
66
|
-
"@systemfsoftware/
|
|
65
|
+
"@systemfsoftware/oxlint-config": "^0.1.0",
|
|
66
|
+
"@systemfsoftware/tsconfig": "^1.3.3"
|
|
67
67
|
},
|
|
68
68
|
"publishConfig": {
|
|
69
69
|
"provenance": true
|