screw-bugs 0.1.9 → 0.1.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/README.md +100 -54
- package/dist/browser-playwright/capture.js +1 -1
- package/dist/build-info.json +3 -3
- package/dist/cli/app.js +6 -2
- package/dist/cli/commands.js +4 -3
- package/dist/cli/doctor.d.ts +17 -2
- package/dist/cli/doctor.js +62 -4
- package/dist/cli/mcp.js +7 -4
- package/dist/cli/report-server.d.ts +19 -10
- package/dist/cli/report-server.js +43 -18
- package/dist/cli/share.js +2 -2
- package/dist/cli/sign-in.d.ts +9 -3
- package/dist/cli/sign-in.js +12 -9
- package/dist/cli/tailnet.d.ts +57 -0
- package/dist/cli/tailnet.js +82 -0
- package/dist/core/index.d.ts +1 -14
- package/dist/core/index.js +3 -14
- package/dist/report/index.d.ts +1 -10
- package/dist/report/index.js +3 -10
- package/dist/schema/index.d.ts +1 -9
- package/dist/schema/index.js +3 -9
- package/package.json +14 -14
- package/dist/core/accounts.d.ts +0 -40
- package/dist/core/accounts.js +0 -95
- package/dist/core/css.d.ts +0 -95
- package/dist/core/css.js +0 -436
- package/dist/core/engine.d.ts +0 -75
- package/dist/core/engine.js +0 -560
- package/dist/core/errors.d.ts +0 -85
- package/dist/core/errors.js +0 -36
- package/dist/core/evidence.d.ts +0 -14
- package/dist/core/evidence.js +0 -131
- package/dist/core/labels.d.ts +0 -47
- package/dist/core/labels.js +0 -199
- package/dist/core/liveness.d.ts +0 -45
- package/dist/core/liveness.js +0 -66
- package/dist/core/marks.d.ts +0 -63
- package/dist/core/marks.js +0 -410
- package/dist/core/services.d.ts +0 -579
- package/dist/core/services.js +0 -25
- package/dist/core/share.d.ts +0 -68
- package/dist/core/share.js +0 -318
- package/dist/core/steps.d.ts +0 -106
- package/dist/core/steps.js +0 -722
- package/dist/core/uploads.d.ts +0 -49
- package/dist/core/uploads.js +0 -133
- package/dist/core/video.d.ts +0 -53
- package/dist/core/video.js +0 -241
- package/dist/core/viewport.d.ts +0 -28
- package/dist/core/viewport.js +0 -50
- package/dist/report/assets.d.ts +0 -34
- package/dist/report/assets.js +0 -105
- package/dist/report/bug.d.ts +0 -11
- package/dist/report/bug.js +0 -20
- package/dist/report/html.d.ts +0 -47
- package/dist/report/html.js +0 -923
- package/dist/report/icons.d.ts +0 -51
- package/dist/report/icons.js +0 -93
- package/dist/report/live.d.ts +0 -7
- package/dist/report/live.js +0 -135
- package/dist/report/logos.d.ts +0 -4
- package/dist/report/logos.js +0 -19
- package/dist/report/markup.d.ts +0 -50
- package/dist/report/markup.js +0 -156
- package/dist/report/menu-bar.d.ts +0 -60
- package/dist/report/menu-bar.js +0 -157
- package/dist/report/player.d.ts +0 -102
- package/dist/report/player.js +0 -315
- package/dist/report/pr-summary.d.ts +0 -11
- package/dist/report/pr-summary.js +0 -119
- package/dist/report/sha256.d.ts +0 -9
- package/dist/report/sha256.js +0 -97
- package/dist/report/share-page.d.ts +0 -48
- package/dist/report/share-page.js +0 -291
- package/dist/report/shots.d.ts +0 -59
- package/dist/report/shots.js +0 -280
- package/dist/report/sign-in.d.ts +0 -41
- package/dist/report/sign-in.js +0 -568
- package/dist/report/styles.d.ts +0 -3
- package/dist/report/styles.js +0 -274
- package/dist/report/view.d.ts +0 -296
- package/dist/report/view.js +0 -702
- package/dist/report/walkthrough.d.ts +0 -93
- package/dist/report/walkthrough.js +0 -716
- package/dist/schema/accounts.d.ts +0 -137
- package/dist/schema/accounts.js +0 -121
- package/dist/schema/config.d.ts +0 -7
- package/dist/schema/config.js +0 -6
- package/dist/schema/doctor.d.ts +0 -46
- package/dist/schema/doctor.js +0 -30
- package/dist/schema/evidence.d.ts +0 -1115
- package/dist/schema/evidence.js +0 -565
- package/dist/schema/findings.d.ts +0 -161
- package/dist/schema/findings.js +0 -82
- package/dist/schema/job.d.ts +0 -1905
- package/dist/schema/job.js +0 -577
- package/dist/schema/ledger.d.ts +0 -1124
- package/dist/schema/ledger.js +0 -285
- package/dist/schema/share.d.ts +0 -55
- package/dist/schema/share.js +0 -64
- package/dist/schema/status.d.ts +0 -7
- package/dist/schema/status.js +0 -11
package/dist/report/icons.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/** Where the icons come from: the package and its version. */
|
|
2
|
-
export declare const LUCIDE_SOURCE = "lucide-static@1.70.0";
|
|
3
|
-
/** Each icon's inner elements, on Lucide's 24 × 24 grid, exactly as Lucide ships them. */
|
|
4
|
-
export declare const ICONS: {
|
|
5
|
-
readonly 'arrow-right': '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>';
|
|
6
|
-
readonly check: '<path d="M20 6 9 17l-5-5"/>';
|
|
7
|
-
readonly 'chevron-left': '<path d="m15 18-6-6 6-6"/>';
|
|
8
|
-
readonly 'chevron-right': '<path d="m9 18 6-6-6-6"/>';
|
|
9
|
-
readonly 'chevrons-down-up': '<path d="m7 20 5-5 5 5"/><path d="m7 4 5 5 5-5"/>';
|
|
10
|
-
readonly 'chevrons-up-down': '<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>';
|
|
11
|
-
readonly 'circle-question-mark': '<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>';
|
|
12
|
-
readonly maximize: '<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>';
|
|
13
|
-
readonly copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>';
|
|
14
|
-
readonly 'external-link': '<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>';
|
|
15
|
-
readonly 'file-text': '<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>';
|
|
16
|
-
readonly keyboard: '<path d="M10 8h.01"/><path d="M12 12h.01"/><path d="M14 8h.01"/><path d="M16 12h.01"/><path d="M18 8h.01"/><path d="M6 8h.01"/><path d="M7 16h10"/><path d="M8 12h.01"/><rect width="20" height="16" x="2" y="4" rx="2"/>';
|
|
17
|
-
readonly minimize: '<path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/>';
|
|
18
|
-
readonly minus: '<path d="M5 12h14"/>';
|
|
19
|
-
readonly mouse: '<rect x="5" y="2" width="14" height="20" rx="7"/><path d="M12 6v4"/>';
|
|
20
|
-
readonly 'mouse-left': '<path d="M12 7.318V10"/><path d="M5 10v5a7 7 0 0 0 14 0V9c0-3.527-2.608-6.515-6-7"/><circle cx="7" cy="4" r="2"/>';
|
|
21
|
-
readonly 'mouse-pointer-2': '<path d="M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"/>';
|
|
22
|
-
readonly monitor: '<rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/>';
|
|
23
|
-
readonly moon: '<path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/>';
|
|
24
|
-
readonly pause: '<rect x="14" y="3" width="5" height="18" rx="1"/><rect x="5" y="3" width="5" height="18" rx="1"/>';
|
|
25
|
-
readonly play: '<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"/>';
|
|
26
|
-
readonly 'refresh-cw': '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>';
|
|
27
|
-
readonly smartphone: '<rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/>';
|
|
28
|
-
readonly 'text-cursor': '<path d="M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1"/><path d="M7 22h1a4 4 0 0 0 4-4"/><path d="M7 2h1a4 4 0 0 1 4 4"/>';
|
|
29
|
-
readonly share: '<path d="M12 2v13"/><path d="m16 6-4-4-4 4"/><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/>';
|
|
30
|
-
readonly sun: '<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>';
|
|
31
|
-
readonly timer: '<line x1="10" x2="14" y1="2" y2="2"/><line x1="12" x2="15" y1="14" y2="11"/><circle cx="12" cy="14" r="8"/>';
|
|
32
|
-
readonly x: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>';
|
|
33
|
-
};
|
|
34
|
-
export type IconName = keyof typeof ICONS;
|
|
35
|
-
export interface IconOptions {
|
|
36
|
-
/** Width and height in CSS pixels (16 unless said); the page's styles may size it instead. */
|
|
37
|
-
readonly size?: number;
|
|
38
|
-
/** Lucide's is 2 (of 24); a little more keeps small icons from looking faint. */
|
|
39
|
-
readonly strokeWidth?: number;
|
|
40
|
-
/** More classes after `icon`, such as the play button's `i-play`. */
|
|
41
|
-
readonly className?: string;
|
|
42
|
-
/** Filled as well as stroked, such as the play button's triangle. */
|
|
43
|
-
readonly filled?: boolean;
|
|
44
|
-
/** Draw only part of the icon: its elements with this one removed (a circle, say). */
|
|
45
|
-
readonly without?: string;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* An icon as inline SVG markup, decorative: whatever it is on says its name. Plain text, so this
|
|
49
|
-
* module needs no other; `icon` in `markup.ts` gives it as markup for the page templates.
|
|
50
|
-
*/
|
|
51
|
-
export declare const iconSvg: (name: IconName, options?: IconOptions) => string;
|
package/dist/report/icons.js
DELETED
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Lucide icons, vendored: only the ones the pages use, as their inner SVG elements, copied
|
|
3
|
-
* unchanged from lucide-static 1.70.0
|
|
4
|
-
* (https://unpkg.com/lucide-static@1.70.0/icons/<name>.svg; https://lucide.dev).
|
|
5
|
-
*
|
|
6
|
-
* ISC License
|
|
7
|
-
*
|
|
8
|
-
* Copyright (c) 2026 Lucide Icons and Contributors
|
|
9
|
-
*
|
|
10
|
-
* Permission to use, copy, modify, and/or distribute this software for any
|
|
11
|
-
* purpose with or without fee is hereby granted, provided that the above
|
|
12
|
-
* copyright notice and this permission notice appear in all copies.
|
|
13
|
-
*
|
|
14
|
-
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
15
|
-
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
16
|
-
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
17
|
-
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
18
|
-
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
19
|
-
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
20
|
-
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
21
|
-
*
|
|
22
|
-
* Of these, check, chevron-left, chevron-right, copy, external-link, file-text, maximize, minus,
|
|
23
|
-
* monitor, moon, share,
|
|
24
|
-
* smartphone and x are derived from the Feather project, under its MIT License:
|
|
25
|
-
*
|
|
26
|
-
* The MIT License (MIT) (for the icons listed above)
|
|
27
|
-
*
|
|
28
|
-
* Copyright (c) 2013-present Cole Bemis
|
|
29
|
-
*
|
|
30
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
31
|
-
* of this software and associated documentation files (the "Software"), to deal
|
|
32
|
-
* in the Software without restriction, including without limitation the rights
|
|
33
|
-
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
34
|
-
* copies of the Software, and to permit persons to whom the Software is
|
|
35
|
-
* furnished to do so, subject to the following conditions:
|
|
36
|
-
*
|
|
37
|
-
* The above copyright notice and this permission notice shall be included in all
|
|
38
|
-
* copies or substantial portions of the Software.
|
|
39
|
-
*
|
|
40
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
41
|
-
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
42
|
-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
43
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
44
|
-
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
45
|
-
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
46
|
-
* SOFTWARE.
|
|
47
|
-
*/
|
|
48
|
-
/** Where the icons come from: the package and its version. */
|
|
49
|
-
export const LUCIDE_SOURCE = 'lucide-static@1.70.0';
|
|
50
|
-
/** Each icon's inner elements, on Lucide's 24 × 24 grid, exactly as Lucide ships them. */
|
|
51
|
-
export const ICONS = {
|
|
52
|
-
'arrow-right': '<path d="M5 12h14"/><path d="m12 5 7 7-7 7"/>',
|
|
53
|
-
check: '<path d="M20 6 9 17l-5-5"/>',
|
|
54
|
-
'chevron-left': '<path d="m15 18-6-6 6-6"/>',
|
|
55
|
-
'chevron-right': '<path d="m9 18 6-6-6-6"/>',
|
|
56
|
-
'chevrons-down-up': '<path d="m7 20 5-5 5 5"/><path d="m7 4 5 5 5-5"/>',
|
|
57
|
-
'chevrons-up-down': '<path d="m7 15 5 5 5-5"/><path d="m7 9 5-5 5 5"/>',
|
|
58
|
-
'circle-question-mark': '<circle cx="12" cy="12" r="10"/><path d="M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"/><path d="M12 17h.01"/>',
|
|
59
|
-
maximize: '<path d="M8 3H5a2 2 0 0 0-2 2v3"/><path d="M21 8V5a2 2 0 0 0-2-2h-3"/><path d="M3 16v3a2 2 0 0 0 2 2h3"/><path d="M16 21h3a2 2 0 0 0 2-2v-3"/>',
|
|
60
|
-
copy: '<rect width="14" height="14" x="8" y="8" rx="2" ry="2"/><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"/>',
|
|
61
|
-
'external-link': '<path d="M15 3h6v6"/><path d="M10 14 21 3"/><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"/>',
|
|
62
|
-
'file-text': '<path d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"/><path d="M14 2v5a1 1 0 0 0 1 1h5"/><path d="M10 9H8"/><path d="M16 13H8"/><path d="M16 17H8"/>',
|
|
63
|
-
keyboard: '<path d="M10 8h.01"/><path d="M12 12h.01"/><path d="M14 8h.01"/><path d="M16 12h.01"/><path d="M18 8h.01"/><path d="M6 8h.01"/><path d="M7 16h10"/><path d="M8 12h.01"/><rect width="20" height="16" x="2" y="4" rx="2"/>',
|
|
64
|
-
minimize: '<path d="M8 3v3a2 2 0 0 1-2 2H3"/><path d="M21 8h-3a2 2 0 0 1-2-2V3"/><path d="M3 16h3a2 2 0 0 1 2 2v3"/><path d="M16 21v-3a2 2 0 0 1 2-2h3"/>',
|
|
65
|
-
minus: '<path d="M5 12h14"/>',
|
|
66
|
-
mouse: '<rect x="5" y="2" width="14" height="20" rx="7"/><path d="M12 6v4"/>',
|
|
67
|
-
'mouse-left': '<path d="M12 7.318V10"/><path d="M5 10v5a7 7 0 0 0 14 0V9c0-3.527-2.608-6.515-6-7"/><circle cx="7" cy="4" r="2"/>',
|
|
68
|
-
'mouse-pointer-2': '<path d="M4.037 4.688a.495.495 0 0 1 .651-.651l16 6.5a.5.5 0 0 1-.063.947l-6.124 1.58a2 2 0 0 0-1.438 1.435l-1.579 6.126a.5.5 0 0 1-.947.063z"/>',
|
|
69
|
-
monitor: '<rect width="20" height="14" x="2" y="3" rx="2"/><line x1="8" x2="16" y1="21" y2="21"/><line x1="12" x2="12" y1="17" y2="21"/>',
|
|
70
|
-
moon: '<path d="M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"/>',
|
|
71
|
-
pause: '<rect x="14" y="3" width="5" height="18" rx="1"/><rect x="5" y="3" width="5" height="18" rx="1"/>',
|
|
72
|
-
play: '<path d="M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"/>',
|
|
73
|
-
'refresh-cw': '<path d="M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"/><path d="M21 3v5h-5"/><path d="M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"/><path d="M8 16H3v5"/>',
|
|
74
|
-
smartphone: '<rect width="14" height="20" x="5" y="2" rx="2" ry="2"/><path d="M12 18h.01"/>',
|
|
75
|
-
'text-cursor': '<path d="M17 22h-1a4 4 0 0 1-4-4V6a4 4 0 0 1 4-4h1"/><path d="M7 22h1a4 4 0 0 0 4-4"/><path d="M7 2h1a4 4 0 0 1 4 4"/>',
|
|
76
|
-
share: '<path d="M12 2v13"/><path d="m16 6-4-4-4 4"/><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"/>',
|
|
77
|
-
sun: '<circle cx="12" cy="12" r="4"/><path d="M12 2v2"/><path d="M12 20v2"/><path d="m4.93 4.93 1.41 1.41"/><path d="m17.66 17.66 1.41 1.41"/><path d="M2 12h2"/><path d="M20 12h2"/><path d="m6.34 17.66-1.41 1.41"/><path d="m19.07 4.93-1.41 1.41"/>',
|
|
78
|
-
timer: '<line x1="10" x2="14" y1="2" y2="2"/><line x1="12" x2="15" y1="14" y2="11"/><circle cx="12" cy="14" r="8"/>',
|
|
79
|
-
x: '<path d="M18 6 6 18"/><path d="m6 6 12 12"/>',
|
|
80
|
-
};
|
|
81
|
-
/**
|
|
82
|
-
* An icon as inline SVG markup, decorative: whatever it is on says its name. Plain text, so this
|
|
83
|
-
* module needs no other; `icon` in `markup.ts` gives it as markup for the page templates.
|
|
84
|
-
*/
|
|
85
|
-
export const iconSvg = (name, options = {}) => {
|
|
86
|
-
const size = String(options.size ?? 16);
|
|
87
|
-
const body = options.without === undefined ? ICONS[name] : ICONS[name].replace(options.without, '');
|
|
88
|
-
const className = `icon${options.className ? ` ${options.className}` : ''}`;
|
|
89
|
-
return (`<svg class="${className}" width="${size}" height="${size}" viewBox="0 0 24 24"` +
|
|
90
|
-
` fill="${options.filled ? 'currentColor' : 'none'}" stroke="currentColor"` +
|
|
91
|
-
` stroke-width="${String(options.strokeWidth ?? 2)}" stroke-linecap="round"` +
|
|
92
|
-
` stroke-linejoin="round" aria-hidden="true">${body}</svg>`);
|
|
93
|
-
};
|
package/dist/report/live.d.ts
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { LivePage } from '../core/index.js';
|
|
2
|
-
/** How often the page reloads itself while the run is going, in seconds. */
|
|
3
|
-
export declare const LIVE_REFRESH_S = 3;
|
|
4
|
-
/** No script, nothing from elsewhere: only its own styles and the favicon's data URL. */
|
|
5
|
-
export declare const LIVE_CSP = "default-src 'none'; img-src data:; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'";
|
|
6
|
-
/** The whole `live.html`. */
|
|
7
|
-
export declare const renderLivePage: (page: LivePage) => string;
|
package/dist/report/live.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { progressText, runFiles, summaryOf } from '../schema/index.js';
|
|
2
|
-
import { favicon, html, Markup, safeRelative } from './markup.js';
|
|
3
|
-
import { dark, light } from './styles.js';
|
|
4
|
-
import { countsOf, formatTime, statusLabel } from './view.js';
|
|
5
|
-
/*
|
|
6
|
-
* `live.html`: the page a person watches a run on while it goes. Written by the run with every
|
|
7
|
-
* ledger write (see the engine), it reloads itself every `LIVE_REFRESH_S` seconds while the run is
|
|
8
|
-
* going; once the run ended it stops and links the report (and the walkthrough). No script.
|
|
9
|
-
*/
|
|
10
|
-
/** How often the page reloads itself while the run is going, in seconds. */
|
|
11
|
-
export const LIVE_REFRESH_S = 3;
|
|
12
|
-
/** No script, nothing from elsewhere: only its own styles and the favicon's data URL. */
|
|
13
|
-
export const LIVE_CSP = "default-src 'none'; img-src data:; style-src 'unsafe-inline'; base-uri 'none'; form-action 'none'";
|
|
14
|
-
const liveStyles = /* css */ `
|
|
15
|
-
:root { ${light} }
|
|
16
|
-
@media (prefers-color-scheme: dark) { :root { ${dark} } }
|
|
17
|
-
* { box-sizing: border-box; }
|
|
18
|
-
body { margin: 0; background: var(--bg); color: var(--text);
|
|
19
|
-
font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
|
|
20
|
-
main { max-width: 760px; margin: 0 auto; padding: 32px 16px 48px; }
|
|
21
|
-
h1 { font-size: 20px; margin: 0 0 4px; }
|
|
22
|
-
.sub, .note { color: var(--muted); font-size: 13px; margin: 0; }
|
|
23
|
-
.now { margin: 20px 0 8px; padding: 12px 14px; border: 1px solid var(--accent-border);
|
|
24
|
-
background: var(--accent-subtle); border-radius: 8px; font-weight: 600; }
|
|
25
|
-
.now.ended { border-color: var(--border); background: var(--panel); }
|
|
26
|
-
.now a { color: var(--link); }
|
|
27
|
-
.counts { margin: 0 0 16px; color: var(--muted); }
|
|
28
|
-
ol { list-style: none; padding: 0; margin: 0 0 16px; border: 1px solid var(--border);
|
|
29
|
-
border-radius: 8px; overflow: hidden; }
|
|
30
|
-
li { display: flex; gap: 12px; align-items: baseline; padding: 10px 14px;
|
|
31
|
-
border-top: 1px solid var(--border); background: var(--panel); }
|
|
32
|
-
li:first-child { border-top: 0; }
|
|
33
|
-
li.current { background: var(--accent-subtle); }
|
|
34
|
-
.state { flex: none; width: 112px; font-size: 13px; font-weight: 600; }
|
|
35
|
-
.s-failed, .s-blocked { color: var(--fail-text); }
|
|
36
|
-
.s-pending, .s-not_verified { color: var(--muted); }
|
|
37
|
-
.title { min-width: 0; overflow-wrap: anywhere; }
|
|
38
|
-
.title code { font-size: 12px; color: var(--muted); }
|
|
39
|
-
.reason { display: block; font-size: 13px; color: var(--muted); }
|
|
40
|
-
`;
|
|
41
|
-
const isEnded = (page) => page.ledger.state === 'finished' || page.ledger.state === 'errored';
|
|
42
|
-
/** A case's state as the page shows it: its result, or running, or pending while the run goes. */
|
|
43
|
-
const stateOf = (page, entry, index) => {
|
|
44
|
-
if (isEnded(page) || entry.status !== 'not_verified' || entry.reason !== undefined)
|
|
45
|
-
return { key: entry.status, label: statusLabel[entry.status] };
|
|
46
|
-
const current = page.ledger.progress?.case;
|
|
47
|
-
if (current === index + 1) {
|
|
48
|
-
const { step, kind } = page.ledger.progress ?? {};
|
|
49
|
-
return {
|
|
50
|
-
key: 'running',
|
|
51
|
-
label: step === undefined ? 'Running' : `Running step ${step}${kind ? ` (${kind})` : ''}`,
|
|
52
|
-
};
|
|
53
|
-
}
|
|
54
|
-
return { key: 'pending', label: 'Pending' };
|
|
55
|
-
};
|
|
56
|
-
const countsLine = (cases) => {
|
|
57
|
-
const counts = countsOf(cases);
|
|
58
|
-
return (`${counts.passed} passed, ${counts.failed} failed, ${counts.blocked} blocked, ` +
|
|
59
|
-
`${counts.not_verified} not verified`);
|
|
60
|
-
};
|
|
61
|
-
/** What the run is doing now, or how it ended and where its report is. */
|
|
62
|
-
const nowLine = (page) => {
|
|
63
|
-
const { ledger } = page;
|
|
64
|
-
if (!isEnded(page)) {
|
|
65
|
-
const where = progressText(ledger);
|
|
66
|
-
return html `<p class="now" role="status">
|
|
67
|
-
${where === undefined
|
|
68
|
-
? ledger.state === 'queued'
|
|
69
|
-
? 'Starting the browser…'
|
|
70
|
-
: 'The run is going.'
|
|
71
|
-
: `Running ${where}.`}
|
|
72
|
-
</p>`;
|
|
73
|
-
}
|
|
74
|
-
const report = safeRelative(page.report);
|
|
75
|
-
const walkthrough = safeRelative(page.walkthrough);
|
|
76
|
-
const how = ledger.state === 'finished' ? 'The run finished.' : `The run stopped: ${ledger.error ?? ''}`;
|
|
77
|
-
const links = [
|
|
78
|
-
...(report ? [html `<a href="${report}">Open the report</a>`] : []),
|
|
79
|
-
...(walkthrough ? [html `<a href="${walkthrough}">watch it step by step</a>`] : []),
|
|
80
|
-
];
|
|
81
|
-
return html `<p class="now ended" role="status">
|
|
82
|
-
${how}
|
|
83
|
-
${links.length === 0
|
|
84
|
-
? `Its report could not be written; \`screw-bugs report ${ledger.jobId}\` tries again.`
|
|
85
|
-
: html `${links.length === 2 ? html `${links[0]} or ${links[1]}` : links[0]}.`}
|
|
86
|
-
</p>`;
|
|
87
|
-
};
|
|
88
|
-
/** The whole `live.html`. */
|
|
89
|
-
export const renderLivePage = (page) => {
|
|
90
|
-
const { ledger, spec } = page;
|
|
91
|
-
const ended = isEnded(page);
|
|
92
|
-
const updated = ledger.heartbeatAt ?? ledger.startedAt;
|
|
93
|
-
const heading = summaryOf(spec).text;
|
|
94
|
-
return html `<!doctype html>
|
|
95
|
-
<html lang="en">
|
|
96
|
-
<head>
|
|
97
|
-
<meta charset="utf-8" />
|
|
98
|
-
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
99
|
-
<meta http-equiv="Content-Security-Policy" content="${LIVE_CSP}" />
|
|
100
|
-
${ended ? '' : html `<meta http-equiv="refresh" content="${LIVE_REFRESH_S}" />`}
|
|
101
|
-
<title>${ended ? 'Run ended' : 'Running'} · screw-bugs</title>
|
|
102
|
-
${favicon}
|
|
103
|
-
<style>
|
|
104
|
-
${new Markup(liveStyles)}
|
|
105
|
-
</style>
|
|
106
|
-
</head>
|
|
107
|
-
<body>
|
|
108
|
-
<main>
|
|
109
|
-
<h1>${spec.title?.trim() ? spec.title : heading}</h1>
|
|
110
|
-
<p class="sub">Job ${ledger.jobId} · ${spec.url}</p>
|
|
111
|
-
${nowLine(page)}
|
|
112
|
-
<p class="counts">${countsLine(ledger.cases)}</p>
|
|
113
|
-
<ol>
|
|
114
|
-
${ledger.cases.map((entry, index) => {
|
|
115
|
-
const state = stateOf(page, entry, index);
|
|
116
|
-
return html `<li class="${state.key === 'running' ? 'current' : ''}">
|
|
117
|
-
<span class="${`state s-${state.key}`}">${state.label}</span>
|
|
118
|
-
<span class="title"
|
|
119
|
-
>${entry.title} <code>${entry.id}</code> ${entry.reason !== undefined
|
|
120
|
-
? html `<span class="reason">${entry.reason}</span>`
|
|
121
|
-
: ''}</span
|
|
122
|
-
>
|
|
123
|
-
</li>`;
|
|
124
|
-
})}
|
|
125
|
-
</ol>
|
|
126
|
-
<p class="note">
|
|
127
|
-
${updated !== undefined ? `Last updated ${formatTime(updated)}. ` : ''}${ended
|
|
128
|
-
? `This page no longer changes; ${runFiles.html} has the results.`
|
|
129
|
-
: `This page reloads itself every ${LIVE_REFRESH_S} s while the run is going. ` +
|
|
130
|
-
'If “last updated” stops moving, the run has stopped: its status then gives its report.'}
|
|
131
|
-
</p>
|
|
132
|
-
</main>
|
|
133
|
-
</body>
|
|
134
|
-
</html>`.value;
|
|
135
|
-
};
|
package/dist/report/logos.d.ts
DELETED
package/dist/report/logos.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Brand logos, inline so the pages stay one file: GitHub's mark beside the top bar's GitHub link,
|
|
3
|
-
* and Chrome's beside a run's Chrome or Chromium in the meta row. From SVGL
|
|
4
|
-
* (https://svgl.app/library/chrome.svg, github_light.svg and github_dark.svg), minified: each
|
|
5
|
-
* path's data as given, without the files' sizes, and the dark mark's `scale(64)` folded into
|
|
6
|
-
* its view box. The logos are their owners' trademarks (GitHub, Inc. and Google LLC), shown only
|
|
7
|
-
* to name what they stand for. Decorative: the words beside them say the same.
|
|
8
|
-
*/
|
|
9
|
-
/** GitHub's mark in dark ink, for the light theme (SVGL's `github_light.svg`). */
|
|
10
|
-
const GITHUB_ON_LIGHT = '<svg class="logo gh-light" width="14" height="14" viewBox="0 0 1024 1024" aria-hidden="true">' +
|
|
11
|
-
'<path fill="#1b1f23" fill-rule="evenodd" clip-rule="evenodd" d="M512 0C229.12 0 0 229.12 0 512c0 226.56 146.56 417.92 350.08 485.76 25.6 4.48 35.2-10.88 35.2-24.32 0-12.16-.64-52.48-.64-95.36-128.64 23.68-161.92-31.36-172.16-60.16-5.76-14.72-30.72-60.16-52.48-72.32-17.92-9.6-43.52-33.28-.64-33.92 40.32-.64 69.12 37.12 78.72 52.48 46.08 77.44 119.68 55.68 149.12 42.24 4.48-33.28 17.92-55.68 32.64-68.48-113.92-12.8-232.96-56.96-232.96-252.8 0-55.68 19.84-101.76 52.48-137.6-5.12-12.8-23.04-65.28 5.12-135.68 0 0 42.88-13.44 140.8 52.48 40.96-11.52 84.48-17.28 128-17.28s87.04 5.76 128 17.28c97.92-66.56 140.8-52.48 140.8-52.48 28.16 70.4 10.24 122.88 5.12 135.68 32.64 35.84 52.48 81.28 52.48 137.6 0 196.48-119.68 240-233.6 252.8 18.56 16 34.56 46.72 34.56 94.72 0 68.48-.64 123.52-.64 140.8 0 13.44 9.6 29.44 35.2 24.32C877.44 929.92 1024 737.92 1024 512 1024 229.12 794.88 0 512 0"/></svg>';
|
|
12
|
-
/** GitHub's mark in white, for the dark theme (SVGL's `github_dark.svg`). */
|
|
13
|
-
const GITHUB_ON_DARK = '<svg class="logo gh-dark" width="14" height="14" viewBox="0 0 16 16" aria-hidden="true">' +
|
|
14
|
-
'<path fill="#fff" fill-rule="evenodd" clip-rule="evenodd" d="M8 0C3.58 0 0 3.58 0 8C0 11.54 2.29 14.53 5.47 15.59C5.87 15.66 6.02 15.42 6.02 15.21C6.02 15.02 6.01 14.39 6.01 13.72C4 14.09 3.48 13.23 3.32 12.78C3.23 12.55 2.84 11.84 2.5 11.65C2.22 11.5 1.82 11.13 2.49 11.12C3.12 11.11 3.57 11.7 3.72 11.94C4.44 13.15 5.59 12.81 6.05 12.6C6.12 12.08 6.33 11.73 6.56 11.53C4.78 11.33 2.92 10.64 2.92 7.58C2.92 6.71 3.23 5.99 3.74 5.43C3.66 5.23 3.38 4.41 3.82 3.31C3.82 3.31 4.49 3.1 6.02 4.13C6.66 3.95 7.34 3.86 8.02 3.86C8.7 3.86 9.38 3.95 10.02 4.13C11.55 3.09 12.22 3.31 12.22 3.31C12.66 4.41 12.38 5.23 12.3 5.43C12.81 5.99 13.12 6.7 13.12 7.58C13.12 10.65 11.25 11.33 9.47 11.53C9.76 11.78 10.01 12.26 10.01 13.01C10.01 14.08 10 14.94 10 15.21C10 15.42 10.15 15.67 10.55 15.59C13.71 14.53 16 11.53 16 8C16 3.58 12.42 0 8 0Z"/></svg>';
|
|
15
|
-
/** GitHub's mark, one per theme; the styles show the one of the page's theme. */
|
|
16
|
-
export const GITHUB_MARK = GITHUB_ON_LIGHT + GITHUB_ON_DARK;
|
|
17
|
-
/** Chrome's logo, in its own colors in both themes. */
|
|
18
|
-
export const CHROME_LOGO = '<svg class="logo" width="15" height="15" viewBox="0 0 190.5 190.5" aria-hidden="true">' +
|
|
19
|
-
'<path fill="#fff" d="M95.252 142.873c26.304 0 47.627-21.324 47.627-47.628s-21.323-47.628-47.627-47.628-47.627 21.324-47.627 47.628 21.323 47.628 47.627 47.628z"/><path fill="#229342" d="m54.005 119.07-41.24-71.43a95.227 95.227 0 0 0-.003 95.25 95.234 95.234 0 0 0 82.496 47.61l41.24-71.43v-.011a47.613 47.613 0 0 1-17.428 17.443 47.62 47.62 0 0 1-47.632.007 47.62 47.62 0 0 1-17.433-17.437z"/><path fill="#fbc116" d="m136.495 119.067-41.239 71.43a95.229 95.229 0 0 0 82.489-47.622A95.24 95.24 0 0 0 190.5 95.248a95.237 95.237 0 0 0-12.772-47.623H95.249l-.01.007a47.62 47.62 0 0 1 23.819 6.372 47.618 47.618 0 0 1 17.439 17.431 47.62 47.62 0 0 1-.001 47.633z"/><path fill="#1a73e8" d="M95.252 132.961c20.824 0 37.705-16.881 37.705-37.706S116.076 57.55 95.252 57.55 57.547 74.431 57.547 95.255s16.881 37.706 37.705 37.706z"/><path fill="#e33b2e" d="M95.252 47.628h82.479A95.237 95.237 0 0 0 142.87 12.76 95.23 95.23 0 0 0 95.245 0a95.222 95.222 0 0 0-47.623 12.767 95.23 95.23 0 0 0-34.856 34.872l41.24 71.43.011.006a47.62 47.62 0 0 1-.015-47.633 47.61 47.61 0 0 1 41.252-23.815z"/></svg>';
|
package/dist/report/markup.d.ts
DELETED
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import type { CaseStatus, ReportBundle } from '../schema/index.js';
|
|
2
|
-
import { type IconName, type IconOptions } from './icons.js';
|
|
3
|
-
import { type TextPart } from './view.js';
|
|
4
|
-
/** Markup that is already safe. Everything else that goes into the page is escaped. */
|
|
5
|
-
export declare class Markup {
|
|
6
|
-
readonly value: string;
|
|
7
|
-
constructor(value: string);
|
|
8
|
-
toString(): string;
|
|
9
|
-
}
|
|
10
|
-
export declare const escapeHtml: (text: string) => string;
|
|
11
|
-
export type Value = Markup | string | number | boolean | null | undefined | ReadonlyArray<Value>;
|
|
12
|
-
export declare const render: (value: Value) => string;
|
|
13
|
-
/** A template whose interpolations are escaped unless they are markup themselves. */
|
|
14
|
-
export declare const html: (strings: TemplateStringsArray, ...values: ReadonlyArray<Value>) => Markup;
|
|
15
|
-
/**
|
|
16
|
-
* Paths from the ledger should look like `evidence/01/02-name.png` or `video/session-1.webm`.
|
|
17
|
-
* Anything else (absolute paths, `..`, URL schemes) is not linked, so a damaged ledger cannot
|
|
18
|
-
* point the page elsewhere.
|
|
19
|
-
*/
|
|
20
|
-
export declare const safeRelative: (path: string | undefined) => string | undefined;
|
|
21
|
-
export declare const textParts: (parts: ReadonlyArray<TextPart>) => Markup[];
|
|
22
|
-
/**
|
|
23
|
-
* `<meta name="generator">` with the screw-bugs version that built the page's bundle, so whoever
|
|
24
|
-
* serves or shares the page can tell which version made it without the bundle; nothing when the
|
|
25
|
-
* bundle does not know it.
|
|
26
|
-
*/
|
|
27
|
-
export declare const generatorMeta: ({ generator }: ReportBundle) => "" | Markup;
|
|
28
|
-
/**
|
|
29
|
-
* The pages' favicon: the system's colors at first, and each theme's in `data-*`, which the theme
|
|
30
|
-
* button's script (`THEME_BUTTON_JS`) puts in `href` as the reader switches.
|
|
31
|
-
*/
|
|
32
|
-
export declare const favicon: Markup;
|
|
33
|
-
export declare const webFonts: Markup;
|
|
34
|
-
/** A Lucide icon (see `icons.ts`) as markup for the page templates. */
|
|
35
|
-
export declare const icon: (name: IconName, options?: IconOptions) => Markup;
|
|
36
|
-
/** screw-bugs' website, which the brand links to. */
|
|
37
|
-
export declare const SITE_URL = "https://screwbugs.dev";
|
|
38
|
-
/** The project's home, from `package.json`'s `repository`. */
|
|
39
|
-
export declare const REPO_URL = "https://github.com/uxstudioteam/screw-bugs";
|
|
40
|
-
/** A status as an icon: a filled circle with its glyph. Always next to its words, never alone. */
|
|
41
|
-
export declare const statusIcon: (status: CaseStatus) => Markup;
|
|
42
|
-
/** A status as an icon and its words, such as ✕ Failed. */
|
|
43
|
-
export declare const statusTag: (status: CaseStatus) => Markup;
|
|
44
|
-
/** The bug of each theme (`bugMark`), for the menu bar (`menu-bar.ts`). */
|
|
45
|
-
export declare const brandMark: Markup;
|
|
46
|
-
/**
|
|
47
|
-
* What the user asked, in quotes, clamped to two lines; the page's script offers the rest in place
|
|
48
|
-
* when it does not fit. Nothing when the job recorded no request.
|
|
49
|
-
*/
|
|
50
|
-
export declare const promptBlock: (text: string | undefined, extraClass?: string) => "" | Markup;
|
package/dist/report/markup.js
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { BUG_DARK, BUG_GIF_ON_DARK, BUG_GIF_ON_LIGHT, BUG_LIME, bugStill } from './bug.js';
|
|
2
|
-
import { iconSvg } from './icons.js';
|
|
3
|
-
import { statusLabel } from './view.js';
|
|
4
|
-
/*
|
|
5
|
-
* The pieces both HTML pages (the report and the walkthrough) are built from: escaped templates,
|
|
6
|
-
* safe relative links, status icons, the brand's bug, and the prompt (the top bar: `menu-bar.ts`).
|
|
7
|
-
*/
|
|
8
|
-
/** Markup that is already safe. Everything else that goes into the page is escaped. */
|
|
9
|
-
export class Markup {
|
|
10
|
-
value;
|
|
11
|
-
constructor(value) {
|
|
12
|
-
this.value = value;
|
|
13
|
-
}
|
|
14
|
-
toString() {
|
|
15
|
-
return this.value;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export const escapeHtml = (text) => text
|
|
19
|
-
.replaceAll('&', '&')
|
|
20
|
-
.replaceAll('<', '<')
|
|
21
|
-
.replaceAll('>', '>')
|
|
22
|
-
.replaceAll('"', '"')
|
|
23
|
-
.replaceAll("'", ''');
|
|
24
|
-
export const render = (value) => {
|
|
25
|
-
if (value instanceof Markup)
|
|
26
|
-
return value.value;
|
|
27
|
-
if (Array.isArray(value))
|
|
28
|
-
return value.map(render).join('');
|
|
29
|
-
if (value === undefined || value === null || value === false)
|
|
30
|
-
return '';
|
|
31
|
-
return escapeHtml(String(value));
|
|
32
|
-
};
|
|
33
|
-
/** A template whose interpolations are escaped unless they are markup themselves. */
|
|
34
|
-
export const html = (strings, ...values) => new Markup(strings.reduce((out, string, i) => out + render(values[i - 1]) + string));
|
|
35
|
-
/**
|
|
36
|
-
* Paths from the ledger should look like `evidence/01/02-name.png` or `video/session-1.webm`.
|
|
37
|
-
* Anything else (absolute paths, `..`, URL schemes) is not linked, so a damaged ledger cannot
|
|
38
|
-
* point the page elsewhere.
|
|
39
|
-
*/
|
|
40
|
-
export const safeRelative = (path) => path !== undefined &&
|
|
41
|
-
/^[A-Za-z0-9._-]+(\/[A-Za-z0-9._-]+)*$/.test(path) &&
|
|
42
|
-
!path.split('/').includes('..')
|
|
43
|
-
? path
|
|
44
|
-
: undefined;
|
|
45
|
-
export const textParts = (parts) => parts.map((part) => part.kind === 'text'
|
|
46
|
-
? html `${part.text}`
|
|
47
|
-
: part.kind === 'value'
|
|
48
|
-
? html `<q class="value">${part.text}</q>`
|
|
49
|
-
: html `<code>${part.text}</code>`);
|
|
50
|
-
/**
|
|
51
|
-
* The report icon, as the design's light and dark favicons draw it: a pixel page with a folded
|
|
52
|
-
* corner, its outline dark, or lime on dark, on nothing. `faviconSvg(style)` colors it: `light`,
|
|
53
|
-
* `dark`, or `system`, which follows `prefers-color-scheme` (the browser's, not the page's theme
|
|
54
|
-
* button). Inline, so the page stays one file; the CSP allows `data:` images. `assets/icon.svg` is
|
|
55
|
-
* the same drawing, as a file for tools that look for a project icon (T3 Code).
|
|
56
|
-
*/
|
|
57
|
-
const LIME = '#96F011';
|
|
58
|
-
const INK = '#1D1D1D';
|
|
59
|
-
const ICON_PATH = 'M94 2H464V57H94zM409 2H464V464H409zM48 48H103V464H48zM103 57H149V103H103zM103 409H149V455H103z' +
|
|
60
|
-
'M363 409H409V455H363zM94 455H418V510H94zM279 57H334V187H279zM279 132H409V187H279z';
|
|
61
|
-
const faviconSvg = (style) => "<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'>" +
|
|
62
|
-
`<style>${style}</style>` +
|
|
63
|
-
`<path d='${ICON_PATH}'/>` +
|
|
64
|
-
'</svg>';
|
|
65
|
-
const LIGHT_STYLE = `path{fill:${INK}}`;
|
|
66
|
-
const DARK_STYLE = `path{fill:${LIME}}`;
|
|
67
|
-
const iconUrl = (style) => `data:image/svg+xml,${faviconSvg(style).replaceAll('#', '%23')}`;
|
|
68
|
-
const FAVICON = {
|
|
69
|
-
light: iconUrl(LIGHT_STYLE),
|
|
70
|
-
dark: iconUrl(DARK_STYLE),
|
|
71
|
-
system: iconUrl(`${LIGHT_STYLE}@media (prefers-color-scheme:dark){${DARK_STYLE}}`),
|
|
72
|
-
};
|
|
73
|
-
/**
|
|
74
|
-
* `<meta name="generator">` with the screw-bugs version that built the page's bundle, so whoever
|
|
75
|
-
* serves or shares the page can tell which version made it without the bundle; nothing when the
|
|
76
|
-
* bundle does not know it.
|
|
77
|
-
*/
|
|
78
|
-
export const generatorMeta = ({ generator }) => {
|
|
79
|
-
if (generator === undefined)
|
|
80
|
-
return '';
|
|
81
|
-
const content = `${generator.name} ${generator.version}`;
|
|
82
|
-
return html `<meta name="generator" content="${content}" />`;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* The pages' favicon: the system's colors at first, and each theme's in `data-*`, which the theme
|
|
86
|
-
* button's script (`THEME_BUTTON_JS`) puts in `href` as the reader switches.
|
|
87
|
-
*/
|
|
88
|
-
export const favicon = html `<link
|
|
89
|
-
rel="icon"
|
|
90
|
-
type="image/svg+xml"
|
|
91
|
-
href="${FAVICON.system}"
|
|
92
|
-
id="favicon"
|
|
93
|
-
data-light="${FAVICON.light}"
|
|
94
|
-
data-dark="${FAVICON.dark}"
|
|
95
|
-
data-system="${FAVICON.system}"
|
|
96
|
-
/>`;
|
|
97
|
-
/**
|
|
98
|
-
* Geist and Geist Mono from Google Fonts, in exactly the weights the pages use (Geist 400,
|
|
99
|
-
* 500, 600 for the menu bar (`menu-bar.ts`), and 700; Geist Mono 400 and 500). Offline, or where Google cannot be reached, the pages use
|
|
100
|
-
* the system fonts after them in `--sans` and `--mono`. The CSPs allow these two hosts only.
|
|
101
|
-
*/
|
|
102
|
-
const GOOGLE_FONTS_CSS = 'https://fonts.googleapis.com/css2?family=Geist:wght@400;500;600;700&family=Geist+Mono:wght@400;500&display=swap';
|
|
103
|
-
export const webFonts = html `<link rel="preconnect" href="https://fonts.googleapis.com" />
|
|
104
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
|
105
|
-
<link rel="stylesheet" href="${GOOGLE_FONTS_CSS}" />`;
|
|
106
|
-
/** A Lucide icon (see `icons.ts`) as markup for the page templates. */
|
|
107
|
-
export const icon = (name, options) => new Markup(iconSvg(name, options));
|
|
108
|
-
/** screw-bugs' website, which the brand links to. */
|
|
109
|
-
export const SITE_URL = 'https://screwbugs.dev';
|
|
110
|
-
/** The project's home, from `package.json`'s `repository`. */
|
|
111
|
-
export const REPO_URL = 'https://github.com/uxstudioteam/screw-bugs';
|
|
112
|
-
/*
|
|
113
|
-
* The glyph in each status's circle, one distinct shape per status: Lucide's check, x and minus,
|
|
114
|
-
* and the question mark of its circle-question-mark (the status's own circle stands in for its
|
|
115
|
-
* circle). Bolder than Lucide's usual stroke, as they are small and white on a color.
|
|
116
|
-
*/
|
|
117
|
-
const statusGlyphs = {
|
|
118
|
-
passed: icon('check', { size: 14, strokeWidth: 3.5 }),
|
|
119
|
-
failed: icon('x', { size: 14, strokeWidth: 3.5 }),
|
|
120
|
-
blocked: icon('minus', { size: 14, strokeWidth: 3.5 }),
|
|
121
|
-
not_verified: icon('circle-question-mark', {
|
|
122
|
-
size: 14,
|
|
123
|
-
strokeWidth: 3.5,
|
|
124
|
-
without: '<circle cx="12" cy="12" r="10"/>',
|
|
125
|
-
}),
|
|
126
|
-
};
|
|
127
|
-
/** A status as an icon: a filled circle with its glyph. Always next to its words, never alone. */
|
|
128
|
-
export const statusIcon = (status) => html `<span class="st s-${status}" aria-hidden="true">${statusGlyphs[status]}</span>`;
|
|
129
|
-
/** A status as an icon and its words, such as ✕ Failed. */
|
|
130
|
-
export const statusTag = (status) => html `<span class="tag s-${status}"
|
|
131
|
-
>${statusIcon(status)}<span class="st-label">${statusLabel[status]}</span></span
|
|
132
|
-
>`;
|
|
133
|
-
/**
|
|
134
|
-
* screw-bugs' mark: the idle bug, animated, in the color of the page's theme (one image per theme;
|
|
135
|
-
* the styles show the one that matches, the reader's choice included). Where the reader prefers less
|
|
136
|
-
* motion, the bug at rest instead. Decorative: the brand's name is beside it.
|
|
137
|
-
*/
|
|
138
|
-
const bugMark = (gif, color, theme) => html `<picture class="${`bug bug-${theme}`}"
|
|
139
|
-
><source media="(prefers-reduced-motion: reduce)" srcset="${bugStill(color)}" />
|
|
140
|
-
<img src="${gif}" alt=""
|
|
141
|
-
/></picture>`;
|
|
142
|
-
/** The bug of each theme (`bugMark`), for the menu bar (`menu-bar.ts`). */
|
|
143
|
-
export const brandMark = html `${bugMark(BUG_GIF_ON_LIGHT, BUG_DARK, 'light')}${bugMark(BUG_GIF_ON_DARK, BUG_LIME, 'dark')}`;
|
|
144
|
-
/**
|
|
145
|
-
* What the user asked, in quotes, clamped to two lines; the page's script offers the rest in place
|
|
146
|
-
* when it does not fit. Nothing when the job recorded no request.
|
|
147
|
-
*/
|
|
148
|
-
export const promptBlock = (text, extraClass = '') => {
|
|
149
|
-
const asked = text?.trim();
|
|
150
|
-
if (!asked)
|
|
151
|
-
return '';
|
|
152
|
-
return html `<div class="${`prompt ${extraClass}`.trim()}">
|
|
153
|
-
<p class="prompt-text"><span class="sr">Asked: </span>“${asked}”</p>
|
|
154
|
-
<button type="button" class="prompt-more" aria-expanded="false" hidden>Show full prompt</button>
|
|
155
|
-
</div>`;
|
|
156
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { IconName } from './icons.js';
|
|
2
|
-
import { Markup } from './markup.js';
|
|
3
|
-
/** The project on GitHub, as the menu bar names it: `owner/name`. */
|
|
4
|
-
export declare const REPO: string;
|
|
5
|
-
/**
|
|
6
|
-
* Where a page's Share button starts sharing its run on screw-bugs Cloud: a route of the local
|
|
7
|
-
* report server (`src/cli/share.ts`), by absolute path, so it is the server the page came from.
|
|
8
|
-
*/
|
|
9
|
-
export declare const SHARE_START_PATH = "/.screw-bugs/share/start";
|
|
10
|
-
/**
|
|
11
|
-
* The Share button, in the place of Cloud's Sign in button: a link to the report server's start of
|
|
12
|
-
* a share. Hidden until the page's script finds it was served over `http:`, as the local report
|
|
13
|
-
* server serves it (on 127.0.0.1, or a tailnet address with `SCREW_BUGS_REPORT_HOST`): opened from
|
|
14
|
-
* disk or on a host such as screw-bugs Cloud (`https:`), there is no server to share it.
|
|
15
|
-
*/
|
|
16
|
-
export declare const shareButton: (jobId: string) => Markup;
|
|
17
|
-
/**
|
|
18
|
-
* The theme button: light, dark or the system's, in turn, as on Cloud's menu bar; it shows the
|
|
19
|
-
* current one (`THEME_BUTTON_JS` names it and switches). `hidden` until a script shows it, where a
|
|
20
|
-
* page's script may not run.
|
|
21
|
-
*/
|
|
22
|
-
export declare const themeButton: (hidden: boolean) => Markup;
|
|
23
|
-
/**
|
|
24
|
-
* The script of the theme button (`themeButton`): `themeCycle(button, key)` names the theme it
|
|
25
|
-
* shows and, on a click, moves to the next one, kept under `key` in `localStorage` where the browser
|
|
26
|
-
* allows (none: not kept). The favicon (`#favicon`, where the page has its own) follows it. Plain ES2020, without backslashes, for the pages' scripts to include.
|
|
27
|
-
*/
|
|
28
|
-
export declare const THEME_BUTTON_JS = "const themeCycle=(b,key)=>{\n const r=document.documentElement,T=['light','dark','system'],N={light:'Light theme',dark:'Dark theme',system:'Theme from system'};\n const at=()=>{const i=T.indexOf(r.dataset.theme);return i<0?2:i};\n const show=()=>{const i=at(),f=document.getElementById('favicon'),h=f&&f.dataset[T[i]];if(h)f.href=h;b.setAttribute('aria-label',N[T[i]]+'. Switch to '+N[T[(i+1)%3]].toLowerCase());b.title=N[T[i]]};\n show();\n b.addEventListener('click',()=>{const m=T[(at()+1)%3];r.dataset.theme=m;if(key)try{localStorage.setItem(key,m)}catch(e){}show()});\n};";
|
|
29
|
-
/** The project on GitHub, by its mark; `owner/name` beside it from `from` px wide. */
|
|
30
|
-
export declare const githubLink: (from: 640 | 1280) => Markup;
|
|
31
|
-
/** A link to another page of the run (report ↔ walkthrough), by its icon and name. */
|
|
32
|
-
export declare const pageLink: (href: string, name: string, mark: IconName, from: 640 | 1280) => Markup;
|
|
33
|
-
/**
|
|
34
|
-
* The bar: the brand (a link to the website), the middle capsule when there is one, and the right
|
|
35
|
-
* capsule (`ends`). `className` adds the page's own classes to the header.
|
|
36
|
-
*/
|
|
37
|
-
export declare const menuBar: (options: {
|
|
38
|
-
readonly middle?: Markup;
|
|
39
|
-
readonly ends: Markup;
|
|
40
|
-
readonly className?: string;
|
|
41
|
-
}) => Markup;
|
|
42
|
-
/**
|
|
43
|
-
* The reports' bar (the report's and the walkthrough's): when the run started in the middle, in UTC
|
|
44
|
-
* and saying so until the page's script puts it in the reader's own time (see `PLAYER_JS`); on the
|
|
45
|
-
* right the other page of the run (`other`, when there is one), the project's GitHub, the theme
|
|
46
|
-
* button and the Share button (see `shareButton`). The theme button and Share wait for the script.
|
|
47
|
-
*/
|
|
48
|
-
export declare const topBar: (startedAt: string, jobId: string, other: {
|
|
49
|
-
readonly href: string;
|
|
50
|
-
readonly name: string;
|
|
51
|
-
readonly icon: IconName;
|
|
52
|
-
} | undefined) => Markup;
|
|
53
|
-
/**
|
|
54
|
-
* The bar's styles, in the landing's own colors (`--l-*`, which differ a little from the reports'),
|
|
55
|
-
* its sizes and breakpoints: 56 px tall, 72 px from 768 px wide; capsules 40 px tall, the page's
|
|
56
|
-
* background at 70 % over a 12 px blur. The three capsules sit in a grid, the middle one centered
|
|
57
|
-
* between the ends; on a phone (below 640 px) the right capsule keeps only icons and the middle one
|
|
58
|
-
* only the date's shortest form (see `topBar`), so the bar stays one row down to 360 px.
|
|
59
|
-
*/
|
|
60
|
-
export declare const menuBarStyles = "\n.menubar { --l-text: #303030; --l-muted: #636363; --l-icon: #000000; }\n@media (prefers-color-scheme: dark) { :root:not([data-theme=\"light\"]) .menubar { --l-text: #eceeec; --l-muted: #afb5ad; --l-icon: #eceeec; } }\n:root[data-theme=\"dark\"] .menubar { --l-text: #eceeec; --l-muted: #afb5ad; --l-icon: #eceeec; }\n.menubar { position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; height: 56px; padding: 0 12px; background: transparent; font: 600 13px/16px var(--sans); letter-spacing: -0.03em; color: var(--l-text); }\n.capsule { display: flex; align-items: center; height: 40px; box-sizing: border-box; border-radius: 999px; background: color-mix(in srgb, var(--bg) 70%, transparent); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }\n.menubar .brand { grid-column: 1; justify-self: start; gap: 8px; padding: 0 16px 0 12px; white-space: nowrap; color: inherit; text-decoration: none; }\n.menubar .mid { grid-column: 2; min-width: 0; padding: 0 16px; font: 400 12px/16px var(--mono); letter-spacing: -0.038em; white-space: nowrap; }\n.menubar .ends { grid-column: 3; justify-self: end; flex: none; gap: 6px; padding: 4px 4px 4px 12px; }\n.menubar .ends a:not(.share-btn) { display: inline-flex; align-items: center; gap: 6px; font: 400 12px/16px var(--mono); letter-spacing: -0.038em; color: inherit; text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }\n.menubar .ends a:not(.share-btn):hover { color: var(--l-muted); }\n.menubar .ends .logo, .menubar .ends .icon { width: 16px; height: 16px; }\n.menubar .ends .page .icon { color: var(--l-icon); }\n.menubar .gh .logo path { fill: var(--l-icon); }\n.menubar .from-640, .menubar .from-1280 { display: none; }\n.menubar .theme { display: grid; place-items: center; flex: none; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 999px; background: none; color: var(--l-text); cursor: pointer; }\n.menubar .theme:hover { background: color-mix(in srgb, var(--l-text) 8%, transparent); }\n.menubar .theme .t-light, .menubar .theme .t-dark, :root[data-theme=\"light\"] .menubar .theme .t-system, :root[data-theme=\"dark\"] .menubar .theme .t-system { display: none; }\n:root[data-theme=\"light\"] .menubar .theme .t-light, :root[data-theme=\"dark\"] .menubar .theme .t-dark { display: block; }\n.menubar .share-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none; height: 32px; padding: 0 16px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font: 500 14px/20px var(--sans); letter-spacing: -0.02em; text-decoration: none; white-space: nowrap; }\n.menubar .share-btn:hover { filter: brightness(.95); }\n/* Three capsules on a phone: the brand by its bug alone, the date without its year, Share by its\n icon (each still named for screen readers). */\n@media (max-width: 639px) {\n .menubar.with-mid .brand { padding: 0 8px; }\n .menubar.with-mid :is(.brand-name, .share-word) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }\n .menubar.with-mid .share-btn { width: 32px; padding: 0; }\n /* Icon-only links get the theme button's 32 px cell, a target a finger can hit, with the\n capsule's padding and gaps taken in by as much, so it stays as wide. */\n .menubar.with-mid .ends { gap: 0; padding-left: 4px; }\n .menubar.with-mid .ends a:not(.share-btn) { justify-content: center; width: 32px; height: 32px; border-radius: 999px; }\n .menubar .when .year { display: none; }\n}\n/* The reports' bar is sticky over a dense page: it keeps the page's background behind it, so no\n text runs between the capsules (the sign-in page's, over a page that does not scroll under it,\n stays see-through). */\n.menubar.solid { background: var(--bg); }\n@media (min-width: 400px) { .menubar .ends { gap: 8px; } }\n@media (min-width: 640px) { .menubar .from-640 { display: inline; } .menubar .share-btn { padding: 0 20px; } }\n@media (min-width: 768px) { .menubar { height: 72px; padding: 0 32px; } .menubar .ends { gap: 12px; } .menubar .share-btn { padding: 0 28px; } }\n@media (min-width: 1280px) { .menubar .from-1280 { display: inline; } }\n@media print { .menubar .theme, .menubar .share-btn { display: none; } }\n";
|