@a.incantalupo/web-tools 0.4.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/audit/lighthouse-cli.js +4 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -47,6 +47,7 @@ FAIL /contact reading ease 61 · 1 fail · 2 warn (small-text, target-44)
|
|
|
47
47
|
| Largest contentful paint | 2.5 s |
|
|
48
48
|
| Layout shift (CLS) | 0.1 |
|
|
49
49
|
| The server's first byte | 800 ms |
|
|
50
|
+
| Total blocking time (main-thread work while loading; the lab's stand-in for INP) | 200 ms |
|
|
50
51
|
| Scripts, as sent | 100 kB |
|
|
51
52
|
|
|
52
53
|
- A `FAIL` line names the number and its limit; for the largest paint, also the element that was timed.
|
|
@@ -47,7 +47,8 @@ await mkdir(outDir, { recursive: true });
|
|
|
47
47
|
const runs = await runLighthouse(positionals, outDir, times);
|
|
48
48
|
// The limits of a public page. Lab numbers on a simulated mid-range phone and on a
|
|
49
49
|
// desktop: limits, not goals.
|
|
50
|
-
|
|
50
|
+
// TBT: the lab's stand-in for INP (main-thread work while the page loads); INP itself is field-only.
|
|
51
|
+
const LIMITS = { lcpMs: 2500, cls: 0.1, ttfbMs: 800, tbtMs: 200, scriptBytes: 100 * 1024 };
|
|
51
52
|
const judging = values.budget || minPerf != null;
|
|
52
53
|
const over = [];
|
|
53
54
|
for (const r of runs) {
|
|
@@ -66,6 +67,8 @@ for (const r of runs) {
|
|
|
66
67
|
add("cls", `CLS ${m.cls.toFixed(3)} over ${LIMITS.cls}`);
|
|
67
68
|
if (m.ttfbMs != null && m.ttfbMs > LIMITS.ttfbMs)
|
|
68
69
|
add("ttfb", `first byte ${Math.round(m.ttfbMs)} ms over ${LIMITS.ttfbMs} ms`);
|
|
70
|
+
if (m.tbtMs != null && m.tbtMs > LIMITS.tbtMs)
|
|
71
|
+
add("tbt", `blocking time ${Math.round(m.tbtMs)} ms over ${LIMITS.tbtMs} ms`);
|
|
69
72
|
if (r.scriptBytes != null && r.scriptBytes > LIMITS.scriptBytes)
|
|
70
73
|
add("js", `scripts ${Math.round(r.scriptBytes / 1024)} kB over ${LIMITS.scriptBytes / 1024} kB`);
|
|
71
74
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a.incantalupo/web-tools",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Checks and captures for any website: readability and contrast, screenshots, style snapshots and diffs, glyph and image checks, a site audit with niche profiles, your own signed-in browser.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
"scripts": {
|
|
31
31
|
"build": "rm -rf dist && tsc -p tsconfig.json && chmod +x dist/cli.js",
|
|
32
32
|
"check": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"test": "node --test 'test/*.test.ts'",
|
|
33
34
|
"prepublishOnly": "pnpm build"
|
|
34
35
|
},
|
|
35
36
|
"dependencies": {
|