executable-stories-react 0.9.0 → 0.10.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/dist/parse.d.cts CHANGED
@@ -1,238 +1,7 @@
1
+ import { StoryReport } from 'executable-stories-core';
2
+ export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-core';
1
3
  import { z } from 'zod';
2
4
 
3
- /**
4
- * OTel span types for trace waterfall rendering.
5
- *
6
- * Structurally compatible with autotel's SerializedSpan
7
- * and raw OTel nanosecond formats. No import dependency on autotel.
8
- */
9
- type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[];
10
- interface OtelSpan {
11
- spanId: string;
12
- parentSpanId?: string;
13
- name: string;
14
- /** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */
15
- startTimeMs?: number;
16
- durationMs?: number;
17
- /** Compatibility: raw OTel nanosecond timestamps */
18
- startTimeUnixNano?: number;
19
- endTimeUnixNano?: number;
20
- status: "ok" | "error" | "unset";
21
- statusMessage?: string;
22
- attributes?: Record<string, OtelAttributeValue>;
23
- }
24
-
25
- /** Phase tracks when the doc entry was added */
26
- type DocPhase = "static" | "runtime";
27
-
28
- /**
29
- * StoryReport — public, frozen contract for UI renderers.
30
- *
31
- * Distinct from internal TestRunResult. Pre-grouped feature → scenario tree,
32
- * with pre-computed summaries at every level. Adapter concerns (rawStatus,
33
- * projectName, titlePath) are stripped at the toStoryReport boundary.
34
- *
35
- * Versioning: semver-style "<major>.<minor>". Additive-only within a major.
36
- * Source of truth: schemas/story-report-v1.json. Types here must stay in sync.
37
- */
38
-
39
- type StoryReportSchemaVersion = `1.${number}`;
40
- type TestStatus = "passed" | "failed" | "skipped" | "pending";
41
- type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
42
- type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent";
43
- interface ReportSummary {
44
- total: number;
45
- passed: number;
46
- failed: number;
47
- skipped: number;
48
- pending: number;
49
- durationMs: number;
50
- }
51
- interface ReportTicket {
52
- id: string;
53
- url?: string;
54
- }
55
- interface ReportAttachment {
56
- name: string;
57
- mediaType: string;
58
- body: string;
59
- contentEncoding: "BASE64" | "IDENTITY";
60
- }
61
- interface ReportCIInfo {
62
- name: string;
63
- url?: string;
64
- buildNumber?: string;
65
- branch?: string;
66
- commitSha?: string;
67
- prNumber?: string;
68
- }
69
- interface ReportCoverageSummary {
70
- linesPct?: number;
71
- branchesPct?: number;
72
- functionsPct?: number;
73
- statementsPct?: number;
74
- }
75
- type ReportDocEntry = ReportDocNote | ReportDocTag | ReportDocKv | ReportDocCode | ReportDocTable | ReportDocLink | ReportDocSection | ReportDocMermaid | ReportDocScreenshot | ReportDocVideo | ReportDocHtml | ReportDocState | ReportDocCustom;
76
- interface ReportDocNote {
77
- kind: "note";
78
- text: string;
79
- phase: DocPhase;
80
- children?: ReportDocEntry[];
81
- }
82
- interface ReportDocTag {
83
- kind: "tag";
84
- names: string[];
85
- phase: DocPhase;
86
- children?: ReportDocEntry[];
87
- }
88
- interface ReportDocKv {
89
- kind: "kv";
90
- label: string;
91
- value: unknown;
92
- phase: DocPhase;
93
- children?: ReportDocEntry[];
94
- }
95
- interface ReportDocCode {
96
- kind: "code";
97
- label: string;
98
- content: string;
99
- lang?: string;
100
- phase: DocPhase;
101
- children?: ReportDocEntry[];
102
- }
103
- interface ReportDocTable {
104
- kind: "table";
105
- label: string;
106
- columns: string[];
107
- rows: string[][];
108
- phase: DocPhase;
109
- children?: ReportDocEntry[];
110
- }
111
- interface ReportDocLink {
112
- kind: "link";
113
- label: string;
114
- url: string;
115
- phase: DocPhase;
116
- children?: ReportDocEntry[];
117
- }
118
- interface ReportDocSection {
119
- kind: "section";
120
- title: string;
121
- markdown: string;
122
- phase: DocPhase;
123
- children?: ReportDocEntry[];
124
- }
125
- interface ReportDocMermaid {
126
- kind: "mermaid";
127
- code: string;
128
- title?: string;
129
- phase: DocPhase;
130
- children?: ReportDocEntry[];
131
- }
132
- interface ReportDocScreenshot {
133
- kind: "screenshot";
134
- path: string;
135
- alt?: string;
136
- phase: DocPhase;
137
- children?: ReportDocEntry[];
138
- }
139
- interface ReportDocVideo {
140
- kind: "video";
141
- path: string;
142
- caption?: string;
143
- poster?: string;
144
- phase: DocPhase;
145
- children?: ReportDocEntry[];
146
- }
147
- interface ReportDocHtml {
148
- kind: "html";
149
- /** Local HTML file path (exactly one of path/url/content) */
150
- path?: string;
151
- /** Remote URL rendered via iframe src (exactly one of path/url/content) */
152
- url?: string;
153
- /** Inline HTML content rendered via iframe srcdoc (exactly one of path/url/content) */
154
- content?: string;
155
- title?: string;
156
- /** Iframe height: number → px, string passed through (e.g. "60vh"). Default 400px. */
157
- height?: number | string;
158
- phase: DocPhase;
159
- children?: ReportDocEntry[];
160
- }
161
- interface ReportDocState {
162
- kind: "state";
163
- /** Entity name ("Basket") — diff identity across steps. Unlabeled states share one lane. */
164
- label?: string;
165
- /** JSON-serializable snapshot of the state at this step. */
166
- value: unknown;
167
- phase: DocPhase;
168
- children?: ReportDocEntry[];
169
- }
170
- interface ReportDocCustom {
171
- kind: "custom";
172
- type: string;
173
- data: unknown;
174
- phase: DocPhase;
175
- children?: ReportDocEntry[];
176
- }
177
- interface ReportStep {
178
- id: string;
179
- index: number;
180
- keyword: StepKeyword;
181
- text: string;
182
- status: TestStatus;
183
- durationMs: number;
184
- errorMessage?: string;
185
- mode?: StepMode;
186
- docEntries: ReportDocEntry[];
187
- }
188
- interface ReportScenario {
189
- id: string;
190
- title: string;
191
- status: TestStatus;
192
- /**
193
- * True for scenarios authored with the framework's todo modifier
194
- * (e.g. `it.todo`): specified behavior with no implementation yet.
195
- * Canonical status stays "pending"; this flags why.
196
- */
197
- planned?: boolean;
198
- durationMs: number;
199
- tags: string[];
200
- tickets?: ReportTicket[];
201
- /** Product-code paths/globs this scenario exercises (project-root-relative). */
202
- covers?: string[];
203
- sourceLine?: number;
204
- errorMessage?: string;
205
- errorStack?: string;
206
- retry: number;
207
- retries: number;
208
- docEntries: ReportDocEntry[];
209
- steps: ReportStep[];
210
- attachments: ReportAttachment[];
211
- /** OTel spans for the trace waterfall (carried through from the run). */
212
- otelSpans?: OtelSpan[];
213
- }
214
- interface ReportFeature {
215
- id: string;
216
- title: string;
217
- sourceFile: string;
218
- summary: ReportSummary;
219
- scenarios: ReportScenario[];
220
- }
221
- interface StoryReport {
222
- schemaVersion: StoryReportSchemaVersion;
223
- runId: string;
224
- startedAtMs: number;
225
- finishedAtMs: number;
226
- durationMs: number;
227
- projectRoot: string;
228
- packageVersion?: string;
229
- gitSha?: string;
230
- ci?: ReportCIInfo;
231
- coverage?: ReportCoverageSummary;
232
- summary: ReportSummary;
233
- features: ReportFeature[];
234
- }
235
-
236
5
  /**
237
6
  * Result<T> — explicit success/error type matching the cookbook convention.
238
7
  *
@@ -287,4 +56,4 @@ declare const STORY_REPORT_SCHEMA_MAJOR: 1;
287
56
 
288
57
  declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
289
58
 
290
- export { type ReportParseError, type ReportParseErrorCode, type Result, STORY_REPORT_SCHEMA_MAJOR, type StoryReport, type ReportDocEntry as StoryReportDocEntry, type ReportFeature as StoryReportFeature, type ReportScenario as StoryReportScenario, type ReportStep as StoryReportStep, type ReportSummary as StoryReportSummary, err, ok, parseStoryReport, storyReportSchema };
59
+ export { type ReportParseError, type ReportParseErrorCode, type Result, STORY_REPORT_SCHEMA_MAJOR, err, ok, parseStoryReport, storyReportSchema };
package/dist/parse.d.ts CHANGED
@@ -1,238 +1,7 @@
1
+ import { StoryReport } from 'executable-stories-core';
2
+ export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-core';
1
3
  import { z } from 'zod';
2
4
 
3
- /**
4
- * OTel span types for trace waterfall rendering.
5
- *
6
- * Structurally compatible with autotel's SerializedSpan
7
- * and raw OTel nanosecond formats. No import dependency on autotel.
8
- */
9
- type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[];
10
- interface OtelSpan {
11
- spanId: string;
12
- parentSpanId?: string;
13
- name: string;
14
- /** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */
15
- startTimeMs?: number;
16
- durationMs?: number;
17
- /** Compatibility: raw OTel nanosecond timestamps */
18
- startTimeUnixNano?: number;
19
- endTimeUnixNano?: number;
20
- status: "ok" | "error" | "unset";
21
- statusMessage?: string;
22
- attributes?: Record<string, OtelAttributeValue>;
23
- }
24
-
25
- /** Phase tracks when the doc entry was added */
26
- type DocPhase = "static" | "runtime";
27
-
28
- /**
29
- * StoryReport — public, frozen contract for UI renderers.
30
- *
31
- * Distinct from internal TestRunResult. Pre-grouped feature → scenario tree,
32
- * with pre-computed summaries at every level. Adapter concerns (rawStatus,
33
- * projectName, titlePath) are stripped at the toStoryReport boundary.
34
- *
35
- * Versioning: semver-style "<major>.<minor>". Additive-only within a major.
36
- * Source of truth: schemas/story-report-v1.json. Types here must stay in sync.
37
- */
38
-
39
- type StoryReportSchemaVersion = `1.${number}`;
40
- type TestStatus = "passed" | "failed" | "skipped" | "pending";
41
- type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
42
- type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent";
43
- interface ReportSummary {
44
- total: number;
45
- passed: number;
46
- failed: number;
47
- skipped: number;
48
- pending: number;
49
- durationMs: number;
50
- }
51
- interface ReportTicket {
52
- id: string;
53
- url?: string;
54
- }
55
- interface ReportAttachment {
56
- name: string;
57
- mediaType: string;
58
- body: string;
59
- contentEncoding: "BASE64" | "IDENTITY";
60
- }
61
- interface ReportCIInfo {
62
- name: string;
63
- url?: string;
64
- buildNumber?: string;
65
- branch?: string;
66
- commitSha?: string;
67
- prNumber?: string;
68
- }
69
- interface ReportCoverageSummary {
70
- linesPct?: number;
71
- branchesPct?: number;
72
- functionsPct?: number;
73
- statementsPct?: number;
74
- }
75
- type ReportDocEntry = ReportDocNote | ReportDocTag | ReportDocKv | ReportDocCode | ReportDocTable | ReportDocLink | ReportDocSection | ReportDocMermaid | ReportDocScreenshot | ReportDocVideo | ReportDocHtml | ReportDocState | ReportDocCustom;
76
- interface ReportDocNote {
77
- kind: "note";
78
- text: string;
79
- phase: DocPhase;
80
- children?: ReportDocEntry[];
81
- }
82
- interface ReportDocTag {
83
- kind: "tag";
84
- names: string[];
85
- phase: DocPhase;
86
- children?: ReportDocEntry[];
87
- }
88
- interface ReportDocKv {
89
- kind: "kv";
90
- label: string;
91
- value: unknown;
92
- phase: DocPhase;
93
- children?: ReportDocEntry[];
94
- }
95
- interface ReportDocCode {
96
- kind: "code";
97
- label: string;
98
- content: string;
99
- lang?: string;
100
- phase: DocPhase;
101
- children?: ReportDocEntry[];
102
- }
103
- interface ReportDocTable {
104
- kind: "table";
105
- label: string;
106
- columns: string[];
107
- rows: string[][];
108
- phase: DocPhase;
109
- children?: ReportDocEntry[];
110
- }
111
- interface ReportDocLink {
112
- kind: "link";
113
- label: string;
114
- url: string;
115
- phase: DocPhase;
116
- children?: ReportDocEntry[];
117
- }
118
- interface ReportDocSection {
119
- kind: "section";
120
- title: string;
121
- markdown: string;
122
- phase: DocPhase;
123
- children?: ReportDocEntry[];
124
- }
125
- interface ReportDocMermaid {
126
- kind: "mermaid";
127
- code: string;
128
- title?: string;
129
- phase: DocPhase;
130
- children?: ReportDocEntry[];
131
- }
132
- interface ReportDocScreenshot {
133
- kind: "screenshot";
134
- path: string;
135
- alt?: string;
136
- phase: DocPhase;
137
- children?: ReportDocEntry[];
138
- }
139
- interface ReportDocVideo {
140
- kind: "video";
141
- path: string;
142
- caption?: string;
143
- poster?: string;
144
- phase: DocPhase;
145
- children?: ReportDocEntry[];
146
- }
147
- interface ReportDocHtml {
148
- kind: "html";
149
- /** Local HTML file path (exactly one of path/url/content) */
150
- path?: string;
151
- /** Remote URL rendered via iframe src (exactly one of path/url/content) */
152
- url?: string;
153
- /** Inline HTML content rendered via iframe srcdoc (exactly one of path/url/content) */
154
- content?: string;
155
- title?: string;
156
- /** Iframe height: number → px, string passed through (e.g. "60vh"). Default 400px. */
157
- height?: number | string;
158
- phase: DocPhase;
159
- children?: ReportDocEntry[];
160
- }
161
- interface ReportDocState {
162
- kind: "state";
163
- /** Entity name ("Basket") — diff identity across steps. Unlabeled states share one lane. */
164
- label?: string;
165
- /** JSON-serializable snapshot of the state at this step. */
166
- value: unknown;
167
- phase: DocPhase;
168
- children?: ReportDocEntry[];
169
- }
170
- interface ReportDocCustom {
171
- kind: "custom";
172
- type: string;
173
- data: unknown;
174
- phase: DocPhase;
175
- children?: ReportDocEntry[];
176
- }
177
- interface ReportStep {
178
- id: string;
179
- index: number;
180
- keyword: StepKeyword;
181
- text: string;
182
- status: TestStatus;
183
- durationMs: number;
184
- errorMessage?: string;
185
- mode?: StepMode;
186
- docEntries: ReportDocEntry[];
187
- }
188
- interface ReportScenario {
189
- id: string;
190
- title: string;
191
- status: TestStatus;
192
- /**
193
- * True for scenarios authored with the framework's todo modifier
194
- * (e.g. `it.todo`): specified behavior with no implementation yet.
195
- * Canonical status stays "pending"; this flags why.
196
- */
197
- planned?: boolean;
198
- durationMs: number;
199
- tags: string[];
200
- tickets?: ReportTicket[];
201
- /** Product-code paths/globs this scenario exercises (project-root-relative). */
202
- covers?: string[];
203
- sourceLine?: number;
204
- errorMessage?: string;
205
- errorStack?: string;
206
- retry: number;
207
- retries: number;
208
- docEntries: ReportDocEntry[];
209
- steps: ReportStep[];
210
- attachments: ReportAttachment[];
211
- /** OTel spans for the trace waterfall (carried through from the run). */
212
- otelSpans?: OtelSpan[];
213
- }
214
- interface ReportFeature {
215
- id: string;
216
- title: string;
217
- sourceFile: string;
218
- summary: ReportSummary;
219
- scenarios: ReportScenario[];
220
- }
221
- interface StoryReport {
222
- schemaVersion: StoryReportSchemaVersion;
223
- runId: string;
224
- startedAtMs: number;
225
- finishedAtMs: number;
226
- durationMs: number;
227
- projectRoot: string;
228
- packageVersion?: string;
229
- gitSha?: string;
230
- ci?: ReportCIInfo;
231
- coverage?: ReportCoverageSummary;
232
- summary: ReportSummary;
233
- features: ReportFeature[];
234
- }
235
-
236
5
  /**
237
6
  * Result<T> — explicit success/error type matching the cookbook convention.
238
7
  *
@@ -287,4 +56,4 @@ declare const STORY_REPORT_SCHEMA_MAJOR: 1;
287
56
 
288
57
  declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
289
58
 
290
- export { type ReportParseError, type ReportParseErrorCode, type Result, STORY_REPORT_SCHEMA_MAJOR, type StoryReport, type ReportDocEntry as StoryReportDocEntry, type ReportFeature as StoryReportFeature, type ReportScenario as StoryReportScenario, type ReportStep as StoryReportStep, type ReportSummary as StoryReportSummary, err, ok, parseStoryReport, storyReportSchema };
59
+ export { type ReportParseError, type ReportParseErrorCode, type Result, STORY_REPORT_SCHEMA_MAJOR, err, ok, parseStoryReport, storyReportSchema };