lighthouse 9.5.0-dev.20220711 → 9.5.0-dev.20220714
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/{esm-utils.mjs → esm-utils.js} +2 -2
- package/flow-report/tsconfig.json +1 -0
- package/lighthouse-cli/bin.js +5 -9
- package/lighthouse-cli/commands/list-audits.js +2 -2
- package/lighthouse-cli/commands/list-trace-categories.js +1 -2
- package/lighthouse-cli/run.js +2 -2
- package/lighthouse-cli/test/smokehouse/core-tests.js +3 -2
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +4 -3
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +8 -4
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +1 -1
- package/lighthouse-cli/test/smokehouse/lighthouse-runners/devtools.js +17 -68
- package/lighthouse-cli/test/smokehouse/smokehouse.js +10 -1
- package/lighthouse-core/audits/accessibility/accesskeys.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-allowed-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-command-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-hidden-body.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-hidden-focus.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-input-field-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-meter-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-children.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-required-parent.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-roles.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-toggle-field-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +6 -5
- package/lighthouse-core/audits/accessibility/aria-valid-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/axe-audit.js +6 -5
- package/lighthouse-core/audits/accessibility/button-name.js +6 -5
- package/lighthouse-core/audits/accessibility/bypass.js +6 -5
- package/lighthouse-core/audits/accessibility/color-contrast.js +6 -5
- package/lighthouse-core/audits/accessibility/definition-list.js +6 -5
- package/lighthouse-core/audits/accessibility/dlitem.js +6 -5
- package/lighthouse-core/audits/accessibility/document-title.js +6 -5
- package/lighthouse-core/audits/accessibility/duplicate-id-active.js +6 -5
- package/lighthouse-core/audits/accessibility/duplicate-id-aria.js +6 -5
- package/lighthouse-core/audits/accessibility/form-field-multiple-labels.js +6 -5
- package/lighthouse-core/audits/accessibility/frame-title.js +6 -5
- package/lighthouse-core/audits/accessibility/heading-order.js +6 -5
- package/lighthouse-core/audits/accessibility/html-has-lang.js +6 -5
- package/lighthouse-core/audits/accessibility/html-lang-valid.js +6 -5
- package/lighthouse-core/audits/accessibility/image-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/input-image-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/label.js +6 -5
- package/lighthouse-core/audits/accessibility/link-name.js +6 -5
- package/lighthouse-core/audits/accessibility/list.js +6 -5
- package/lighthouse-core/audits/accessibility/listitem.js +6 -5
- package/lighthouse-core/audits/accessibility/manual/custom-controls-labels.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/custom-controls-roles.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/focus-traps.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/focusable-controls.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/interactive-element-affordance.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/logical-tab-order.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/managed-focus.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/offscreen-content-hidden.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/use-landmarks.js +2 -2
- package/lighthouse-core/audits/accessibility/manual/visual-order-follows-dom.js +2 -2
- package/lighthouse-core/audits/accessibility/meta-refresh.js +6 -5
- package/lighthouse-core/audits/accessibility/meta-viewport.js +6 -5
- package/lighthouse-core/audits/accessibility/object-alt.js +6 -5
- package/lighthouse-core/audits/accessibility/tabindex.js +6 -5
- package/lighthouse-core/audits/accessibility/td-headers-attr.js +6 -5
- package/lighthouse-core/audits/accessibility/th-has-data-cells.js +6 -5
- package/lighthouse-core/audits/accessibility/valid-lang.js +6 -5
- package/lighthouse-core/audits/accessibility/video-caption.js +6 -5
- package/lighthouse-core/audits/apple-touch-icon.js +5 -5
- package/lighthouse-core/audits/audit.js +4 -4
- package/lighthouse-core/audits/autocomplete.js +6 -6
- package/lighthouse-core/audits/bootup-time.js +9 -9
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +12 -12
- package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +9 -8
- package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +18 -10
- package/lighthouse-core/audits/byte-efficiency/modern-image-formats.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +11 -11
- package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +15 -15
- package/lighthouse-core/audits/byte-efficiency/total-byte-weight.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/unminified-css.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +9 -9
- package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +10 -10
- package/lighthouse-core/audits/byte-efficiency/uses-optimized-images.js +7 -7
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js +8 -8
- package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +9 -10
- package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +7 -7
- package/lighthouse-core/audits/content-width.js +5 -5
- package/lighthouse-core/audits/critical-request-chains.js +6 -6
- package/lighthouse-core/audits/csp-xss.js +7 -10
- package/lighthouse-core/audits/deprecations.js +7 -6
- package/lighthouse-core/audits/diagnostics.js +6 -6
- package/lighthouse-core/audits/dobetterweb/charset.js +6 -9
- package/lighthouse-core/audits/dobetterweb/doctype.js +5 -5
- package/lighthouse-core/audits/dobetterweb/dom-size.js +5 -5
- package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +5 -5
- package/lighthouse-core/audits/dobetterweb/inspector-issues.js +6 -5
- package/lighthouse-core/audits/dobetterweb/js-libraries.js +5 -5
- package/lighthouse-core/audits/dobetterweb/no-document-write.js +5 -5
- package/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +12 -8
- package/lighthouse-core/audits/dobetterweb/notification-on-start.js +5 -5
- package/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +5 -5
- package/lighthouse-core/audits/dobetterweb/uses-http2.js +15 -14
- package/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +5 -5
- package/lighthouse-core/audits/errors-in-console.js +8 -7
- package/lighthouse-core/audits/final-screenshot.js +5 -5
- package/lighthouse-core/audits/font-display.js +8 -8
- package/lighthouse-core/audits/full-page-screenshot.js +2 -2
- package/lighthouse-core/audits/image-aspect-ratio.js +6 -6
- package/lighthouse-core/audits/image-size-responsive.js +6 -6
- package/lighthouse-core/audits/installable-manifest.js +6 -6
- package/lighthouse-core/audits/is-on-https.js +8 -8
- package/lighthouse-core/audits/largest-contentful-paint-element.js +5 -5
- package/lighthouse-core/audits/layout-shift-elements.js +5 -5
- package/lighthouse-core/audits/lcp-lazy-loaded.js +5 -5
- package/lighthouse-core/audits/long-tasks.js +10 -10
- package/lighthouse-core/audits/main-thread-tasks.js +3 -3
- package/lighthouse-core/audits/mainthread-work-breakdown.js +7 -7
- package/lighthouse-core/audits/manual/manual-audit.js +2 -2
- package/lighthouse-core/audits/manual/pwa-cross-browser.js +5 -5
- package/lighthouse-core/audits/manual/pwa-each-page-has-url.js +5 -5
- package/lighthouse-core/audits/manual/pwa-page-transitions.js +5 -5
- package/lighthouse-core/audits/maskable-icon.js +6 -6
- package/lighthouse-core/audits/metrics/cumulative-layout-shift.js +6 -6
- package/lighthouse-core/audits/metrics/experimental-interaction-to-next-paint.js +6 -6
- package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +6 -4
- package/lighthouse-core/audits/metrics/first-contentful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/first-meaningful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/interactive.js +6 -6
- package/lighthouse-core/audits/metrics/largest-contentful-paint.js +6 -6
- package/lighthouse-core/audits/metrics/max-potential-fid.js +6 -6
- package/lighthouse-core/audits/metrics/speed-index.js +6 -6
- package/lighthouse-core/audits/metrics/total-blocking-time.js +6 -6
- package/lighthouse-core/audits/metrics.js +3 -3
- package/lighthouse-core/audits/multi-check-audit.js +2 -2
- package/lighthouse-core/audits/network-requests.js +5 -5
- package/lighthouse-core/audits/network-rtt.js +7 -7
- package/lighthouse-core/audits/network-server-latency.js +7 -7
- package/lighthouse-core/audits/no-unload-listeners.js +6 -6
- package/lighthouse-core/audits/non-composited-animations.js +6 -5
- package/lighthouse-core/audits/oopif-iframe-test-audit.js +1 -1
- package/lighthouse-core/audits/performance-budget.js +8 -8
- package/lighthouse-core/audits/predictive-perf.js +9 -10
- package/lighthouse-core/audits/preload-fonts.js +8 -7
- package/lighthouse-core/audits/preload-lcp-image.js +11 -11
- package/lighthouse-core/audits/redirects.js +11 -11
- package/lighthouse-core/audits/resource-summary.js +6 -6
- package/lighthouse-core/audits/screenshot-thumbnails.js +5 -5
- package/lighthouse-core/audits/script-elements-test-audit.js +1 -1
- package/lighthouse-core/audits/script-treemap-data.js +7 -6
- package/lighthouse-core/audits/seo/canonical.js +7 -7
- package/lighthouse-core/audits/seo/crawlable-anchors.js +5 -5
- package/lighthouse-core/audits/seo/font-size.js +8 -6
- package/lighthouse-core/audits/seo/hreflang.js +7 -6
- package/lighthouse-core/audits/seo/http-status-code.js +7 -6
- package/lighthouse-core/audits/seo/is-crawlable.js +11 -9
- package/lighthouse-core/audits/seo/link-text.js +7 -6
- package/lighthouse-core/audits/seo/manual/structured-data.js +5 -5
- package/lighthouse-core/audits/seo/meta-description.js +5 -5
- package/lighthouse-core/audits/seo/plugins.js +6 -6
- package/lighthouse-core/audits/seo/robots-txt.js +7 -6
- package/lighthouse-core/audits/seo/tap-targets.js +12 -9
- package/lighthouse-core/audits/server-response-time.js +6 -6
- package/lighthouse-core/audits/service-worker.js +6 -6
- package/lighthouse-core/audits/splash-screen.js +6 -6
- package/lighthouse-core/audits/themed-omnibox.js +7 -7
- package/lighthouse-core/audits/third-party-facades.js +14 -13
- package/lighthouse-core/audits/third-party-summary.js +9 -9
- package/lighthouse-core/audits/timing-budget.js +8 -8
- package/lighthouse-core/audits/unsized-images.js +6 -6
- package/lighthouse-core/audits/user-timings.js +6 -6
- package/lighthouse-core/audits/uses-rel-preconnect.js +15 -15
- package/lighthouse-core/audits/uses-rel-preload.js +13 -13
- package/lighthouse-core/audits/valid-source-maps.js +6 -6
- package/lighthouse-core/audits/viewport.js +6 -6
- package/lighthouse-core/audits/violation-audit.js +3 -3
- package/lighthouse-core/audits/work-during-interaction.js +15 -15
- package/lighthouse-core/computed/computed-artifact.js +3 -3
- package/lighthouse-core/computed/critical-request-chains.js +5 -5
- package/lighthouse-core/computed/image-records.js +3 -3
- package/lighthouse-core/computed/js-bundles.js +4 -4
- package/lighthouse-core/computed/load-simulator.js +8 -5
- package/lighthouse-core/computed/main-resource.js +4 -4
- package/lighthouse-core/computed/main-thread-tasks.js +4 -4
- package/lighthouse-core/computed/manifest-values.js +3 -3
- package/lighthouse-core/computed/metrics/cumulative-layout-shift.js +4 -4
- package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +3 -3
- package/lighthouse-core/computed/metrics/first-contentful-paint.js +4 -4
- package/lighthouse-core/computed/metrics/first-meaningful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/interactive.js +8 -9
- package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +7 -7
- package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/lantern-interactive.js +7 -7
- package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +5 -5
- package/lighthouse-core/computed/metrics/lantern-max-potential-fid.js +6 -6
- package/lighthouse-core/computed/metrics/lantern-metric.js +10 -10
- package/lighthouse-core/computed/metrics/lantern-speed-index.js +8 -8
- package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +8 -8
- package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +5 -4
- package/lighthouse-core/computed/metrics/largest-contentful-paint.js +6 -5
- package/lighthouse-core/computed/metrics/max-potential-fid.js +6 -6
- package/lighthouse-core/computed/metrics/metric.js +6 -6
- package/lighthouse-core/computed/metrics/navigation-metric.js +2 -2
- package/lighthouse-core/computed/metrics/responsiveness.js +3 -3
- package/lighthouse-core/computed/metrics/speed-index.js +5 -5
- package/lighthouse-core/computed/metrics/tbt-utils.js +1 -1
- package/lighthouse-core/computed/metrics/timing-summary.js +15 -15
- package/lighthouse-core/computed/metrics/total-blocking-time.js +7 -7
- package/lighthouse-core/computed/module-duplication.js +3 -3
- package/lighthouse-core/computed/network-analysis.js +4 -4
- package/lighthouse-core/computed/network-records.js +3 -3
- package/lighthouse-core/computed/page-dependency-graph.js +11 -11
- package/lighthouse-core/computed/processed-navigation.js +3 -3
- package/lighthouse-core/computed/processed-trace.js +3 -3
- package/lighthouse-core/computed/resource-summary.js +7 -7
- package/lighthouse-core/computed/screenshots.js +2 -2
- package/lighthouse-core/computed/speedline.js +5 -5
- package/lighthouse-core/computed/trace-of-tab.js +6 -5
- package/lighthouse-core/computed/unused-css.js +4 -4
- package/lighthouse-core/computed/unused-javascript-summary.js +2 -2
- package/lighthouse-core/computed/user-timings.js +3 -3
- package/lighthouse-core/computed/viewport-meta.js +3 -4
- package/lighthouse-core/config/budget.js +1 -1
- package/lighthouse-core/config/config-helpers.js +47 -19
- package/lighthouse-core/config/config-plugin.js +2 -2
- package/lighthouse-core/config/config.js +16 -14
- package/lighthouse-core/config/constants.js +1 -1
- package/lighthouse-core/config/default-config.js +11 -10
- package/lighthouse-core/config/desktop-config.js +2 -2
- package/lighthouse-core/config/experimental-config.js +1 -1
- package/lighthouse-core/config/full-config.js +1 -1
- package/lighthouse-core/config/lr-desktop-config.js +2 -2
- package/lighthouse-core/config/lr-mobile-config.js +1 -1
- package/lighthouse-core/config/metrics-to-audits.js +1 -1
- package/lighthouse-core/config/perf-config.js +1 -1
- package/lighthouse-core/fraggle-rock/api.js +8 -8
- package/lighthouse-core/fraggle-rock/config/config.js +27 -17
- package/lighthouse-core/fraggle-rock/config/default-config.js +5 -5
- package/lighthouse-core/fraggle-rock/config/filters.js +3 -4
- package/lighthouse-core/fraggle-rock/config/validation.js +4 -4
- package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +6 -8
- package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +2 -1
- package/lighthouse-core/fraggle-rock/gather/driver.js +5 -5
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +23 -27
- package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +3 -3
- package/lighthouse-core/fraggle-rock/gather/session.js +3 -3
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +7 -11
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +8 -12
- package/lighthouse-core/fraggle-rock/user-flow.js +8 -8
- package/lighthouse-core/gather/connections/connection.js +4 -4
- package/lighthouse-core/gather/connections/cri.js +6 -6
- package/lighthouse-core/gather/connections/raw.js +2 -2
- package/lighthouse-core/gather/driver/dom.js +1 -1
- package/lighthouse-core/gather/driver/environment.js +6 -6
- package/lighthouse-core/gather/driver/execution-context.js +2 -2
- package/lighthouse-core/gather/driver/navigation.js +8 -8
- package/lighthouse-core/gather/driver/network-monitor.js +7 -6
- package/lighthouse-core/gather/driver/network.js +2 -2
- package/lighthouse-core/gather/driver/prepare.js +5 -5
- package/lighthouse-core/gather/driver/service-workers.js +1 -1
- package/lighthouse-core/gather/driver/storage.js +4 -4
- package/lighthouse-core/gather/driver/target-manager.js +9 -4
- package/lighthouse-core/gather/driver/wait-for-condition.js +6 -5
- package/lighthouse-core/gather/driver.js +11 -16
- package/lighthouse-core/gather/fetcher.js +1 -1
- package/lighthouse-core/gather/gather-runner.js +22 -22
- package/lighthouse-core/gather/gatherers/accessibility.js +6 -5
- package/lighthouse-core/gather/gatherers/anchor-elements.js +6 -5
- package/lighthouse-core/gather/gatherers/cache-contents.js +2 -2
- package/lighthouse-core/gather/gatherers/console-messages.js +2 -2
- package/lighthouse-core/gather/gatherers/css-usage.js +6 -5
- package/lighthouse-core/gather/gatherers/devtools-log-compat.js +4 -3
- package/lighthouse-core/gather/gatherers/devtools-log.js +3 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +2 -2
- package/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +3 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js +8 -8
- package/lighthouse-core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +4 -3
- package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +10 -10
- package/lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +4 -4
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +7 -6
- package/lighthouse-core/gather/gatherers/gatherer.js +1 -1
- package/lighthouse-core/gather/gatherers/global-listeners.js +2 -2
- package/lighthouse-core/gather/gatherers/iframe-elements.js +4 -3
- package/lighthouse-core/gather/gatherers/image-elements.js +5 -5
- package/lighthouse-core/gather/gatherers/inputs.js +5 -4
- package/lighthouse-core/gather/gatherers/inspector-issues.js +4 -4
- package/lighthouse-core/gather/gatherers/installability-errors.js +3 -3
- package/lighthouse-core/gather/gatherers/js-usage.js +2 -2
- package/lighthouse-core/gather/gatherers/link-elements.js +7 -7
- package/lighthouse-core/gather/gatherers/main-document-content.js +5 -5
- package/lighthouse-core/gather/gatherers/meta-elements.js +3 -3
- package/lighthouse-core/gather/gatherers/network-user-agent.js +3 -3
- package/lighthouse-core/gather/gatherers/script-elements.js +6 -6
- package/lighthouse-core/gather/gatherers/scripts.js +2 -2
- package/lighthouse-core/gather/gatherers/seo/embedded-content.js +4 -3
- package/lighthouse-core/gather/gatherers/seo/font-size.js +8 -5
- package/lighthouse-core/gather/gatherers/seo/robots-txt.js +2 -2
- package/lighthouse-core/gather/gatherers/seo/tap-targets.js +5 -4
- package/lighthouse-core/gather/gatherers/service-worker.js +3 -3
- package/lighthouse-core/gather/gatherers/source-maps.js +3 -3
- package/lighthouse-core/gather/gatherers/stacks.js +12 -4
- package/lighthouse-core/gather/gatherers/trace-compat.js +4 -3
- package/lighthouse-core/gather/gatherers/trace-elements.js +13 -12
- package/lighthouse-core/gather/gatherers/trace.js +4 -3
- package/lighthouse-core/gather/gatherers/viewport-dimensions.js +2 -2
- package/lighthouse-core/gather/gatherers/web-app-manifest.js +5 -5
- package/lighthouse-core/index.cjs +21 -0
- package/lighthouse-core/index.js +25 -23
- package/lighthouse-core/lib/arbitrary-equality-map.js +2 -2
- package/lighthouse-core/lib/asset-saver.js +15 -12
- package/lighthouse-core/lib/axe.js +9 -4
- package/lighthouse-core/lib/cdt/package.json +4 -0
- package/lighthouse-core/lib/csp-evaluator.js +11 -13
- package/lighthouse-core/lib/dependency-graph/base-node.js +2 -2
- package/lighthouse-core/lib/dependency-graph/cpu-node.js +2 -2
- package/lighthouse-core/lib/dependency-graph/network-node.js +3 -3
- package/lighthouse-core/lib/dependency-graph/simulator/connection-pool.js +4 -4
- package/lighthouse-core/lib/dependency-graph/simulator/dns-cache.js +1 -1
- package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +11 -10
- package/lighthouse-core/lib/dependency-graph/simulator/simulator-timing-map.js +5 -5
- package/lighthouse-core/lib/dependency-graph/simulator/simulator.js +12 -10
- package/lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js +1 -1
- package/lighthouse-core/lib/emulation.js +2 -2
- package/lighthouse-core/lib/i18n/README.md +1 -1
- package/lighthouse-core/lib/i18n/i18n.js +13 -13
- package/lighthouse-core/lib/icons.js +2 -2
- package/lighthouse-core/lib/lantern-trace-saver.js +1 -1
- package/lighthouse-core/lib/lh-env.js +7 -5
- package/lighthouse-core/lib/lh-error.js +4 -4
- package/lighthouse-core/lib/lh-trace-processor.js +3 -3
- package/lighthouse-core/lib/manifest-parser.js +4 -4
- package/lighthouse-core/lib/median-run.js +1 -1
- package/lighthouse-core/lib/minification-estimator.js +1 -1
- package/lighthouse-core/lib/minify-devtoolslog.js +1 -1
- package/lighthouse-core/lib/minify-trace.js +3 -3
- package/lighthouse-core/lib/navigation-error.js +6 -6
- package/lighthouse-core/lib/network-recorder.js +4 -4
- package/lighthouse-core/lib/network-request.js +2 -3
- package/lighthouse-core/lib/page-functions.js +2 -1
- package/lighthouse-core/lib/proto-preprocessor.js +7 -6
- package/lighthouse-core/lib/rect-helpers.js +1 -1
- package/lighthouse-core/lib/script-helpers.js +4 -1
- package/lighthouse-core/lib/sentry.js +4 -4
- package/lighthouse-core/lib/stack-packs.js +4 -4
- package/lighthouse-core/lib/statistics.js +1 -1
- package/lighthouse-core/lib/tappable-rects.js +2 -2
- package/lighthouse-core/lib/third-party-web.js +2 -2
- package/lighthouse-core/lib/timing-trace-saver.js +1 -1
- package/lighthouse-core/lib/tracehouse/cpu-profile-model.js +8 -8
- package/lighthouse-core/lib/tracehouse/main-thread-tasks.js +2 -2
- package/lighthouse-core/lib/tracehouse/task-groups.js +1 -1
- package/lighthouse-core/lib/tracehouse/task-summary.js +2 -2
- package/lighthouse-core/lib/tracehouse/trace-processor.js +2 -3
- package/lighthouse-core/lib/traces/pwmetrics-events.js +4 -3
- package/lighthouse-core/lib/url-shim.js +6 -4
- package/lighthouse-core/package.json +4 -0
- package/lighthouse-core/runner.js +40 -34
- package/lighthouse-core/scoring.js +2 -2
- package/lighthouse-core/{util-commonjs.js → util.cjs} +0 -0
- package/package.json +4 -2
- package/report/test/generator/report-generator-test.js +4 -3
- package/report/test/renderer/report-renderer-axe-test.js +2 -2
- package/root.js +10 -2
- package/shared/package.json +4 -0
- package/shared/test/localization/format-test.js +23 -13
- package/shared/test/localization/swap-locale-test.js +1 -0
- package/third-party/axe/valid-langs.js +1 -1
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +3 -3
- package/third-party/chromium-synchronization/installability-errors-test.js +3 -3
- package/third-party/download-content-shell/download-content-shell.js +6 -5
- package/third-party/download-content-shell/utils.js +8 -8
- package/tsconfig.json +3 -1
- package/types/artifacts.d.ts +9 -11
- package/types/audit.d.ts +2 -2
- package/types/config.d.ts +1 -1
- package/types/cssstyle/index.d.ts +1 -1
- package/types/gatherer.d.ts +7 -7
- package/types/global-lh.d.ts +2 -2
- package/types/smokehouse.d.ts +2 -0
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import {NetworkAnalyzer} from '../lib/dependency-graph/simulator/network-analyzer.js';
|
|
10
|
+
import NetworkRecords from './network-records.js';
|
|
11
11
|
|
|
12
12
|
class NetworkAnalysis {
|
|
13
13
|
/**
|
|
@@ -61,4 +61,4 @@ class NetworkAnalysis {
|
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
export default makeComputedArtifact(NetworkAnalysis, null);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import {NetworkRecorder} from '../lib/network-recorder.js';
|
|
10
10
|
|
|
11
11
|
class NetworkRecords {
|
|
12
12
|
/**
|
|
@@ -18,4 +18,4 @@ class NetworkRecords {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
export default makeComputedArtifact(NetworkRecords, null);
|
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import {NetworkNode} from '../lib/dependency-graph/network-node.js';
|
|
10
|
+
import {CPUNode} from '../lib/dependency-graph/cpu-node.js';
|
|
11
|
+
import {TraceProcessor} from '../lib/tracehouse/trace-processor.js';
|
|
12
|
+
import {NetworkRequest} from '../lib/network-request.js';
|
|
13
|
+
import ProcessedTrace from './processed-trace.js';
|
|
14
|
+
import NetworkRecords from './network-records.js';
|
|
15
|
+
import {NetworkAnalyzer} from '../lib/dependency-graph/simulator/network-analyzer.js';
|
|
16
16
|
|
|
17
17
|
/** @typedef {import('../lib/dependency-graph/base-node.js').Node} Node */
|
|
18
18
|
/** @typedef {Omit<LH.Artifacts['URL'], 'initialUrl'|'finalUrl'>} URLArtifact */
|
|
@@ -111,14 +111,14 @@ class PageDependencyGraph {
|
|
|
111
111
|
const nodes = [];
|
|
112
112
|
let i = 0;
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
TraceProcessor.assertHasToplevelEvents(mainThreadEvents);
|
|
115
115
|
|
|
116
116
|
while (i < mainThreadEvents.length) {
|
|
117
117
|
const evt = mainThreadEvents[i];
|
|
118
118
|
i++;
|
|
119
119
|
|
|
120
120
|
// Skip all trace events that aren't schedulable tasks with sizable duration
|
|
121
|
-
if (!
|
|
121
|
+
if (!TraceProcessor.isScheduleableTask(evt) || !evt.dur) {
|
|
122
122
|
continue;
|
|
123
123
|
}
|
|
124
124
|
|
|
@@ -504,7 +504,7 @@ class PageDependencyGraph {
|
|
|
504
504
|
}
|
|
505
505
|
}
|
|
506
506
|
|
|
507
|
-
|
|
507
|
+
export default makeComputedArtifact(PageDependencyGraph, ['devtoolsLog', 'trace', 'URL']);
|
|
508
508
|
|
|
509
509
|
/**
|
|
510
510
|
* @typedef {Object} NetworkNodeOutput
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import LHTraceProcessor from '../lib/lh-trace-processor.js';
|
|
10
10
|
|
|
11
11
|
class ProcessedNavigation {
|
|
12
12
|
/**
|
|
@@ -18,4 +18,4 @@ class ProcessedNavigation {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
export default makeComputedArtifact(ProcessedNavigation, null);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import LHTraceProcessor from '../lib/lh-trace-processor.js';
|
|
10
10
|
|
|
11
11
|
class ProcessedTrace {
|
|
12
12
|
/**
|
|
@@ -18,4 +18,4 @@ class ProcessedTrace {
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
export default makeComputedArtifact(ProcessedTrace, null);
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import NetworkRecords from './network-records.js';
|
|
10
|
+
import URL from '../lib/url-shim.js';
|
|
11
|
+
import {NetworkRequest} from '../lib/network-request.js';
|
|
12
|
+
import {Budget} from '../config/budget.js';
|
|
13
|
+
import {Util} from '../util.cjs';
|
|
14
14
|
|
|
15
15
|
/** @typedef {{count: number, resourceSize: number, transferSize: number}} ResourceEntry */
|
|
16
16
|
|
|
@@ -111,4 +111,4 @@ class ResourceSummary {
|
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
|
|
114
|
-
|
|
114
|
+
export default makeComputedArtifact(ResourceSummary, ['URL', 'devtoolsLog', 'budgets']);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
9
|
|
|
10
10
|
const SCREENSHOT_TRACE_NAME = 'Screenshot';
|
|
11
11
|
|
|
@@ -26,4 +26,4 @@ class Screenshots {
|
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
export default makeComputedArtifact(Screenshots, null);
|
|
@@ -5,10 +5,10 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import speedline from 'speedline-core';
|
|
10
|
+
import {LighthouseError} from '../lib/lh-error.js';
|
|
11
|
+
import ProcessedTrace from './processed-trace.js';
|
|
12
12
|
|
|
13
13
|
class Speedline {
|
|
14
14
|
/**
|
|
@@ -51,4 +51,4 @@ class Speedline {
|
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
54
|
+
export default makeComputedArtifact(Speedline, null);
|
|
@@ -7,10 +7,11 @@
|
|
|
7
7
|
|
|
8
8
|
/** @fileoverview This file is no longer used internally, but remains here for backcompat with plugins. */
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
import log from 'lighthouse-logger';
|
|
11
|
+
|
|
12
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
13
|
+
import ProcessedTrace from './processed-trace.js';
|
|
14
|
+
import ProcessedNavigation from './processed-navigation.js';
|
|
14
15
|
|
|
15
16
|
class TraceOfTab {
|
|
16
17
|
/**
|
|
@@ -26,5 +27,5 @@ class TraceOfTab {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
log.warn(`trace-of-tab`, `trace-of-tab is deprecated, use processed-trace / processed-navigation instead`); // eslint-disable-line max-len
|
|
29
|
-
|
|
30
|
+
export default makeComputedArtifact(TraceOfTab, null);
|
|
30
31
|
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import {ByteEfficiencyAudit} from '../audits/byte-efficiency/byte-efficiency-audit.js';
|
|
10
|
+
import NetworkRecords from './network-records.js';
|
|
11
11
|
|
|
12
12
|
const PREVIEW_LENGTH = 100;
|
|
13
13
|
|
|
@@ -150,4 +150,4 @@ class UnusedCSS {
|
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
-
|
|
153
|
+
export default makeComputedArtifact(UnusedCSS, ['CSSUsage', 'devtoolsLog']);
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @typedef WasteData
|
|
@@ -149,7 +149,7 @@ class UnusedJavascriptSummary {
|
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
export default makeComputedArtifact(
|
|
153
153
|
UnusedJavascriptSummary,
|
|
154
154
|
['bundle', 'scriptCoverage', 'scriptId']
|
|
155
155
|
);
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
9
|
+
import ProcessedTrace from './processed-trace.js';
|
|
10
10
|
|
|
11
11
|
/** @typedef {{name: string, isMark: true, args: LH.TraceEvent['args'], startTime: number}} MarkEvent */
|
|
12
12
|
/** @typedef {{name: string, isMark: false, args: LH.TraceEvent['args'], startTime: number, endTime: number, duration: number}} MeasureEvent */
|
|
@@ -80,4 +80,4 @@ class UserTimings {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
export default makeComputedArtifact(UserTimings, null);
|
|
@@ -5,9 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const makeComputedArtifact = require('./computed-artifact.js');
|
|
8
|
+
import Parser from 'metaviewport-parser';
|
|
9
|
+
import {makeComputedArtifact} from './computed-artifact.js';
|
|
11
10
|
|
|
12
11
|
class ViewportMeta {
|
|
13
12
|
/**
|
|
@@ -46,7 +45,7 @@ class ViewportMeta {
|
|
|
46
45
|
}
|
|
47
46
|
}
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
export default makeComputedArtifact(ViewportMeta, null);
|
|
50
49
|
|
|
51
50
|
/**
|
|
52
51
|
* @typedef {object} ViewportMetaResult
|
|
@@ -5,17 +5,21 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
import path from 'path';
|
|
9
|
+
import {createRequire} from 'module';
|
|
10
|
+
import isDeepEqual from 'lodash/isEqual.js';
|
|
11
|
+
import * as constants from './constants.js';
|
|
12
|
+
import {Budget} from './budget.js';
|
|
13
|
+
import ConfigPlugin from './config-plugin.js';
|
|
14
|
+
import {Runner} from '../runner.js';
|
|
15
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
16
|
+
import * as validation from '../fraggle-rock/config/validation.js';
|
|
17
|
+
import {getModuleDirectory} from '../../esm-utils.js';
|
|
18
|
+
|
|
19
|
+
const require = createRequire(import.meta.url);
|
|
20
|
+
|
|
21
|
+
/** @typedef {typeof import('../gather/gatherers/gatherer.js').Gatherer} GathererConstructor */
|
|
22
|
+
/** @typedef {typeof import('../audits/audit.js')['Audit']} Audit */
|
|
19
23
|
/** @typedef {InstanceType<GathererConstructor>} Gatherer */
|
|
20
24
|
|
|
21
25
|
function isBundledEnvironment() {
|
|
@@ -203,17 +207,41 @@ function expandAuditShorthand(audit) {
|
|
|
203
207
|
}
|
|
204
208
|
}
|
|
205
209
|
|
|
206
|
-
/** @type {Map<string, any
|
|
210
|
+
/** @type {Map<string, Promise<any>>} */
|
|
207
211
|
const bundledModules = new Map(/* BUILD_REPLACE_BUNDLED_MODULES */);
|
|
208
212
|
|
|
209
213
|
/**
|
|
210
|
-
* Wraps `require` with an entrypoint for bundled dynamic modules.
|
|
214
|
+
* Wraps `import`/`require` with an entrypoint for bundled dynamic modules.
|
|
211
215
|
* See build-bundle.js
|
|
212
216
|
* @param {string} requirePath
|
|
213
217
|
*/
|
|
214
218
|
async function requireWrapper(requirePath) {
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
/** @type {any} */
|
|
220
|
+
let module;
|
|
221
|
+
if (bundledModules.has(requirePath)) {
|
|
222
|
+
module = await bundledModules.get(requirePath);
|
|
223
|
+
} else if (requirePath.match(/\.(js|mjs|cjs)$/)) {
|
|
224
|
+
module = await import(requirePath);
|
|
225
|
+
} else {
|
|
226
|
+
requirePath += '.js';
|
|
227
|
+
module = await import(requirePath);
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
if (module.default) return module.default;
|
|
231
|
+
|
|
232
|
+
// Find a valid named export.
|
|
233
|
+
// TODO(esmodules): actually make all the audits/gatherers use named exports
|
|
234
|
+
const methods = new Set(['meta']);
|
|
235
|
+
const possibleNamedExports = Object.keys(module).filter(key => {
|
|
236
|
+
if (!(module[key] && module[key] instanceof Object)) return false;
|
|
237
|
+
return Object.getOwnPropertyNames(module[key]).some(method => methods.has(method));
|
|
238
|
+
});
|
|
239
|
+
if (possibleNamedExports.length === 1) return possibleNamedExports[0];
|
|
240
|
+
if (possibleNamedExports.length > 1) {
|
|
241
|
+
throw new Error(`module '${requirePath}' has too many possible exports`);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
throw new Error(`module '${requirePath}' missing default export`);
|
|
217
245
|
}
|
|
218
246
|
|
|
219
247
|
/**
|
|
@@ -259,7 +287,7 @@ function requireAudit(auditPath, coreAuditList, configDir) {
|
|
|
259
287
|
// Otherwise, attempt to find it elsewhere. This throws if not found.
|
|
260
288
|
const absolutePath = resolveModulePath(auditPath, configDir, 'audit');
|
|
261
289
|
// Use a relative path so bundler can easily expose it.
|
|
262
|
-
requirePath = path.relative(
|
|
290
|
+
requirePath = path.relative(getModuleDirectory(import.meta), absolutePath);
|
|
263
291
|
}
|
|
264
292
|
}
|
|
265
293
|
|
|
@@ -478,8 +506,8 @@ function resolveModulePath(moduleIdentifier, configDir, category) {
|
|
|
478
506
|
|
|
479
507
|
const errorString = 'Unable to locate ' + (category ? `${category}: ` : '') +
|
|
480
508
|
`\`${moduleIdentifier}\`.
|
|
481
|
-
Tried to
|
|
482
|
-
${
|
|
509
|
+
Tried to resolve the module from these locations:
|
|
510
|
+
${getModuleDirectory(import.meta)}
|
|
483
511
|
${cwdPath}`;
|
|
484
512
|
|
|
485
513
|
if (!configDir) {
|
|
@@ -592,7 +620,7 @@ function flagsToFRContext(flags) {
|
|
|
592
620
|
};
|
|
593
621
|
}
|
|
594
622
|
|
|
595
|
-
|
|
623
|
+
export {
|
|
596
624
|
deepClone,
|
|
597
625
|
deepCloneConfigJson,
|
|
598
626
|
mergeConfigFragment,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @param {unknown} arr
|
|
@@ -248,4 +248,4 @@ class ConfigPlugin {
|
|
|
248
248
|
}
|
|
249
249
|
}
|
|
250
250
|
|
|
251
|
-
|
|
251
|
+
export default ConfigPlugin;
|
|
@@ -5,16 +5,15 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const {
|
|
8
|
+
import defaultConfig from './default-config.js';
|
|
9
|
+
import * as constants from './constants.js';
|
|
10
|
+
import format from '../../shared/localization/format.js';
|
|
11
|
+
import * as validation from './../fraggle-rock/config/validation.js';
|
|
12
|
+
import log from 'lighthouse-logger';
|
|
13
|
+
import path from 'path';
|
|
14
|
+
import {Runner} from '../runner.js';
|
|
15
|
+
|
|
16
|
+
import {
|
|
18
17
|
mergePlugins,
|
|
19
18
|
mergeConfigFragment,
|
|
20
19
|
resolveSettings,
|
|
@@ -22,9 +21,12 @@ const {
|
|
|
22
21
|
resolveGathererToDefn,
|
|
23
22
|
deepClone,
|
|
24
23
|
deepCloneConfigJson,
|
|
25
|
-
}
|
|
24
|
+
} from './config-helpers.js';
|
|
25
|
+
import {getModuleDirectory} from '../../esm-utils.js';
|
|
26
|
+
|
|
27
|
+
const defaultConfigPath = './default-config.js';
|
|
26
28
|
|
|
27
|
-
/** @typedef {typeof import('../gather/gatherers/gatherer.js')} GathererConstructor */
|
|
29
|
+
/** @typedef {typeof import('../gather/gatherers/gatherer.js').Gatherer} GathererConstructor */
|
|
28
30
|
/** @typedef {InstanceType<GathererConstructor>} Gatherer */
|
|
29
31
|
|
|
30
32
|
/**
|
|
@@ -167,7 +169,7 @@ class Config {
|
|
|
167
169
|
|
|
168
170
|
if (!configJSON) {
|
|
169
171
|
configJSON = defaultConfig;
|
|
170
|
-
configPath = path.resolve(
|
|
172
|
+
configPath = path.resolve(getModuleDirectory(import.meta), defaultConfigPath);
|
|
171
173
|
}
|
|
172
174
|
|
|
173
175
|
if (configPath && !path.isAbsolute(configPath)) {
|
|
@@ -559,4 +561,4 @@ class Config {
|
|
|
559
561
|
}
|
|
560
562
|
}
|
|
561
563
|
|
|
562
|
-
|
|
564
|
+
export {Config};
|
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
|
|
8
8
|
/* eslint-disable max-len */
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
import * as constants from './constants.js';
|
|
11
|
+
|
|
12
|
+
import * as i18n from '../lib/i18n/i18n.js';
|
|
13
|
+
import {metricsToAudits} from './metrics-to-audits.js';
|
|
13
14
|
|
|
14
15
|
const UIStrings = {
|
|
15
16
|
/** Title of the Performance category of audits. Equivalent to 'Web performance', this term is inclusive of all web page speed and loading optimization topics. Also used as a label of a score gauge; try to limit to 20 characters. */
|
|
@@ -120,7 +121,7 @@ const UIStrings = {
|
|
|
120
121
|
pwaOptimizedGroupTitle: 'PWA Optimized',
|
|
121
122
|
};
|
|
122
123
|
|
|
123
|
-
const str_ = i18n.createMessageInstanceIdFn(
|
|
124
|
+
const str_ = i18n.createMessageInstanceIdFn(import.meta.url, UIStrings);
|
|
124
125
|
|
|
125
126
|
/** @type {LH.Config.Json} */
|
|
126
127
|
const defaultConfig = {
|
|
@@ -413,12 +414,12 @@ const defaultConfig = {
|
|
|
413
414
|
title: str_(UIStrings.performanceCategoryTitle),
|
|
414
415
|
supportedModes: ['navigation', 'timespan', 'snapshot'],
|
|
415
416
|
auditRefs: [
|
|
416
|
-
{id: 'first-contentful-paint', weight: 10, group: 'metrics', acronym: 'FCP', relevantAudits:
|
|
417
|
+
{id: 'first-contentful-paint', weight: 10, group: 'metrics', acronym: 'FCP', relevantAudits: metricsToAudits.fcpRelevantAudits},
|
|
417
418
|
{id: 'interactive', weight: 10, group: 'metrics', acronym: 'TTI'},
|
|
418
419
|
{id: 'speed-index', weight: 10, group: 'metrics', acronym: 'SI'},
|
|
419
|
-
{id: 'total-blocking-time', weight: 30, group: 'metrics', acronym: 'TBT', relevantAudits:
|
|
420
|
-
{id: 'largest-contentful-paint', weight: 25, group: 'metrics', acronym: 'LCP', relevantAudits:
|
|
421
|
-
{id: 'cumulative-layout-shift', weight: 15, group: 'metrics', acronym: 'CLS', relevantAudits:
|
|
420
|
+
{id: 'total-blocking-time', weight: 30, group: 'metrics', acronym: 'TBT', relevantAudits: metricsToAudits.tbtRelevantAudits},
|
|
421
|
+
{id: 'largest-contentful-paint', weight: 25, group: 'metrics', acronym: 'LCP', relevantAudits: metricsToAudits.lcpRelevantAudits},
|
|
422
|
+
{id: 'cumulative-layout-shift', weight: 15, group: 'metrics', acronym: 'CLS', relevantAudits: metricsToAudits.clsRelevantAudits},
|
|
422
423
|
|
|
423
424
|
// These are our "invisible" metrics. Not displayed, but still in the LHR.
|
|
424
425
|
{id: 'max-potential-fid', weight: 0, group: 'hidden'},
|
|
@@ -624,10 +625,10 @@ const defaultConfig = {
|
|
|
624
625
|
},
|
|
625
626
|
};
|
|
626
627
|
|
|
627
|
-
|
|
628
|
+
export default defaultConfig;
|
|
628
629
|
|
|
629
630
|
// Use `defineProperty` so that the strings are accesible from original but ignored when we copy it
|
|
630
|
-
Object.defineProperty(
|
|
631
|
+
Object.defineProperty(defaultConfig, 'UIStrings', {
|
|
631
632
|
enumerable: false,
|
|
632
633
|
get: () => UIStrings,
|
|
633
634
|
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import * as constants from './constants.js';
|
|
9
9
|
|
|
10
10
|
/** @type {LH.Config.Json} */
|
|
11
11
|
const config = {
|
|
@@ -18,4 +18,4 @@ const config = {
|
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
export default config;
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import * as constants from './constants.js';
|
|
9
9
|
|
|
10
10
|
/** @type {LH.Config.Json} */
|
|
11
11
|
const config = {
|
|
@@ -22,4 +22,4 @@ const config = {
|
|
|
22
22
|
},
|
|
23
23
|
};
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
export default config;
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import {UserFlow, auditGatherSteps} from './user-flow.js';
|
|
9
|
+
import {snapshotGather} from './gather/snapshot-runner.js';
|
|
10
|
+
import {startTimespanGather} from './gather/timespan-runner.js';
|
|
11
|
+
import {navigationGather} from './gather/navigation-runner.js';
|
|
12
|
+
import ReportGenerator from '../../report/generator/report-generator.js';
|
|
13
|
+
import {Runner} from '../runner.js';
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {LH.Puppeteer.Page} page
|
|
@@ -55,7 +55,7 @@ async function startTimespan(...params) {
|
|
|
55
55
|
* @param {LH.FlowResult} flowResult
|
|
56
56
|
*/
|
|
57
57
|
async function generateFlowReport(flowResult) {
|
|
58
|
-
return generateFlowReportHtml(flowResult);
|
|
58
|
+
return ReportGenerator.generateFlowReportHtml(flowResult);
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
@@ -67,7 +67,7 @@ async function auditFlowArtifacts(flowArtifacts, config) {
|
|
|
67
67
|
return await auditGatherSteps(gatherSteps, {name, config});
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
|
|
70
|
+
export {
|
|
71
71
|
snapshot,
|
|
72
72
|
startTimespan,
|
|
73
73
|
navigation,
|