executable-stories-formatters 0.3.0 → 0.5.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/README.md +38 -1
- package/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/cli.js +1132 -10
- package/dist/cli.js.map +1 -1
- package/dist/{index-DCJ0NvAp.d.cts → index-C4QO-SVT.d.cts} +58 -8
- package/dist/{index-DCJ0NvAp.d.ts → index-C4QO-SVT.d.ts} +58 -8
- package/dist/index.cjs +1224 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +403 -5
- package/dist/index.d.ts +403 -5
- package/dist/index.js +1205 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/README.md +11 -2
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTel span types for trace waterfall rendering.
|
|
3
|
+
*
|
|
4
|
+
* Structurally compatible with autotel's SerializedSpan
|
|
5
|
+
* and raw OTel nanosecond formats. No import dependency on autotel.
|
|
6
|
+
*/
|
|
7
|
+
type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
8
|
+
interface OtelSpan {
|
|
9
|
+
spanId: string;
|
|
10
|
+
parentSpanId?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
/** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */
|
|
13
|
+
startTimeMs?: number;
|
|
14
|
+
durationMs?: number;
|
|
15
|
+
/** Compatibility: raw OTel nanosecond timestamps */
|
|
16
|
+
startTimeUnixNano?: number;
|
|
17
|
+
endTimeUnixNano?: number;
|
|
18
|
+
status: "ok" | "error" | "unset";
|
|
19
|
+
statusMessage?: string;
|
|
20
|
+
attributes?: Record<string, OtelAttributeValue>;
|
|
21
|
+
}
|
|
22
|
+
|
|
1
23
|
/**
|
|
2
24
|
* Story types — the shared vocabulary for all framework adapters.
|
|
3
25
|
*
|
|
@@ -5,6 +27,7 @@
|
|
|
5
27
|
* They now live in formatters so every adapter can import them
|
|
6
28
|
* from the same place that defines RawRun (the output contract).
|
|
7
29
|
*/
|
|
30
|
+
|
|
8
31
|
/** BDD step keywords for scenario documentation */
|
|
9
32
|
type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
|
|
10
33
|
/** Step execution mode for docs rendering */
|
|
@@ -103,17 +126,12 @@ interface StoryMeta {
|
|
|
103
126
|
docs?: DocEntry[];
|
|
104
127
|
/** Order in which story.init() was called (for source ordering) */
|
|
105
128
|
sourceOrder?: number;
|
|
129
|
+
/** OTel spans from autotel for trace waterfall rendering */
|
|
130
|
+
otelSpans?: OtelSpan[];
|
|
106
131
|
}
|
|
107
132
|
/** Key used to store StoryMeta in test metadata */
|
|
108
133
|
declare const STORY_META_KEY = "story";
|
|
109
134
|
|
|
110
|
-
/**
|
|
111
|
-
* Raw types for Layer 1: Framework Adapters.
|
|
112
|
-
*
|
|
113
|
-
* These types are permissive and gather best-effort data from each framework.
|
|
114
|
-
* The ACL (Layer 2) will normalize these into strict canonical types.
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
135
|
/** Permissive status from any framework */
|
|
118
136
|
type RawStatus = "pass" | "fail" | "skip" | "todo" | "pending" | "timeout" | "interrupted" | "unknown";
|
|
119
137
|
/** Raw attachment - don't decide inline vs link yet */
|
|
@@ -184,8 +202,16 @@ interface RawTestCase {
|
|
|
184
202
|
/** CI environment info */
|
|
185
203
|
interface RawCIInfo {
|
|
186
204
|
name: string;
|
|
205
|
+
/** Typed provider key (stable identifier) */
|
|
206
|
+
provider?: CIProvider;
|
|
187
207
|
url?: string;
|
|
188
208
|
buildNumber?: string;
|
|
209
|
+
/** Git branch name */
|
|
210
|
+
branch?: string;
|
|
211
|
+
/** Git commit SHA */
|
|
212
|
+
commitSha?: string;
|
|
213
|
+
/** Pull/merge request number */
|
|
214
|
+
prNumber?: string;
|
|
189
215
|
}
|
|
190
216
|
/** Raw run - all framework data gathered */
|
|
191
217
|
interface RawRun {
|
|
@@ -205,6 +231,30 @@ interface RawRun {
|
|
|
205
231
|
ci?: RawCIInfo;
|
|
206
232
|
}
|
|
207
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Typed CI provider and canonical CI info.
|
|
236
|
+
*
|
|
237
|
+
* RawCIInfo.name = legacy transport string (kept for backward compat + schema).
|
|
238
|
+
* CIInfo.displayName = canonical display name for downstream consumers.
|
|
239
|
+
*
|
|
240
|
+
* All downstream code (HTML meta, notifications, history) uses CIInfo via mappers.
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown";
|
|
244
|
+
interface CIInfo {
|
|
245
|
+
provider: CIProvider;
|
|
246
|
+
displayName: string;
|
|
247
|
+
url?: string;
|
|
248
|
+
buildNumber?: string;
|
|
249
|
+
branch?: string;
|
|
250
|
+
commitSha?: string;
|
|
251
|
+
prNumber?: string;
|
|
252
|
+
}
|
|
253
|
+
/** Convert RawCIInfo (legacy transport) to canonical CIInfo. */
|
|
254
|
+
declare function toCIInfo(raw?: RawCIInfo): CIInfo | undefined;
|
|
255
|
+
/** Convert canonical CIInfo back to RawCIInfo (for serialization). */
|
|
256
|
+
declare function toRawCIInfo(ci?: CIInfo): RawCIInfo | undefined;
|
|
257
|
+
|
|
208
258
|
/**
|
|
209
259
|
* Jest Adapter - Layer 1.
|
|
210
260
|
*
|
|
@@ -375,4 +425,4 @@ interface PlaywrightAdapterOptions {
|
|
|
375
425
|
*/
|
|
376
426
|
declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun;
|
|
377
427
|
|
|
378
|
-
export { type
|
|
428
|
+
export { type VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type OtelAttributeValue as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type RawAttachment as b, type RawRun as c, type CIProvider as d, type RawCIInfo as e, adaptJestRun as f, adaptPlaywrightRun as g, adaptVitestRun as h, type DocPhase as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelSpan as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport as z };
|
|
@@ -1,3 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OTel span types for trace waterfall rendering.
|
|
3
|
+
*
|
|
4
|
+
* Structurally compatible with autotel's SerializedSpan
|
|
5
|
+
* and raw OTel nanosecond formats. No import dependency on autotel.
|
|
6
|
+
*/
|
|
7
|
+
type OtelAttributeValue = string | number | boolean | string[] | number[] | boolean[];
|
|
8
|
+
interface OtelSpan {
|
|
9
|
+
spanId: string;
|
|
10
|
+
parentSpanId?: string;
|
|
11
|
+
name: string;
|
|
12
|
+
/** Preferred: epoch-based milliseconds (from autotel's SerializedSpan) */
|
|
13
|
+
startTimeMs?: number;
|
|
14
|
+
durationMs?: number;
|
|
15
|
+
/** Compatibility: raw OTel nanosecond timestamps */
|
|
16
|
+
startTimeUnixNano?: number;
|
|
17
|
+
endTimeUnixNano?: number;
|
|
18
|
+
status: "ok" | "error" | "unset";
|
|
19
|
+
statusMessage?: string;
|
|
20
|
+
attributes?: Record<string, OtelAttributeValue>;
|
|
21
|
+
}
|
|
22
|
+
|
|
1
23
|
/**
|
|
2
24
|
* Story types — the shared vocabulary for all framework adapters.
|
|
3
25
|
*
|
|
@@ -5,6 +27,7 @@
|
|
|
5
27
|
* They now live in formatters so every adapter can import them
|
|
6
28
|
* from the same place that defines RawRun (the output contract).
|
|
7
29
|
*/
|
|
30
|
+
|
|
8
31
|
/** BDD step keywords for scenario documentation */
|
|
9
32
|
type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
|
|
10
33
|
/** Step execution mode for docs rendering */
|
|
@@ -103,17 +126,12 @@ interface StoryMeta {
|
|
|
103
126
|
docs?: DocEntry[];
|
|
104
127
|
/** Order in which story.init() was called (for source ordering) */
|
|
105
128
|
sourceOrder?: number;
|
|
129
|
+
/** OTel spans from autotel for trace waterfall rendering */
|
|
130
|
+
otelSpans?: OtelSpan[];
|
|
106
131
|
}
|
|
107
132
|
/** Key used to store StoryMeta in test metadata */
|
|
108
133
|
declare const STORY_META_KEY = "story";
|
|
109
134
|
|
|
110
|
-
/**
|
|
111
|
-
* Raw types for Layer 1: Framework Adapters.
|
|
112
|
-
*
|
|
113
|
-
* These types are permissive and gather best-effort data from each framework.
|
|
114
|
-
* The ACL (Layer 2) will normalize these into strict canonical types.
|
|
115
|
-
*/
|
|
116
|
-
|
|
117
135
|
/** Permissive status from any framework */
|
|
118
136
|
type RawStatus = "pass" | "fail" | "skip" | "todo" | "pending" | "timeout" | "interrupted" | "unknown";
|
|
119
137
|
/** Raw attachment - don't decide inline vs link yet */
|
|
@@ -184,8 +202,16 @@ interface RawTestCase {
|
|
|
184
202
|
/** CI environment info */
|
|
185
203
|
interface RawCIInfo {
|
|
186
204
|
name: string;
|
|
205
|
+
/** Typed provider key (stable identifier) */
|
|
206
|
+
provider?: CIProvider;
|
|
187
207
|
url?: string;
|
|
188
208
|
buildNumber?: string;
|
|
209
|
+
/** Git branch name */
|
|
210
|
+
branch?: string;
|
|
211
|
+
/** Git commit SHA */
|
|
212
|
+
commitSha?: string;
|
|
213
|
+
/** Pull/merge request number */
|
|
214
|
+
prNumber?: string;
|
|
189
215
|
}
|
|
190
216
|
/** Raw run - all framework data gathered */
|
|
191
217
|
interface RawRun {
|
|
@@ -205,6 +231,30 @@ interface RawRun {
|
|
|
205
231
|
ci?: RawCIInfo;
|
|
206
232
|
}
|
|
207
233
|
|
|
234
|
+
/**
|
|
235
|
+
* Typed CI provider and canonical CI info.
|
|
236
|
+
*
|
|
237
|
+
* RawCIInfo.name = legacy transport string (kept for backward compat + schema).
|
|
238
|
+
* CIInfo.displayName = canonical display name for downstream consumers.
|
|
239
|
+
*
|
|
240
|
+
* All downstream code (HTML meta, notifications, history) uses CIInfo via mappers.
|
|
241
|
+
*/
|
|
242
|
+
|
|
243
|
+
type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown";
|
|
244
|
+
interface CIInfo {
|
|
245
|
+
provider: CIProvider;
|
|
246
|
+
displayName: string;
|
|
247
|
+
url?: string;
|
|
248
|
+
buildNumber?: string;
|
|
249
|
+
branch?: string;
|
|
250
|
+
commitSha?: string;
|
|
251
|
+
prNumber?: string;
|
|
252
|
+
}
|
|
253
|
+
/** Convert RawCIInfo (legacy transport) to canonical CIInfo. */
|
|
254
|
+
declare function toCIInfo(raw?: RawCIInfo): CIInfo | undefined;
|
|
255
|
+
/** Convert canonical CIInfo back to RawCIInfo (for serialization). */
|
|
256
|
+
declare function toRawCIInfo(ci?: CIInfo): RawCIInfo | undefined;
|
|
257
|
+
|
|
208
258
|
/**
|
|
209
259
|
* Jest Adapter - Layer 1.
|
|
210
260
|
*
|
|
@@ -375,4 +425,4 @@ interface PlaywrightAdapterOptions {
|
|
|
375
425
|
*/
|
|
376
426
|
declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun;
|
|
377
427
|
|
|
378
|
-
export { type
|
|
428
|
+
export { type VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type OtelAttributeValue as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type RawAttachment as b, type RawRun as c, type CIProvider as d, type RawCIInfo as e, adaptJestRun as f, adaptPlaywrightRun as g, adaptVitestRun as h, type DocPhase as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelSpan as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport as z };
|