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 CHANGED
@@ -321,4 +321,4 @@ stage('Lighthouse') {
321
321
 
322
322
  ## GitHub Actions
323
323
 
324
- TODO
324
+ See example https://github.com/mgrybyk/html-trend-report-action
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-PDApvt-A.cjs");
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-9b_WPkRp.js";
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.test));
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(ports)) {
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-PDApvt-A.cjs");
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("@playwright/test").TestType<import("@playwright/test").PlaywrightTestArgs & import("@playwright/test").PlaywrightTestOptions & {
2
+ export declare const playwrightLighthouseTest: import("playwright/test").TestType<import("playwright/test").PlaywrightTestArgs & import("playwright/test").PlaywrightTestOptions & {
3
3
  context: BrowserContext;
4
- }, import("@playwright/test").PlaywrightWorkerArgs & import("@playwright/test").PlaywrightWorkerOptions & {
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-9b_WPkRp.js";
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?: 'disabled' | 'allow';
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?: 'hide' | 'initial';
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?: 'css' | 'device';
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?: ((page: Page) => Promise<void>) | undefined) => Promise<void>;
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.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 --ext .ts --ignore-path .gitignore .",
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.34.3",
31
+ "@playwright/test": "^1.54.2",
32
32
  "@types/fs-extra": "^11.0.4",
33
- "@types/node": "^20.11.16",
34
- "@typescript-eslint/eslint-plugin": "^6.20.0",
35
- "@typescript-eslint/parser": "^6.20.0",
36
- "eslint": "^8.56.0",
37
- "eslint-config-prettier": "^9.1.0",
38
- "eslint-plugin-prettier": "^5.1.3",
39
- "get-port": "^7.0.0",
40
- "husky": "^9.0.10",
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.4",
43
- "semantic-release": "^23.0.0",
44
- "typescript": "^5.3.3",
45
- "vite": "^5.0.12",
46
- "vite-plugin-static-copy": "^1.0.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.2.0"
49
+ "fs-extra": "^11.3.1"
50
50
  },
51
51
  "repository": {
52
52
  "type": "git",