lighthouse-reporting 1.6.5 → 1.6.7
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 -1
- package/dist/hooks.cjs +1 -1
- package/dist/hooks.js +1 -1
- package/dist/index.cjs +0 -7
- package/dist/index.js +0 -7
- package/dist/lighthouse-reporting.umd.cjs +3 -2
- package/dist/lighthouseReports.cjs +3 -2
- package/dist/lighthouseReports.js +3 -2
- package/dist/playwrightLighthouseTest.cjs +1 -1
- package/dist/playwrightLighthouseTest.js +1 -1
- package/dist/storybookPlaywright.d.ts +1 -1
- package/package.json +11 -11
- /package/dist/{constants-PDApvt-A.cjs → constants-ClvZzVIQ.cjs} +0 -0
- /package/dist/{constants-9b_WPkRp.js → constants-CvRW9vHz.js} +0 -0
package/README.md
CHANGED
package/dist/hooks.cjs
CHANGED
|
@@ -4,7 +4,7 @@ const os = require("os");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const fse = require("fs-extra");
|
|
6
6
|
const url = require("url");
|
|
7
|
-
const constants = require("./constants-
|
|
7
|
+
const constants = require("./constants-ClvZzVIQ.cjs");
|
|
8
8
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
9
9
|
let dirname;
|
|
10
10
|
if (typeof __dirname !== "string") {
|
package/dist/hooks.js
CHANGED
|
@@ -2,7 +2,7 @@ import os from "os";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import fse from "fs-extra";
|
|
4
4
|
import url from "url";
|
|
5
|
-
import { L as LH_OUT_DIR, I as INDEX_HTML, P as PW_TMP_DIR } from "./constants-
|
|
5
|
+
import { L as LH_OUT_DIR, I as INDEX_HTML, P as PW_TMP_DIR } from "./constants-CvRW9vHz.js";
|
|
6
6
|
let dirname;
|
|
7
7
|
if (typeof __dirname !== "string") {
|
|
8
8
|
const filename = url.fileURLToPath(import.meta.url);
|
package/dist/index.cjs
CHANGED
|
@@ -4,13 +4,6 @@ const hooks = require("./hooks.cjs");
|
|
|
4
4
|
const lighthouseReports = require("./lighthouseReports.cjs");
|
|
5
5
|
const playwrightLighthouseTest = require("./playwrightLighthouseTest.cjs");
|
|
6
6
|
const storybookPlaywright = require("./storybookPlaywright.cjs");
|
|
7
|
-
require("os");
|
|
8
|
-
require("path");
|
|
9
|
-
require("fs-extra");
|
|
10
|
-
require("url");
|
|
11
|
-
require("./constants-PDApvt-A.cjs");
|
|
12
|
-
require("get-port");
|
|
13
|
-
require("@playwright/test");
|
|
14
7
|
exports.lighthousePlaywrightTeardown = hooks.lighthousePlaywrightTeardown;
|
|
15
8
|
exports.lighthouseSetup = hooks.lighthouseSetup;
|
|
16
9
|
exports.buildAverageCsv = lighthouseReports.buildAverageCsv;
|
package/dist/index.js
CHANGED
|
@@ -2,13 +2,6 @@ import { lighthousePlaywrightTeardown, lighthouseSetup } from "./hooks.js";
|
|
|
2
2
|
import { buildAverageCsv, getScores, writeCsvResult, writeHtmlListEntryWithRetry, writeScoresToJson } from "./lighthouseReports.js";
|
|
3
3
|
import { playwrightLighthouseTest } from "./playwrightLighthouseTest.js";
|
|
4
4
|
import { storybookPlaywright } from "./storybookPlaywright.js";
|
|
5
|
-
import "os";
|
|
6
|
-
import "path";
|
|
7
|
-
import "fs-extra";
|
|
8
|
-
import "url";
|
|
9
|
-
import "./constants-9b_WPkRp.js";
|
|
10
|
-
import "get-port";
|
|
11
|
-
import "@playwright/test";
|
|
12
5
|
export {
|
|
13
6
|
buildAverageCsv,
|
|
14
7
|
getScores,
|
|
@@ -58,9 +58,10 @@
|
|
|
58
58
|
}
|
|
59
59
|
throw error;
|
|
60
60
|
};
|
|
61
|
-
const getScores = (result) => Object.entries(result.lhr.categories).
|
|
61
|
+
const getScores = (result) => Object.entries(result.lhr.categories).reduce(
|
|
62
62
|
(prev, [key, c]) => {
|
|
63
|
-
|
|
63
|
+
const score = typeof c.score === "number" ? c.score : 0;
|
|
64
|
+
prev[key] = Math.floor(score * 100);
|
|
64
65
|
return prev;
|
|
65
66
|
},
|
|
66
67
|
{}
|
|
@@ -38,9 +38,10 @@ const writeHtmlListEntryWithRetry = async (htmlFilePath, name, scores, threshold
|
|
|
38
38
|
}
|
|
39
39
|
throw error;
|
|
40
40
|
};
|
|
41
|
-
const getScores = (result) => Object.entries(result.lhr.categories).
|
|
41
|
+
const getScores = (result) => Object.entries(result.lhr.categories).reduce(
|
|
42
42
|
(prev, [key, c]) => {
|
|
43
|
-
|
|
43
|
+
const score = typeof c.score === "number" ? c.score : 0;
|
|
44
|
+
prev[key] = Math.floor(score * 100);
|
|
44
45
|
return prev;
|
|
45
46
|
},
|
|
46
47
|
{}
|
|
@@ -36,9 +36,10 @@ const writeHtmlListEntryWithRetry = async (htmlFilePath, name, scores, threshold
|
|
|
36
36
|
}
|
|
37
37
|
throw error;
|
|
38
38
|
};
|
|
39
|
-
const getScores = (result) => Object.entries(result.lhr.categories).
|
|
39
|
+
const getScores = (result) => Object.entries(result.lhr.categories).reduce(
|
|
40
40
|
(prev, [key, c]) => {
|
|
41
|
-
|
|
41
|
+
const score = typeof c.score === "number" ? c.score : 0;
|
|
42
|
+
prev[key] = Math.floor(score * 100);
|
|
42
43
|
return prev;
|
|
43
44
|
},
|
|
44
45
|
{}
|
|
@@ -4,7 +4,7 @@ const os = require("os");
|
|
|
4
4
|
const path = require("path");
|
|
5
5
|
const getPort = require("get-port");
|
|
6
6
|
const test = require("@playwright/test");
|
|
7
|
-
const constants = require("./constants-
|
|
7
|
+
const constants = require("./constants-ClvZzVIQ.cjs");
|
|
8
8
|
const playwrightLighthouseTest = test.test.extend({
|
|
9
9
|
port: [
|
|
10
10
|
// eslint-disable-next-line no-empty-pattern
|
|
@@ -2,7 +2,7 @@ import os from "os";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
import getPort from "get-port";
|
|
4
4
|
import { test, chromium } from "@playwright/test";
|
|
5
|
-
import { P as PW_TMP_DIR } from "./constants-
|
|
5
|
+
import { P as PW_TMP_DIR } from "./constants-CvRW9vHz.js";
|
|
6
6
|
const playwrightLighthouseTest = test.extend({
|
|
7
7
|
port: [
|
|
8
8
|
// eslint-disable-next-line no-empty-pattern
|
|
@@ -109,5 +109,5 @@ export declare const storybookPlaywright: {
|
|
|
109
109
|
timeout?: number;
|
|
110
110
|
}, options?: {
|
|
111
111
|
waitForLoadStateTimeout: number;
|
|
112
|
-
}, actionBeforeScreenshot?: (
|
|
112
|
+
}, actionBeforeScreenshot?: (page: Page) => Promise<void>) => Promise<void>;
|
|
113
113
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse-reporting",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.7",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build && vite build -c vite.umd.config.ts && tsc -p ./tsconfig.build.json",
|
|
@@ -30,20 +30,20 @@
|
|
|
30
30
|
"devDependencies": {
|
|
31
31
|
"@playwright/test": "^1.34.3",
|
|
32
32
|
"@types/fs-extra": "^11.0.4",
|
|
33
|
-
"@types/node": "^20.
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"eslint": "^8.
|
|
33
|
+
"@types/node": "^20.12.7",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^7.7.1",
|
|
35
|
+
"@typescript-eslint/parser": "^7.7.1",
|
|
36
|
+
"eslint": "^8.57.0",
|
|
37
37
|
"eslint-config-prettier": "^9.1.0",
|
|
38
38
|
"eslint-plugin-prettier": "^5.1.3",
|
|
39
39
|
"get-port": "^7.0.0",
|
|
40
|
-
"husky": "^
|
|
40
|
+
"husky": "^9.0.11",
|
|
41
41
|
"npm-run-all": "^4.1.5",
|
|
42
|
-
"prettier": "^3.2.
|
|
43
|
-
"semantic-release": "^23.0.
|
|
44
|
-
"typescript": "^5.
|
|
45
|
-
"vite": "^5.
|
|
46
|
-
"vite-plugin-static-copy": "^1.0.
|
|
42
|
+
"prettier": "^3.2.5",
|
|
43
|
+
"semantic-release": "^23.0.8",
|
|
44
|
+
"typescript": "^5.4.5",
|
|
45
|
+
"vite": "^5.2.10",
|
|
46
|
+
"vite-plugin-static-copy": "^1.0.3"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"fs-extra": "^11.2.0"
|
|
File without changes
|
|
File without changes
|