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/index.cjs +540 -483
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -235
- package/dist/index.d.ts +50 -235
- package/dist/index.js +525 -475
- package/dist/index.js.map +1 -1
- package/dist/interactive.cjs +615 -689
- package/dist/interactive.cjs.map +1 -1
- package/dist/interactive.d.cts +1 -233
- package/dist/interactive.d.ts +1 -233
- package/dist/interactive.js +607 -681
- package/dist/interactive.js.map +1 -1
- package/dist/parse.d.cts +3 -234
- package/dist/parse.d.ts +3 -234
- package/dist/report-island.global.js +28 -28
- package/dist/ssr.cjs +492 -449
- package/dist/ssr.cjs.map +1 -1
- package/dist/ssr.d.cts +1 -232
- package/dist/ssr.d.ts +1 -232
- package/dist/ssr.js +484 -441
- package/dist/ssr.js.map +1 -1
- package/dist/tailwind.css +1 -1
- package/package.json +4 -4
package/dist/index.d.cts
CHANGED
|
@@ -1,241 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, Ref } from 'react';
|
|
3
|
+
import * as executable_stories_core from 'executable-stories-core';
|
|
4
|
+
import { ReportDocMermaid, ReportDocCode, ReportDocSection, ReportDocCustom, StoryReport, ReportSummary as ReportSummary$1, ReportAttachment, ReportFeature as ReportFeature$1, ReportScenario as ReportScenario$1, ReportStep, ReportDocEntry, ReportDocNote, ReportDocTag, ReportDocKv, ReportDocTable, ReportDocLink, ReportDocScreenshot, ReportDocVideo, ReportDocHtml } from 'executable-stories-core';
|
|
5
|
+
export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-core';
|
|
6
|
+
import { OtelSpan } from 'executable-stories-core/types/otel';
|
|
3
7
|
import * as mermaid from 'mermaid';
|
|
4
8
|
import { z } from 'zod';
|
|
5
9
|
|
|
6
|
-
/**
|
|
7
|
-
* OTel span types for trace waterfall rendering.
|
|
8
|
-
*
|
|
9
|
-
* Structurally compatible with autotel's SerializedSpan
|
|
10
|
-
* and raw OTel nanosecond formats. No import dependency on autotel.
|
|
11
|
-
*/
|
|
12
|
-
type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
13
|
-
interface OtelSpan {
|
|
14
|
-
spanId: string;
|
|
15
|
-
parentSpanId?: string;
|
|
16
|
-
name: string;
|
|
17
|
-
/** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */
|
|
18
|
-
startTimeMs?: number;
|
|
19
|
-
durationMs?: number;
|
|
20
|
-
/** Compatibility: raw OTel nanosecond timestamps */
|
|
21
|
-
startTimeUnixNano?: number;
|
|
22
|
-
endTimeUnixNano?: number;
|
|
23
|
-
status: "ok" | "error" | "unset";
|
|
24
|
-
statusMessage?: string;
|
|
25
|
-
attributes?: Record<string, OtelAttributeValue>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** Phase tracks when the doc entry was added */
|
|
29
|
-
type DocPhase = "static" | "runtime";
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* StoryReport — public, frozen contract for UI renderers.
|
|
33
|
-
*
|
|
34
|
-
* Distinct from internal TestRunResult. Pre-grouped feature → scenario tree,
|
|
35
|
-
* with pre-computed summaries at every level. Adapter concerns (rawStatus,
|
|
36
|
-
* projectName, titlePath) are stripped at the toStoryReport boundary.
|
|
37
|
-
*
|
|
38
|
-
* Versioning: semver-style "<major>.<minor>". Additive-only within a major.
|
|
39
|
-
* Source of truth: schemas/story-report-v1.json. Types here must stay in sync.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
type StoryReportSchemaVersion = `1.${number}`;
|
|
43
|
-
type TestStatus = "passed" | "failed" | "skipped" | "pending";
|
|
44
|
-
type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
|
|
45
|
-
type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent";
|
|
46
|
-
interface ReportSummary$1 {
|
|
47
|
-
total: number;
|
|
48
|
-
passed: number;
|
|
49
|
-
failed: number;
|
|
50
|
-
skipped: number;
|
|
51
|
-
pending: number;
|
|
52
|
-
durationMs: number;
|
|
53
|
-
}
|
|
54
|
-
interface ReportTicket {
|
|
55
|
-
id: string;
|
|
56
|
-
url?: string;
|
|
57
|
-
}
|
|
58
|
-
interface ReportAttachment {
|
|
59
|
-
name: string;
|
|
60
|
-
mediaType: string;
|
|
61
|
-
body: string;
|
|
62
|
-
contentEncoding: "BASE64" | "IDENTITY";
|
|
63
|
-
}
|
|
64
|
-
interface ReportCIInfo {
|
|
65
|
-
name: string;
|
|
66
|
-
url?: string;
|
|
67
|
-
buildNumber?: string;
|
|
68
|
-
branch?: string;
|
|
69
|
-
commitSha?: string;
|
|
70
|
-
prNumber?: string;
|
|
71
|
-
}
|
|
72
|
-
interface ReportCoverageSummary {
|
|
73
|
-
linesPct?: number;
|
|
74
|
-
branchesPct?: number;
|
|
75
|
-
functionsPct?: number;
|
|
76
|
-
statementsPct?: number;
|
|
77
|
-
}
|
|
78
|
-
type ReportDocEntry = ReportDocNote | ReportDocTag | ReportDocKv | ReportDocCode | ReportDocTable | ReportDocLink | ReportDocSection | ReportDocMermaid | ReportDocScreenshot | ReportDocVideo | ReportDocHtml | ReportDocState | ReportDocCustom;
|
|
79
|
-
interface ReportDocNote {
|
|
80
|
-
kind: "note";
|
|
81
|
-
text: string;
|
|
82
|
-
phase: DocPhase;
|
|
83
|
-
children?: ReportDocEntry[];
|
|
84
|
-
}
|
|
85
|
-
interface ReportDocTag {
|
|
86
|
-
kind: "tag";
|
|
87
|
-
names: string[];
|
|
88
|
-
phase: DocPhase;
|
|
89
|
-
children?: ReportDocEntry[];
|
|
90
|
-
}
|
|
91
|
-
interface ReportDocKv {
|
|
92
|
-
kind: "kv";
|
|
93
|
-
label: string;
|
|
94
|
-
value: unknown;
|
|
95
|
-
phase: DocPhase;
|
|
96
|
-
children?: ReportDocEntry[];
|
|
97
|
-
}
|
|
98
|
-
interface ReportDocCode {
|
|
99
|
-
kind: "code";
|
|
100
|
-
label: string;
|
|
101
|
-
content: string;
|
|
102
|
-
lang?: string;
|
|
103
|
-
phase: DocPhase;
|
|
104
|
-
children?: ReportDocEntry[];
|
|
105
|
-
}
|
|
106
|
-
interface ReportDocTable {
|
|
107
|
-
kind: "table";
|
|
108
|
-
label: string;
|
|
109
|
-
columns: string[];
|
|
110
|
-
rows: string[][];
|
|
111
|
-
phase: DocPhase;
|
|
112
|
-
children?: ReportDocEntry[];
|
|
113
|
-
}
|
|
114
|
-
interface ReportDocLink {
|
|
115
|
-
kind: "link";
|
|
116
|
-
label: string;
|
|
117
|
-
url: string;
|
|
118
|
-
phase: DocPhase;
|
|
119
|
-
children?: ReportDocEntry[];
|
|
120
|
-
}
|
|
121
|
-
interface ReportDocSection {
|
|
122
|
-
kind: "section";
|
|
123
|
-
title: string;
|
|
124
|
-
markdown: string;
|
|
125
|
-
phase: DocPhase;
|
|
126
|
-
children?: ReportDocEntry[];
|
|
127
|
-
}
|
|
128
|
-
interface ReportDocMermaid {
|
|
129
|
-
kind: "mermaid";
|
|
130
|
-
code: string;
|
|
131
|
-
title?: string;
|
|
132
|
-
phase: DocPhase;
|
|
133
|
-
children?: ReportDocEntry[];
|
|
134
|
-
}
|
|
135
|
-
interface ReportDocScreenshot {
|
|
136
|
-
kind: "screenshot";
|
|
137
|
-
path: string;
|
|
138
|
-
alt?: string;
|
|
139
|
-
phase: DocPhase;
|
|
140
|
-
children?: ReportDocEntry[];
|
|
141
|
-
}
|
|
142
|
-
interface ReportDocVideo {
|
|
143
|
-
kind: "video";
|
|
144
|
-
path: string;
|
|
145
|
-
caption?: string;
|
|
146
|
-
poster?: string;
|
|
147
|
-
phase: DocPhase;
|
|
148
|
-
children?: ReportDocEntry[];
|
|
149
|
-
}
|
|
150
|
-
interface ReportDocHtml {
|
|
151
|
-
kind: "html";
|
|
152
|
-
/** Local HTML file path (exactly one of path/url/content) */
|
|
153
|
-
path?: string;
|
|
154
|
-
/** Remote URL rendered via iframe src (exactly one of path/url/content) */
|
|
155
|
-
url?: string;
|
|
156
|
-
/** Inline HTML content rendered via iframe srcdoc (exactly one of path/url/content) */
|
|
157
|
-
content?: string;
|
|
158
|
-
title?: string;
|
|
159
|
-
/** Iframe height: number → px, string passed through (e.g. "60vh"). Default 400px. */
|
|
160
|
-
height?: number | string;
|
|
161
|
-
phase: DocPhase;
|
|
162
|
-
children?: ReportDocEntry[];
|
|
163
|
-
}
|
|
164
|
-
interface ReportDocState {
|
|
165
|
-
kind: "state";
|
|
166
|
-
/** Entity name ("Basket") — diff identity across steps. Unlabeled states share one lane. */
|
|
167
|
-
label?: string;
|
|
168
|
-
/** JSON-serializable snapshot of the state at this step. */
|
|
169
|
-
value: unknown;
|
|
170
|
-
phase: DocPhase;
|
|
171
|
-
children?: ReportDocEntry[];
|
|
172
|
-
}
|
|
173
|
-
interface ReportDocCustom {
|
|
174
|
-
kind: "custom";
|
|
175
|
-
type: string;
|
|
176
|
-
data: unknown;
|
|
177
|
-
phase: DocPhase;
|
|
178
|
-
children?: ReportDocEntry[];
|
|
179
|
-
}
|
|
180
|
-
interface ReportStep {
|
|
181
|
-
id: string;
|
|
182
|
-
index: number;
|
|
183
|
-
keyword: StepKeyword;
|
|
184
|
-
text: string;
|
|
185
|
-
status: TestStatus;
|
|
186
|
-
durationMs: number;
|
|
187
|
-
errorMessage?: string;
|
|
188
|
-
mode?: StepMode;
|
|
189
|
-
docEntries: ReportDocEntry[];
|
|
190
|
-
}
|
|
191
|
-
interface ReportScenario$1 {
|
|
192
|
-
id: string;
|
|
193
|
-
title: string;
|
|
194
|
-
status: TestStatus;
|
|
195
|
-
/**
|
|
196
|
-
* True for scenarios authored with the framework's todo modifier
|
|
197
|
-
* (e.g. `it.todo`): specified behavior with no implementation yet.
|
|
198
|
-
* Canonical status stays "pending"; this flags why.
|
|
199
|
-
*/
|
|
200
|
-
planned?: boolean;
|
|
201
|
-
durationMs: number;
|
|
202
|
-
tags: string[];
|
|
203
|
-
tickets?: ReportTicket[];
|
|
204
|
-
/** Product-code paths/globs this scenario exercises (project-root-relative). */
|
|
205
|
-
covers?: string[];
|
|
206
|
-
sourceLine?: number;
|
|
207
|
-
errorMessage?: string;
|
|
208
|
-
errorStack?: string;
|
|
209
|
-
retry: number;
|
|
210
|
-
retries: number;
|
|
211
|
-
docEntries: ReportDocEntry[];
|
|
212
|
-
steps: ReportStep[];
|
|
213
|
-
attachments: ReportAttachment[];
|
|
214
|
-
/** OTel spans for the trace waterfall (carried through from the run). */
|
|
215
|
-
otelSpans?: OtelSpan[];
|
|
216
|
-
}
|
|
217
|
-
interface ReportFeature$1 {
|
|
218
|
-
id: string;
|
|
219
|
-
title: string;
|
|
220
|
-
sourceFile: string;
|
|
221
|
-
summary: ReportSummary$1;
|
|
222
|
-
scenarios: ReportScenario$1[];
|
|
223
|
-
}
|
|
224
|
-
interface StoryReport {
|
|
225
|
-
schemaVersion: StoryReportSchemaVersion;
|
|
226
|
-
runId: string;
|
|
227
|
-
startedAtMs: number;
|
|
228
|
-
finishedAtMs: number;
|
|
229
|
-
durationMs: number;
|
|
230
|
-
projectRoot: string;
|
|
231
|
-
packageVersion?: string;
|
|
232
|
-
gitSha?: string;
|
|
233
|
-
ci?: ReportCIInfo;
|
|
234
|
-
coverage?: ReportCoverageSummary;
|
|
235
|
-
summary: ReportSummary$1;
|
|
236
|
-
features: ReportFeature$1[];
|
|
237
|
-
}
|
|
238
|
-
|
|
239
10
|
/**
|
|
240
11
|
* Result<T> — explicit success/error type matching the cookbook convention.
|
|
241
12
|
*
|
|
@@ -513,6 +284,50 @@ declare function DocCustom({ entry }: {
|
|
|
513
284
|
entry: ReportDocCustom;
|
|
514
285
|
}): react.JSX.Element;
|
|
515
286
|
|
|
287
|
+
declare const FILE_TREE_TYPE = "file-tree";
|
|
288
|
+
declare const DATA_MODEL_TYPE = "data-model";
|
|
289
|
+
/** Change annotation shared by both blocks. */
|
|
290
|
+
type ChangeKind = "added" | "modified" | "removed" | "renamed";
|
|
291
|
+
interface FileEntry {
|
|
292
|
+
path: string;
|
|
293
|
+
change?: ChangeKind;
|
|
294
|
+
note?: string;
|
|
295
|
+
}
|
|
296
|
+
interface FileTreeData {
|
|
297
|
+
title?: string;
|
|
298
|
+
authored?: string;
|
|
299
|
+
files: FileEntry[];
|
|
300
|
+
}
|
|
301
|
+
declare function parseFileTree(data: unknown): FileTreeData | undefined;
|
|
302
|
+
declare function FileTreeBlock({ entry }: {
|
|
303
|
+
entry: ReportDocCustom;
|
|
304
|
+
}): react.JSX.Element;
|
|
305
|
+
interface ModelField {
|
|
306
|
+
name: string;
|
|
307
|
+
type?: string;
|
|
308
|
+
note?: string;
|
|
309
|
+
change?: ChangeKind;
|
|
310
|
+
}
|
|
311
|
+
interface DataModelData {
|
|
312
|
+
title?: string;
|
|
313
|
+
authored?: string;
|
|
314
|
+
name?: string;
|
|
315
|
+
fields: ModelField[];
|
|
316
|
+
}
|
|
317
|
+
declare function parseDataModel(data: unknown): DataModelData | undefined;
|
|
318
|
+
declare function DataModelBlock({ entry }: {
|
|
319
|
+
entry: ReportDocCustom;
|
|
320
|
+
}): react.JSX.Element;
|
|
321
|
+
/**
|
|
322
|
+
* The narrative block renderers, ready to spread into `customRenderers`.
|
|
323
|
+
* Consumer-supplied renderers for the same type win, so a project can swap
|
|
324
|
+
* either one out.
|
|
325
|
+
*/
|
|
326
|
+
declare const narrativeBlockRenderers: {
|
|
327
|
+
"file-tree": (entry: ReportDocCustom) => react.JSX.Element;
|
|
328
|
+
"data-model": (entry: ReportDocCustom) => react.JSX.Element;
|
|
329
|
+
};
|
|
330
|
+
|
|
516
331
|
type ExplorerStatus = "passed" | "failed" | "skipped" | "pending";
|
|
517
332
|
interface ExplorerScenario {
|
|
518
333
|
id: string;
|
|
@@ -617,7 +432,7 @@ interface ReportSchemaErrorProps {
|
|
|
617
432
|
}
|
|
618
433
|
declare function ReportSchemaError({ error }: ReportSchemaErrorProps): react.JSX.Element;
|
|
619
434
|
|
|
620
|
-
declare function useReport(): StoryReport;
|
|
435
|
+
declare function useReport(): executable_stories_core.StoryReport;
|
|
621
436
|
|
|
622
437
|
/**
|
|
623
438
|
* parseStoryReport — boundary validator. Accepts unknown input (file contents,
|
|
@@ -647,4 +462,4 @@ declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
|
647
462
|
|
|
648
463
|
declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
649
464
|
|
|
650
|
-
export { type BuiltinRenderers, type CustomRenderer, type CustomRenderers, DocCode, DocCustom, DocEntry, DocHtml, DocKv, DocLink, DocMermaid, DocNote, DocScreenshot, DocSection, DocTable, DocTag, DocVideo, type ExplorerScenario, type ExplorerStatus, MermaidDiagram, MermaidSource, Report, ReportAttachments, ReportDocEntries, type ReportDocEntriesProps, ReportEmpty, type ReportEmptyProps, ReportFeature, ReportFeatureList, type ReportFeatureProps, ReportMeta, type ReportParseError, type ReportParseErrorCode, type ReportProps, ReportRoot, type ReportRootProps, ReportScenario, ReportScenarioList, type ReportScenarioListProps, type ReportScenarioProps, ReportSchemaError, type ReportSchemaErrorProps, ReportStepItem, ReportSteps, type ReportStepsProps, ReportStoryboard, type ReportStoryboardProps, ReportSummary, type ReportSummaryProps, ReportSummaryView, type ReportSummaryViewProps, ReportTrace, type Result, type RunStreak, STORY_REPORT_SCHEMA_MAJOR, ScenarioExplorer, type ScenarioExplorerProps, type ScenarioHistoryMap, type ScenarioRunEvent, ScenarioRunHistory, type ScenarioRunStatus,
|
|
465
|
+
export { type BuiltinRenderers, type CustomRenderer, type CustomRenderers, DATA_MODEL_TYPE, DataModelBlock, type DataModelData, DocCode, DocCustom, DocEntry, DocHtml, DocKv, DocLink, DocMermaid, DocNote, DocScreenshot, DocSection, DocTable, DocTag, DocVideo, type ExplorerScenario, type ExplorerStatus, FILE_TREE_TYPE, FileTreeBlock, type FileTreeData, MermaidDiagram, MermaidSource, Report, ReportAttachments, ReportDocEntries, type ReportDocEntriesProps, ReportEmpty, type ReportEmptyProps, ReportFeature, ReportFeatureList, type ReportFeatureProps, ReportMeta, type ReportParseError, type ReportParseErrorCode, type ReportProps, ReportRoot, type ReportRootProps, ReportScenario, ReportScenarioList, type ReportScenarioListProps, type ReportScenarioProps, ReportSchemaError, type ReportSchemaErrorProps, ReportStepItem, ReportSteps, type ReportStepsProps, ReportStoryboard, type ReportStoryboardProps, ReportSummary, type ReportSummaryProps, ReportSummaryView, type ReportSummaryViewProps, ReportTrace, type Result, type RunStreak, STORY_REPORT_SCHEMA_MAJOR, ScenarioExplorer, type ScenarioExplorerProps, type ScenarioHistoryMap, type ScenarioRunEvent, ScenarioRunHistory, type ScenarioRunStatus, ciDisplayName, commitUrl, currentStreak, describeRunHistory, err, formatRelativeAge, isReportStale, narrativeBlockRenderers, ok, parseDataModel, parseFileTree, parseStoryReport, prUrl, reportLastRunMs, storyReportSchema, useBuiltinRenderers, useCustomRenderers, useReport };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,241 +1,12 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import { ReactNode, Ref } from 'react';
|
|
3
|
+
import * as executable_stories_core from 'executable-stories-core';
|
|
4
|
+
import { ReportDocMermaid, ReportDocCode, ReportDocSection, ReportDocCustom, StoryReport, ReportSummary as ReportSummary$1, ReportAttachment, ReportFeature as ReportFeature$1, ReportScenario as ReportScenario$1, ReportStep, ReportDocEntry, ReportDocNote, ReportDocTag, ReportDocKv, ReportDocTable, ReportDocLink, ReportDocScreenshot, ReportDocVideo, ReportDocHtml } from 'executable-stories-core';
|
|
5
|
+
export { StoryReport, ReportDocEntry as StoryReportDocEntry, ReportFeature as StoryReportFeature, ReportScenario as StoryReportScenario, ReportStep as StoryReportStep, ReportSummary as StoryReportSummary } from 'executable-stories-core';
|
|
6
|
+
import { OtelSpan } from 'executable-stories-core/types/otel';
|
|
3
7
|
import * as mermaid from 'mermaid';
|
|
4
8
|
import { z } from 'zod';
|
|
5
9
|
|
|
6
|
-
/**
|
|
7
|
-
* OTel span types for trace waterfall rendering.
|
|
8
|
-
*
|
|
9
|
-
* Structurally compatible with autotel's SerializedSpan
|
|
10
|
-
* and raw OTel nanosecond formats. No import dependency on autotel.
|
|
11
|
-
*/
|
|
12
|
-
type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
13
|
-
interface OtelSpan {
|
|
14
|
-
spanId: string;
|
|
15
|
-
parentSpanId?: string;
|
|
16
|
-
name: string;
|
|
17
|
-
/** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */
|
|
18
|
-
startTimeMs?: number;
|
|
19
|
-
durationMs?: number;
|
|
20
|
-
/** Compatibility: raw OTel nanosecond timestamps */
|
|
21
|
-
startTimeUnixNano?: number;
|
|
22
|
-
endTimeUnixNano?: number;
|
|
23
|
-
status: "ok" | "error" | "unset";
|
|
24
|
-
statusMessage?: string;
|
|
25
|
-
attributes?: Record<string, OtelAttributeValue>;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/** Phase tracks when the doc entry was added */
|
|
29
|
-
type DocPhase = "static" | "runtime";
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* StoryReport — public, frozen contract for UI renderers.
|
|
33
|
-
*
|
|
34
|
-
* Distinct from internal TestRunResult. Pre-grouped feature → scenario tree,
|
|
35
|
-
* with pre-computed summaries at every level. Adapter concerns (rawStatus,
|
|
36
|
-
* projectName, titlePath) are stripped at the toStoryReport boundary.
|
|
37
|
-
*
|
|
38
|
-
* Versioning: semver-style "<major>.<minor>". Additive-only within a major.
|
|
39
|
-
* Source of truth: schemas/story-report-v1.json. Types here must stay in sync.
|
|
40
|
-
*/
|
|
41
|
-
|
|
42
|
-
type StoryReportSchemaVersion = `1.${number}`;
|
|
43
|
-
type TestStatus = "passed" | "failed" | "skipped" | "pending";
|
|
44
|
-
type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
|
|
45
|
-
type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent";
|
|
46
|
-
interface ReportSummary$1 {
|
|
47
|
-
total: number;
|
|
48
|
-
passed: number;
|
|
49
|
-
failed: number;
|
|
50
|
-
skipped: number;
|
|
51
|
-
pending: number;
|
|
52
|
-
durationMs: number;
|
|
53
|
-
}
|
|
54
|
-
interface ReportTicket {
|
|
55
|
-
id: string;
|
|
56
|
-
url?: string;
|
|
57
|
-
}
|
|
58
|
-
interface ReportAttachment {
|
|
59
|
-
name: string;
|
|
60
|
-
mediaType: string;
|
|
61
|
-
body: string;
|
|
62
|
-
contentEncoding: "BASE64" | "IDENTITY";
|
|
63
|
-
}
|
|
64
|
-
interface ReportCIInfo {
|
|
65
|
-
name: string;
|
|
66
|
-
url?: string;
|
|
67
|
-
buildNumber?: string;
|
|
68
|
-
branch?: string;
|
|
69
|
-
commitSha?: string;
|
|
70
|
-
prNumber?: string;
|
|
71
|
-
}
|
|
72
|
-
interface ReportCoverageSummary {
|
|
73
|
-
linesPct?: number;
|
|
74
|
-
branchesPct?: number;
|
|
75
|
-
functionsPct?: number;
|
|
76
|
-
statementsPct?: number;
|
|
77
|
-
}
|
|
78
|
-
type ReportDocEntry = ReportDocNote | ReportDocTag | ReportDocKv | ReportDocCode | ReportDocTable | ReportDocLink | ReportDocSection | ReportDocMermaid | ReportDocScreenshot | ReportDocVideo | ReportDocHtml | ReportDocState | ReportDocCustom;
|
|
79
|
-
interface ReportDocNote {
|
|
80
|
-
kind: "note";
|
|
81
|
-
text: string;
|
|
82
|
-
phase: DocPhase;
|
|
83
|
-
children?: ReportDocEntry[];
|
|
84
|
-
}
|
|
85
|
-
interface ReportDocTag {
|
|
86
|
-
kind: "tag";
|
|
87
|
-
names: string[];
|
|
88
|
-
phase: DocPhase;
|
|
89
|
-
children?: ReportDocEntry[];
|
|
90
|
-
}
|
|
91
|
-
interface ReportDocKv {
|
|
92
|
-
kind: "kv";
|
|
93
|
-
label: string;
|
|
94
|
-
value: unknown;
|
|
95
|
-
phase: DocPhase;
|
|
96
|
-
children?: ReportDocEntry[];
|
|
97
|
-
}
|
|
98
|
-
interface ReportDocCode {
|
|
99
|
-
kind: "code";
|
|
100
|
-
label: string;
|
|
101
|
-
content: string;
|
|
102
|
-
lang?: string;
|
|
103
|
-
phase: DocPhase;
|
|
104
|
-
children?: ReportDocEntry[];
|
|
105
|
-
}
|
|
106
|
-
interface ReportDocTable {
|
|
107
|
-
kind: "table";
|
|
108
|
-
label: string;
|
|
109
|
-
columns: string[];
|
|
110
|
-
rows: string[][];
|
|
111
|
-
phase: DocPhase;
|
|
112
|
-
children?: ReportDocEntry[];
|
|
113
|
-
}
|
|
114
|
-
interface ReportDocLink {
|
|
115
|
-
kind: "link";
|
|
116
|
-
label: string;
|
|
117
|
-
url: string;
|
|
118
|
-
phase: DocPhase;
|
|
119
|
-
children?: ReportDocEntry[];
|
|
120
|
-
}
|
|
121
|
-
interface ReportDocSection {
|
|
122
|
-
kind: "section";
|
|
123
|
-
title: string;
|
|
124
|
-
markdown: string;
|
|
125
|
-
phase: DocPhase;
|
|
126
|
-
children?: ReportDocEntry[];
|
|
127
|
-
}
|
|
128
|
-
interface ReportDocMermaid {
|
|
129
|
-
kind: "mermaid";
|
|
130
|
-
code: string;
|
|
131
|
-
title?: string;
|
|
132
|
-
phase: DocPhase;
|
|
133
|
-
children?: ReportDocEntry[];
|
|
134
|
-
}
|
|
135
|
-
interface ReportDocScreenshot {
|
|
136
|
-
kind: "screenshot";
|
|
137
|
-
path: string;
|
|
138
|
-
alt?: string;
|
|
139
|
-
phase: DocPhase;
|
|
140
|
-
children?: ReportDocEntry[];
|
|
141
|
-
}
|
|
142
|
-
interface ReportDocVideo {
|
|
143
|
-
kind: "video";
|
|
144
|
-
path: string;
|
|
145
|
-
caption?: string;
|
|
146
|
-
poster?: string;
|
|
147
|
-
phase: DocPhase;
|
|
148
|
-
children?: ReportDocEntry[];
|
|
149
|
-
}
|
|
150
|
-
interface ReportDocHtml {
|
|
151
|
-
kind: "html";
|
|
152
|
-
/** Local HTML file path (exactly one of path/url/content) */
|
|
153
|
-
path?: string;
|
|
154
|
-
/** Remote URL rendered via iframe src (exactly one of path/url/content) */
|
|
155
|
-
url?: string;
|
|
156
|
-
/** Inline HTML content rendered via iframe srcdoc (exactly one of path/url/content) */
|
|
157
|
-
content?: string;
|
|
158
|
-
title?: string;
|
|
159
|
-
/** Iframe height: number → px, string passed through (e.g. "60vh"). Default 400px. */
|
|
160
|
-
height?: number | string;
|
|
161
|
-
phase: DocPhase;
|
|
162
|
-
children?: ReportDocEntry[];
|
|
163
|
-
}
|
|
164
|
-
interface ReportDocState {
|
|
165
|
-
kind: "state";
|
|
166
|
-
/** Entity name ("Basket") — diff identity across steps. Unlabeled states share one lane. */
|
|
167
|
-
label?: string;
|
|
168
|
-
/** JSON-serializable snapshot of the state at this step. */
|
|
169
|
-
value: unknown;
|
|
170
|
-
phase: DocPhase;
|
|
171
|
-
children?: ReportDocEntry[];
|
|
172
|
-
}
|
|
173
|
-
interface ReportDocCustom {
|
|
174
|
-
kind: "custom";
|
|
175
|
-
type: string;
|
|
176
|
-
data: unknown;
|
|
177
|
-
phase: DocPhase;
|
|
178
|
-
children?: ReportDocEntry[];
|
|
179
|
-
}
|
|
180
|
-
interface ReportStep {
|
|
181
|
-
id: string;
|
|
182
|
-
index: number;
|
|
183
|
-
keyword: StepKeyword;
|
|
184
|
-
text: string;
|
|
185
|
-
status: TestStatus;
|
|
186
|
-
durationMs: number;
|
|
187
|
-
errorMessage?: string;
|
|
188
|
-
mode?: StepMode;
|
|
189
|
-
docEntries: ReportDocEntry[];
|
|
190
|
-
}
|
|
191
|
-
interface ReportScenario$1 {
|
|
192
|
-
id: string;
|
|
193
|
-
title: string;
|
|
194
|
-
status: TestStatus;
|
|
195
|
-
/**
|
|
196
|
-
* True for scenarios authored with the framework's todo modifier
|
|
197
|
-
* (e.g. `it.todo`): specified behavior with no implementation yet.
|
|
198
|
-
* Canonical status stays "pending"; this flags why.
|
|
199
|
-
*/
|
|
200
|
-
planned?: boolean;
|
|
201
|
-
durationMs: number;
|
|
202
|
-
tags: string[];
|
|
203
|
-
tickets?: ReportTicket[];
|
|
204
|
-
/** Product-code paths/globs this scenario exercises (project-root-relative). */
|
|
205
|
-
covers?: string[];
|
|
206
|
-
sourceLine?: number;
|
|
207
|
-
errorMessage?: string;
|
|
208
|
-
errorStack?: string;
|
|
209
|
-
retry: number;
|
|
210
|
-
retries: number;
|
|
211
|
-
docEntries: ReportDocEntry[];
|
|
212
|
-
steps: ReportStep[];
|
|
213
|
-
attachments: ReportAttachment[];
|
|
214
|
-
/** OTel spans for the trace waterfall (carried through from the run). */
|
|
215
|
-
otelSpans?: OtelSpan[];
|
|
216
|
-
}
|
|
217
|
-
interface ReportFeature$1 {
|
|
218
|
-
id: string;
|
|
219
|
-
title: string;
|
|
220
|
-
sourceFile: string;
|
|
221
|
-
summary: ReportSummary$1;
|
|
222
|
-
scenarios: ReportScenario$1[];
|
|
223
|
-
}
|
|
224
|
-
interface StoryReport {
|
|
225
|
-
schemaVersion: StoryReportSchemaVersion;
|
|
226
|
-
runId: string;
|
|
227
|
-
startedAtMs: number;
|
|
228
|
-
finishedAtMs: number;
|
|
229
|
-
durationMs: number;
|
|
230
|
-
projectRoot: string;
|
|
231
|
-
packageVersion?: string;
|
|
232
|
-
gitSha?: string;
|
|
233
|
-
ci?: ReportCIInfo;
|
|
234
|
-
coverage?: ReportCoverageSummary;
|
|
235
|
-
summary: ReportSummary$1;
|
|
236
|
-
features: ReportFeature$1[];
|
|
237
|
-
}
|
|
238
|
-
|
|
239
10
|
/**
|
|
240
11
|
* Result<T> — explicit success/error type matching the cookbook convention.
|
|
241
12
|
*
|
|
@@ -513,6 +284,50 @@ declare function DocCustom({ entry }: {
|
|
|
513
284
|
entry: ReportDocCustom;
|
|
514
285
|
}): react.JSX.Element;
|
|
515
286
|
|
|
287
|
+
declare const FILE_TREE_TYPE = "file-tree";
|
|
288
|
+
declare const DATA_MODEL_TYPE = "data-model";
|
|
289
|
+
/** Change annotation shared by both blocks. */
|
|
290
|
+
type ChangeKind = "added" | "modified" | "removed" | "renamed";
|
|
291
|
+
interface FileEntry {
|
|
292
|
+
path: string;
|
|
293
|
+
change?: ChangeKind;
|
|
294
|
+
note?: string;
|
|
295
|
+
}
|
|
296
|
+
interface FileTreeData {
|
|
297
|
+
title?: string;
|
|
298
|
+
authored?: string;
|
|
299
|
+
files: FileEntry[];
|
|
300
|
+
}
|
|
301
|
+
declare function parseFileTree(data: unknown): FileTreeData | undefined;
|
|
302
|
+
declare function FileTreeBlock({ entry }: {
|
|
303
|
+
entry: ReportDocCustom;
|
|
304
|
+
}): react.JSX.Element;
|
|
305
|
+
interface ModelField {
|
|
306
|
+
name: string;
|
|
307
|
+
type?: string;
|
|
308
|
+
note?: string;
|
|
309
|
+
change?: ChangeKind;
|
|
310
|
+
}
|
|
311
|
+
interface DataModelData {
|
|
312
|
+
title?: string;
|
|
313
|
+
authored?: string;
|
|
314
|
+
name?: string;
|
|
315
|
+
fields: ModelField[];
|
|
316
|
+
}
|
|
317
|
+
declare function parseDataModel(data: unknown): DataModelData | undefined;
|
|
318
|
+
declare function DataModelBlock({ entry }: {
|
|
319
|
+
entry: ReportDocCustom;
|
|
320
|
+
}): react.JSX.Element;
|
|
321
|
+
/**
|
|
322
|
+
* The narrative block renderers, ready to spread into `customRenderers`.
|
|
323
|
+
* Consumer-supplied renderers for the same type win, so a project can swap
|
|
324
|
+
* either one out.
|
|
325
|
+
*/
|
|
326
|
+
declare const narrativeBlockRenderers: {
|
|
327
|
+
"file-tree": (entry: ReportDocCustom) => react.JSX.Element;
|
|
328
|
+
"data-model": (entry: ReportDocCustom) => react.JSX.Element;
|
|
329
|
+
};
|
|
330
|
+
|
|
516
331
|
type ExplorerStatus = "passed" | "failed" | "skipped" | "pending";
|
|
517
332
|
interface ExplorerScenario {
|
|
518
333
|
id: string;
|
|
@@ -617,7 +432,7 @@ interface ReportSchemaErrorProps {
|
|
|
617
432
|
}
|
|
618
433
|
declare function ReportSchemaError({ error }: ReportSchemaErrorProps): react.JSX.Element;
|
|
619
434
|
|
|
620
|
-
declare function useReport(): StoryReport;
|
|
435
|
+
declare function useReport(): executable_stories_core.StoryReport;
|
|
621
436
|
|
|
622
437
|
/**
|
|
623
438
|
* parseStoryReport — boundary validator. Accepts unknown input (file contents,
|
|
@@ -647,4 +462,4 @@ declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
|
647
462
|
|
|
648
463
|
declare const storyReportSchema: z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>;
|
|
649
464
|
|
|
650
|
-
export { type BuiltinRenderers, type CustomRenderer, type CustomRenderers, DocCode, DocCustom, DocEntry, DocHtml, DocKv, DocLink, DocMermaid, DocNote, DocScreenshot, DocSection, DocTable, DocTag, DocVideo, type ExplorerScenario, type ExplorerStatus, MermaidDiagram, MermaidSource, Report, ReportAttachments, ReportDocEntries, type ReportDocEntriesProps, ReportEmpty, type ReportEmptyProps, ReportFeature, ReportFeatureList, type ReportFeatureProps, ReportMeta, type ReportParseError, type ReportParseErrorCode, type ReportProps, ReportRoot, type ReportRootProps, ReportScenario, ReportScenarioList, type ReportScenarioListProps, type ReportScenarioProps, ReportSchemaError, type ReportSchemaErrorProps, ReportStepItem, ReportSteps, type ReportStepsProps, ReportStoryboard, type ReportStoryboardProps, ReportSummary, type ReportSummaryProps, ReportSummaryView, type ReportSummaryViewProps, ReportTrace, type Result, type RunStreak, STORY_REPORT_SCHEMA_MAJOR, ScenarioExplorer, type ScenarioExplorerProps, type ScenarioHistoryMap, type ScenarioRunEvent, ScenarioRunHistory, type ScenarioRunStatus,
|
|
465
|
+
export { type BuiltinRenderers, type CustomRenderer, type CustomRenderers, DATA_MODEL_TYPE, DataModelBlock, type DataModelData, DocCode, DocCustom, DocEntry, DocHtml, DocKv, DocLink, DocMermaid, DocNote, DocScreenshot, DocSection, DocTable, DocTag, DocVideo, type ExplorerScenario, type ExplorerStatus, FILE_TREE_TYPE, FileTreeBlock, type FileTreeData, MermaidDiagram, MermaidSource, Report, ReportAttachments, ReportDocEntries, type ReportDocEntriesProps, ReportEmpty, type ReportEmptyProps, ReportFeature, ReportFeatureList, type ReportFeatureProps, ReportMeta, type ReportParseError, type ReportParseErrorCode, type ReportProps, ReportRoot, type ReportRootProps, ReportScenario, ReportScenarioList, type ReportScenarioListProps, type ReportScenarioProps, ReportSchemaError, type ReportSchemaErrorProps, ReportStepItem, ReportSteps, type ReportStepsProps, ReportStoryboard, type ReportStoryboardProps, ReportSummary, type ReportSummaryProps, ReportSummaryView, type ReportSummaryViewProps, ReportTrace, type Result, type RunStreak, STORY_REPORT_SCHEMA_MAJOR, ScenarioExplorer, type ScenarioExplorerProps, type ScenarioHistoryMap, type ScenarioRunEvent, ScenarioRunHistory, type ScenarioRunStatus, ciDisplayName, commitUrl, currentStreak, describeRunHistory, err, formatRelativeAge, isReportStale, narrativeBlockRenderers, ok, parseDataModel, parseFileTree, parseStoryReport, prUrl, reportLastRunMs, storyReportSchema, useBuiltinRenderers, useCustomRenderers, useReport };
|