lighthouse 13.5.0-dev.20261020 → 13.5.0-dev.20261021
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/cli/bin.d.ts +2 -2
- package/cli/bin.js +5 -4
- package/cli/cli-flags.d.ts +16 -1
- package/cli/cli-flags.js +51 -0
- package/cli/run.d.ts +5 -5
- package/cli/run.js +97 -47
- package/core/audits/baseline.d.ts +3 -0
- package/core/audits/byte-efficiency/byte-efficiency-audit.js +2 -2
- package/core/computed/lcp-image-record.d.ts +2 -23
- package/core/computed/lcp-image-record.js +3 -67
- package/core/computed/lcp-network-record.d.ts +24 -0
- package/core/computed/lcp-network-record.js +74 -0
- package/core/computed/metrics/lcp-breakdown.js +2 -2
- package/core/config/config-helpers.d.ts +5 -0
- package/core/config/config-helpers.js +6 -24
- package/core/lib/baseline/web-features-data.json +14 -1
- package/dist/report/bundle.esm.js +2 -2
- package/dist/report/flow.js +13 -13
- package/dist/report/standalone.js +2 -2
- package/flow-report/src/util.d.ts +1 -1
- package/package.json +36 -39
- package/readme.md +11 -17
- package/report/generator/file-namer.d.ts +1 -1
- package/report/generator/file-namer.js +4 -3
- package/report/renderer/performance-category-renderer.js +2 -1
- package/report/renderer/text-encoding.js +2 -2
- package/report/types/augment-dom.d.ts +4 -0
- package/types/externs.d.ts +4 -0
package/readme.md
CHANGED
|
@@ -106,6 +106,9 @@ Configuration:
|
|
|
106
106
|
--only-categories Only run the specified categories. Available categories: accessibility, best-practices, performance, seo [array]
|
|
107
107
|
--skip-audits Run everything except these audits [array]
|
|
108
108
|
--disable-full-page-screenshot Disables collection of the full page screenshot, which can be quite large [boolean]
|
|
109
|
+
--ignore-status-code Disables failing on all error status codes, and instead issues a warning. [boolean]
|
|
110
|
+
--url-file The path to a file containing newline-delimited URLs to audit. [string]
|
|
111
|
+
--fail-fast Stop auditing remaining URLs immediately if a run fails. [boolean]
|
|
109
112
|
|
|
110
113
|
Output:
|
|
111
114
|
--output Reporter for the results, supports multiple values. choices: "json", "html", "csv" [array] [default: ["html"]]
|
|
@@ -177,6 +180,12 @@ lighthouse --output-path=~/mydir/foo.out --save-assets
|
|
|
177
180
|
|
|
178
181
|
lighthouse --output-path=./report.json --output json
|
|
179
182
|
# saves `./report.json`
|
|
183
|
+
|
|
184
|
+
lighthouse https://example.com https://example.org
|
|
185
|
+
# audits multiple URLs sequentially and saves `./<HOST>_<DATE>.report.html` for each
|
|
186
|
+
|
|
187
|
+
lighthouse --url-file=./urls.txt --output-path=./reports
|
|
188
|
+
# audits all URLs in `./urls.txt` and saves reports into the existing `./reports` directory
|
|
180
189
|
```
|
|
181
190
|
|
|
182
191
|
##### Lifecycle Examples
|
|
@@ -394,32 +403,17 @@ This section details services that have integrated Lighthouse data. If you're wo
|
|
|
394
403
|
Other awesome open source projects that use Lighthouse.
|
|
395
404
|
|
|
396
405
|
* **[auto-lighthouse](https://github.com/TGiles/auto-lighthouse)** - a CLI for crawling a domain and generating mobile and desktop reports for each page.
|
|
397
|
-
* **[Exthouse](https://github.com/treosh/exthouse)** - Analyze the impact of a browser extension on web performance.
|
|
398
|
-
* **[Gimbal](https://labs.moduscreate.com/gimbal-web-performance-audit-budgeting)** - An [open source (MIT licensed)](https://github.com/ModusCreateOrg/gimbal) tool used to measure, analyze, and budget aspects of a web application. Gimbal also integrates reports with GitHub pull requests.
|
|
399
|
-
* **[Gradle Lighthouse Plugin](https://github.com/Cognifide/gradle-lighthouse-plugin)** - An open source Gradle plugin that runs Lighthouse tests on multiple URLs and asserts category score thresholds (useful in continuous integration).
|
|
400
406
|
* **[lighthouse-badges](https://github.com/emazzotta/lighthouse-badges)** - Generate gh-badges (shields.io) based on Lighthouse performance.
|
|
401
|
-
* **[lighthouse-batch](https://github.com/mikestead/lighthouse-batch)** - Run Lighthouse over a number of sites and generate a summary of their metrics/scores.
|
|
402
|
-
* **[lighthouse-batch-parallel](https://github.com/Carr1005/lighthouse-batch-parallel)** - Run multiple Lighthouse runs in parallel to accelerate the data collecting process, get the result stream (csv, json, js object) in your own process (warning: performance results may be volatile).
|
|
403
407
|
* **[lighthouse-check-action](https://github.com/foo-software/lighthouse-check-action)** - A GitHub Action to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.
|
|
404
408
|
* **[lighthouse-check-orb](https://circleci.com/orbs/registry/orb/foo-software/lighthouse-check)** - A CircleCI Orb to run Lighthouse in a workflow, featuring Slack notifications and report upload to S3.
|
|
405
|
-
* **[andreasonny83/lighthouse-ci](https://github.com/andreasonny83/lighthouse-ci)** - Run Lighthouse and assert scores satisfy your custom thresholds.
|
|
406
409
|
* **[GoogleChrome/lighthouse-ci](https://github.com/GoogleChrome/lighthouse-ci)** - (**official**) Automate running Lighthouse for every commit, viewing the changes, and preventing regressions.
|
|
407
410
|
* **[lighthouse-ci-action](https://github.com/treosh/lighthouse-ci-action)** - A GitHub Action that makes it easy to run Lighthouse in CI and keep your pages small using performance budgets.
|
|
408
|
-
* **[lighthouse-gh-reporter](https://github.com/carlesnunez/lighthouse-gh-reporter)** - Run Lighthouse in CI and report back in a comment on your pull requests
|
|
409
|
-
* **[lighthouse-jest-example](https://github.com/justinribeiro/lighthouse-jest-example)** - Gather performance metrics via Lighthouse and assert results with Jest; uses Puppeteer to start Chrome with network emulation settings defined by WebPageTest.
|
|
410
|
-
* **[lighthouse-lambda](https://github.com/Otterseer/lighthouse-lambda)** - Run Lighthouse on AWS Lambda with prebuilt stable desktop Headless Chrome.
|
|
411
411
|
* **[lighthouse-matchers](https://github.com/ackama/lighthouse-matchers)** - Provides RSpec matchers for executing and evaluating Google Chrome Lighthouse audit scores.
|
|
412
|
-
* **[lighthouse-mocha-example](https://github.com/rishichawda/lighthouse-mocha-example)** - Run Lighthouse performance tests with Mocha and chrome-launcher.
|
|
413
|
-
* **[lighthouse-monitor](https://github.com/verivox/lighthouse-monitor)** - Run Lighthouse against all your URLs. Send metrics to any backend you want, save all reports with automatic data retention, and compare any two results in a web UI.
|
|
414
412
|
* **[lighthouse-persist](https://github.com/foo-software/lighthouse-persist)** - Run Lighthouse and upload HTML reports to an AWS S3 bucket.
|
|
415
413
|
* **[lighthouse-viewer](https://github.com/dvelasquez/lighthouse-viewer/tree/main/packages/lighthouse-viewer)** - Render the Lighthouse JSON into a report, using the Lighthouse Report Renderer repackaged as UMD and ESM. Also available with React, Svelte and Vue wrappers.
|
|
416
|
-
* **[
|
|
417
|
-
* **[react-lighthouse-viewer](https://www.npmjs.com/package/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.
|
|
414
|
+
* **[react-lighthouse-viewer](https://github.com/blencorp/react-lighthouse-viewer)** - Render a Lighthouse JSON report in a React Component.
|
|
418
415
|
* **[site-audit-seo](https://github.com/viasite/site-audit-seo)** - CLI tool for SEO site audit, crawl site, lighthouse each page. Output to console and tables in csv, xlsx, json, web or Google Drive.
|
|
419
|
-
* **[
|
|
420
|
-
* **[cypress-audit](https://github.com/mfrachet/cypress-audit)** - Run Lighthouse and Pa11y audits directly in your E2E test suites.
|
|
421
|
-
* **[laravel-lighthouse](https://github.com/adityadees/laravel-lighthouse)** - Google Lighthouse wrapper for laravel framework to run Google Lighthouse CLI with custom option and can automatically save result in your server directory.
|
|
422
|
-
* **[Neodymium](https://github.com/Xceptance/neodymium/wiki/Accessibility)** - The Neodymium test automation framework integrates Lighthouse for accessibility and Web Vitals verification, allowing programmatic validation and assertion of all audit values.
|
|
416
|
+
* **[Neodymium](https://docs.xceptance.com/neodymium/features/accessibility/)** - The Neodymium test automation framework integrates Lighthouse for accessibility and Web Vitals verification, allowing programmatic validation and assertion of all audit values.
|
|
423
417
|
|
|
424
418
|
## FAQ
|
|
425
419
|
|
|
@@ -34,13 +34,14 @@ function getFilenamePrefix(name, fetchTime) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
|
-
* Generate a filenamePrefix of
|
|
37
|
+
* Generate a filenamePrefix of hostname-pathname_YYYY-MM-DD_HH-MM-SS.
|
|
38
38
|
* @param {{finalDisplayedUrl: string, fetchTime: string}} lhr
|
|
39
39
|
* @return {string}
|
|
40
40
|
*/
|
|
41
41
|
function getLhrFilenamePrefix(lhr) {
|
|
42
|
-
const hostname = new URL(lhr.finalDisplayedUrl)
|
|
43
|
-
|
|
42
|
+
const {hostname, pathname} = new URL(lhr.finalDisplayedUrl);
|
|
43
|
+
const name = hostname + pathname.replace(/\/$/, '');
|
|
44
|
+
return getFilenamePrefix(name, lhr.fetchTime);
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
/**
|
|
@@ -226,7 +226,8 @@ export class PerformanceCategoryRenderer extends CategoryRenderer {
|
|
|
226
226
|
* @return {Element|null}
|
|
227
227
|
*/
|
|
228
228
|
renderFilterableSection(category, groups, groupNames, metricAudits) {
|
|
229
|
-
|
|
229
|
+
groupNames = groupNames.filter(groupName => Boolean(groups[groupName]));
|
|
230
|
+
if (!groupNames.length) return null;
|
|
230
231
|
|
|
231
232
|
const element = this.dom.createElement('div');
|
|
232
233
|
|
|
@@ -36,7 +36,7 @@ async function toBase64(string, options) {
|
|
|
36
36
|
} else {
|
|
37
37
|
/** @type {typeof import('pako')=} */
|
|
38
38
|
const pako = window.pako;
|
|
39
|
-
bytes =
|
|
39
|
+
bytes = pako.gzip(string);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
42
|
|
|
@@ -62,7 +62,7 @@ function fromBase64(encoded, options) {
|
|
|
62
62
|
if (options.gzip) {
|
|
63
63
|
/** @type {typeof import('pako')=} */
|
|
64
64
|
const pako = window.pako;
|
|
65
|
-
return pako.ungzip(bytes, {
|
|
65
|
+
return pako.ungzip(bytes, {toText: true});
|
|
66
66
|
} else {
|
|
67
67
|
return new TextDecoder().decode(bytes);
|
|
68
68
|
}
|
package/types/externs.d.ts
CHANGED
|
@@ -57,6 +57,10 @@ export interface CliFlags extends Flags {
|
|
|
57
57
|
precomputedLanternDataPath?: string;
|
|
58
58
|
/** Path to the file where precomputed lantern data should be written to. */
|
|
59
59
|
lanternDataOutputPath?: string;
|
|
60
|
+
/** Path to a file containing newline-delimited URLs to audit. */
|
|
61
|
+
urlFile?: string[];
|
|
62
|
+
/** Flag to stop auditing remaining URLs immediately if a run fails. */
|
|
63
|
+
failFast?: boolean;
|
|
60
64
|
|
|
61
65
|
// The following are given defaults in cli-flags, so are not optional like in Flags or SharedFlagsSettings.
|
|
62
66
|
output: OutputMode[];
|