lighthouse 9.5.0-dev.20220712 → 9.5.0-dev.20220713
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,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import log from 'lighthouse-logger';
|
|
9
9
|
|
|
10
10
|
/** @typedef {import('@sentry/node').Breadcrumb} Breadcrumb */
|
|
11
11
|
/** @typedef {import('@sentry/node').NodeClient} NodeClient */
|
|
@@ -48,7 +48,7 @@ const sentryDelegate = {
|
|
|
48
48
|
* When called, replaces noops with actual Sentry implementation.
|
|
49
49
|
* @param {{url: string, flags: LH.CliFlags, environmentData: NodeOptions}} opts
|
|
50
50
|
*/
|
|
51
|
-
function init(opts) {
|
|
51
|
+
async function init(opts) {
|
|
52
52
|
// If error reporting is disabled, leave the functions as a noop
|
|
53
53
|
if (!opts.flags.enableErrorReporting) {
|
|
54
54
|
return;
|
|
@@ -60,7 +60,7 @@ function init(opts) {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
try {
|
|
63
|
-
const Sentry =
|
|
63
|
+
const Sentry = await import('@sentry/node');
|
|
64
64
|
Sentry.init({
|
|
65
65
|
...opts.environmentData,
|
|
66
66
|
dsn: SENTRY_URL,
|
|
@@ -141,4 +141,4 @@ function init(opts) {
|
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
|
|
144
|
+
export const Sentry = sentryDelegate;
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import log from 'lighthouse-logger';
|
|
9
|
+
import stackPacks from 'lighthouse-stack-packs';
|
|
10
|
+
import * as i18n from './i18n/i18n.js';
|
|
11
11
|
|
|
12
12
|
/**
|
|
13
13
|
* Pairs consisting of a stack pack's ID and the set of stacks needed to be
|
|
@@ -114,7 +114,7 @@ function getStackPacks(pageStacks) {
|
|
|
114
114
|
return packs;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
|
|
117
|
+
export {
|
|
118
118
|
getStackPacks,
|
|
119
119
|
stackPacksToInclude,
|
|
120
120
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import * as RectHelpers from './rect-helpers.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Merge client rects together and remove small ones. This may result in a larger overall
|
|
@@ -94,6 +94,6 @@ function mergeTouchingClientRects(clientRects) {
|
|
|
94
94
|
return clientRects;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
|
|
97
|
+
export {
|
|
98
98
|
getTappableRectsFromClientRects,
|
|
99
99
|
};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import thirdPartyWeb from 'third-party-web/httparchive-nostats-subset.js';
|
|
9
9
|
|
|
10
10
|
/** @typedef {import("third-party-web").IEntity} ThirdPartyEntity */
|
|
11
11
|
/** @typedef {import("third-party-web").IProduct} ThirdPartyProduct */
|
|
@@ -45,7 +45,7 @@ function isFirstParty(url, mainDocumentEntity) {
|
|
|
45
45
|
return !isThirdParty(url, mainDocumentEntity);
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
export default {
|
|
49
49
|
getEntity,
|
|
50
50
|
getProduct,
|
|
51
51
|
isThirdParty,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {MainThreadTasks} from './main-thread-tasks.js';
|
|
9
9
|
|
|
10
10
|
const SAMPLER_TRACE_EVENT_NAME = 'FunctionCall-SynthesizedByProfilerModel';
|
|
11
11
|
|
|
@@ -48,7 +48,7 @@ const SAMPLER_TRACE_EVENT_NAME = 'FunctionCall-SynthesizedByProfilerModel';
|
|
|
48
48
|
/** @typedef {LH.TraceEvent & {args: {data: {_syntheticProfilerRange: ProfilerRange}}}} SynthethicEvent */
|
|
49
49
|
/** @typedef {Omit<LH.Artifacts.TaskNode, 'event'> & {event: SynthethicEvent, endEvent: SynthethicEvent}} SynthethicTaskNode */
|
|
50
50
|
|
|
51
|
-
class
|
|
51
|
+
class CpuProfileModel {
|
|
52
52
|
/**
|
|
53
53
|
* @param {CpuProfile} profile
|
|
54
54
|
*/
|
|
@@ -193,8 +193,8 @@ class CpuProfilerModel {
|
|
|
193
193
|
* @return {task is SynthethicTaskNode}
|
|
194
194
|
*/
|
|
195
195
|
static isSyntheticTask(task) {
|
|
196
|
-
return
|
|
197
|
-
|
|
196
|
+
return CpuProfileModel.isSyntheticEvent(task.event) &&
|
|
197
|
+
CpuProfileModel.isSyntheticEvent(task.endEvent);
|
|
198
198
|
}
|
|
199
199
|
|
|
200
200
|
/**
|
|
@@ -474,7 +474,7 @@ class CpuProfilerModel {
|
|
|
474
474
|
const allEventsAtTs = syntheticEventsByTs.get(event.ts);
|
|
475
475
|
if (!allEventsAtTs) throw new Error('Impossible - we just mapped every event');
|
|
476
476
|
|
|
477
|
-
const effectiveTimestampData =
|
|
477
|
+
const effectiveTimestampData = CpuProfileModel._findEffectiveTimestamp({
|
|
478
478
|
eventType: event.ph === 'B' ? 'start' : 'end',
|
|
479
479
|
syntheticTask,
|
|
480
480
|
allEventsAtTs,
|
|
@@ -524,7 +524,7 @@ class CpuProfilerModel {
|
|
|
524
524
|
// We'll also create tasks for our naive events so we have the B/E pairs readily available.
|
|
525
525
|
const naiveProfilerTasks = MainThreadTasks.getMainThreadTasks(naiveEvents, [], Infinity)
|
|
526
526
|
.map(rebaseTaskTime(naiveEvents[0].ts))
|
|
527
|
-
.filter(
|
|
527
|
+
.filter(CpuProfileModel.isSyntheticTask);
|
|
528
528
|
if (!naiveProfilerTasks.length) throw new Error('Failed to create naive profiler tasks');
|
|
529
529
|
|
|
530
530
|
finalEvents = this._refineTraceEventsWithTasks(knownTasks, naiveProfilerTasks, naiveEvents);
|
|
@@ -541,7 +541,7 @@ class CpuProfilerModel {
|
|
|
541
541
|
* @return {Array<LH.TraceEvent>}
|
|
542
542
|
*/
|
|
543
543
|
static synthesizeTraceEvents(profile, tasks) {
|
|
544
|
-
const model = new
|
|
544
|
+
const model = new CpuProfileModel(profile);
|
|
545
545
|
return model.synthesizeTraceEvents(tasks);
|
|
546
546
|
}
|
|
547
547
|
|
|
@@ -589,4 +589,4 @@ class CpuProfilerModel {
|
|
|
589
589
|
}
|
|
590
590
|
}
|
|
591
591
|
|
|
592
|
-
|
|
592
|
+
export {CpuProfileModel};
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import {taskGroups, taskNameToGroup} from './task-groups.js';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @fileoverview
|
|
@@ -684,4 +684,4 @@ class MainThreadTasks {
|
|
|
684
684
|
}
|
|
685
685
|
}
|
|
686
686
|
|
|
687
|
-
|
|
687
|
+
export {MainThreadTasks};
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @fileoverview Utility functions for grouping and summarizing tasks.
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import {NetworkRequest} from '../network-request.js';
|
|
13
13
|
|
|
14
14
|
// These trace events, when not triggered by a script inside a particular task, are just general Chrome overhead.
|
|
15
15
|
const BROWSER_TASK_NAMES_SET = new Set([
|
|
@@ -80,7 +80,7 @@ function getExecutionTimingsByURL(tasks, networkRecords) {
|
|
|
80
80
|
return result;
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
|
|
83
|
+
export {
|
|
84
84
|
getJavaScriptURLs,
|
|
85
85
|
getAttributableURLForTask,
|
|
86
86
|
getExecutionTimingsByURL,
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
/** @typedef {Omit<LH.TraceEvent, 'name'|'args'> & {name: 'largestContentfulPaint::Invalidate'|'largestContentfulPaint::Candidate', args: {data?: {size?: number}, frame: string}}} LCPEvent */
|
|
23
23
|
/** @typedef {Omit<LH.TraceEvent, 'name'|'args'> & {name: 'largestContentfulPaint::Candidate', args: {data: {size: number}, frame: string}}} LCPCandidateEvent */
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
import log from 'lighthouse-logger';
|
|
26
26
|
|
|
27
27
|
const ACCEPTABLE_NAVIGATION_URL_REGEX = /^(chrome|https?):/;
|
|
28
28
|
|
|
@@ -951,8 +951,7 @@ class TraceProcessor {
|
|
|
951
951
|
}
|
|
952
952
|
}
|
|
953
953
|
|
|
954
|
-
|
|
955
|
-
|
|
954
|
+
export {TraceProcessor};
|
|
956
955
|
|
|
957
956
|
/**
|
|
958
957
|
* @typedef ToplevelEvent
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import log from 'lighthouse-logger';
|
|
9
|
+
import {TraceProcessor} from '../tracehouse/trace-processor.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @param {LH.Result['audits']} auditResults
|
|
@@ -197,4 +197,5 @@ class Metrics {
|
|
|
197
197
|
}
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
|
|
200
|
+
// TODO(esmodule): rename?
|
|
201
|
+
export {Metrics};
|
|
@@ -9,10 +9,11 @@
|
|
|
9
9
|
* URL shim so we keep our code DRY
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
const LighthouseError = require('../lib/lh-error.js');
|
|
12
|
+
import {Util} from '../util.cjs';
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
import {LighthouseError} from '../lib/lh-error.js';
|
|
15
|
+
|
|
16
|
+
/** @typedef {import('./network-request.js').NetworkRequest} NetworkRequest */
|
|
16
17
|
|
|
17
18
|
const allowedProtocols = [
|
|
18
19
|
'https:', 'http:', 'chrome:', 'chrome-extension:',
|
|
@@ -271,4 +272,5 @@ URLShim.INVALID_URL_DEBUG_STRING =
|
|
|
271
272
|
'Lighthouse was unable to determine the URL of some script executions. ' +
|
|
272
273
|
'It\'s possible a Chrome extension or other eval\'d code is the source.';
|
|
273
274
|
|
|
274
|
-
|
|
275
|
+
// TODO(esmodules): don't use default export
|
|
276
|
+
export default URLShim;
|
|
@@ -5,24 +5,27 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
8
|
+
import isDeepEqual from 'lodash/isEqual.js';
|
|
9
|
+
import {Driver} from './gather/driver.js';
|
|
10
|
+
import {GatherRunner} from './gather/gather-runner.js';
|
|
11
|
+
import {ReportScoring} from './scoring.js';
|
|
12
|
+
import {Audit} from './audits/audit.js';
|
|
13
|
+
import log from 'lighthouse-logger';
|
|
14
|
+
import format from '../shared/localization/format.js';
|
|
15
|
+
import * as stackPacks from './lib/stack-packs.js';
|
|
16
|
+
import * as assetSaver from './lib/asset-saver.js';
|
|
17
|
+
import fs from 'fs';
|
|
18
|
+
import path from 'path';
|
|
19
|
+
import {Sentry} from './lib/sentry.js';
|
|
20
|
+
import ReportGenerator from '../report/generator/report-generator.js';
|
|
21
|
+
import {LighthouseError} from './lib/lh-error.js';
|
|
22
|
+
import {lighthouseVersion} from '../root.js';
|
|
23
|
+
import {getModuleDirectory} from '../esm-utils.js';
|
|
24
|
+
|
|
25
|
+
const moduleDir = getModuleDirectory(import.meta);
|
|
26
|
+
|
|
27
|
+
/** @typedef {import('./gather/connections/connection.js').Connection} Connection */
|
|
28
|
+
/** @typedef {import('./lib/arbitrary-equality-map.js').ArbitraryEqualityMap} ArbitraryEqualityMap */
|
|
26
29
|
/** @typedef {LH.Config.Config} Config */
|
|
27
30
|
|
|
28
31
|
class Runner {
|
|
@@ -123,7 +126,7 @@ class Runner {
|
|
|
123
126
|
}
|
|
124
127
|
|
|
125
128
|
// Create the HTML, JSON, and/or CSV string
|
|
126
|
-
const report = generateReport(lhr, settings.output);
|
|
129
|
+
const report = ReportGenerator.generateReport(lhr, settings.output);
|
|
127
130
|
|
|
128
131
|
return {lhr, artifacts, report};
|
|
129
132
|
} catch (err) {
|
|
@@ -364,7 +367,7 @@ class Runner {
|
|
|
364
367
|
// If artifact was an error, output error result on behalf of audit.
|
|
365
368
|
if (artifacts[artifactName] instanceof Error) {
|
|
366
369
|
/** @type {Error} */
|
|
367
|
-
// @ts-expect-error
|
|
370
|
+
// @ts-expect-error: TODO why is this a type error now?
|
|
368
371
|
const artifactError = artifacts[artifactName];
|
|
369
372
|
|
|
370
373
|
Sentry.captureException(artifactError, {
|
|
@@ -436,8 +439,10 @@ class Runner {
|
|
|
436
439
|
];
|
|
437
440
|
|
|
438
441
|
for (const possibleErrorArtifact of possibleErrorArtifacts) {
|
|
442
|
+
const isError = possibleErrorArtifact instanceof LighthouseError;
|
|
443
|
+
|
|
439
444
|
// eslint-disable-next-line max-len
|
|
440
|
-
if (
|
|
445
|
+
if (isError && possibleErrorArtifact.lhrRuntimeError) {
|
|
441
446
|
const errorMessage = possibleErrorArtifact.friendlyMessage || possibleErrorArtifact.message;
|
|
442
447
|
|
|
443
448
|
return {
|
|
@@ -465,18 +470,18 @@ class Runner {
|
|
|
465
470
|
];
|
|
466
471
|
|
|
467
472
|
const fileList = [
|
|
468
|
-
...fs.readdirSync(path.join(
|
|
469
|
-
...fs.readdirSync(path.join(
|
|
470
|
-
...fs.readdirSync(path.join(
|
|
471
|
-
...fs.readdirSync(path.join(
|
|
472
|
-
...fs.readdirSync(path.join(
|
|
473
|
-
...fs.readdirSync(path.join(
|
|
473
|
+
...fs.readdirSync(path.join(moduleDir, './audits')),
|
|
474
|
+
...fs.readdirSync(path.join(moduleDir, './audits/dobetterweb')).map(f => `dobetterweb/${f}`),
|
|
475
|
+
...fs.readdirSync(path.join(moduleDir, './audits/metrics')).map(f => `metrics/${f}`),
|
|
476
|
+
...fs.readdirSync(path.join(moduleDir, './audits/seo')).map(f => `seo/${f}`),
|
|
477
|
+
...fs.readdirSync(path.join(moduleDir, './audits/seo/manual')).map(f => `seo/manual/${f}`),
|
|
478
|
+
...fs.readdirSync(path.join(moduleDir, './audits/accessibility'))
|
|
474
479
|
.map(f => `accessibility/${f}`),
|
|
475
|
-
...fs.readdirSync(path.join(
|
|
480
|
+
...fs.readdirSync(path.join(moduleDir, './audits/accessibility/manual'))
|
|
476
481
|
.map(f => `accessibility/manual/${f}`),
|
|
477
|
-
...fs.readdirSync(path.join(
|
|
482
|
+
...fs.readdirSync(path.join(moduleDir, './audits/byte-efficiency'))
|
|
478
483
|
.map(f => `byte-efficiency/${f}`),
|
|
479
|
-
...fs.readdirSync(path.join(
|
|
484
|
+
...fs.readdirSync(path.join(moduleDir, './audits/manual')).map(f => `manual/${f}`),
|
|
480
485
|
];
|
|
481
486
|
return fileList.filter(f => {
|
|
482
487
|
return /\.js$/.test(f) && !ignoredFiles.includes(f);
|
|
@@ -489,9 +494,9 @@ class Runner {
|
|
|
489
494
|
*/
|
|
490
495
|
static getGathererList() {
|
|
491
496
|
const fileList = [
|
|
492
|
-
...fs.readdirSync(path.join(
|
|
493
|
-
...fs.readdirSync(path.join(
|
|
494
|
-
...fs.readdirSync(path.join(
|
|
497
|
+
...fs.readdirSync(path.join(moduleDir, './gather/gatherers')),
|
|
498
|
+
...fs.readdirSync(path.join(moduleDir, './gather/gatherers/seo')).map(f => `seo/${f}`),
|
|
499
|
+
...fs.readdirSync(path.join(moduleDir, './gather/gatherers/dobetterweb'))
|
|
495
500
|
.map(f => `dobetterweb/${f}`),
|
|
496
501
|
];
|
|
497
502
|
return fileList.filter(f => /\.js$/.test(f) && f !== 'gatherer.js').sort();
|
|
@@ -513,4 +518,5 @@ class Runner {
|
|
|
513
518
|
}
|
|
514
519
|
}
|
|
515
520
|
|
|
516
|
-
|
|
521
|
+
// TODO(esmodules): make this not a class.
|
|
522
|
+
export {Runner};
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
'use strict';
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
import {Audit} from './audits/audit.js';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Clamp figure to 2 decimal places
|
|
@@ -90,4 +90,4 @@ class ReportScoring {
|
|
|
90
90
|
}
|
|
91
91
|
}
|
|
92
92
|
|
|
93
|
-
|
|
93
|
+
export {ReportScoring};
|
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lighthouse",
|
|
3
|
-
"
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "9.5.0-dev.20220713",
|
|
4
5
|
"description": "Automated auditing, performance metrics, and best practices for the web.",
|
|
5
6
|
"main": "./lighthouse-core/index.js",
|
|
6
7
|
"bin": {
|
|
@@ -214,7 +215,8 @@
|
|
|
214
215
|
},
|
|
215
216
|
"resolutions": {
|
|
216
217
|
"puppeteer/**/devtools-protocol": "0.0.995287",
|
|
217
|
-
"puppeteer-core/**/devtools-protocol": "0.0.995287"
|
|
218
|
+
"puppeteer-core/**/devtools-protocol": "0.0.995287",
|
|
219
|
+
"testdouble/**/quibble": "connorjclark/quibble#mod-cache"
|
|
218
220
|
},
|
|
219
221
|
"repository": "GoogleChrome/lighthouse",
|
|
220
222
|
"keywords": [
|
|
@@ -13,9 +13,10 @@ const fs = require('fs');
|
|
|
13
13
|
const csvValidator = require('csv-validator');
|
|
14
14
|
|
|
15
15
|
const ReportGenerator = require('../../generator/report-generator.js');
|
|
16
|
-
const {readJson} = require('../../../root.js');
|
|
17
|
-
|
|
18
|
-
const sampleResults = readJson('lighthouse-core/test/results/sample_v2.json');
|
|
16
|
+
// const {readJson} = require('../../../root.js');
|
|
17
|
+
// TODO(esmodules): remove when this folder is esm
|
|
18
|
+
// const sampleResults = readJson('lighthouse-core/test/results/sample_v2.json');
|
|
19
|
+
const sampleResults = require('../../../lighthouse-core/test/results/sample_v2.json');
|
|
19
20
|
|
|
20
21
|
describe('ReportGenerator', () => {
|
|
21
22
|
describe('#replaceStrings', () => {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import puppeteer from 'puppeteer';
|
|
8
8
|
|
|
9
9
|
import reportGenerator from '../../generator/report-generator.js';
|
|
10
|
-
import
|
|
10
|
+
import {axeSource} from '../../../lighthouse-core/lib/axe.js';
|
|
11
11
|
import {readJson} from '../../../lighthouse-core/test/test-utils.js';
|
|
12
12
|
|
|
13
13
|
const sampleResults = readJson('../../../lighthouse-core/test/results/sample_v2.json', import.meta);
|
|
@@ -52,7 +52,7 @@ describe('ReportRendererAxe', () => {
|
|
|
52
52
|
},
|
|
53
53
|
};
|
|
54
54
|
|
|
55
|
-
await page.evaluate(
|
|
55
|
+
await page.evaluate(axeSource);
|
|
56
56
|
// eslint-disable-next-line no-undef
|
|
57
57
|
const axeResults = await page.evaluate(config => axe.run(config), config);
|
|
58
58
|
|
package/root.js
CHANGED
|
@@ -5,6 +5,14 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import {getModuleDirectory} from './esm-utils.js';
|
|
10
|
+
|
|
11
|
+
const LH_ROOT = getModuleDirectory(import.meta);
|
|
12
|
+
const pkg = JSON.parse(fs.readFileSync(`${LH_ROOT}/package.json`, 'utf-8'));
|
|
13
|
+
const lighthouseVersion = pkg.version;
|
|
14
|
+
|
|
15
|
+
export {
|
|
16
|
+
LH_ROOT,
|
|
17
|
+
lighthouseVersion,
|
|
10
18
|
};
|
|
@@ -8,10 +8,16 @@
|
|
|
8
8
|
const path = require('path');
|
|
9
9
|
|
|
10
10
|
const format = require('../../localization/format.js');
|
|
11
|
-
const i18n = require('../../../lighthouse-core/lib/i18n/i18n.js');
|
|
12
|
-
const constants = require('../../../lighthouse-core/config/constants.js');
|
|
13
11
|
const locales = require('../../localization/locales.js');
|
|
14
12
|
|
|
13
|
+
// TODO(esmodules): remove when shared/ is esm
|
|
14
|
+
let i18n;
|
|
15
|
+
let constants;
|
|
16
|
+
before(async () => {
|
|
17
|
+
i18n = await import('../../../lighthouse-core/lib/i18n/i18n.js');
|
|
18
|
+
constants = await import('../../../lighthouse-core/config/constants.js');
|
|
19
|
+
});
|
|
20
|
+
|
|
15
21
|
describe('format', () => {
|
|
16
22
|
describe('DEFAULT_LOCALE', () => {
|
|
17
23
|
it('is the same as the default config locale', () => {
|
|
@@ -183,9 +189,9 @@ describe('format', () => {
|
|
|
183
189
|
expect(formattedStr).toEqual('en-XZ cuerda!');
|
|
184
190
|
});
|
|
185
191
|
|
|
186
|
-
it('overwrites existing locale strings', () => {
|
|
192
|
+
it('overwrites existing locale strings', async () => {
|
|
187
193
|
const filename = 'lighthouse-core/audits/is-on-https.js';
|
|
188
|
-
const UIStrings =
|
|
194
|
+
const {UIStrings} = await import('../../../lighthouse-core/audits/is-on-https.js');
|
|
189
195
|
const str_ = i18n.createMessageInstanceIdFn(filename, UIStrings);
|
|
190
196
|
|
|
191
197
|
// To start with, we get back the intended string..
|
|
@@ -305,17 +311,21 @@ describe('format', () => {
|
|
|
305
311
|
helloWorldMultiReplace: '{hello} {world}',
|
|
306
312
|
helloPlural: '{itemCount, plural, =1{1 hello} other{hellos}}',
|
|
307
313
|
helloPluralNestedICU: '{itemCount, plural, ' +
|
|
308
|
-
|
|
309
|
-
|
|
314
|
+
'=1{1 hello {in, number, bytes}} ' +
|
|
315
|
+
'other{hellos {in, number, bytes}}}',
|
|
310
316
|
helloPluralNestedPluralAndICU: '{itemCount, plural, ' +
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
+
'=1{{innerItemCount, plural, ' +
|
|
318
|
+
'=1{1 hello 1 goodbye {in, number, bytes}} ' +
|
|
319
|
+
'other{1 hello, goodbyes {in, number, bytes}}}} ' +
|
|
320
|
+
'other{{innerItemCount, plural, ' +
|
|
321
|
+
'=1{hellos 1 goodbye {in, number, bytes}} ' +
|
|
322
|
+
'other{hellos, goodbyes {in, number, bytes}}}}}',
|
|
317
323
|
};
|
|
318
|
-
|
|
324
|
+
|
|
325
|
+
let str_;
|
|
326
|
+
before(() => {
|
|
327
|
+
str_ = i18n.createMessageInstanceIdFn(__filename, UIStrings);
|
|
328
|
+
});
|
|
319
329
|
|
|
320
330
|
it('formats a basic message', () => {
|
|
321
331
|
const helloStr = str_(UIStrings.helloWorld);
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import fetch from 'node-fetch';
|
|
10
|
+
import { LH_ROOT } from '../../root.js';
|
|
11
11
|
|
|
12
12
|
const inspectorIssuesGathererPath = LH_ROOT +
|
|
13
13
|
'/lighthouse-core/gather/gatherers/inspector-issues.js';
|
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import fetch from 'node-fetch';
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
import {UIStrings} from '../../lighthouse-core/audits/installable-manifest.js';
|
|
11
11
|
|
|
12
12
|
describe('installabilityErrors', () => {
|
|
13
13
|
let chromiumErrorIds;
|
|
@@ -74,7 +74,7 @@ Array [
|
|
|
74
74
|
});
|
|
75
75
|
|
|
76
76
|
it('are each handled explicitly in the gatherer', () => {
|
|
77
|
-
const errorStrings = Object.keys(
|
|
77
|
+
const errorStrings = Object.keys(UIStrings)
|
|
78
78
|
.filter(key => chromiumErrorIds.includes(key))
|
|
79
79
|
.sort();
|
|
80
80
|
expect(errorStrings).toEqual(chromiumErrorIds);
|
|
@@ -7,11 +7,12 @@
|
|
|
7
7
|
|
|
8
8
|
// Grabbed from https://github.com/ChromeDevTools/devtools-frontend/commit/26bb5ad91b147e9c918819711542ec2337d6b268
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
import fs from 'fs';
|
|
11
|
+
|
|
12
|
+
import path from 'path';
|
|
13
|
+
import { execSync as shell } from 'child_process';
|
|
14
|
+
import * as utils from './utils.js';
|
|
15
|
+
import { LH_ROOT } from '../../root.js';
|
|
15
16
|
|
|
16
17
|
const TARGET = 'Release';
|
|
17
18
|
const CONTENT_SHELL_ZIP = 'content-shell.zip';
|