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.
Files changed (380) hide show
  1. package/{esm-utils.mjs → esm-utils.js} +2 -2
  2. package/flow-report/tsconfig.json +1 -0
  3. package/lighthouse-cli/bin.js +5 -9
  4. package/lighthouse-cli/commands/list-audits.js +2 -2
  5. package/lighthouse-cli/commands/list-trace-categories.js +1 -2
  6. package/lighthouse-cli/run.js +2 -2
  7. package/lighthouse-cli/test/smokehouse/core-tests.js +3 -2
  8. package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +4 -3
  9. package/lighthouse-cli/test/smokehouse/lighthouse-runners/bundle.js +8 -4
  10. package/lighthouse-cli/test/smokehouse/lighthouse-runners/cli.js +1 -1
  11. package/lighthouse-cli/test/smokehouse/lighthouse-runners/devtools.js +17 -68
  12. package/lighthouse-cli/test/smokehouse/smokehouse.js +10 -1
  13. package/lighthouse-core/audits/accessibility/accesskeys.js +6 -5
  14. package/lighthouse-core/audits/accessibility/aria-allowed-attr.js +6 -5
  15. package/lighthouse-core/audits/accessibility/aria-command-name.js +6 -5
  16. package/lighthouse-core/audits/accessibility/aria-hidden-body.js +6 -5
  17. package/lighthouse-core/audits/accessibility/aria-hidden-focus.js +6 -5
  18. package/lighthouse-core/audits/accessibility/aria-input-field-name.js +6 -5
  19. package/lighthouse-core/audits/accessibility/aria-meter-name.js +6 -5
  20. package/lighthouse-core/audits/accessibility/aria-progressbar-name.js +6 -5
  21. package/lighthouse-core/audits/accessibility/aria-required-attr.js +6 -5
  22. package/lighthouse-core/audits/accessibility/aria-required-children.js +6 -5
  23. package/lighthouse-core/audits/accessibility/aria-required-parent.js +6 -5
  24. package/lighthouse-core/audits/accessibility/aria-roles.js +6 -5
  25. package/lighthouse-core/audits/accessibility/aria-toggle-field-name.js +6 -5
  26. package/lighthouse-core/audits/accessibility/aria-tooltip-name.js +6 -5
  27. package/lighthouse-core/audits/accessibility/aria-treeitem-name.js +6 -5
  28. package/lighthouse-core/audits/accessibility/aria-valid-attr-value.js +6 -5
  29. package/lighthouse-core/audits/accessibility/aria-valid-attr.js +6 -5
  30. package/lighthouse-core/audits/accessibility/axe-audit.js +6 -5
  31. package/lighthouse-core/audits/accessibility/button-name.js +6 -5
  32. package/lighthouse-core/audits/accessibility/bypass.js +6 -5
  33. package/lighthouse-core/audits/accessibility/color-contrast.js +6 -5
  34. package/lighthouse-core/audits/accessibility/definition-list.js +6 -5
  35. package/lighthouse-core/audits/accessibility/dlitem.js +6 -5
  36. package/lighthouse-core/audits/accessibility/document-title.js +6 -5
  37. package/lighthouse-core/audits/accessibility/duplicate-id-active.js +6 -5
  38. package/lighthouse-core/audits/accessibility/duplicate-id-aria.js +6 -5
  39. package/lighthouse-core/audits/accessibility/form-field-multiple-labels.js +6 -5
  40. package/lighthouse-core/audits/accessibility/frame-title.js +6 -5
  41. package/lighthouse-core/audits/accessibility/heading-order.js +6 -5
  42. package/lighthouse-core/audits/accessibility/html-has-lang.js +6 -5
  43. package/lighthouse-core/audits/accessibility/html-lang-valid.js +6 -5
  44. package/lighthouse-core/audits/accessibility/image-alt.js +6 -5
  45. package/lighthouse-core/audits/accessibility/input-image-alt.js +6 -5
  46. package/lighthouse-core/audits/accessibility/label.js +6 -5
  47. package/lighthouse-core/audits/accessibility/link-name.js +6 -5
  48. package/lighthouse-core/audits/accessibility/list.js +6 -5
  49. package/lighthouse-core/audits/accessibility/listitem.js +6 -5
  50. package/lighthouse-core/audits/accessibility/manual/custom-controls-labels.js +2 -2
  51. package/lighthouse-core/audits/accessibility/manual/custom-controls-roles.js +2 -2
  52. package/lighthouse-core/audits/accessibility/manual/focus-traps.js +2 -2
  53. package/lighthouse-core/audits/accessibility/manual/focusable-controls.js +2 -2
  54. package/lighthouse-core/audits/accessibility/manual/interactive-element-affordance.js +2 -2
  55. package/lighthouse-core/audits/accessibility/manual/logical-tab-order.js +2 -2
  56. package/lighthouse-core/audits/accessibility/manual/managed-focus.js +2 -2
  57. package/lighthouse-core/audits/accessibility/manual/offscreen-content-hidden.js +2 -2
  58. package/lighthouse-core/audits/accessibility/manual/use-landmarks.js +2 -2
  59. package/lighthouse-core/audits/accessibility/manual/visual-order-follows-dom.js +2 -2
  60. package/lighthouse-core/audits/accessibility/meta-refresh.js +6 -5
  61. package/lighthouse-core/audits/accessibility/meta-viewport.js +6 -5
  62. package/lighthouse-core/audits/accessibility/object-alt.js +6 -5
  63. package/lighthouse-core/audits/accessibility/tabindex.js +6 -5
  64. package/lighthouse-core/audits/accessibility/td-headers-attr.js +6 -5
  65. package/lighthouse-core/audits/accessibility/th-has-data-cells.js +6 -5
  66. package/lighthouse-core/audits/accessibility/valid-lang.js +6 -5
  67. package/lighthouse-core/audits/accessibility/video-caption.js +6 -5
  68. package/lighthouse-core/audits/apple-touch-icon.js +5 -5
  69. package/lighthouse-core/audits/audit.js +4 -4
  70. package/lighthouse-core/audits/autocomplete.js +6 -6
  71. package/lighthouse-core/audits/bootup-time.js +9 -9
  72. package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +12 -12
  73. package/lighthouse-core/audits/byte-efficiency/duplicated-javascript.js +9 -8
  74. package/lighthouse-core/audits/byte-efficiency/efficient-animated-content.js +7 -7
  75. package/lighthouse-core/audits/byte-efficiency/legacy-javascript.js +18 -10
  76. package/lighthouse-core/audits/byte-efficiency/modern-image-formats.js +7 -7
  77. package/lighthouse-core/audits/byte-efficiency/offscreen-images.js +11 -11
  78. package/lighthouse-core/audits/byte-efficiency/render-blocking-resources.js +15 -15
  79. package/lighthouse-core/audits/byte-efficiency/total-byte-weight.js +7 -7
  80. package/lighthouse-core/audits/byte-efficiency/unminified-css.js +8 -8
  81. package/lighthouse-core/audits/byte-efficiency/unminified-javascript.js +8 -8
  82. package/lighthouse-core/audits/byte-efficiency/unused-css-rules.js +7 -7
  83. package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +9 -9
  84. package/lighthouse-core/audits/byte-efficiency/uses-long-cache-ttl.js +10 -10
  85. package/lighthouse-core/audits/byte-efficiency/uses-optimized-images.js +7 -7
  86. package/lighthouse-core/audits/byte-efficiency/uses-responsive-images-snapshot.js +8 -8
  87. package/lighthouse-core/audits/byte-efficiency/uses-responsive-images.js +9 -10
  88. package/lighthouse-core/audits/byte-efficiency/uses-text-compression.js +7 -7
  89. package/lighthouse-core/audits/content-width.js +5 -5
  90. package/lighthouse-core/audits/critical-request-chains.js +6 -6
  91. package/lighthouse-core/audits/csp-xss.js +7 -10
  92. package/lighthouse-core/audits/deprecations.js +7 -6
  93. package/lighthouse-core/audits/diagnostics.js +6 -6
  94. package/lighthouse-core/audits/dobetterweb/charset.js +6 -9
  95. package/lighthouse-core/audits/dobetterweb/doctype.js +5 -5
  96. package/lighthouse-core/audits/dobetterweb/dom-size.js +5 -5
  97. package/lighthouse-core/audits/dobetterweb/geolocation-on-start.js +5 -5
  98. package/lighthouse-core/audits/dobetterweb/inspector-issues.js +6 -5
  99. package/lighthouse-core/audits/dobetterweb/js-libraries.js +5 -5
  100. package/lighthouse-core/audits/dobetterweb/no-document-write.js +5 -5
  101. package/lighthouse-core/audits/dobetterweb/no-vulnerable-libraries.js +12 -8
  102. package/lighthouse-core/audits/dobetterweb/notification-on-start.js +5 -5
  103. package/lighthouse-core/audits/dobetterweb/password-inputs-can-be-pasted-into.js +5 -5
  104. package/lighthouse-core/audits/dobetterweb/uses-http2.js +15 -14
  105. package/lighthouse-core/audits/dobetterweb/uses-passive-event-listeners.js +5 -5
  106. package/lighthouse-core/audits/errors-in-console.js +8 -7
  107. package/lighthouse-core/audits/final-screenshot.js +5 -5
  108. package/lighthouse-core/audits/font-display.js +8 -8
  109. package/lighthouse-core/audits/full-page-screenshot.js +2 -2
  110. package/lighthouse-core/audits/image-aspect-ratio.js +6 -6
  111. package/lighthouse-core/audits/image-size-responsive.js +6 -6
  112. package/lighthouse-core/audits/installable-manifest.js +6 -6
  113. package/lighthouse-core/audits/is-on-https.js +8 -8
  114. package/lighthouse-core/audits/largest-contentful-paint-element.js +5 -5
  115. package/lighthouse-core/audits/layout-shift-elements.js +5 -5
  116. package/lighthouse-core/audits/lcp-lazy-loaded.js +5 -5
  117. package/lighthouse-core/audits/long-tasks.js +10 -10
  118. package/lighthouse-core/audits/main-thread-tasks.js +3 -3
  119. package/lighthouse-core/audits/mainthread-work-breakdown.js +7 -7
  120. package/lighthouse-core/audits/manual/manual-audit.js +2 -2
  121. package/lighthouse-core/audits/manual/pwa-cross-browser.js +5 -5
  122. package/lighthouse-core/audits/manual/pwa-each-page-has-url.js +5 -5
  123. package/lighthouse-core/audits/manual/pwa-page-transitions.js +5 -5
  124. package/lighthouse-core/audits/maskable-icon.js +6 -6
  125. package/lighthouse-core/audits/metrics/cumulative-layout-shift.js +6 -6
  126. package/lighthouse-core/audits/metrics/experimental-interaction-to-next-paint.js +6 -6
  127. package/lighthouse-core/audits/metrics/first-contentful-paint-3g.js +6 -4
  128. package/lighthouse-core/audits/metrics/first-contentful-paint.js +6 -6
  129. package/lighthouse-core/audits/metrics/first-meaningful-paint.js +6 -6
  130. package/lighthouse-core/audits/metrics/interactive.js +6 -6
  131. package/lighthouse-core/audits/metrics/largest-contentful-paint.js +6 -6
  132. package/lighthouse-core/audits/metrics/max-potential-fid.js +6 -6
  133. package/lighthouse-core/audits/metrics/speed-index.js +6 -6
  134. package/lighthouse-core/audits/metrics/total-blocking-time.js +6 -6
  135. package/lighthouse-core/audits/metrics.js +3 -3
  136. package/lighthouse-core/audits/multi-check-audit.js +2 -2
  137. package/lighthouse-core/audits/network-requests.js +5 -5
  138. package/lighthouse-core/audits/network-rtt.js +7 -7
  139. package/lighthouse-core/audits/network-server-latency.js +7 -7
  140. package/lighthouse-core/audits/no-unload-listeners.js +6 -6
  141. package/lighthouse-core/audits/non-composited-animations.js +6 -5
  142. package/lighthouse-core/audits/oopif-iframe-test-audit.js +1 -1
  143. package/lighthouse-core/audits/performance-budget.js +8 -8
  144. package/lighthouse-core/audits/predictive-perf.js +9 -10
  145. package/lighthouse-core/audits/preload-fonts.js +8 -7
  146. package/lighthouse-core/audits/preload-lcp-image.js +11 -11
  147. package/lighthouse-core/audits/redirects.js +11 -11
  148. package/lighthouse-core/audits/resource-summary.js +6 -6
  149. package/lighthouse-core/audits/screenshot-thumbnails.js +5 -5
  150. package/lighthouse-core/audits/script-elements-test-audit.js +1 -1
  151. package/lighthouse-core/audits/script-treemap-data.js +7 -6
  152. package/lighthouse-core/audits/seo/canonical.js +7 -7
  153. package/lighthouse-core/audits/seo/crawlable-anchors.js +5 -5
  154. package/lighthouse-core/audits/seo/font-size.js +8 -6
  155. package/lighthouse-core/audits/seo/hreflang.js +7 -6
  156. package/lighthouse-core/audits/seo/http-status-code.js +7 -6
  157. package/lighthouse-core/audits/seo/is-crawlable.js +11 -9
  158. package/lighthouse-core/audits/seo/link-text.js +7 -6
  159. package/lighthouse-core/audits/seo/manual/structured-data.js +5 -5
  160. package/lighthouse-core/audits/seo/meta-description.js +5 -5
  161. package/lighthouse-core/audits/seo/plugins.js +6 -6
  162. package/lighthouse-core/audits/seo/robots-txt.js +7 -6
  163. package/lighthouse-core/audits/seo/tap-targets.js +12 -9
  164. package/lighthouse-core/audits/server-response-time.js +6 -6
  165. package/lighthouse-core/audits/service-worker.js +6 -6
  166. package/lighthouse-core/audits/splash-screen.js +6 -6
  167. package/lighthouse-core/audits/themed-omnibox.js +7 -7
  168. package/lighthouse-core/audits/third-party-facades.js +14 -13
  169. package/lighthouse-core/audits/third-party-summary.js +9 -9
  170. package/lighthouse-core/audits/timing-budget.js +8 -8
  171. package/lighthouse-core/audits/unsized-images.js +6 -6
  172. package/lighthouse-core/audits/user-timings.js +6 -6
  173. package/lighthouse-core/audits/uses-rel-preconnect.js +15 -15
  174. package/lighthouse-core/audits/uses-rel-preload.js +13 -13
  175. package/lighthouse-core/audits/valid-source-maps.js +6 -6
  176. package/lighthouse-core/audits/viewport.js +6 -6
  177. package/lighthouse-core/audits/violation-audit.js +3 -3
  178. package/lighthouse-core/audits/work-during-interaction.js +15 -15
  179. package/lighthouse-core/computed/computed-artifact.js +3 -3
  180. package/lighthouse-core/computed/critical-request-chains.js +5 -5
  181. package/lighthouse-core/computed/image-records.js +3 -3
  182. package/lighthouse-core/computed/js-bundles.js +4 -4
  183. package/lighthouse-core/computed/load-simulator.js +8 -5
  184. package/lighthouse-core/computed/main-resource.js +4 -4
  185. package/lighthouse-core/computed/main-thread-tasks.js +4 -4
  186. package/lighthouse-core/computed/manifest-values.js +3 -3
  187. package/lighthouse-core/computed/metrics/cumulative-layout-shift.js +4 -4
  188. package/lighthouse-core/computed/metrics/first-contentful-paint-all-frames.js +3 -3
  189. package/lighthouse-core/computed/metrics/first-contentful-paint.js +4 -4
  190. package/lighthouse-core/computed/metrics/first-meaningful-paint.js +5 -5
  191. package/lighthouse-core/computed/metrics/interactive.js +8 -9
  192. package/lighthouse-core/computed/metrics/lantern-first-contentful-paint.js +7 -7
  193. package/lighthouse-core/computed/metrics/lantern-first-meaningful-paint.js +5 -5
  194. package/lighthouse-core/computed/metrics/lantern-interactive.js +7 -7
  195. package/lighthouse-core/computed/metrics/lantern-largest-contentful-paint.js +5 -5
  196. package/lighthouse-core/computed/metrics/lantern-max-potential-fid.js +6 -6
  197. package/lighthouse-core/computed/metrics/lantern-metric.js +10 -10
  198. package/lighthouse-core/computed/metrics/lantern-speed-index.js +8 -8
  199. package/lighthouse-core/computed/metrics/lantern-total-blocking-time.js +8 -8
  200. package/lighthouse-core/computed/metrics/largest-contentful-paint-all-frames.js +5 -4
  201. package/lighthouse-core/computed/metrics/largest-contentful-paint.js +6 -5
  202. package/lighthouse-core/computed/metrics/max-potential-fid.js +6 -6
  203. package/lighthouse-core/computed/metrics/metric.js +6 -6
  204. package/lighthouse-core/computed/metrics/navigation-metric.js +2 -2
  205. package/lighthouse-core/computed/metrics/responsiveness.js +3 -3
  206. package/lighthouse-core/computed/metrics/speed-index.js +5 -5
  207. package/lighthouse-core/computed/metrics/tbt-utils.js +1 -1
  208. package/lighthouse-core/computed/metrics/timing-summary.js +15 -15
  209. package/lighthouse-core/computed/metrics/total-blocking-time.js +7 -7
  210. package/lighthouse-core/computed/module-duplication.js +3 -3
  211. package/lighthouse-core/computed/network-analysis.js +4 -4
  212. package/lighthouse-core/computed/network-records.js +3 -3
  213. package/lighthouse-core/computed/page-dependency-graph.js +11 -11
  214. package/lighthouse-core/computed/processed-navigation.js +3 -3
  215. package/lighthouse-core/computed/processed-trace.js +3 -3
  216. package/lighthouse-core/computed/resource-summary.js +7 -7
  217. package/lighthouse-core/computed/screenshots.js +2 -2
  218. package/lighthouse-core/computed/speedline.js +5 -5
  219. package/lighthouse-core/computed/trace-of-tab.js +6 -5
  220. package/lighthouse-core/computed/unused-css.js +4 -4
  221. package/lighthouse-core/computed/unused-javascript-summary.js +2 -2
  222. package/lighthouse-core/computed/user-timings.js +3 -3
  223. package/lighthouse-core/computed/viewport-meta.js +3 -4
  224. package/lighthouse-core/config/budget.js +1 -1
  225. package/lighthouse-core/config/config-helpers.js +47 -19
  226. package/lighthouse-core/config/config-plugin.js +2 -2
  227. package/lighthouse-core/config/config.js +16 -14
  228. package/lighthouse-core/config/constants.js +1 -1
  229. package/lighthouse-core/config/default-config.js +11 -10
  230. package/lighthouse-core/config/desktop-config.js +2 -2
  231. package/lighthouse-core/config/experimental-config.js +1 -1
  232. package/lighthouse-core/config/full-config.js +1 -1
  233. package/lighthouse-core/config/lr-desktop-config.js +2 -2
  234. package/lighthouse-core/config/lr-mobile-config.js +1 -1
  235. package/lighthouse-core/config/metrics-to-audits.js +1 -1
  236. package/lighthouse-core/config/perf-config.js +1 -1
  237. package/lighthouse-core/fraggle-rock/api.js +8 -8
  238. package/lighthouse-core/fraggle-rock/config/config.js +27 -17
  239. package/lighthouse-core/fraggle-rock/config/default-config.js +5 -5
  240. package/lighthouse-core/fraggle-rock/config/filters.js +3 -4
  241. package/lighthouse-core/fraggle-rock/config/validation.js +4 -4
  242. package/lighthouse-core/fraggle-rock/gather/base-artifacts.js +6 -8
  243. package/lighthouse-core/fraggle-rock/gather/base-gatherer.js +2 -1
  244. package/lighthouse-core/fraggle-rock/gather/driver.js +5 -5
  245. package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +23 -27
  246. package/lighthouse-core/fraggle-rock/gather/runner-helpers.js +3 -3
  247. package/lighthouse-core/fraggle-rock/gather/session.js +3 -3
  248. package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +7 -11
  249. package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +8 -12
  250. package/lighthouse-core/fraggle-rock/user-flow.js +8 -8
  251. package/lighthouse-core/gather/connections/connection.js +4 -4
  252. package/lighthouse-core/gather/connections/cri.js +6 -6
  253. package/lighthouse-core/gather/connections/raw.js +2 -2
  254. package/lighthouse-core/gather/driver/dom.js +1 -1
  255. package/lighthouse-core/gather/driver/environment.js +6 -6
  256. package/lighthouse-core/gather/driver/execution-context.js +2 -2
  257. package/lighthouse-core/gather/driver/navigation.js +8 -8
  258. package/lighthouse-core/gather/driver/network-monitor.js +7 -6
  259. package/lighthouse-core/gather/driver/network.js +2 -2
  260. package/lighthouse-core/gather/driver/prepare.js +5 -5
  261. package/lighthouse-core/gather/driver/service-workers.js +1 -1
  262. package/lighthouse-core/gather/driver/storage.js +4 -4
  263. package/lighthouse-core/gather/driver/target-manager.js +9 -4
  264. package/lighthouse-core/gather/driver/wait-for-condition.js +6 -5
  265. package/lighthouse-core/gather/driver.js +11 -16
  266. package/lighthouse-core/gather/fetcher.js +1 -1
  267. package/lighthouse-core/gather/gather-runner.js +22 -22
  268. package/lighthouse-core/gather/gatherers/accessibility.js +6 -5
  269. package/lighthouse-core/gather/gatherers/anchor-elements.js +6 -5
  270. package/lighthouse-core/gather/gatherers/cache-contents.js +2 -2
  271. package/lighthouse-core/gather/gatherers/console-messages.js +2 -2
  272. package/lighthouse-core/gather/gatherers/css-usage.js +6 -5
  273. package/lighthouse-core/gather/gatherers/devtools-log-compat.js +4 -3
  274. package/lighthouse-core/gather/gatherers/devtools-log.js +3 -3
  275. package/lighthouse-core/gather/gatherers/dobetterweb/doctype.js +2 -2
  276. package/lighthouse-core/gather/gatherers/dobetterweb/domstats.js +3 -3
  277. package/lighthouse-core/gather/gatherers/dobetterweb/optimized-images.js +8 -8
  278. package/lighthouse-core/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste.js +4 -3
  279. package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +10 -10
  280. package/lighthouse-core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +4 -4
  281. package/lighthouse-core/gather/gatherers/full-page-screenshot.js +7 -6
  282. package/lighthouse-core/gather/gatherers/gatherer.js +1 -1
  283. package/lighthouse-core/gather/gatherers/global-listeners.js +2 -2
  284. package/lighthouse-core/gather/gatherers/iframe-elements.js +4 -3
  285. package/lighthouse-core/gather/gatherers/image-elements.js +5 -5
  286. package/lighthouse-core/gather/gatherers/inputs.js +5 -4
  287. package/lighthouse-core/gather/gatherers/inspector-issues.js +4 -4
  288. package/lighthouse-core/gather/gatherers/installability-errors.js +3 -3
  289. package/lighthouse-core/gather/gatherers/js-usage.js +2 -2
  290. package/lighthouse-core/gather/gatherers/link-elements.js +7 -7
  291. package/lighthouse-core/gather/gatherers/main-document-content.js +5 -5
  292. package/lighthouse-core/gather/gatherers/meta-elements.js +3 -3
  293. package/lighthouse-core/gather/gatherers/network-user-agent.js +3 -3
  294. package/lighthouse-core/gather/gatherers/script-elements.js +6 -6
  295. package/lighthouse-core/gather/gatherers/scripts.js +2 -2
  296. package/lighthouse-core/gather/gatherers/seo/embedded-content.js +4 -3
  297. package/lighthouse-core/gather/gatherers/seo/font-size.js +8 -5
  298. package/lighthouse-core/gather/gatherers/seo/robots-txt.js +2 -2
  299. package/lighthouse-core/gather/gatherers/seo/tap-targets.js +5 -4
  300. package/lighthouse-core/gather/gatherers/service-worker.js +3 -3
  301. package/lighthouse-core/gather/gatherers/source-maps.js +3 -3
  302. package/lighthouse-core/gather/gatherers/stacks.js +12 -4
  303. package/lighthouse-core/gather/gatherers/trace-compat.js +4 -3
  304. package/lighthouse-core/gather/gatherers/trace-elements.js +13 -12
  305. package/lighthouse-core/gather/gatherers/trace.js +4 -3
  306. package/lighthouse-core/gather/gatherers/viewport-dimensions.js +2 -2
  307. package/lighthouse-core/gather/gatherers/web-app-manifest.js +5 -5
  308. package/lighthouse-core/index.cjs +21 -0
  309. package/lighthouse-core/index.js +25 -23
  310. package/lighthouse-core/lib/arbitrary-equality-map.js +2 -2
  311. package/lighthouse-core/lib/asset-saver.js +15 -12
  312. package/lighthouse-core/lib/axe.js +9 -4
  313. package/lighthouse-core/lib/cdt/package.json +4 -0
  314. package/lighthouse-core/lib/csp-evaluator.js +11 -13
  315. package/lighthouse-core/lib/dependency-graph/base-node.js +2 -2
  316. package/lighthouse-core/lib/dependency-graph/cpu-node.js +2 -2
  317. package/lighthouse-core/lib/dependency-graph/network-node.js +3 -3
  318. package/lighthouse-core/lib/dependency-graph/simulator/connection-pool.js +4 -4
  319. package/lighthouse-core/lib/dependency-graph/simulator/dns-cache.js +1 -1
  320. package/lighthouse-core/lib/dependency-graph/simulator/network-analyzer.js +11 -10
  321. package/lighthouse-core/lib/dependency-graph/simulator/simulator-timing-map.js +5 -5
  322. package/lighthouse-core/lib/dependency-graph/simulator/simulator.js +12 -10
  323. package/lighthouse-core/lib/dependency-graph/simulator/tcp-connection.js +1 -1
  324. package/lighthouse-core/lib/emulation.js +2 -2
  325. package/lighthouse-core/lib/i18n/README.md +1 -1
  326. package/lighthouse-core/lib/i18n/i18n.js +13 -13
  327. package/lighthouse-core/lib/icons.js +2 -2
  328. package/lighthouse-core/lib/lantern-trace-saver.js +1 -1
  329. package/lighthouse-core/lib/lh-env.js +7 -5
  330. package/lighthouse-core/lib/lh-error.js +4 -4
  331. package/lighthouse-core/lib/lh-trace-processor.js +3 -3
  332. package/lighthouse-core/lib/manifest-parser.js +4 -4
  333. package/lighthouse-core/lib/median-run.js +1 -1
  334. package/lighthouse-core/lib/minification-estimator.js +1 -1
  335. package/lighthouse-core/lib/minify-devtoolslog.js +1 -1
  336. package/lighthouse-core/lib/minify-trace.js +3 -3
  337. package/lighthouse-core/lib/navigation-error.js +6 -6
  338. package/lighthouse-core/lib/network-recorder.js +4 -4
  339. package/lighthouse-core/lib/network-request.js +2 -3
  340. package/lighthouse-core/lib/page-functions.js +2 -1
  341. package/lighthouse-core/lib/proto-preprocessor.js +7 -6
  342. package/lighthouse-core/lib/rect-helpers.js +1 -1
  343. package/lighthouse-core/lib/script-helpers.js +4 -1
  344. package/lighthouse-core/lib/sentry.js +4 -4
  345. package/lighthouse-core/lib/stack-packs.js +4 -4
  346. package/lighthouse-core/lib/statistics.js +1 -1
  347. package/lighthouse-core/lib/tappable-rects.js +2 -2
  348. package/lighthouse-core/lib/third-party-web.js +2 -2
  349. package/lighthouse-core/lib/timing-trace-saver.js +1 -1
  350. package/lighthouse-core/lib/tracehouse/cpu-profile-model.js +8 -8
  351. package/lighthouse-core/lib/tracehouse/main-thread-tasks.js +2 -2
  352. package/lighthouse-core/lib/tracehouse/task-groups.js +1 -1
  353. package/lighthouse-core/lib/tracehouse/task-summary.js +2 -2
  354. package/lighthouse-core/lib/tracehouse/trace-processor.js +2 -3
  355. package/lighthouse-core/lib/traces/pwmetrics-events.js +4 -3
  356. package/lighthouse-core/lib/url-shim.js +6 -4
  357. package/lighthouse-core/package.json +4 -0
  358. package/lighthouse-core/runner.js +40 -34
  359. package/lighthouse-core/scoring.js +2 -2
  360. package/lighthouse-core/{util-commonjs.js → util.cjs} +0 -0
  361. package/package.json +4 -2
  362. package/report/test/generator/report-generator-test.js +4 -3
  363. package/report/test/renderer/report-renderer-axe-test.js +2 -2
  364. package/root.js +10 -2
  365. package/shared/package.json +4 -0
  366. package/shared/test/localization/format-test.js +23 -13
  367. package/shared/test/localization/swap-locale-test.js +1 -0
  368. package/third-party/axe/valid-langs.js +1 -1
  369. package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +3 -3
  370. package/third-party/chromium-synchronization/installability-errors-test.js +3 -3
  371. package/third-party/download-content-shell/download-content-shell.js +6 -5
  372. package/third-party/download-content-shell/utils.js +8 -8
  373. package/tsconfig.json +3 -1
  374. package/types/artifacts.d.ts +9 -11
  375. package/types/audit.d.ts +2 -2
  376. package/types/config.d.ts +1 -1
  377. package/types/cssstyle/index.d.ts +1 -1
  378. package/types/gatherer.d.ts +7 -7
  379. package/types/global-lh.d.ts +2 -2
  380. package/types/smokehouse.d.ts +2 -0
@@ -10,9 +10,9 @@
10
10
 
11
11
  'use strict';
12
12
 
13
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
14
- const NetworkRecords = require('../../computed/network-records.js');
15
- const DevtoolsLog = require('./devtools-log.js');
13
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
14
+ import NetworkRecords from '../../computed/network-records.js';
15
+ import DevtoolsLog from './devtools-log.js';
16
16
 
17
17
  class InspectorIssues extends FRGatherer {
18
18
  /** @type {LH.Gatherer.GathererMeta<'DevtoolsLog'>} */
@@ -124,4 +124,4 @@ class InspectorIssues extends FRGatherer {
124
124
  }
125
125
  }
126
126
 
127
- module.exports = InspectorIssues;
127
+ export default InspectorIssues;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const log = require('lighthouse-logger');
9
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
8
+ import log from 'lighthouse-logger';
9
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
10
10
 
11
11
  class InstallabilityErrors extends FRGatherer {
12
12
  /** @type {LH.Gatherer.GathererMeta} */
@@ -45,4 +45,4 @@ class InstallabilityErrors extends FRGatherer {
45
45
  }
46
46
  }
47
47
 
48
- module.exports = InstallabilityErrors;
48
+ export default InstallabilityErrors;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
9
 
10
10
  /**
11
11
  * @fileoverview Tracks unused JavaScript
@@ -67,4 +67,4 @@ class JsUsage extends FRGatherer {
67
67
  }
68
68
  }
69
69
 
70
- module.exports = JsUsage;
70
+ export default JsUsage;
@@ -5,12 +5,12 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const LinkHeader = require('http-link-header');
9
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
10
- const {URL} = require('../../lib/url-shim.js');
11
- const pageFunctions = require('../../lib/page-functions.js');
12
- const DevtoolsLog = require('./devtools-log.js');
13
- const MainResource = require('../../computed/main-resource.js');
8
+ import LinkHeader from 'http-link-header';
9
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
10
+ import URL from '../../lib/url-shim.js';
11
+ import {pageFunctions} from '../../lib/page-functions.js';
12
+ import DevtoolsLog from './devtools-log.js';
13
+ import MainResource from '../../computed/main-resource.js';
14
14
 
15
15
  /* globals HTMLLinkElement getNodeDetails */
16
16
 
@@ -179,4 +179,4 @@ class LinkElements extends FRGatherer {
179
179
  }
180
180
  }
181
181
 
182
- module.exports = LinkElements;
182
+ export default LinkElements;
@@ -5,10 +5,10 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
9
- const DevtoolsLog = require('./devtools-log.js');
10
- const {fetchResponseBodyFromCache} = require('../driver/network.js');
11
- const MainResource = require('../../computed/main-resource.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
+ import DevtoolsLog from './devtools-log.js';
10
+ import {fetchResponseBodyFromCache} from '../driver/network.js';
11
+ import MainResource from '../../computed/main-resource.js';
12
12
 
13
13
  /**
14
14
  * Collects the content of the main html document.
@@ -51,4 +51,4 @@ class MainDocumentContent extends FRGatherer {
51
51
  }
52
52
  }
53
53
 
54
- module.exports = MainDocumentContent;
54
+ export default MainDocumentContent;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
9
- const pageFunctions = require('../../lib/page-functions.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
+ import {pageFunctions} from '../../lib/page-functions.js';
10
10
 
11
11
  /* globals getElementsInDocument getNodeDetails */
12
12
 
@@ -65,4 +65,4 @@ class MetaElements extends FRGatherer {
65
65
  }
66
66
  }
67
67
 
68
- module.exports = MetaElements;
68
+ export default MetaElements;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
9
- const DevtoolsLogGatherer = require('./devtools-log.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
+ import DevtoolsLogGatherer from './devtools-log.js';
10
10
 
11
11
  /** @implements {LH.Gatherer.FRGathererInstance<'DevtoolsLog'>} */
12
12
  class NetworkUserAgent extends FRGatherer {
@@ -39,4 +39,4 @@ class NetworkUserAgent extends FRGatherer {
39
39
  }
40
40
  }
41
41
 
42
- module.exports = NetworkUserAgent;
42
+ export default NetworkUserAgent;
@@ -5,11 +5,11 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
9
- const NetworkRecords = require('../../computed/network-records.js');
10
- const NetworkRequest = require('../../lib/network-request.js');
11
- const pageFunctions = require('../../lib/page-functions.js');
12
- const DevtoolsLog = require('./devtools-log.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
+ import NetworkRecords from '../../computed/network-records.js';
10
+ import {NetworkRequest} from '../../lib/network-request.js';
11
+ import {pageFunctions} from '../../lib/page-functions.js';
12
+ import DevtoolsLog from './devtools-log.js';
13
13
 
14
14
  /* global getNodeDetails */
15
15
 
@@ -108,4 +108,4 @@ class ScriptElements extends FRGatherer {
108
108
  }
109
109
  }
110
110
 
111
- module.exports = ScriptElements;
111
+ export default ScriptElements;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
9
 
10
10
  /**
11
11
  * @template T, U
@@ -137,4 +137,4 @@ class Scripts extends FRGatherer {
137
137
  }
138
138
  }
139
139
 
140
- module.exports = Scripts;
140
+ export default Scripts;
@@ -7,8 +7,9 @@
7
7
 
8
8
  /* globals getElementsInDocument getNodeDetails */
9
9
 
10
- const FRGatherer = require('../../../fraggle-rock/gather/base-gatherer.js');
11
- const pageFunctions = require('../../../lib/page-functions.js');
10
+ import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
11
+
12
+ import {pageFunctions} from '../../../lib/page-functions.js';
12
13
 
13
14
  /**
14
15
  * @return {LH.Artifacts.EmbeddedContentInfo[]}
@@ -61,4 +62,4 @@ class EmbeddedContent extends FRGatherer {
61
62
  }
62
63
  }
63
64
 
64
- module.exports = EmbeddedContent;
65
+ export default EmbeddedContent;
@@ -16,7 +16,8 @@
16
16
  * This gatherer collects stylesheet metadata by itself, instead of relying on the styles gatherer which is slow (because it parses the stylesheet content).
17
17
  */
18
18
 
19
- const FRGatherer = require('../../../fraggle-rock/gather/base-gatherer.js');
19
+ import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
20
+
20
21
  const FONT_SIZE_PROPERTY_NAME = 'font-size';
21
22
  const MINIMAL_LEGIBLE_FONT_SIZE_PX = 12;
22
23
  // limit number of protocol calls to make sure that gatherer doesn't take more than 1-2s
@@ -374,7 +375,9 @@ class FontSize extends FRGatherer {
374
375
  }
375
376
  }
376
377
 
377
- module.exports = FontSize;
378
- module.exports.computeSelectorSpecificity = computeSelectorSpecificity;
379
- module.exports.getEffectiveFontRule = getEffectiveFontRule;
380
- module.exports.findMostSpecificMatchedCSSRule = findMostSpecificMatchedCSSRule;
378
+ export default FontSize;
379
+ export {
380
+ computeSelectorSpecificity,
381
+ getEffectiveFontRule,
382
+ findMostSpecificMatchedCSSRule,
383
+ };
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../../fraggle-rock/gather/base-gatherer.js');
8
+ import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
9
9
 
10
10
  class RobotsTxt extends FRGatherer {
11
11
  /** @type {LH.Gatherer.GathererMeta} */
@@ -25,4 +25,4 @@ class RobotsTxt extends FRGatherer {
25
25
  }
26
26
  }
27
27
 
28
- module.exports = RobotsTxt;
28
+ export default RobotsTxt;
@@ -7,9 +7,10 @@
7
7
 
8
8
  /* global document, window, getComputedStyle, getElementsInDocument, Node, getNodeDetails, getRectCenterPoint */
9
9
 
10
- const FRGatherer = require('../../../fraggle-rock/gather/base-gatherer.js');
11
- const pageFunctions = require('../../../lib/page-functions.js');
12
- const RectHelpers = require('../../../lib/rect-helpers.js');
10
+ import FRGatherer from '../../../fraggle-rock/gather/base-gatherer.js';
11
+
12
+ import {pageFunctions} from '../../../lib/page-functions.js';
13
+ import * as RectHelpers from '../../../lib/rect-helpers.js';
13
14
 
14
15
  const TARGET_SELECTORS = [
15
16
  'button',
@@ -367,4 +368,4 @@ class TapTargets extends FRGatherer {
367
368
  }
368
369
  }
369
370
 
370
- module.exports = TapTargets;
371
+ export default TapTargets;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
9
- const serviceWorkers = require('../driver/service-workers.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
+ import * as serviceWorkers from '../driver/service-workers.js';
10
10
 
11
11
  class ServiceWorker extends FRGatherer {
12
12
  /** @type {LH.Gatherer.GathererMeta} */
@@ -42,4 +42,4 @@ class ServiceWorker extends FRGatherer {
42
42
  }
43
43
  }
44
44
 
45
- module.exports = ServiceWorker;
45
+ export default ServiceWorker;
@@ -5,8 +5,8 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
9
- const URL = require('../../lib/url-shim.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
+ import URL from '../../lib/url-shim.js';
10
10
 
11
11
  /**
12
12
  * @fileoverview Gets JavaScript source maps.
@@ -154,4 +154,4 @@ class SourceMaps extends FRGatherer {
154
154
  }
155
155
  }
156
156
 
157
- module.exports = SourceMaps;
157
+ export default SourceMaps;
@@ -12,9 +12,17 @@
12
12
  /* global window */
13
13
  /* global d41d8cd98f00b204e9800998ecf8427e_LibraryDetectorTests */
14
14
 
15
- const fs = require('fs');
16
- const log = require('lighthouse-logger');
17
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
15
+ import fs from 'fs';
16
+
17
+ import log from 'lighthouse-logger';
18
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
19
+
20
+ import {createRequire} from 'module';
21
+
22
+ // This is removed by rollup, because the only usage is to resolve a module path
23
+ // but that is replaced by the inline-fs plugin, leaving `require` unused.
24
+ const require = /* #__PURE__ */ createRequire(import.meta.url);
25
+
18
26
  const libDetectorSource = fs.readFileSync(
19
27
  require.resolve('js-library-detector/library/libraries.js'), 'utf8');
20
28
 
@@ -122,4 +130,4 @@ class Stacks extends FRGatherer {
122
130
  }
123
131
  }
124
132
 
125
- module.exports = Stacks;
133
+ export default Stacks;
@@ -11,8 +11,9 @@
11
11
  * when devtools logs and traces were special-cased.
12
12
  */
13
13
 
14
- const TraceGatherer = require('./trace.js');
15
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
14
+ import TraceGatherer from './trace.js';
15
+
16
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
16
17
 
17
18
  /** @implements {LH.Gatherer.FRGathererInstance<'Trace'>} */
18
19
  class TraceCompat extends FRGatherer {
@@ -33,4 +34,4 @@ class TraceCompat extends FRGatherer {
33
34
  }
34
35
  }
35
36
 
36
- module.exports = TraceCompat;
37
+ export default TraceCompat;
@@ -13,16 +13,17 @@
13
13
  * We take the backend nodeId from the trace and use it to find the corresponding element in the DOM.
14
14
  */
15
15
 
16
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
17
- const {resolveNodeIdToObjectId} = require('../driver/dom.js');
18
- const pageFunctions = require('../../lib/page-functions.js');
19
- const RectHelpers = require('../../lib/rect-helpers.js');
20
- const Sentry = require('../../lib/sentry.js');
21
- const Trace = require('./trace.js');
22
- const ProcessedTrace = require('../../computed/processed-trace.js');
23
- const ProcessedNavigation = require('../../computed/processed-navigation.js');
24
- const LighthouseError = require('../../lib/lh-error.js');
25
- const ComputedResponsivenes = require('../../computed/metrics/responsiveness.js');
16
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
17
+
18
+ import {resolveNodeIdToObjectId} from '../driver/dom.js';
19
+ import {pageFunctions} from '../../lib/page-functions.js';
20
+ import * as RectHelpers from '../../lib/rect-helpers.js';
21
+ import {Sentry} from '../../lib/sentry.js';
22
+ import Trace from './trace.js';
23
+ import ProcessedTrace from '../../computed/processed-trace.js';
24
+ import ProcessedNavigation from '../../computed/processed-navigation.js';
25
+ import {LighthouseError} from '../../lib/lh-error.js';
26
+ import ComputedResponsiveness from '../../computed/metrics/responsiveness.js';
26
27
 
27
28
  /** @typedef {{nodeId: number, score?: number, animations?: {name?: string, failureReasonsMask?: number, unsupportedProperties?: string[]}[]}} TraceElementData */
28
29
 
@@ -151,7 +152,7 @@ class TraceElements extends FRGatherer {
151
152
  static async getResponsivenessElement(trace, context) {
152
153
  const {settings} = context;
153
154
  try {
154
- const responsivenessEvent = await ComputedResponsivenes.request({trace, settings}, context);
155
+ const responsivenessEvent = await ComputedResponsiveness.request({trace, settings}, context);
155
156
  if (!responsivenessEvent || responsivenessEvent.name === 'FallbackTiming') return;
156
157
  return {nodeId: responsivenessEvent.args.data.nodeId};
157
158
  } catch {
@@ -327,4 +328,4 @@ class TraceElements extends FRGatherer {
327
328
  }
328
329
  }
329
330
 
330
- module.exports = TraceElements;
331
+ export default TraceElements;
@@ -11,8 +11,9 @@
11
11
  * This protocol log can be used to recreate the network records using lib/network-recorder.js.
12
12
  */
13
13
 
14
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
15
- const TraceProcessor = require('../../lib/tracehouse/trace-processor.js');
14
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
15
+
16
+ import {TraceProcessor} from '../../lib/tracehouse/trace-processor.js';
16
17
 
17
18
  class Trace extends FRGatherer {
18
19
  /** @type {LH.Trace} */
@@ -128,4 +129,4 @@ class Trace extends FRGatherer {
128
129
  }
129
130
  }
130
131
 
131
- module.exports = Trace;
132
+ export default Trace;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
8
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
9
9
 
10
10
  /* global window */
11
11
 
@@ -55,4 +55,4 @@ class ViewportDimensions extends FRGatherer {
55
55
  }
56
56
  }
57
57
 
58
- module.exports = ViewportDimensions;
58
+ export default ViewportDimensions;
@@ -5,9 +5,9 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const log = require('lighthouse-logger');
9
- const manifestParser = require('../../lib/manifest-parser.js');
10
- const FRGatherer = require('../../fraggle-rock/gather/base-gatherer.js');
8
+ import log from 'lighthouse-logger';
9
+ import {parseManifest} from '../../lib/manifest-parser.js';
10
+ import FRGatherer from '../../fraggle-rock/gather/base-gatherer.js';
11
11
 
12
12
  class WebAppManifest extends FRGatherer {
13
13
  /** @type {LH.Gatherer.GathererMeta} */
@@ -83,7 +83,7 @@ class WebAppManifest extends FRGatherer {
83
83
  log.time(status);
84
84
  const response = await WebAppManifest.fetchAppManifest(session);
85
85
  if (!response) return null;
86
- const manifest = manifestParser(response.data, response.url, pageUrl);
86
+ const manifest = parseManifest(response.data, response.url, pageUrl);
87
87
  log.timeEnd(status);
88
88
  return manifest;
89
89
  }
@@ -99,4 +99,4 @@ class WebAppManifest extends FRGatherer {
99
99
  }
100
100
  }
101
101
 
102
- module.exports = WebAppManifest;
102
+ export default WebAppManifest;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license Copyright 2022 The Lighthouse Authors. All Rights Reserved.
3
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
4
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
5
+ */
6
+ 'use strict';
7
+
8
+ /** @type {import('./index.js')['default']} */
9
+ const lighthouse = async function lighthouse(...args) {
10
+ const {default: lighthouse} = await import('./index.js');
11
+ return lighthouse(...args);
12
+ };
13
+
14
+ /** @type {import('./index.js')['legacyNavigation']} */
15
+ const legacyNavigation = async function legacyNavigation(...args) {
16
+ const {legacyNavigation} = await import('./index.js');
17
+ return legacyNavigation(...args);
18
+ };
19
+
20
+ module.exports = lighthouse;
21
+ module.exports.legacyNavigation = legacyNavigation;
@@ -5,16 +5,17 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const Runner = require('./runner.js');
9
- const log = require('lighthouse-logger');
10
- const ChromeProtocol = require('./gather/connections/cri.js');
11
- const Config = require('./config/config.js');
12
- const URL = require('./lib/url-shim.js');
13
- const fraggleRock = require('./fraggle-rock/api.js');
14
- const {initializeConfig} = require('./fraggle-rock/config/config.js');
15
- const {flagsToFRContext} = require('./config/config-helpers.js');
8
+ import {Runner} from './runner.js';
9
+ import log from 'lighthouse-logger';
10
+ import {CriConnection} from './gather/connections/cri.js';
11
+ import {Config} from './config/config.js';
12
+ import URL from './lib/url-shim.js';
13
+ import * as fraggleRock from './fraggle-rock/api.js';
14
+ import {Driver} from './gather/driver.js';
15
+ import {flagsToFRContext} from './config/config-helpers.js';
16
+ import {initializeConfig} from './fraggle-rock/config/config.js';
16
17
 
17
- /** @typedef {import('./gather/connections/connection.js')} Connection */
18
+ /** @typedef {import('./gather/connections/connection.js').Connection} Connection */
18
19
 
19
20
  /*
20
21
  * The relationship between these root modules:
@@ -64,7 +65,7 @@ async function legacyNavigation(url, flags = {}, configJSON, userConnection) {
64
65
  const config = await generateLegacyConfig(configJSON, flags);
65
66
  const computedCache = new Map();
66
67
  const options = {config, computedCache};
67
- const connection = userConnection || new ChromeProtocol(flags.port, flags.hostname);
68
+ const connection = userConnection || new CriConnection(flags.port, flags.hostname);
68
69
 
69
70
  // kick off a lighthouse run
70
71
  const artifacts = await Runner.gather(() => {
@@ -103,17 +104,18 @@ function generateLegacyConfig(configJson, flags) {
103
104
  return Config.fromJson(configJson, flags);
104
105
  }
105
106
 
106
- lighthouse.legacyNavigation = legacyNavigation;
107
- lighthouse.generateConfig = generateConfig;
108
- lighthouse.generateLegacyConfig = generateLegacyConfig;
109
- lighthouse.getAuditList = Runner.getAuditList;
110
- lighthouse.traceCategories = require('./gather/driver.js').traceCategories;
111
- lighthouse.Audit = require('./audits/audit.js');
112
- lighthouse.Gatherer = require('./fraggle-rock/gather/base-gatherer.js');
113
-
114
- // Explicit type reference (hidden by makeComputedArtifact) for d.ts export.
115
- // TODO(esmodules): should be a workaround for module.export and can be removed when in esm.
116
- /** @type {typeof import('./computed/network-records.js')} */
117
- lighthouse.NetworkRecords = require('./computed/network-records.js');
107
+ function getAuditList() {
108
+ return Runner.getAuditList();
109
+ }
118
110
 
119
- module.exports = lighthouse;
111
+ export default lighthouse;
112
+ export {Audit} from './audits/audit.js';
113
+ export {default as Gatherer} from './fraggle-rock/gather/base-gatherer.js';
114
+ export {default as NetworkRecords} from './computed/network-records.js';
115
+ export {
116
+ legacyNavigation,
117
+ generateConfig,
118
+ generateLegacyConfig,
119
+ getAuditList,
120
+ };
121
+ export const traceCategories = Driver.traceCategories;
@@ -5,7 +5,7 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const isDeepEqual = require('lodash/isEqual.js');
8
+ import isDeepEqual from 'lodash/isEqual.js';
9
9
 
10
10
  /**
11
11
  * @fileoverview This class is designed to allow maps with arbitrary equality functions.
@@ -78,4 +78,4 @@ class ArbitraryEqualityMap {
78
78
  }
79
79
  }
80
80
 
81
- module.exports = ArbitraryEqualityMap;
81
+ export {ArbitraryEqualityMap};
@@ -5,17 +5,20 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const fs = require('fs');
9
- const path = require('path');
10
- const log = require('lighthouse-logger');
11
- const stream = require('stream');
12
- const {promisify} = require('util');
13
- const Simulator = require('./dependency-graph/simulator/simulator.js');
14
- const lanternTraceSaver = require('./lantern-trace-saver.js');
15
- const Metrics = require('./traces/pwmetrics-events.js');
16
- const NetworkAnalysisComputed = require('../computed/network-analysis.js');
17
- const LoadSimulatorComputed = require('../computed/load-simulator.js');
18
- const LighthouseError = require('../lib/lh-error.js');
8
+ import fs from 'fs';
9
+ import path from 'path';
10
+ import log from 'lighthouse-logger';
11
+ import stream from 'stream';
12
+ import util from 'util';
13
+ import {Simulator} from './dependency-graph/simulator/simulator.js';
14
+ import lanternTraceSaver from './lantern-trace-saver.js';
15
+ import {Metrics} from './traces/pwmetrics-events.js';
16
+ import NetworkAnalysisComputed from '../computed/network-analysis.js';
17
+ import LoadSimulatorComputed from '../computed/load-simulator.js';
18
+ import {LighthouseError} from '../lib/lh-error.js';
19
+
20
+ const {promisify} = util;
21
+
19
22
  // TODO(esmodules): Rollup does not support `promisfy` or `stream.pipeline`. Bundled files
20
23
  // don't need anything in this file except for `stringifyReplacer`, so a check for
21
24
  // truthiness before using is enough.
@@ -326,7 +329,7 @@ function normalizeTimingEntries(timings) {
326
329
  }
327
330
  }
328
331
 
329
- module.exports = {
332
+ export {
330
333
  saveArtifacts,
331
334
  saveLhr,
332
335
  loadArtifacts,
@@ -5,9 +5,14 @@
5
5
  */
6
6
  'use strict';
7
7
 
8
- const fs = require('fs');
9
- const source = fs.readFileSync(require.resolve('axe-core/axe.min.js'), 'utf8');
8
+ import fs from 'fs';
9
+ import {createRequire} from 'module';
10
10
 
11
- module.exports = {
12
- source,
11
+ // This is removed by rollup, because the only usage is to resolve a module path
12
+ // but that is replaced by the inline-fs plugin, leaving `require` unused.
13
+ const require = /* #__PURE__ */ createRequire(import.meta.url);
14
+ const axeSource = fs.readFileSync(require.resolve('axe-core/axe.min.js'), 'utf8');
15
+
16
+ export {
17
+ axeSource,
13
18
  };
@@ -0,0 +1,4 @@
1
+ {
2
+ "type": "commonjs",
3
+ "//": "Temporary file until made esm"
4
+ }