@tracelane/cli 0.1.0-alpha.1 → 0.1.0-alpha.11
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/LICENSE +202 -0
- package/README.md +15 -7
- package/dist/commands/index-cmd.d.ts +3 -0
- package/dist/commands/index-cmd.d.ts.map +1 -0
- package/dist/commands/index-cmd.js +206 -0
- package/dist/commands/index-cmd.js.map +1 -0
- package/dist/commands/init.d.ts +1 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +5 -10
- package/dist/commands/init.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/extract-metadata.d.ts +43 -0
- package/dist/lib/extract-metadata.d.ts.map +1 -0
- package/dist/lib/extract-metadata.js +95 -0
- package/dist/lib/extract-metadata.js.map +1 -0
- package/dist/lib/render-index.d.ts +21 -0
- package/dist/lib/render-index.d.ts.map +1 -0
- package/dist/lib/render-index.js +273 -0
- package/dist/lib/render-index.js.map +1 -0
- package/package.json +29 -9
package/LICENSE
ADDED
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
<img src="https://raw.githubusercontent.com/Cubenest/rrweb-stack/main/assets/brand/sub-tracelane.svg" height="40" alt="tracelane">
|
|
2
|
+
|
|
1
3
|
# @tracelane/cli
|
|
2
4
|
|
|
3
|
-
>
|
|
5
|
+
> The reporter for your WebdriverIO tests — Playwright and Cypress on the roadmap. Self-contained HTML for every run — replay failures, audit successes, attach to any bug tracker. No SaaS, no dashboard, no signup.
|
|
6
|
+
|
|
7
|
+
One command to wire tracelane into your WebdriverIO project. Detects your runner + package manager, installs `@tracelane/wdio`, edits `wdio.conf.ts`, creates `tracelane-reports/`, ignores it in git. Idempotent and dry-runnable.
|
|
4
8
|
|
|
5
9
|
[](https://www.npmjs.com/package/@tracelane/cli)
|
|
6
10
|
[](https://www.npmjs.com/package/@tracelane/cli)
|
|
@@ -8,12 +12,16 @@
|
|
|
8
12
|
[](https://github.com/Cubenest/rrweb-stack/actions/workflows/ci.yml)
|
|
9
13
|
[](https://scorecard.dev/viewer/?uri=github.com/Cubenest/rrweb-stack)
|
|
10
14
|
|
|
15
|
+

|
|
16
|
+
|
|
17
|
+
Docs: <https://tracelane.cubenest.in>
|
|
18
|
+
|
|
11
19
|
```sh
|
|
12
20
|
cd your-wdio-project
|
|
13
|
-
npx tracelane init
|
|
21
|
+
npx @tracelane/cli init
|
|
14
22
|
```
|
|
15
23
|
|
|
16
|
-
That's it. `npx tracelane init` does four things:
|
|
24
|
+
That's it. `npx @tracelane/cli init` does four things:
|
|
17
25
|
|
|
18
26
|
1. Detects WebdriverIO from `wdio.conf.{ts,js,mjs,cjs}` and your package manager from your lockfile.
|
|
19
27
|
2. Runs the package manager's dev-add for `@tracelane/wdio` (`pnpm add -D` / `yarn add -D` / `npm install --save-dev` / `bun add -d`).
|
|
@@ -27,7 +35,7 @@ See the [@tracelane/wdio README](https://github.com/Cubenest/rrweb-stack/tree/ma
|
|
|
27
35
|
## Usage
|
|
28
36
|
|
|
29
37
|
```
|
|
30
|
-
npx tracelane init [options]
|
|
38
|
+
npx @tracelane/cli init [options]
|
|
31
39
|
|
|
32
40
|
Options:
|
|
33
41
|
--runner <name> Force runner choice (wdio|playwright|cypress).
|
|
@@ -49,10 +57,10 @@ Options:
|
|
|
49
57
|
|
|
50
58
|
## Playwright and Cypress
|
|
51
59
|
|
|
52
|
-
Detection works, but the v0.1 CLI exits 0 with a "coming Q3/Q4 2026" message for these. The integration packages (`@tracelane/playwright`, `@tracelane/cypress`) aren't published yet — when they are, a future bump to `@tracelane/cli` will add the wiring.
|
|
60
|
+
Detection works, but the v0.1 CLI exits 0 with a "coming Q3/Q4 2026" message for these. The integration packages (`@tracelane/playwright`, `@tracelane/cypress`) aren't published yet — when they are, a future bump to `@tracelane/cli` will add the wiring. Progress is [tracked on the issues board](https://github.com/Cubenest/rrweb-stack/issues):
|
|
53
61
|
|
|
54
|
-
- Playwright
|
|
55
|
-
- Cypress
|
|
62
|
+
- Playwright — target Q3 2026
|
|
63
|
+
- Cypress — target Q4 2026
|
|
56
64
|
|
|
57
65
|
If you have a `wdio.conf.*` alongside a Playwright/Cypress conf, the WDIO path wins by default — pass `--runner playwright` or `--runner cypress` to override (it'll still print the coming-soon message).
|
|
58
66
|
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export declare const INDEX_HELP = "tracelane index - generate a single-file triage index for a directory of reports\n\nUsage: npx tracelane index <dir> [options]\n\nArguments:\n <dir> Directory containing tracelane-report-*.html files (recursive)\n\nOptions:\n --out <path> Output file path (default: <dir>/index.html)\n --sort <field> Sort cards by 'captured' (default) | 'spec' | 'status'\n --title <text> Override the index page title\n --help, -h Show this help\n\nExit codes:\n 0 index written successfully (even if some reports failed to parse)\n 1 <dir> not found or no .html reports inside\n 2 bad CLI arguments\n\nExample:\n npx tracelane index ./tracelane-reports\n npx tracelane index ./tracelane-reports --out ./reports-index.html\n";
|
|
2
|
+
export declare function runIndex(argv: readonly string[]): Promise<number>;
|
|
3
|
+
//# sourceMappingURL=index-cmd.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-cmd.d.ts","sourceRoot":"","sources":["../../src/commands/index-cmd.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,UAAU,0yBAqBtB,CAAC;AAoIF,wBAAsB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA8DvE"}
|
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
// `tracelane index <dir> [--out <path>]` — scan a directory of tracelane HTML
|
|
2
|
+
// reports and emit a single self-contained index page with one metadata card
|
|
3
|
+
// per failure. The triage workflow described in
|
|
4
|
+
// recipes/triage-ci-run-with-replay-thumbnails depends on this command.
|
|
5
|
+
//
|
|
6
|
+
// Pure parsing + rendering live in lib/extract-metadata.ts and
|
|
7
|
+
// lib/render-index.ts. This file owns: arg parsing, file walking,
|
|
8
|
+
// orchestration, exit codes, stdout messaging.
|
|
9
|
+
import { readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
|
|
10
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
11
|
+
import { parseArgs } from 'node:util';
|
|
12
|
+
import { extractMetadata } from '../lib/extract-metadata.js';
|
|
13
|
+
import { renderIndex } from '../lib/render-index.js';
|
|
14
|
+
export const INDEX_HELP = `tracelane index - generate a single-file triage index for a directory of reports
|
|
15
|
+
|
|
16
|
+
Usage: npx tracelane index <dir> [options]
|
|
17
|
+
|
|
18
|
+
Arguments:
|
|
19
|
+
<dir> Directory containing tracelane-report-*.html files (recursive)
|
|
20
|
+
|
|
21
|
+
Options:
|
|
22
|
+
--out <path> Output file path (default: <dir>/index.html)
|
|
23
|
+
--sort <field> Sort cards by 'captured' (default) | 'spec' | 'status'
|
|
24
|
+
--title <text> Override the index page title
|
|
25
|
+
--help, -h Show this help
|
|
26
|
+
|
|
27
|
+
Exit codes:
|
|
28
|
+
0 index written successfully (even if some reports failed to parse)
|
|
29
|
+
1 <dir> not found or no .html reports inside
|
|
30
|
+
2 bad CLI arguments
|
|
31
|
+
|
|
32
|
+
Example:
|
|
33
|
+
npx tracelane index ./tracelane-reports
|
|
34
|
+
npx tracelane index ./tracelane-reports --out ./reports-index.html
|
|
35
|
+
`;
|
|
36
|
+
class CliError extends Error {
|
|
37
|
+
exitCode;
|
|
38
|
+
constructor(message, exitCode) {
|
|
39
|
+
super(message);
|
|
40
|
+
this.exitCode = exitCode;
|
|
41
|
+
this.name = 'CliError';
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
function parseOptions(argv) {
|
|
45
|
+
let parsed;
|
|
46
|
+
try {
|
|
47
|
+
parsed = parseArgs({
|
|
48
|
+
args: [...argv],
|
|
49
|
+
options: {
|
|
50
|
+
out: { type: 'string' },
|
|
51
|
+
sort: { type: 'string', default: 'captured' },
|
|
52
|
+
title: { type: 'string' },
|
|
53
|
+
help: { type: 'boolean', short: 'h' },
|
|
54
|
+
},
|
|
55
|
+
allowPositionals: true,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
catch (e) {
|
|
59
|
+
throw new CliError(`tracelane index: ${e instanceof Error ? e.message : String(e)}`, 2);
|
|
60
|
+
}
|
|
61
|
+
if (parsed.values.help) {
|
|
62
|
+
process.stdout.write(INDEX_HELP);
|
|
63
|
+
throw new CliError('', 0);
|
|
64
|
+
}
|
|
65
|
+
const dir = parsed.positionals[0];
|
|
66
|
+
if (!dir) {
|
|
67
|
+
throw new CliError('tracelane index: missing required <dir> argument\n', 2);
|
|
68
|
+
}
|
|
69
|
+
const sort = parsed.values.sort;
|
|
70
|
+
if (!['captured', 'spec', 'status'].includes(sort)) {
|
|
71
|
+
throw new CliError(`tracelane index: invalid --sort value '${sort}' (expected captured | spec | status)\n`, 2);
|
|
72
|
+
}
|
|
73
|
+
const dirAbs = isAbsolute(dir) ? dir : resolve(process.cwd(), dir);
|
|
74
|
+
const outArg = typeof parsed.values.out === 'string' ? parsed.values.out : undefined;
|
|
75
|
+
const out = outArg
|
|
76
|
+
? isAbsolute(outArg)
|
|
77
|
+
? outArg
|
|
78
|
+
: resolve(process.cwd(), outArg)
|
|
79
|
+
: join(dirAbs, 'index.html');
|
|
80
|
+
const result = { dir: dirAbs, out, sort };
|
|
81
|
+
if (typeof parsed.values.title === 'string')
|
|
82
|
+
result.title = parsed.values.title;
|
|
83
|
+
return result;
|
|
84
|
+
}
|
|
85
|
+
/** Recursively walk a directory and return every `*.html` file path. */
|
|
86
|
+
function findHtmlReports(dir) {
|
|
87
|
+
const out = [];
|
|
88
|
+
let entries;
|
|
89
|
+
try {
|
|
90
|
+
entries = readdirSync(dir);
|
|
91
|
+
}
|
|
92
|
+
catch (e) {
|
|
93
|
+
throw new CliError(`tracelane index: cannot read directory '${dir}': ${e instanceof Error ? e.message : String(e)}\n`, 1);
|
|
94
|
+
}
|
|
95
|
+
for (const name of entries) {
|
|
96
|
+
const full = join(dir, name);
|
|
97
|
+
let stat;
|
|
98
|
+
try {
|
|
99
|
+
stat = statSync(full);
|
|
100
|
+
}
|
|
101
|
+
catch {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
if (stat.isDirectory()) {
|
|
105
|
+
out.push(...findHtmlReports(full));
|
|
106
|
+
}
|
|
107
|
+
else if (stat.isFile() && name.endsWith('.html')) {
|
|
108
|
+
out.push(full);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return out;
|
|
112
|
+
}
|
|
113
|
+
function statusOrder(status) {
|
|
114
|
+
// failed/broken first (most-actionable), then unknown, then passed/skipped.
|
|
115
|
+
switch (status) {
|
|
116
|
+
case 'failed':
|
|
117
|
+
return 0;
|
|
118
|
+
case 'broken':
|
|
119
|
+
return 1;
|
|
120
|
+
case 'unknown':
|
|
121
|
+
return 2;
|
|
122
|
+
case 'skipped':
|
|
123
|
+
return 3;
|
|
124
|
+
case 'passed':
|
|
125
|
+
return 4;
|
|
126
|
+
default:
|
|
127
|
+
return 5;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
function sortEntries(entries, sortBy) {
|
|
131
|
+
const sorted = [...entries];
|
|
132
|
+
if (sortBy === 'spec') {
|
|
133
|
+
sorted.sort((a, b) => (a.meta?.spec ?? a.filename).localeCompare(b.meta?.spec ?? b.filename));
|
|
134
|
+
}
|
|
135
|
+
else if (sortBy === 'status') {
|
|
136
|
+
sorted.sort((a, b) => {
|
|
137
|
+
const ao = a.meta ? statusOrder(a.meta.status) : 6;
|
|
138
|
+
const bo = b.meta ? statusOrder(b.meta.status) : 6;
|
|
139
|
+
if (ao !== bo)
|
|
140
|
+
return ao - bo;
|
|
141
|
+
return (a.meta?.capturedAt ?? '').localeCompare(b.meta?.capturedAt ?? '');
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
// captured: descending so newest-first
|
|
146
|
+
sorted.sort((a, b) => (b.meta?.capturedAt ?? '').localeCompare(a.meta?.capturedAt ?? ''));
|
|
147
|
+
}
|
|
148
|
+
return sorted;
|
|
149
|
+
}
|
|
150
|
+
export async function runIndex(argv) {
|
|
151
|
+
let options;
|
|
152
|
+
try {
|
|
153
|
+
options = parseOptions(argv);
|
|
154
|
+
}
|
|
155
|
+
catch (e) {
|
|
156
|
+
if (e instanceof CliError) {
|
|
157
|
+
if (e.message)
|
|
158
|
+
process.stderr.write(e.message);
|
|
159
|
+
return e.exitCode;
|
|
160
|
+
}
|
|
161
|
+
throw e;
|
|
162
|
+
}
|
|
163
|
+
let files;
|
|
164
|
+
try {
|
|
165
|
+
files = findHtmlReports(options.dir);
|
|
166
|
+
}
|
|
167
|
+
catch (e) {
|
|
168
|
+
if (e instanceof CliError) {
|
|
169
|
+
process.stderr.write(e.message);
|
|
170
|
+
return e.exitCode;
|
|
171
|
+
}
|
|
172
|
+
throw e;
|
|
173
|
+
}
|
|
174
|
+
// Exclude any prior index.html (don't index ourselves).
|
|
175
|
+
files = files.filter((f) => f !== options.out);
|
|
176
|
+
if (files.length === 0) {
|
|
177
|
+
process.stderr.write(`tracelane index: no .html reports found in '${options.dir}'\n`);
|
|
178
|
+
return 1;
|
|
179
|
+
}
|
|
180
|
+
const outDir = dirname(options.out);
|
|
181
|
+
const entries = files.map((full) => {
|
|
182
|
+
const html = readFileSync(full, 'utf8');
|
|
183
|
+
const meta = extractMetadata(html);
|
|
184
|
+
// Relativise the filename against the index's output directory so the
|
|
185
|
+
// <a href> works regardless of where the index lands.
|
|
186
|
+
const rel = full.startsWith(`${outDir}/`) ? full.slice(outDir.length + 1) : full;
|
|
187
|
+
return { filename: rel, meta };
|
|
188
|
+
});
|
|
189
|
+
const parsed = entries.filter((e) => e.meta).length;
|
|
190
|
+
const unparsed = entries.length - parsed;
|
|
191
|
+
const sorted = sortEntries(entries, options.sort);
|
|
192
|
+
const renderInput = { entries: sorted };
|
|
193
|
+
if (options.title)
|
|
194
|
+
renderInput.title = options.title;
|
|
195
|
+
const html = renderIndex(renderInput);
|
|
196
|
+
try {
|
|
197
|
+
writeFileSync(options.out, html, 'utf8');
|
|
198
|
+
}
|
|
199
|
+
catch (e) {
|
|
200
|
+
process.stderr.write(`tracelane index: failed to write '${options.out}': ${e instanceof Error ? e.message : String(e)}\n`);
|
|
201
|
+
return 1;
|
|
202
|
+
}
|
|
203
|
+
process.stdout.write(`tracelane index: wrote ${options.out} (${parsed} parsed, ${unparsed} unparsed of ${entries.length} reports)\n`);
|
|
204
|
+
return 0;
|
|
205
|
+
}
|
|
206
|
+
//# sourceMappingURL=index-cmd.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-cmd.js","sourceRoot":"","sources":["../../src/commands/index-cmd.ts"],"names":[],"mappings":"AAAA,8EAA8E;AAC9E,6EAA6E;AAC7E,gDAAgD;AAChD,wEAAwE;AACxE,EAAE;AACF,+DAA+D;AAC/D,kEAAkE;AAClE,+CAA+C;AAE/C,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAA0B,eAAe,EAAE,MAAM,4BAA4B,CAAC;AACrF,O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rG,CAAC;QACF,OAAO,CAAC,CAAC;IACX,CAAC;IAED,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,0BAA0B,OAAO,CAAC,GAAG,KAAK,MAAM,YAAY,QAAQ,gBAAgB,OAAO,CAAC,MAAM,aAAa,CAChH,CAAC;IACF,OAAO,CAAC,CAAC;AACX,CAAC"}
|
package/dist/commands/init.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export interface InitOptions {
|
|
|
35
35
|
*/
|
|
36
36
|
export declare function runInitProgrammatic(opts: InitOptions): Promise<number>;
|
|
37
37
|
/** Help text for `tracelane init --help`. */
|
|
38
|
-
export declare const INIT_HELP = "tracelane init - wire @tracelane/wdio into the project in this directory.\n\nUsage: npx tracelane init [options]\n\nOptions:\n --runner <name> Force runner choice (wdio|playwright|cypress).\n Default: auto-detected from project files.\n --dry-run Print what would happen; change nothing.\n --yes, -y Skip the \"about to do X, Y, Z - continue?\" prompt.\n --skip-install Don't run the package-manager install command.\n Useful if you have @tracelane/wdio already.\n --help, -h Show this help.\n\nThe CLI scans the current working directory for a wdio.conf.{ts,js,mjs,cjs},\nadds @tracelane/wdio as a devDependency via the detected package manager\n(pnpm/yarn/npm/bun), inserts the import + service tuple into the conf, creates\n./tracelane-reports/, and appends to .gitignore. Idempotent: re-running on an\nalready-wired project is a no-op.\n\nAuto-edit limitation: the conf editor uses string regex to insert into the\nservices array. If it can't recognise the array shape it BACKS OUT cleanly\nand prints the snippet to paste manually - it will NEVER corrupt your conf.\n";
|
|
38
|
+
export declare const INIT_HELP = "tracelane init - wire @tracelane/wdio into the project in this directory.\n\nUsage: npx @tracelane/cli init [options] (one-off; recommended)\n tracelane init [options] (after 'npm i -D @tracelane/cli')\n\nOptions:\n --runner <name> Force runner choice (wdio|playwright|cypress).\n Default: auto-detected from project files.\n --dry-run Print what would happen; change nothing.\n --yes, -y Skip the \"about to do X, Y, Z - continue?\" prompt.\n --skip-install Don't run the package-manager install command.\n Useful if you have @tracelane/wdio already.\n --help, -h Show this help.\n\nThe CLI scans the current working directory for a wdio.conf.{ts,js,mjs,cjs},\nadds @tracelane/wdio as a devDependency via the detected package manager\n(pnpm/yarn/npm/bun), inserts the import + service tuple into the conf, creates\n./tracelane-reports/, and appends to .gitignore. Idempotent: re-running on an\nalready-wired project is a no-op.\n\nAuto-edit limitation: the conf editor uses string regex to insert into the\nservices array. If it can't recognise the array shape it BACKS OUT cleanly\nand prints the snippet to paste manually - it will NEVER corrupt your conf.\n";
|
|
39
39
|
/**
|
|
40
40
|
* Argv entry for `tracelane init`. Parses flags via node:util.parseArgs and
|
|
41
41
|
* delegates to runInitProgrammatic.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,gBAAgB,EAAa,MAAM,oBAAoB,CAAC;AAWtE,OAAO,EAGL,KAAK,MAAM,EAKZ,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,KAAK,gBAAgB,EAAa,MAAM,oBAAoB,CAAC;AAWtE,OAAO,EAGL,KAAK,MAAM,EAKZ,MAAM,kBAAkB,CAAC;AAQ1B,6EAA6E;AAC7E,MAAM,MAAM,WAAW,GAAG,CACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,OAAO,EAAE;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;CAAE,KACzE,gBAAgB,CAAC,MAAM,CAAC,CAAC;AAK9B,yEAAyE;AACzE,MAAM,WAAW,WAAW;IAC1B,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,8DAA8D;IAC9D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,kDAAkD;IAClD,QAAQ,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC;IAC1B,2CAA2C;IAC3C,QAAQ,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACvB,6DAA6D;IAC7D,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACxC,0DAA0D;IAC1D,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,cAAc,CAAC;IACxC,yEAAyE;IACzE,QAAQ,CAAC,KAAK,CAAC,EAAE,WAAW,CAAC;CAC9B;AAiFD;;;;;;;GAOG;AACH,wBAAsB,mBAAmB,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAAC,MAAM,CAAC,CA+L5E;AAuFD,6CAA6C;AAC7C,eAAO,MAAM,SAAS,6vCAuBrB,CAAC;AAEF;;;GAGG;AACH,wBAAsB,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAuDtE"}
|
package/dist/commands/init.js
CHANGED
|
@@ -21,13 +21,8 @@ import { detectPackageManager, detectRunner, findRunnerConfig, installCommand, }
|
|
|
21
21
|
import { hasTracelaneEntry, mergeGitignore } from '../lib/gitignore.js';
|
|
22
22
|
import { confirm } from '../lib/prompt.js';
|
|
23
23
|
import { MANUAL_SNIPPET, applyWdioEdit } from '../lib/wdio-editor.js';
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
// `tracelane init` is exiting 0 either way. File them before announcement so
|
|
27
|
-
// the URL resolves to a real tracking issue instead of a 404. (#11 = Playwright,
|
|
28
|
-
// #12 = Cypress per the wedge-amplifier spec.)
|
|
29
|
-
const PLAYWRIGHT_ISSUE = 'https://github.com/Cubenest/rrweb-stack/issues/11';
|
|
30
|
-
const CYPRESS_ISSUE = 'https://github.com/Cubenest/rrweb-stack/issues/12';
|
|
24
|
+
/** Issues board for tracking the not-yet-shipped Playwright/Cypress paths. */
|
|
25
|
+
const ISSUES_BOARD = 'https://github.com/Cubenest/rrweb-stack/issues';
|
|
31
26
|
const realSpawn = (program, args, options) => spawnSync(program, args, options);
|
|
32
27
|
/** Wrap process.stdout.write so we can swap in a fake in tests. */
|
|
33
28
|
function write(s, msg) {
|
|
@@ -74,12 +69,11 @@ function basename(p) {
|
|
|
74
69
|
function printComingSoon(detected, stdout) {
|
|
75
70
|
const runnerLabel = detected.runner === 'playwright' ? 'Playwright' : 'Cypress';
|
|
76
71
|
const target = detected.runner === 'playwright' ? 'Q3 2026' : 'Q4 2026';
|
|
77
|
-
const issue = detected.runner === 'playwright' ? PLAYWRIGHT_ISSUE : CYPRESS_ISSUE;
|
|
78
72
|
write(stdout, [
|
|
79
73
|
`tracelane init - detected ${runnerLabel} project (${basename(detected.configPath)}).`,
|
|
80
74
|
'',
|
|
81
75
|
`tracelane ${runnerLabel} support is in development; target ship ${target}.`,
|
|
82
|
-
`Track: ${
|
|
76
|
+
`Track progress: ${ISSUES_BOARD}`,
|
|
83
77
|
'',
|
|
84
78
|
'To use tracelane today, add a WebdriverIO suite, or pass --runner wdio',
|
|
85
79
|
'if your project already has a wdio.conf.*.',
|
|
@@ -315,7 +309,8 @@ function previewConfEdit(configPath) {
|
|
|
315
309
|
/** Help text for `tracelane init --help`. */
|
|
316
310
|
export const INIT_HELP = `tracelane init - wire @tracelane/wdio into the project in this directory.
|
|
317
311
|
|
|
318
|
-
Usage: npx tracelane init [options]
|
|
312
|
+
Usage: npx @tracelane/cli init [options] (one-off; recommended)
|
|
313
|
+
tracelane init [options] (after 'npm i -D @tracelane/cli')
|
|
319
314
|
|
|
320
315
|
Options:
|
|
321
316
|
--runner <name> Force runner choice (wdio|playwright|cypress).
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],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,MAAM,CAAC,SAAS,CAAC,IAAI,KAAK;QACzC,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG,IAAI,KAAK;QAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,IAAI,KAAK;KACpD,CAAC,CAAC;AACL,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import { INDEX_HELP } from './commands/index-cmd.js';
|
|
2
3
|
import { INIT_HELP } from './commands/init.js';
|
|
3
4
|
export declare function run(argv: readonly string[]): Promise<number>;
|
|
4
|
-
/** Helper for tests that want the init help
|
|
5
|
-
export { INIT_HELP };
|
|
5
|
+
/** Helper for tests that want the init or index help strings. */
|
|
6
|
+
export { INIT_HELP, INDEX_HELP };
|
|
6
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,SAAS,EAAW,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAYA,OAAO,EAAE,UAAU,EAAY,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,SAAS,EAAW,MAAM,oBAAoB,CAAC;AAgBxD,wBAAsB,GAAG,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CA+BlE;AAED,iEAAiE;AACjE,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
// the first positional so the subcommand owns its own option schema, matching
|
|
10
10
|
// the peek-cli pattern.
|
|
11
11
|
import { realpathSync } from 'node:fs';
|
|
12
|
+
import { INDEX_HELP, runIndex } from './commands/index-cmd.js';
|
|
12
13
|
import { INIT_HELP, runInit } from './commands/init.js';
|
|
13
14
|
import { CLI_VERSION } from './version.js';
|
|
14
15
|
const HELP = `tracelane ${CLI_VERSION} - drop-in test-failure replay reporter scaffolding
|
|
@@ -17,6 +18,7 @@ Usage: npx tracelane <command> [options]
|
|
|
17
18
|
|
|
18
19
|
Commands:
|
|
19
20
|
init Detect runner + wire @tracelane/wdio into the project
|
|
21
|
+
index <dir> Generate a triage index for a directory of reports
|
|
20
22
|
|
|
21
23
|
Run \`npx tracelane <command> --help\` for command-specific options.
|
|
22
24
|
|
|
@@ -27,6 +29,8 @@ export async function run(argv) {
|
|
|
27
29
|
switch (command) {
|
|
28
30
|
case 'init':
|
|
29
31
|
return runInit(rest);
|
|
32
|
+
case 'index':
|
|
33
|
+
return runIndex(rest);
|
|
30
34
|
case 'version':
|
|
31
35
|
case '--version':
|
|
32
36
|
case '-v':
|
|
@@ -51,8 +55,8 @@ export async function run(argv) {
|
|
|
51
55
|
return 1;
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
|
-
/** Helper for tests that want the init help
|
|
55
|
-
export { INIT_HELP };
|
|
58
|
+
/** Helper for tests that want the init or index help strings. */
|
|
59
|
+
export { INIT_HELP, INDEX_HELP };
|
|
56
60
|
async function main() {
|
|
57
61
|
const code = await run(process.argv.slice(2));
|
|
58
62
|
process.exitCode = code;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA,yEAAyE;AACzE,6EAA6E;AAC7E,6EAA6E;AAC7E,eAAe;AACf,EAAE;AACF,6EAA6E;AAC7E,2EAA2E;AAC3E,8EAA8E;AAC9E,wBAAwB;AAExB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,WAAW,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AAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAC1F,CAAC;QACF,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;IACvB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface ExtractedMetadata {
|
|
2
|
+
/** Spec file path, e.g. `tests/e2e/checkout.e2e.ts`. */
|
|
3
|
+
spec?: string;
|
|
4
|
+
/** Test title, e.g. `completes checkout with valid card details`. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Test outcome. `unknown` if the META status couldn't be parsed. */
|
|
7
|
+
status: 'passed' | 'failed' | 'skipped' | 'broken' | 'unknown';
|
|
8
|
+
/** Multi-line assertion / stack trace; absent on pass/skip. */
|
|
9
|
+
error?: string;
|
|
10
|
+
/** Total test duration in milliseconds. */
|
|
11
|
+
durationMs?: number;
|
|
12
|
+
/** Browser name, e.g. `chrome`. */
|
|
13
|
+
browserName?: string;
|
|
14
|
+
/** Browser version string. */
|
|
15
|
+
browserVersion?: string;
|
|
16
|
+
/** Viewport at recording start. */
|
|
17
|
+
viewport?: {
|
|
18
|
+
width: number;
|
|
19
|
+
height: number;
|
|
20
|
+
};
|
|
21
|
+
/** Git SHA (auto-detected from CI env vars by the report builder). */
|
|
22
|
+
commitSha?: string;
|
|
23
|
+
/** CI build URL (auto-detected). */
|
|
24
|
+
buildUrl?: string;
|
|
25
|
+
/** Render-time timestamp pulled from the meta-strip's "Captured" item. */
|
|
26
|
+
capturedAt?: string;
|
|
27
|
+
/** Recorded event count pulled from the meta-strip's "Events" item. */
|
|
28
|
+
eventCount?: number;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Extract metadata from a tracelane report HTML string.
|
|
32
|
+
*
|
|
33
|
+
* Returns null if the META const can't be located or parsed. The caller
|
|
34
|
+
* should treat null as "this file isn't a tracelane report" and skip.
|
|
35
|
+
*/
|
|
36
|
+
export declare function extractMetadata(html: string): ExtractedMetadata | null;
|
|
37
|
+
/**
|
|
38
|
+
* Return the first non-empty line of an error string, trimmed and clamped.
|
|
39
|
+
* Used by the index card to surface a one-line excerpt without leaking the
|
|
40
|
+
* full stack trace.
|
|
41
|
+
*/
|
|
42
|
+
export declare function errorExcerpt(error: string | undefined, maxChars?: number): string;
|
|
43
|
+
//# sourceMappingURL=extract-metadata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-metadata.d.ts","sourceRoot":"","sources":["../../src/lib/extract-metadata.ts"],"names":[],"mappings":"AAWA,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,KAAK,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;IAC/D,+DAA+D;IAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2CAA2C;IAC3C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,8BAA8B;IAC9B,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,mCAAmC;IACnC,QAAQ,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC7C,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,0EAA0E;IAC1E,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AASD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI,CA+DtE;AAED;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,QAAQ,SAAM,GAAG,MAAM,CAK9E"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
// Pure metadata extraction from a tracelane HTML report. The report's bootstrap
|
|
2
|
+
// emits a `const META = ${JSON-stringified-ReportMeta};` line as part of its
|
|
3
|
+
// dataScript block (see packages/tracelane-report/src/template.ts). The
|
|
4
|
+
// meta-strip in the rendered hero contributes two more fields not in META:
|
|
5
|
+
// `Captured` (timestamp) and `Events` (count).
|
|
6
|
+
//
|
|
7
|
+
// This extractor is pure (string in → object out) so it's trivially unit-
|
|
8
|
+
// testable. It deliberately fails-soft: if the META line can't be parsed, it
|
|
9
|
+
// returns null and the caller logs + skips the report rather than crashing
|
|
10
|
+
// the index build on one malformed file.
|
|
11
|
+
const KNOWN_STATUSES = new Set([
|
|
12
|
+
'passed',
|
|
13
|
+
'failed',
|
|
14
|
+
'skipped',
|
|
15
|
+
'broken',
|
|
16
|
+
]);
|
|
17
|
+
/**
|
|
18
|
+
* Extract metadata from a tracelane report HTML string.
|
|
19
|
+
*
|
|
20
|
+
* Returns null if the META const can't be located or parsed. The caller
|
|
21
|
+
* should treat null as "this file isn't a tracelane report" and skip.
|
|
22
|
+
*/
|
|
23
|
+
export function extractMetadata(html) {
|
|
24
|
+
// Primary source: the inline `const META = {...};` declaration emitted by
|
|
25
|
+
// the report template's bootstrap dataScript block. The real report
|
|
26
|
+
// minifier collapses the bootstrap to a single line, so we anchor on the
|
|
27
|
+
// next const declaration (EVENTS_GZ_B64) as a terminator rather than `$`.
|
|
28
|
+
// Non-greedy [\s\S]*? handles nested objects (viewport, etc.) correctly
|
|
29
|
+
// because the only `;const EVENTS_GZ_B64` sequence in the report is the
|
|
30
|
+
// intended one.
|
|
31
|
+
const metaMatch = html.match(/const META = (\{[\s\S]*?\});\s*const EVENTS_GZ_B64\b/);
|
|
32
|
+
if (!metaMatch)
|
|
33
|
+
return null;
|
|
34
|
+
let parsedMeta;
|
|
35
|
+
try {
|
|
36
|
+
parsedMeta = JSON.parse(metaMatch[1]);
|
|
37
|
+
}
|
|
38
|
+
catch {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
const title = typeof parsedMeta.title === 'string' ? parsedMeta.title : '(unknown title)';
|
|
42
|
+
const rawStatus = typeof parsedMeta.status === 'string' ? parsedMeta.status : 'unknown';
|
|
43
|
+
const status = (KNOWN_STATUSES.has(rawStatus) ? rawStatus : 'unknown');
|
|
44
|
+
const result = { title, status };
|
|
45
|
+
if (typeof parsedMeta.spec === 'string')
|
|
46
|
+
result.spec = parsedMeta.spec;
|
|
47
|
+
if (typeof parsedMeta.error === 'string')
|
|
48
|
+
result.error = parsedMeta.error;
|
|
49
|
+
if (typeof parsedMeta.durationMs === 'number')
|
|
50
|
+
result.durationMs = parsedMeta.durationMs;
|
|
51
|
+
if (typeof parsedMeta.browserName === 'string')
|
|
52
|
+
result.browserName = parsedMeta.browserName;
|
|
53
|
+
if (typeof parsedMeta.browserVersion === 'string') {
|
|
54
|
+
result.browserVersion = parsedMeta.browserVersion;
|
|
55
|
+
}
|
|
56
|
+
if (parsedMeta.viewport &&
|
|
57
|
+
typeof parsedMeta.viewport === 'object' &&
|
|
58
|
+
'width' in parsedMeta.viewport &&
|
|
59
|
+
'height' in parsedMeta.viewport) {
|
|
60
|
+
const vp = parsedMeta.viewport;
|
|
61
|
+
if (typeof vp.width === 'number' && typeof vp.height === 'number') {
|
|
62
|
+
result.viewport = { width: vp.width, height: vp.height };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
if (typeof parsedMeta.commitSha === 'string')
|
|
66
|
+
result.commitSha = parsedMeta.commitSha;
|
|
67
|
+
if (typeof parsedMeta.buildUrl === 'string')
|
|
68
|
+
result.buildUrl = parsedMeta.buildUrl;
|
|
69
|
+
// Secondary: pull Captured + Events out of the rendered meta-strip. These
|
|
70
|
+
// fields aren't on ReportMeta — they're computed at report-build time.
|
|
71
|
+
const capturedMatch = html.match(/<span class="label">Captured<\/span><span class="value">([^<]+)<\/span>/);
|
|
72
|
+
if (capturedMatch?.[1])
|
|
73
|
+
result.capturedAt = capturedMatch[1];
|
|
74
|
+
const eventsMatch = html.match(/<span class="label">Events<\/span><span class="value">([^<]+)<\/span>/);
|
|
75
|
+
if (eventsMatch) {
|
|
76
|
+
const n = Number.parseInt(eventsMatch[1].replace(/,/g, ''), 10);
|
|
77
|
+
if (!Number.isNaN(n))
|
|
78
|
+
result.eventCount = n;
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Return the first non-empty line of an error string, trimmed and clamped.
|
|
84
|
+
* Used by the index card to surface a one-line excerpt without leaking the
|
|
85
|
+
* full stack trace.
|
|
86
|
+
*/
|
|
87
|
+
export function errorExcerpt(error, maxChars = 140) {
|
|
88
|
+
if (!error)
|
|
89
|
+
return '';
|
|
90
|
+
const firstLine = error.split('\n')[0]?.trim() ?? '';
|
|
91
|
+
if (firstLine.length <= maxChars)
|
|
92
|
+
return firstLine;
|
|
93
|
+
return `${firstLine.slice(0, maxChars - 1)}…`;
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=extract-metadata.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extract-metadata.js","sourceRoot":"","sources":["../../src/lib/extract-metadata.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6EAA6E;AAC7E,wEAAwE;AACxE,2EAA2E;AAC3E,+CAA+C;AAC/C,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,2EAA2E;AAC3E,yCAAyC;AA6BzC,MAAM,cAAc,GAAG,IAAI,GAAG,CAA8B;IAC1D,QAAQ;IACR,QAAQ;IACR,SAAS;IACT,QAAQ;CACT,CAAC,CAAC;AAEH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAY;IAC1C,0EAA0E;IAC1E,oEAAoE;IACpE,yEAAyE;IACzE,0EAA0E;IAC1E,wEAAwE;IACxE,wEAA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,CAAC,CAAC;YAAE,MAAM,CAAC,UAAU,GAAG,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,KAAyB,EAAE,QAAQ,GAAG,GAAG;IACpE,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACrD,IAAI,SAAS,CAAC,MAAM,IAAI,QAAQ;QAAE,OAAO,SAAS,CAAC;IACnD,OAAO,GAAG,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,GAAG,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type ExtractedMetadata } from './extract-metadata.js';
|
|
2
|
+
export interface IndexEntry {
|
|
3
|
+
/** Filename of the source report (relative to the index's output dir). */
|
|
4
|
+
filename: string;
|
|
5
|
+
/** Extracted metadata, or null if the file failed to parse. */
|
|
6
|
+
meta: ExtractedMetadata | null;
|
|
7
|
+
}
|
|
8
|
+
export interface RenderIndexInput {
|
|
9
|
+
/** All entries to render. Already sorted by the caller. */
|
|
10
|
+
entries: IndexEntry[];
|
|
11
|
+
/** Optional title for the index page. Default: `tracelane index`. */
|
|
12
|
+
title?: string;
|
|
13
|
+
/** Render timestamp. Defaults to new Date(). */
|
|
14
|
+
generatedAt?: Date;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Render the full index HTML. Single self-contained file (no remote fetches),
|
|
18
|
+
* uses system fonts so it loads instantly even with 200+ cards.
|
|
19
|
+
*/
|
|
20
|
+
export declare function renderIndex(input: RenderIndexInput): string;
|
|
21
|
+
//# sourceMappingURL=render-index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-index.d.ts","sourceRoot":"","sources":["../../src/lib/render-index.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,KAAK,iBAAiB,EAAgB,MAAM,uBAAuB,CAAC;AAY7E,MAAM,WAAW,UAAU;IACzB,0EAA0E;IAC1E,QAAQ,EAAE,MAAM,CAAC;IACjB,+DAA+D;IAC/D,IAAI,EAAE,iBAAiB,GAAG,IAAI,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,2DAA2D;IAC3D,OAAO,EAAE,UAAU,EAAE,CAAC;IACtB,qEAAqE;IACrE,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gDAAgD;IAChD,WAAW,CAAC,EAAE,IAAI,CAAC;CACpB;AA2DD;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,gBAAgB,GAAG,MAAM,CAuM3D"}
|
|
@@ -0,0 +1,273 @@
|
|
|
1
|
+
// Pure index renderer. Given a list of (filename, extracted metadata) pairs,
|
|
2
|
+
// produce a single self-contained HTML index page with one card per report.
|
|
3
|
+
//
|
|
4
|
+
// The aesthetic mirrors the report itself (Editorial Postmortem: Fraunces
|
|
5
|
+
// serif headlines, JetBrains Mono body, dark slate background, amber failure
|
|
6
|
+
// accent). Fonts are NOT inlined here — the index uses system serif/mono so
|
|
7
|
+
// the page loads instantly without the ~170 KB woff2 cost. Each card links
|
|
8
|
+
// to its source report file relative to the index.
|
|
9
|
+
import { errorExcerpt } from './extract-metadata.js';
|
|
10
|
+
/** HTML-escape a string for safe interpolation into element text / attributes. */
|
|
11
|
+
function escapeHtml(value) {
|
|
12
|
+
return value
|
|
13
|
+
.replace(/&/g, '&')
|
|
14
|
+
.replace(/</g, '<')
|
|
15
|
+
.replace(/>/g, '>')
|
|
16
|
+
.replace(/"/g, '"')
|
|
17
|
+
.replace(/'/g, ''');
|
|
18
|
+
}
|
|
19
|
+
/** Format a duration in ms as a compact human label (e.g. `12.5 s`, `1m 34s`). */
|
|
20
|
+
function formatDuration(ms) {
|
|
21
|
+
if (ms === undefined)
|
|
22
|
+
return '—';
|
|
23
|
+
if (ms < 1000)
|
|
24
|
+
return `${ms} ms`;
|
|
25
|
+
const seconds = ms / 1000;
|
|
26
|
+
if (seconds < 60)
|
|
27
|
+
return `${seconds.toFixed(1)} s`;
|
|
28
|
+
const minutes = Math.floor(seconds / 60);
|
|
29
|
+
const rest = Math.round(seconds - minutes * 60);
|
|
30
|
+
return `${minutes}m ${rest}s`;
|
|
31
|
+
}
|
|
32
|
+
function formatBrowser(meta) {
|
|
33
|
+
if (!meta.browserName)
|
|
34
|
+
return '—';
|
|
35
|
+
const name = meta.browserName.charAt(0).toUpperCase() + meta.browserName.slice(1);
|
|
36
|
+
const ver = meta.browserVersion ? ` ${meta.browserVersion.split('.')[0]}` : '';
|
|
37
|
+
const vp = meta.viewport ? ` · ${meta.viewport.width}×${meta.viewport.height}` : '';
|
|
38
|
+
return `${name}${ver}${vp}`;
|
|
39
|
+
}
|
|
40
|
+
function renderStatusPill(status) {
|
|
41
|
+
const label = status.toUpperCase();
|
|
42
|
+
return `<span class="status ${status}">${label}</span>`;
|
|
43
|
+
}
|
|
44
|
+
function renderCard(entry) {
|
|
45
|
+
const { filename, meta } = entry;
|
|
46
|
+
if (!meta) {
|
|
47
|
+
return `<a class="card unparsed" href="${escapeHtml(filename)}">
|
|
48
|
+
<div class="card-head">
|
|
49
|
+
<span class="status unknown">UNPARSED</span>
|
|
50
|
+
<span class="filename">${escapeHtml(filename)}</span>
|
|
51
|
+
</div>
|
|
52
|
+
<p class="title-row">Could not extract metadata. Click through to inspect the raw report.</p>
|
|
53
|
+
</a>`;
|
|
54
|
+
}
|
|
55
|
+
const excerpt = errorExcerpt(meta.error);
|
|
56
|
+
const specRow = meta.spec ? `<div class="spec">${escapeHtml(meta.spec)}</div>` : '';
|
|
57
|
+
const errorRow = excerpt && (meta.status === 'failed' || meta.status === 'broken')
|
|
58
|
+
? `<p class="error">${escapeHtml(excerpt)}</p>`
|
|
59
|
+
: '';
|
|
60
|
+
const footRow = [formatDuration(meta.durationMs), formatBrowser(meta), meta.capturedAt ?? '—']
|
|
61
|
+
.map((s) => `<span>${escapeHtml(s)}</span>`)
|
|
62
|
+
.join('<span class="sep">·</span>');
|
|
63
|
+
return `<a class="card status-${meta.status}" href="${escapeHtml(filename)}">
|
|
64
|
+
<div class="card-head">
|
|
65
|
+
${renderStatusPill(meta.status)}
|
|
66
|
+
${specRow}
|
|
67
|
+
</div>
|
|
68
|
+
<h2 class="title-row">${escapeHtml(meta.title)}</h2>
|
|
69
|
+
${errorRow}
|
|
70
|
+
<div class="foot">${footRow}</div>
|
|
71
|
+
</a>`;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Render the full index HTML. Single self-contained file (no remote fetches),
|
|
75
|
+
* uses system fonts so it loads instantly even with 200+ cards.
|
|
76
|
+
*/
|
|
77
|
+
export function renderIndex(input) {
|
|
78
|
+
const { entries } = input;
|
|
79
|
+
const title = input.title ?? 'tracelane index';
|
|
80
|
+
const generated = input.generatedAt ?? new Date();
|
|
81
|
+
const counts = {
|
|
82
|
+
total: entries.length,
|
|
83
|
+
failed: entries.filter((e) => e.meta?.status === 'failed').length,
|
|
84
|
+
broken: entries.filter((e) => e.meta?.status === 'broken').length,
|
|
85
|
+
passed: entries.filter((e) => e.meta?.status === 'passed').length,
|
|
86
|
+
skipped: entries.filter((e) => e.meta?.status === 'skipped').length,
|
|
87
|
+
unparsed: entries.filter((e) => !e.meta).length,
|
|
88
|
+
};
|
|
89
|
+
const summary = `${counts.total} report${counts.total === 1 ? '' : 's'} · ${counts.failed + counts.broken} failed · ${counts.passed} passed${counts.skipped ? ` · ${counts.skipped} skipped` : ''}${counts.unparsed ? ` · ${counts.unparsed} unparsed` : ''}`;
|
|
90
|
+
const cards = entries.map(renderCard).join('\n');
|
|
91
|
+
return `<!doctype html>
|
|
92
|
+
<html lang="en">
|
|
93
|
+
<head>
|
|
94
|
+
<meta charset="utf-8">
|
|
95
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
96
|
+
<title>${escapeHtml(title)}</title>
|
|
97
|
+
<style>
|
|
98
|
+
:root {
|
|
99
|
+
color-scheme: dark;
|
|
100
|
+
--bg: #0f1115;
|
|
101
|
+
--surface: #171a20;
|
|
102
|
+
--surface-2: #1d2027;
|
|
103
|
+
--border: #2a2e36;
|
|
104
|
+
--border-strong: #383d47;
|
|
105
|
+
--text: #e7e5e1;
|
|
106
|
+
--muted: #8a92a0;
|
|
107
|
+
--teal: #5eead4;
|
|
108
|
+
--amber: #f5a364;
|
|
109
|
+
--amber-dim: rgba(245, 163, 100, 0.18);
|
|
110
|
+
--serif: ui-serif, Georgia, 'Times New Roman', serif;
|
|
111
|
+
--mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
|
|
112
|
+
}
|
|
113
|
+
* { box-sizing: border-box; }
|
|
114
|
+
html, body { margin: 0; padding: 0; }
|
|
115
|
+
body {
|
|
116
|
+
font-family: var(--mono);
|
|
117
|
+
font-size: 13px;
|
|
118
|
+
line-height: 1.55;
|
|
119
|
+
color: var(--text);
|
|
120
|
+
background: var(--bg);
|
|
121
|
+
-webkit-font-smoothing: antialiased;
|
|
122
|
+
-moz-osx-font-smoothing: grayscale;
|
|
123
|
+
}
|
|
124
|
+
a { color: inherit; text-decoration: none; }
|
|
125
|
+
|
|
126
|
+
.hero {
|
|
127
|
+
padding: 32px 48px 24px;
|
|
128
|
+
border-bottom: 1px solid var(--border);
|
|
129
|
+
}
|
|
130
|
+
.hero h1 {
|
|
131
|
+
font-family: var(--serif);
|
|
132
|
+
font-weight: 500;
|
|
133
|
+
font-style: italic;
|
|
134
|
+
font-size: clamp(24px, 3vw, 32px);
|
|
135
|
+
margin: 0 0 8px;
|
|
136
|
+
letter-spacing: -0.01em;
|
|
137
|
+
}
|
|
138
|
+
.hero .summary {
|
|
139
|
+
font-family: var(--mono);
|
|
140
|
+
font-size: 12px;
|
|
141
|
+
color: var(--muted);
|
|
142
|
+
letter-spacing: 0.04em;
|
|
143
|
+
}
|
|
144
|
+
.hero .generated {
|
|
145
|
+
font-family: var(--mono);
|
|
146
|
+
font-size: 11px;
|
|
147
|
+
color: var(--muted);
|
|
148
|
+
margin-top: 4px;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
main.grid {
|
|
152
|
+
display: grid;
|
|
153
|
+
grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
|
|
154
|
+
gap: 16px;
|
|
155
|
+
padding: 24px 48px 48px;
|
|
156
|
+
}
|
|
157
|
+
@media (max-width: 720px) {
|
|
158
|
+
.hero { padding: 24px; }
|
|
159
|
+
main.grid { padding: 16px; gap: 12px; }
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.card {
|
|
163
|
+
display: block;
|
|
164
|
+
background: var(--surface);
|
|
165
|
+
border: 1px solid var(--border);
|
|
166
|
+
border-radius: 6px;
|
|
167
|
+
padding: 16px 18px;
|
|
168
|
+
transition: border-color 0.12s ease, transform 0.12s ease;
|
|
169
|
+
}
|
|
170
|
+
.card:hover {
|
|
171
|
+
border-color: var(--border-strong);
|
|
172
|
+
transform: translateY(-1px);
|
|
173
|
+
}
|
|
174
|
+
.card.status-failed, .card.status-broken {
|
|
175
|
+
border-left: 3px solid var(--amber);
|
|
176
|
+
}
|
|
177
|
+
.card.status-passed {
|
|
178
|
+
border-left: 3px solid var(--teal);
|
|
179
|
+
}
|
|
180
|
+
.card.unparsed {
|
|
181
|
+
border-left: 3px solid var(--muted);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
.card-head {
|
|
185
|
+
display: flex;
|
|
186
|
+
align-items: center;
|
|
187
|
+
gap: 8px;
|
|
188
|
+
margin-bottom: 8px;
|
|
189
|
+
flex-wrap: wrap;
|
|
190
|
+
}
|
|
191
|
+
.status {
|
|
192
|
+
font-size: 10px;
|
|
193
|
+
font-weight: 600;
|
|
194
|
+
letter-spacing: 0.12em;
|
|
195
|
+
padding: 2px 6px;
|
|
196
|
+
border-radius: 3px;
|
|
197
|
+
background: rgba(0, 0, 0, 0.25);
|
|
198
|
+
border: 1px solid var(--border);
|
|
199
|
+
color: var(--muted);
|
|
200
|
+
}
|
|
201
|
+
.status.failed, .status.broken { color: var(--amber); border-color: var(--amber-dim); }
|
|
202
|
+
.status.passed { color: var(--teal); border-color: rgba(94, 234, 212, 0.3); }
|
|
203
|
+
.spec, .filename {
|
|
204
|
+
font-family: var(--mono);
|
|
205
|
+
font-size: 11px;
|
|
206
|
+
color: var(--muted);
|
|
207
|
+
overflow: hidden;
|
|
208
|
+
text-overflow: ellipsis;
|
|
209
|
+
white-space: nowrap;
|
|
210
|
+
flex: 1;
|
|
211
|
+
min-width: 0;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.title-row {
|
|
215
|
+
font-family: var(--serif);
|
|
216
|
+
font-weight: 500;
|
|
217
|
+
font-size: 16px;
|
|
218
|
+
line-height: 1.3;
|
|
219
|
+
margin: 0 0 10px;
|
|
220
|
+
color: var(--text);
|
|
221
|
+
display: -webkit-box;
|
|
222
|
+
-webkit-line-clamp: 2;
|
|
223
|
+
-webkit-box-orient: vertical;
|
|
224
|
+
overflow: hidden;
|
|
225
|
+
}
|
|
226
|
+
.error {
|
|
227
|
+
font-family: var(--mono);
|
|
228
|
+
font-size: 11px;
|
|
229
|
+
color: var(--muted);
|
|
230
|
+
margin: 0 0 12px;
|
|
231
|
+
padding-left: 8px;
|
|
232
|
+
border-left: 2px solid var(--border-strong);
|
|
233
|
+
display: -webkit-box;
|
|
234
|
+
-webkit-line-clamp: 2;
|
|
235
|
+
-webkit-box-orient: vertical;
|
|
236
|
+
overflow: hidden;
|
|
237
|
+
}
|
|
238
|
+
.foot {
|
|
239
|
+
display: flex;
|
|
240
|
+
align-items: center;
|
|
241
|
+
gap: 6px;
|
|
242
|
+
font-size: 10px;
|
|
243
|
+
color: var(--muted);
|
|
244
|
+
letter-spacing: 0.02em;
|
|
245
|
+
flex-wrap: wrap;
|
|
246
|
+
}
|
|
247
|
+
.foot .sep { opacity: 0.4; }
|
|
248
|
+
|
|
249
|
+
footer {
|
|
250
|
+
padding: 16px 48px 24px;
|
|
251
|
+
border-top: 1px solid var(--border);
|
|
252
|
+
font-size: 11px;
|
|
253
|
+
color: var(--muted);
|
|
254
|
+
}
|
|
255
|
+
footer a { color: var(--teal); }
|
|
256
|
+
</style>
|
|
257
|
+
</head>
|
|
258
|
+
<body>
|
|
259
|
+
<section class="hero">
|
|
260
|
+
<h1>${escapeHtml(title)}</h1>
|
|
261
|
+
<div class="summary">${escapeHtml(summary)}</div>
|
|
262
|
+
<div class="generated">Generated ${escapeHtml(generated.toISOString())}</div>
|
|
263
|
+
</section>
|
|
264
|
+
<main class="grid">
|
|
265
|
+
${cards}
|
|
266
|
+
</main>
|
|
267
|
+
<footer>
|
|
268
|
+
Generated by <a href="https://github.com/Cubenest/rrweb-stack/tree/main/packages/tracelane-cli">tracelane index</a> — single-file CI failure triage. No SaaS, no telemetry.
|
|
269
|
+
</footer>
|
|
270
|
+
</body>
|
|
271
|
+
</html>`;
|
|
272
|
+
}
|
|
273
|
+
//# sourceMappingURL=render-index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"render-index.js","sourceRoot":"","sources":["../../src/lib/render-index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,6EAA6E;AAC7E,4EAA4E;AAC5E,2EAA2E;AAC3E,mDAAmD;AAEnD,OAAO,EAA0B,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE7E,kFAAkF;AAClF,SAAS,UAAU,CAAC,KAAa;IAC/B,OAAO,KAAK;SACT,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;SACtB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,MAAM,CAAC;SACrB,OAAO,CAAC,IAAI,EAAE,QAAQ,CAAC;SACvB,OAAO,CAAC,IAAI,EAAE,OAAO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,OAAO,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,OAAO,UAAU,CAAC,CAAC,CAAC,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,MAAM,CAAC,QAAQ,WAAW,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IAE9P,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAEjD,OAAO;;;;;SAKA,UAAU,CAAC,KAAK,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAoKlB,UAAU,CAAC,KAAK,CAAC;yBACA,UAAU,CAAC,OAAO,CAAC;qCACP,UAAU,CAAC,SAAS,CAAC,WAAW,EAAE,CAAC;;;EAGtE,KAAK;;;;;;QAMC,CAAC;AACT,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tracelane/cli",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
4
|
-
"description": "tracelane scaffolding CLI. `npx tracelane init` detects your test runner (WDIO / Playwright / Cypress) and wires @tracelane/wdio into wdio.conf.* in one command — the published path from `npm install` + manual conf edit to a single npx invocation.",
|
|
3
|
+
"version": "0.1.0-alpha.11",
|
|
4
|
+
"description": "tracelane scaffolding CLI. `npx @tracelane/cli init` detects your test runner (WDIO / Playwright / Cypress) and wires @tracelane/wdio into wdio.conf.* in one command — the published path from `npm install` + manual conf edit to a single npx invocation.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"tracelane",
|
|
7
|
+
"testing",
|
|
8
|
+
"e2e",
|
|
9
|
+
"webdriverio",
|
|
10
|
+
"playwright",
|
|
11
|
+
"cypress",
|
|
12
|
+
"init",
|
|
13
|
+
"scaffold"
|
|
14
|
+
],
|
|
5
15
|
"license": "Apache-2.0",
|
|
16
|
+
"funding": {
|
|
17
|
+
"type": "github",
|
|
18
|
+
"url": "https://github.com/sponsors/harry-harish"
|
|
19
|
+
},
|
|
6
20
|
"type": "module",
|
|
7
21
|
"bin": {
|
|
8
22
|
"tracelane": "./dist/index.js"
|
|
@@ -20,11 +34,6 @@
|
|
|
20
34
|
"NOTICE",
|
|
21
35
|
"README.md"
|
|
22
36
|
],
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsc -p tsconfig.json && node ./scripts/postbuild.mjs",
|
|
25
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
-
"test": "vitest run --passWithNoTests"
|
|
27
|
-
},
|
|
28
37
|
"dependencies": {},
|
|
29
38
|
"devDependencies": {
|
|
30
39
|
"@types/node": "^22.10.0"
|
|
@@ -38,5 +47,16 @@
|
|
|
38
47
|
"url": "https://github.com/Cubenest/rrweb-stack",
|
|
39
48
|
"directory": "packages/tracelane-cli"
|
|
40
49
|
},
|
|
41
|
-
"
|
|
42
|
-
|
|
50
|
+
"bugs": {
|
|
51
|
+
"url": "https://github.com/Cubenest/rrweb-stack/issues"
|
|
52
|
+
},
|
|
53
|
+
"homepage": "https://tracelane.cubenest.in",
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc -p tsconfig.json && node ./scripts/postbuild.mjs",
|
|
59
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
60
|
+
"test": "vitest run --passWithNoTests"
|
|
61
|
+
}
|
|
62
|
+
}
|