lighthouse-reporting 1.6.7 → 1.6.9

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.
@@ -1,33 +1,27 @@
1
1
  import fse from "fs-extra";
2
2
  import { expect } from "@playwright/test";
3
- const storybookPlaywright = {
4
- getStories: (pathToStorybookIndexJson, storyFilterFn) => {
5
- if (!fse.existsSync(pathToStorybookIndexJson)) {
6
- console.log(pathToStorybookIndexJson, "doesn't exist.");
7
- throw new Error("Please build storybook before running tests!");
8
- }
9
- const storybookIndexJson = fse.readJsonSync(pathToStorybookIndexJson);
10
- const storyObject = storybookIndexJson.entries || storybookIndexJson.stories;
11
- const stories = Object.values(storyObject).filter(storyFilterFn);
12
- return stories;
13
- },
14
- captureScreenshot: async (story, context, screenshotOptions, options = {
15
- waitForLoadStateTimeout: 2e3
16
- }, actionBeforeScreenshot) => {
17
- const page = context.pages()[0];
18
- await page.goto(`/iframe.html?id=${story.id}`);
19
- await expect(page.locator(".sb-show-main")).toBeVisible();
20
- await expect(page.locator(".sb-show-errordisplay")).not.toBeVisible();
21
- try {
22
- await page.waitForLoadState("networkidle", { timeout: options.waitForLoadStateTimeout });
23
- } catch {
24
- }
25
- if (actionBeforeScreenshot) {
26
- await actionBeforeScreenshot(page);
27
- }
28
- await expect(page).toHaveScreenshot(`${story.id}.png`, screenshotOptions);
29
- }
30
- };
31
- export {
32
- storybookPlaywright
3
+ //#region src/storybookPlaywright.ts
4
+ var storybookPlaywright = {
5
+ getStories: (pathToStorybookIndexJson, storyFilterFn) => {
6
+ if (!fse.existsSync(pathToStorybookIndexJson)) {
7
+ console.log(pathToStorybookIndexJson, "doesn't exist.");
8
+ throw new Error("Please build storybook before running tests!");
9
+ }
10
+ const storybookIndexJson = fse.readJsonSync(pathToStorybookIndexJson);
11
+ const storyObject = storybookIndexJson.entries || storybookIndexJson.stories;
12
+ return Object.values(storyObject).filter(storyFilterFn);
13
+ },
14
+ captureScreenshot: async (story, context, screenshotOptions, options = { waitForLoadStateTimeout: 2e3 }, actionBeforeScreenshot) => {
15
+ const page = context.pages()[0];
16
+ await page.goto(`/iframe.html?id=${story.id}`);
17
+ await expect(page.locator(".sb-show-main")).toBeVisible();
18
+ await expect(page.locator(".sb-show-errordisplay")).not.toBeVisible();
19
+ try {
20
+ await page.waitForLoadState("networkidle", { timeout: options.waitForLoadStateTimeout });
21
+ } catch {}
22
+ if (actionBeforeScreenshot) await actionBeforeScreenshot(page);
23
+ await expect(page).toHaveScreenshot(`${story.id}.png`, screenshotOptions);
24
+ }
33
25
  };
26
+ //#endregion
27
+ export { storybookPlaywright };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "lighthouse-reporting",
3
- "version": "1.6.7",
3
+ "version": "1.6.9",
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,26 @@
28
28
  "get-port": ">=7"
29
29
  },
30
30
  "devDependencies": {
31
- "@playwright/test": "^1.34.3",
31
+ "@eslint/js": "^10.0.1",
32
+ "@playwright/test": "^1.54.2",
32
33
  "@types/fs-extra": "^11.0.4",
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
- "eslint-config-prettier": "^9.1.0",
38
- "eslint-plugin-prettier": "^5.1.3",
39
- "get-port": "^7.0.0",
40
- "husky": "^9.0.11",
34
+ "@types/node": "^24.13.2",
35
+ "@typescript-eslint/eslint-plugin": "^8.62.0",
36
+ "@typescript-eslint/parser": "^8.62.0",
37
+ "eslint": "^10.5.0",
38
+ "eslint-config-prettier": "^10.1.8",
39
+ "eslint-plugin-prettier": "^5.5.6",
40
+ "get-port": "^7.1.0",
41
+ "husky": "^9.1.7",
41
42
  "npm-run-all": "^4.1.5",
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"
43
+ "prettier": "^3.8.4",
44
+ "semantic-release": "^25.0.5",
45
+ "typescript": "^5.9.3",
46
+ "vite": "^8.1.0",
47
+ "vite-plugin-static-copy": "^4.1.1"
47
48
  },
48
49
  "dependencies": {
49
- "fs-extra": "^11.2.0"
50
+ "fs-extra": "^11.3.5"
50
51
  },
51
52
  "repository": {
52
53
  "type": "git",
@@ -1,7 +0,0 @@
1
- "use strict";
2
- const INDEX_HTML = "index.html";
3
- const LH_OUT_DIR = "lighthouse";
4
- const PW_TMP_DIR = "pwlh";
5
- exports.INDEX_HTML = INDEX_HTML;
6
- exports.LH_OUT_DIR = LH_OUT_DIR;
7
- exports.PW_TMP_DIR = PW_TMP_DIR;
@@ -1,8 +0,0 @@
1
- const INDEX_HTML = "index.html";
2
- const LH_OUT_DIR = "lighthouse";
3
- const PW_TMP_DIR = "pwlh";
4
- export {
5
- INDEX_HTML as I,
6
- LH_OUT_DIR as L,
7
- PW_TMP_DIR as P
8
- };
File without changes