lighthouse-reporting 1.6.6 → 1.6.8
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 +2 -2
- package/dist/hooks.js +1 -1
- package/dist/index.cjs +0 -7
- package/dist/index.js +0 -7
- package/dist/lighthouse-reporting.umd.cjs +5 -29
- package/dist/playwrightLighthouseTest.cjs +1 -1
- package/dist/playwrightLighthouseTest.d.ts +2 -2
- package/dist/playwrightLighthouseTest.js +1 -1
- package/dist/storybookPlaywright.d.ts +4 -4
- package/package.json +19 -19
- /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,11 +4,11 @@ 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") {
|
|
11
|
-
const filename = url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.src || new URL("hooks.cjs", document.baseURI).href);
|
|
11
|
+
const filename = url.fileURLToPath(typeof document === "undefined" ? require("url").pathToFileURL(__filename).href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("hooks.cjs", document.baseURI).href);
|
|
12
12
|
dirname = path.dirname(filename);
|
|
13
13
|
} else {
|
|
14
14
|
dirname = __dirname;
|
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,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("os"), require("path"), require("fs-extra"), require("url"), require("net"), require("@playwright/test")) : typeof define === "function" && define.amd ? define(["exports", "os", "path", "fs-extra", "url", "net", "@playwright/test"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.lh_rep = {}, global.os, global.path, global.fse, global.url, global.net, global
|
|
3
|
-
})(this, function(exports2, os, path, fse, url, net, test) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("os"), require("path"), require("fs-extra"), require("url"), require("net"), require("@playwright/test")) : typeof define === "function" && define.amd ? define(["exports", "os", "path", "fs-extra", "url", "net", "@playwright/test"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.lh_rep = {}, global.os, global.path, global.fse, global.url, global.net, global["@playwright/test"]));
|
|
3
|
+
})(this, (function(exports2, os, path, fse, url, net, test) {
|
|
4
4
|
"use strict";
|
|
5
5
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
6
6
|
const INDEX_HTML = "index.html";
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
const PW_TMP_DIR = "pwlh";
|
|
9
9
|
let dirname;
|
|
10
10
|
if (typeof __dirname !== "string") {
|
|
11
|
-
const filename = url.fileURLToPath(typeof document === "undefined" && typeof location === "undefined" ? require("url").pathToFileURL(__filename).href : typeof document === "undefined" ? location.href : _documentCurrentScript && _documentCurrentScript.src || new URL("lighthouse-reporting.umd.cjs", document.baseURI).href);
|
|
11
|
+
const filename = url.fileURLToPath(typeof document === "undefined" && typeof location === "undefined" ? require("url").pathToFileURL(__filename).href : typeof document === "undefined" ? location.href : _documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === "SCRIPT" && _documentCurrentScript.src || new URL("lighthouse-reporting.umd.cjs", document.baseURI).href);
|
|
12
12
|
dirname = path.dirname(filename);
|
|
13
13
|
} else {
|
|
14
14
|
dirname = __dirname;
|
|
@@ -156,34 +156,10 @@
|
|
|
156
156
|
return options.port;
|
|
157
157
|
};
|
|
158
158
|
const portCheckSequence = function* (ports) {
|
|
159
|
-
if (ports) {
|
|
160
|
-
yield* ports;
|
|
161
|
-
}
|
|
162
159
|
yield 0;
|
|
163
160
|
};
|
|
164
161
|
async function getPorts(options) {
|
|
165
|
-
let ports;
|
|
166
162
|
let exclude = /* @__PURE__ */ new Set();
|
|
167
|
-
if (options) {
|
|
168
|
-
if (options.port) {
|
|
169
|
-
ports = typeof options.port === "number" ? [options.port] : options.port;
|
|
170
|
-
}
|
|
171
|
-
if (options.exclude) {
|
|
172
|
-
const excludeIterable = options.exclude;
|
|
173
|
-
if (typeof excludeIterable[Symbol.iterator] !== "function") {
|
|
174
|
-
throw new TypeError("The `exclude` option must be an iterable.");
|
|
175
|
-
}
|
|
176
|
-
for (const element of excludeIterable) {
|
|
177
|
-
if (typeof element !== "number") {
|
|
178
|
-
throw new TypeError("Each item in the `exclude` option must be a number corresponding to the port you want excluded.");
|
|
179
|
-
}
|
|
180
|
-
if (!Number.isSafeInteger(element)) {
|
|
181
|
-
throw new TypeError(`Number ${element} in the exclude option is not a safe integer and can't be used`);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
exclude = new Set(excludeIterable);
|
|
185
|
-
}
|
|
186
|
-
}
|
|
187
163
|
if (timeout === void 0) {
|
|
188
164
|
timeout = setTimeout(() => {
|
|
189
165
|
timeout = void 0;
|
|
@@ -195,7 +171,7 @@
|
|
|
195
171
|
}
|
|
196
172
|
}
|
|
197
173
|
const hosts = getLocalHosts();
|
|
198
|
-
for (const port of portCheckSequence(
|
|
174
|
+
for (const port of portCheckSequence()) {
|
|
199
175
|
try {
|
|
200
176
|
if (exclude.has(port)) {
|
|
201
177
|
continue;
|
|
@@ -278,4 +254,4 @@
|
|
|
278
254
|
exports2.writeHtmlListEntryWithRetry = writeHtmlListEntryWithRetry;
|
|
279
255
|
exports2.writeScoresToJson = writeScoresToJson;
|
|
280
256
|
Object.defineProperty(exports2, Symbol.toStringTag, { value: "Module" });
|
|
281
|
-
});
|
|
257
|
+
}));
|
|
@@ -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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BrowserContext } from '@playwright/test';
|
|
2
|
-
export declare const playwrightLighthouseTest: import("
|
|
2
|
+
export declare const playwrightLighthouseTest: import("playwright/test").TestType<import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & {
|
|
3
3
|
context: BrowserContext;
|
|
4
|
-
}, import("
|
|
4
|
+
}, import("playwright/test").PlaywrightWorkerArgs & import("playwright/test").PlaywrightWorkerOptions & {
|
|
5
5
|
port: number;
|
|
6
6
|
}>;
|
|
@@ -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
|
|
@@ -37,12 +37,12 @@ export declare const storybookPlaywright: {
|
|
|
37
37
|
*
|
|
38
38
|
* Defaults to `"disabled"` that disables animations.
|
|
39
39
|
*/
|
|
40
|
-
animations?:
|
|
40
|
+
animations?: "disabled" | "allow";
|
|
41
41
|
/**
|
|
42
42
|
* When set to `"hide"`, screenshot will hide text caret. When set to `"initial"`, text caret behavior will not be
|
|
43
43
|
* changed. Defaults to `"hide"`.
|
|
44
44
|
*/
|
|
45
|
-
caret?:
|
|
45
|
+
caret?: "hide" | "initial";
|
|
46
46
|
/**
|
|
47
47
|
* An object which specifies clipping of the resulting image.
|
|
48
48
|
*/
|
|
@@ -96,7 +96,7 @@ export declare const storybookPlaywright: {
|
|
|
96
96
|
*
|
|
97
97
|
* Defaults to `"css"`.
|
|
98
98
|
*/
|
|
99
|
-
scale?:
|
|
99
|
+
scale?: "css" | "device";
|
|
100
100
|
/**
|
|
101
101
|
* An acceptable perceived color difference in the [YIQ color space](https://en.wikipedia.org/wiki/YIQ) between the
|
|
102
102
|
* same pixel in compared images, between zero (strict) and one (lax), default is configurable with
|
|
@@ -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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse-reporting",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"build": "vite build && vite build -c vite.umd.config.ts && tsc -p ./tsconfig.build.json",
|
|
7
7
|
"compile": "tsc",
|
|
8
|
-
"lint": "eslint
|
|
8
|
+
"lint": "eslint .",
|
|
9
9
|
"precommit": "run-p lint compile",
|
|
10
10
|
"semantic-release": "semantic-release"
|
|
11
11
|
},
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"exports": {
|
|
19
19
|
".": {
|
|
20
|
+
"types": "./dist/index.d.ts",
|
|
20
21
|
"import": "./dist/index.js",
|
|
21
22
|
"require": "./dist/lighthouse-reporting.umd.cjs",
|
|
22
|
-
"default": "./dist/index.cjs"
|
|
23
|
-
"types": "./dist/index.d.ts"
|
|
23
|
+
"default": "./dist/index.cjs"
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
"optionalDependencies": {
|
|
@@ -28,25 +28,25 @@
|
|
|
28
28
|
"get-port": ">=7"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@playwright/test": "^1.
|
|
31
|
+
"@playwright/test": "^1.54.2",
|
|
32
32
|
"@types/fs-extra": "^11.0.4",
|
|
33
|
-
"@types/node": "^
|
|
34
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
35
|
-
"@typescript-eslint/parser": "^
|
|
36
|
-
"eslint": "^
|
|
37
|
-
"eslint-config-prettier": "^
|
|
38
|
-
"eslint-plugin-prettier": "^5.
|
|
39
|
-
"get-port": "^7.
|
|
40
|
-
"husky": "^9.
|
|
33
|
+
"@types/node": "^22.17.1",
|
|
34
|
+
"@typescript-eslint/eslint-plugin": "^8.39.1",
|
|
35
|
+
"@typescript-eslint/parser": "^8.39.1",
|
|
36
|
+
"eslint": "^9.33.0",
|
|
37
|
+
"eslint-config-prettier": "^10.1.8",
|
|
38
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
39
|
+
"get-port": "^7.1.0",
|
|
40
|
+
"husky": "^9.1.7",
|
|
41
41
|
"npm-run-all": "^4.1.5",
|
|
42
|
-
"prettier": "^3.2
|
|
43
|
-
"semantic-release": "^
|
|
44
|
-
"typescript": "^5.
|
|
45
|
-
"vite": "^
|
|
46
|
-
"vite-plugin-static-copy": "^1.
|
|
42
|
+
"prettier": "^3.6.2",
|
|
43
|
+
"semantic-release": "^24.2.7",
|
|
44
|
+
"typescript": "^5.9.2",
|
|
45
|
+
"vite": "^7.1.2",
|
|
46
|
+
"vite-plugin-static-copy": "^3.1.1"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"fs-extra": "^11.
|
|
49
|
+
"fs-extra": "^11.3.1"
|
|
50
50
|
},
|
|
51
51
|
"repository": {
|
|
52
52
|
"type": "git",
|
|
File without changes
|
|
File without changes
|