@qartisan/playwright-loupe 0.0.2 → 0.0.3
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/CHANGELOG.md +33 -0
- package/README.md +22 -6
- package/dist/config/resolve.js +3 -1
- package/dist/config/types.d.ts +6 -1
- package/dist/config/validate.js +9 -2
- package/dist/core/build.js +21 -0
- package/dist/core/categories.d.ts +4 -5
- package/dist/core/categories.js +50 -36
- package/dist/core/scope.d.ts +10 -0
- package/dist/core/scope.js +34 -4
- package/dist/core/signature.d.ts +3 -2
- package/dist/core/signature.js +32 -2
- package/dist/renderer/index.html +3 -2
- package/dist/shared/color.d.ts +47 -0
- package/dist/shared/color.js +180 -0
- package/dist/shared/palette.d.ts +37 -0
- package/dist/shared/palette.js +91 -0
- package/licenses/DM-Sans-OFL.txt +93 -0
- package/package.json +7 -3
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Category palette: the single source of truth for category colors, imported
|
|
3
|
+
* by the reporter (names → reference colors written to the report) and by the
|
|
4
|
+
* renderer (reference colors → per-theme badge colors).
|
|
5
|
+
*
|
|
6
|
+
* Each entry has a name usable in the config (`color: 'teal'`), a reference
|
|
7
|
+
* color (the `#rrggbb` value the report carries) and hand-tuned text /
|
|
8
|
+
* background / border triplets per theme. The hues avoid reds and greens, so
|
|
9
|
+
* a category never reads as a failed or passed status. The contrast and
|
|
10
|
+
* distance rules are checked by `test/palette.test.ts`.
|
|
11
|
+
*
|
|
12
|
+
* The order matters: categories without a configured color take the free
|
|
13
|
+
* entries in this order.
|
|
14
|
+
*
|
|
15
|
+
* Kept free of Node imports so the renderer can import it.
|
|
16
|
+
*/
|
|
17
|
+
export const PALETTE_ENTRIES = [
|
|
18
|
+
{
|
|
19
|
+
name: 'blue',
|
|
20
|
+
reference: '#466cc8',
|
|
21
|
+
light: { text: '#385db7', bg: '#eaf0fe', border: '#5981df' },
|
|
22
|
+
dark: { text: '#9ebdff', bg: '#18233c', border: '#577cd3' },
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'cyan',
|
|
26
|
+
reference: '#0a7da1',
|
|
27
|
+
light: { text: '#0a708f', bg: '#e0f4fd', border: '#2b8fb4' },
|
|
28
|
+
dark: { text: '#60cdf5', bg: '#002837', border: '#268cb1' },
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'teal',
|
|
32
|
+
reference: '#04837c',
|
|
33
|
+
light: { text: '#09726c', bg: '#dbf7f4', border: '#29958e' },
|
|
34
|
+
dark: { text: '#6ed2c9', bg: '#002b28', border: '#25928b' },
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'violet',
|
|
38
|
+
reference: '#8656b7',
|
|
39
|
+
light: { text: '#7747a7', bg: '#f4ecfe', border: '#9e6ed2' },
|
|
40
|
+
dark: { text: '#cfaafc', bg: '#2a1d37', border: '#9468c3' },
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'magenta',
|
|
44
|
+
reference: '#ad4681',
|
|
45
|
+
light: { text: '#9d3772', bg: '#feeaf3', border: '#cc629d' },
|
|
46
|
+
dark: { text: '#f79dcc', bg: '#351928', border: '#bb598f' },
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'orange',
|
|
50
|
+
reference: '#ab5803',
|
|
51
|
+
light: { text: '#954d09', bg: '#feece1', border: '#c6702b' },
|
|
52
|
+
dark: { text: '#f9a970', bg: '#361d0a', border: '#bc671f' },
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
// Low chroma: the hue circle has no room left without reds or greens, so
|
|
56
|
+
// this entry stands apart by lightness (dark in light theme).
|
|
57
|
+
name: 'brown',
|
|
58
|
+
reference: '#745f43',
|
|
59
|
+
light: { text: '#3c2d18', bg: '#f5e9d9', border: '#60503a' },
|
|
60
|
+
dark: { text: '#b7a182', bg: '#302412', border: '#ae9779' },
|
|
61
|
+
},
|
|
62
|
+
// Last: never a built-in category, and the last color given to a category
|
|
63
|
+
// without one. It is the hue closest to the flaky status amber.
|
|
64
|
+
{
|
|
65
|
+
name: 'gold',
|
|
66
|
+
reference: '#b9a542',
|
|
67
|
+
light: { text: '#736308', bg: '#f5f1da', border: '#9a861a' },
|
|
68
|
+
dark: { text: '#d2be5d', bg: '#2b2403', border: '#94800e' },
|
|
69
|
+
},
|
|
70
|
+
];
|
|
71
|
+
/** The uncategorized bucket: neutral grey, not selectable by name. */
|
|
72
|
+
export const NEUTRAL_ENTRY = {
|
|
73
|
+
name: 'neutral',
|
|
74
|
+
reference: '#6b6b6b',
|
|
75
|
+
light: { text: '#636363', bg: '#f0f0f0', border: '#868686' },
|
|
76
|
+
dark: { text: '#bebebe', bg: '#242424', border: '#808080' },
|
|
77
|
+
};
|
|
78
|
+
/** Names accepted by `categories.rules[].color`, in palette order. */
|
|
79
|
+
export const PALETTE_NAMES = PALETTE_ENTRIES.map((entry) => entry.name);
|
|
80
|
+
/** Reference color of a palette entry; throws for an unknown name (config validation reports it first). */
|
|
81
|
+
export function paletteReference(name) {
|
|
82
|
+
const entry = PALETTE_ENTRIES.find((candidate) => candidate.name === name);
|
|
83
|
+
if (!entry)
|
|
84
|
+
throw new Error(`unknown palette color "${name}"; known colors: ${PALETTE_NAMES.join(', ')}`);
|
|
85
|
+
return entry.reference;
|
|
86
|
+
}
|
|
87
|
+
/** The palette entry (or the neutral one) whose reference color is `hex`, case-insensitive; null for any other color. */
|
|
88
|
+
export function paletteEntryByReference(hex) {
|
|
89
|
+
const lower = hex.toLowerCase();
|
|
90
|
+
return [...PALETTE_ENTRIES, NEUTRAL_ENTRY].find((entry) => entry.reference === lower) ?? null;
|
|
91
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts) DMSans-Italic[opsz,wght].ttf: Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts)
|
|
2
|
+
|
|
3
|
+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
|
4
|
+
This license is copied below, and is also available with a FAQ at:
|
|
5
|
+
http://scripts.sil.org/OFL
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
-----------------------------------------------------------
|
|
9
|
+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
|
10
|
+
-----------------------------------------------------------
|
|
11
|
+
|
|
12
|
+
PREAMBLE
|
|
13
|
+
The goals of the Open Font License (OFL) are to stimulate worldwide
|
|
14
|
+
development of collaborative font projects, to support the font creation
|
|
15
|
+
efforts of academic and linguistic communities, and to provide a free and
|
|
16
|
+
open framework in which fonts may be shared and improved in partnership
|
|
17
|
+
with others.
|
|
18
|
+
|
|
19
|
+
The OFL allows the licensed fonts to be used, studied, modified and
|
|
20
|
+
redistributed freely as long as they are not sold by themselves. The
|
|
21
|
+
fonts, including any derivative works, can be bundled, embedded,
|
|
22
|
+
redistributed and/or sold with any software provided that any reserved
|
|
23
|
+
names are not used by derivative works. The fonts and derivatives,
|
|
24
|
+
however, cannot be released under any other type of license. The
|
|
25
|
+
requirement for fonts to remain under this license does not apply
|
|
26
|
+
to any document created using the fonts or their derivatives.
|
|
27
|
+
|
|
28
|
+
DEFINITIONS
|
|
29
|
+
"Font Software" refers to the set of files released by the Copyright
|
|
30
|
+
Holder(s) under this license and clearly marked as such. This may
|
|
31
|
+
include source files, build scripts and documentation.
|
|
32
|
+
|
|
33
|
+
"Reserved Font Name" refers to any names specified as such after the
|
|
34
|
+
copyright statement(s).
|
|
35
|
+
|
|
36
|
+
"Original Version" refers to the collection of Font Software components as
|
|
37
|
+
distributed by the Copyright Holder(s).
|
|
38
|
+
|
|
39
|
+
"Modified Version" refers to any derivative made by adding to, deleting,
|
|
40
|
+
or substituting -- in part or in whole -- any of the components of the
|
|
41
|
+
Original Version, by changing formats or by porting the Font Software to a
|
|
42
|
+
new environment.
|
|
43
|
+
|
|
44
|
+
"Author" refers to any designer, engineer, programmer, technical
|
|
45
|
+
writer or other person who contributed to the Font Software.
|
|
46
|
+
|
|
47
|
+
PERMISSION & CONDITIONS
|
|
48
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
|
49
|
+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
|
50
|
+
redistribute, and sell modified and unmodified copies of the Font
|
|
51
|
+
Software, subject to the following conditions:
|
|
52
|
+
|
|
53
|
+
1) Neither the Font Software nor any of its individual components,
|
|
54
|
+
in Original or Modified Versions, may be sold by itself.
|
|
55
|
+
|
|
56
|
+
2) Original or Modified Versions of the Font Software may be bundled,
|
|
57
|
+
redistributed and/or sold with any software, provided that each copy
|
|
58
|
+
contains the above copyright notice and this license. These can be
|
|
59
|
+
included either as stand-alone text files, human-readable headers or
|
|
60
|
+
in the appropriate machine-readable metadata fields within text or
|
|
61
|
+
binary files as long as those fields can be easily viewed by the user.
|
|
62
|
+
|
|
63
|
+
3) No Modified Version of the Font Software may use the Reserved Font
|
|
64
|
+
Name(s) unless explicit written permission is granted by the corresponding
|
|
65
|
+
Copyright Holder. This restriction only applies to the primary font name as
|
|
66
|
+
presented to the users.
|
|
67
|
+
|
|
68
|
+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
|
69
|
+
Software shall not be used to promote, endorse or advertise any
|
|
70
|
+
Modified Version, except to acknowledge the contribution(s) of the
|
|
71
|
+
Copyright Holder(s) and the Author(s) or with their explicit written
|
|
72
|
+
permission.
|
|
73
|
+
|
|
74
|
+
5) The Font Software, modified or unmodified, in part or in whole,
|
|
75
|
+
must be distributed entirely under this license, and must not be
|
|
76
|
+
distributed under any other license. The requirement for fonts to
|
|
77
|
+
remain under this license does not apply to any document created
|
|
78
|
+
using the Font Software.
|
|
79
|
+
|
|
80
|
+
TERMINATION
|
|
81
|
+
This license becomes null and void if any of the above conditions are
|
|
82
|
+
not met.
|
|
83
|
+
|
|
84
|
+
DISCLAIMER
|
|
85
|
+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
86
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
|
87
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
|
88
|
+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
|
89
|
+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
90
|
+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
|
91
|
+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
92
|
+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
|
93
|
+
OTHER DEALINGS IN THE FONT SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qartisan/playwright-loupe",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3",
|
|
4
|
+
"description": "HTML reporter for Playwright: dashboard, error groups by normalized signature, tests by project and suite, dimensions from tags and annotations.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"playwright",
|
|
7
7
|
"reporter",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"types": "./dist/index.d.ts",
|
|
29
29
|
"files": [
|
|
30
30
|
"dist",
|
|
31
|
+
"licenses",
|
|
31
32
|
"README.md",
|
|
32
33
|
"LICENSE",
|
|
33
34
|
"CHANGELOG.md"
|
|
@@ -48,16 +49,19 @@
|
|
|
48
49
|
"pretest": "npm run build",
|
|
49
50
|
"test": "vitest run",
|
|
50
51
|
"fixtures": "npm run build && node scripts/run-fixtures.mjs",
|
|
51
|
-
"sample:update": "npm run
|
|
52
|
+
"sample:update": "npm run build && node scripts/update-sample.mjs",
|
|
52
53
|
"prepublishOnly": "npm run typecheck && npm run build && npm test"
|
|
53
54
|
},
|
|
54
55
|
"peerDependencies": {
|
|
55
56
|
"@playwright/test": "^1.52.0"
|
|
56
57
|
},
|
|
57
58
|
"devDependencies": {
|
|
59
|
+
"@fontsource/dm-sans": "^5.3.0",
|
|
58
60
|
"@playwright/test": "^1.64.0",
|
|
61
|
+
"@preact/signals": "^2.11.3",
|
|
59
62
|
"@types/node": "^22.20.5",
|
|
60
63
|
"ajv": "^8.20.0",
|
|
64
|
+
"preact": "^10.29.8",
|
|
61
65
|
"typescript": "^7.0.2",
|
|
62
66
|
"vite": "^8.3.4",
|
|
63
67
|
"vitest": "^5.0.4"
|