lighthouse-reporting 1.6.8 → 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.
- package/dist/constants-CFLum58k.js +6 -0
- package/dist/constants-WB1XbOZm.cjs +23 -0
- package/dist/hooks.cjs +21 -18
- package/dist/hooks.js +13 -16
- package/dist/index.cjs +13 -14
- package/dist/index.js +1 -11
- package/dist/lighthouse-reporting.umd.cjs +280 -256
- package/dist/lighthouseReports.cjs +82 -84
- package/dist/lighthouseReports.js +78 -88
- package/dist/playwrightLighthouseTest.cjs +20 -28
- package/dist/playwrightLighthouseTest.js +14 -27
- package/dist/rolldown-runtime-D6vf50IK.cjs +28 -0
- package/dist/storybookPlaywright.cjs +27 -30
- package/dist/storybookPlaywright.js +24 -30
- package/package.json +13 -12
- package/dist/constants-ClvZzVIQ.cjs +0 -7
- package/dist/constants-CvRW9vHz.js +0 -8
- /package/dist/{lighthouse.html → src/lighthouse.html} +0 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
//#region src/constants.ts
|
|
2
|
+
var INDEX_HTML = "index.html";
|
|
3
|
+
var LH_OUT_DIR = "lighthouse";
|
|
4
|
+
var PW_TMP_DIR = "pwlh";
|
|
5
|
+
//#endregion
|
|
6
|
+
Object.defineProperty(exports, "INDEX_HTML", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function() {
|
|
9
|
+
return INDEX_HTML;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, "LH_OUT_DIR", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function() {
|
|
15
|
+
return LH_OUT_DIR;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "PW_TMP_DIR", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function() {
|
|
21
|
+
return PW_TMP_DIR;
|
|
22
|
+
}
|
|
23
|
+
});
|
package/dist/hooks.cjs
CHANGED
|
@@ -1,26 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
let
|
|
2
|
+
const require_rolldown_runtime = require("./rolldown-runtime-D6vf50IK.cjs");
|
|
3
|
+
const require_constants = require("./constants-WB1XbOZm.cjs");
|
|
4
|
+
let os = require("os");
|
|
5
|
+
os = require_rolldown_runtime.__toESM(os, 1);
|
|
6
|
+
let path = require("path");
|
|
7
|
+
path = require_rolldown_runtime.__toESM(path, 1);
|
|
8
|
+
let fs_extra = require("fs-extra");
|
|
9
|
+
fs_extra = require_rolldown_runtime.__toESM(fs_extra, 1);
|
|
10
|
+
let url = require("url");
|
|
11
|
+
url = require_rolldown_runtime.__toESM(url, 1);
|
|
12
|
+
//#region src/hooks.ts
|
|
13
|
+
var dirname;
|
|
10
14
|
if (typeof __dirname !== "string") {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
} else
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const reportDir = path.join(process.cwd(), process.env.LH_REPORT_DIR || constants.LH_OUT_DIR);
|
|
17
|
-
const htmlTemplatePath = path.join(dirname, "lighthouse.html");
|
|
15
|
+
const filename = url.default.fileURLToPath({}.url);
|
|
16
|
+
dirname = path.default.dirname(filename);
|
|
17
|
+
} else dirname = __dirname;
|
|
18
|
+
var reportDir = path.default.join(process.cwd(), process.env.LH_REPORT_DIR || "lighthouse");
|
|
19
|
+
var htmlTemplatePath = path.default.join(dirname, "lighthouse.html");
|
|
18
20
|
async function lighthouseSetup() {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
await fs_extra.default.ensureDir(reportDir);
|
|
22
|
+
await fs_extra.default.copyFile(htmlTemplatePath, path.default.join(reportDir, require_constants.INDEX_HTML));
|
|
21
23
|
}
|
|
22
24
|
async function lighthousePlaywrightTeardown() {
|
|
23
|
-
|
|
25
|
+
await fs_extra.default.remove(path.default.join(os.default.tmpdir(), require_constants.PW_TMP_DIR));
|
|
24
26
|
}
|
|
27
|
+
//#endregion
|
|
25
28
|
exports.lighthousePlaywrightTeardown = lighthousePlaywrightTeardown;
|
|
26
29
|
exports.lighthouseSetup = lighthouseSetup;
|
package/dist/hooks.js
CHANGED
|
@@ -1,25 +1,22 @@
|
|
|
1
|
+
import { r as PW_TMP_DIR, t as INDEX_HTML } from "./constants-CFLum58k.js";
|
|
1
2
|
import os from "os";
|
|
2
3
|
import path from "path";
|
|
3
4
|
import fse from "fs-extra";
|
|
4
5
|
import url from "url";
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
//#region src/hooks.ts
|
|
7
|
+
var dirname;
|
|
7
8
|
if (typeof __dirname !== "string") {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} else
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const reportDir = path.join(process.cwd(), process.env.LH_REPORT_DIR || LH_OUT_DIR);
|
|
14
|
-
const htmlTemplatePath = path.join(dirname, "lighthouse.html");
|
|
9
|
+
const filename = url.fileURLToPath(import.meta.url);
|
|
10
|
+
dirname = path.dirname(filename);
|
|
11
|
+
} else dirname = __dirname;
|
|
12
|
+
var reportDir = path.join(process.cwd(), process.env.LH_REPORT_DIR || "lighthouse");
|
|
13
|
+
var htmlTemplatePath = path.join(dirname, "lighthouse.html");
|
|
15
14
|
async function lighthouseSetup() {
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
await fse.ensureDir(reportDir);
|
|
16
|
+
await fse.copyFile(htmlTemplatePath, path.join(reportDir, INDEX_HTML));
|
|
18
17
|
}
|
|
19
18
|
async function lighthousePlaywrightTeardown() {
|
|
20
|
-
|
|
19
|
+
await fse.remove(path.join(os.tmpdir(), PW_TMP_DIR));
|
|
21
20
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
lighthouseSetup
|
|
25
|
-
};
|
|
21
|
+
//#endregion
|
|
22
|
+
export { lighthousePlaywrightTeardown, lighthouseSetup };
|
package/dist/index.cjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
exports.
|
|
8
|
-
exports.
|
|
9
|
-
exports.
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
12
|
-
exports.
|
|
13
|
-
exports.
|
|
14
|
-
exports.
|
|
15
|
-
exports.
|
|
2
|
+
const require_hooks = require("./hooks.cjs");
|
|
3
|
+
const require_lighthouseReports = require("./lighthouseReports.cjs");
|
|
4
|
+
const require_playwrightLighthouseTest = require("./playwrightLighthouseTest.cjs");
|
|
5
|
+
const require_storybookPlaywright = require("./storybookPlaywright.cjs");
|
|
6
|
+
exports.buildAverageCsv = require_lighthouseReports.buildAverageCsv;
|
|
7
|
+
exports.getScores = require_lighthouseReports.getScores;
|
|
8
|
+
exports.lighthousePlaywrightTeardown = require_hooks.lighthousePlaywrightTeardown;
|
|
9
|
+
exports.lighthouseSetup = require_hooks.lighthouseSetup;
|
|
10
|
+
exports.playwrightLighthouseTest = require_playwrightLighthouseTest.playwrightLighthouseTest;
|
|
11
|
+
exports.storybookPlaywright = require_storybookPlaywright.storybookPlaywright;
|
|
12
|
+
exports.writeCsvResult = require_lighthouseReports.writeCsvResult;
|
|
13
|
+
exports.writeHtmlListEntryWithRetry = require_lighthouseReports.writeHtmlListEntryWithRetry;
|
|
14
|
+
exports.writeScoresToJson = require_lighthouseReports.writeScoresToJson;
|
package/dist/index.js
CHANGED
|
@@ -2,14 +2,4 @@ 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
|
-
export {
|
|
6
|
-
buildAverageCsv,
|
|
7
|
-
getScores,
|
|
8
|
-
lighthousePlaywrightTeardown,
|
|
9
|
-
lighthouseSetup,
|
|
10
|
-
playwrightLighthouseTest,
|
|
11
|
-
storybookPlaywright,
|
|
12
|
-
writeCsvResult,
|
|
13
|
-
writeHtmlListEntryWithRetry,
|
|
14
|
-
writeScoresToJson
|
|
15
|
-
};
|
|
5
|
+
export { buildAverageCsv, getScores, lighthousePlaywrightTeardown, lighthouseSetup, playwrightLighthouseTest, storybookPlaywright, writeCsvResult, writeHtmlListEntryWithRetry, writeScoresToJson };
|