lighthouse 10.4.0-dev.20230713 → 10.4.0-dev.20230714

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 (174) hide show
  1. package/cli/cli-flags.d.ts +1 -6
  2. package/cli/cli-flags.js +0 -5
  3. package/cli/run.js +3 -10
  4. package/cli/test/smokehouse/lighthouse-runners/bundle.js +3 -1
  5. package/core/config/config-helpers.d.ts +3 -3
  6. package/core/config/config-helpers.js +5 -12
  7. package/core/config/config.js +1 -7
  8. package/core/config/constants.d.ts +0 -2
  9. package/core/config/constants.js +0 -16
  10. package/core/config/filters.js +1 -1
  11. package/core/config/validation.d.ts +5 -10
  12. package/core/config/validation.js +12 -22
  13. package/core/gather/base-artifacts.d.ts +4 -4
  14. package/core/gather/base-artifacts.js +2 -6
  15. package/core/gather/base-gatherer.d.ts +12 -37
  16. package/core/gather/base-gatherer.js +7 -54
  17. package/core/gather/driver/dom.d.ts +4 -4
  18. package/core/gather/driver/dom.js +2 -2
  19. package/core/gather/driver/environment.d.ts +4 -4
  20. package/core/gather/driver/environment.js +2 -2
  21. package/core/gather/driver/execution-context.d.ts +12 -3
  22. package/core/gather/driver/execution-context.js +27 -3
  23. package/core/gather/driver/navigation.d.ts +2 -2
  24. package/core/gather/driver/navigation.js +1 -1
  25. package/core/gather/driver/network-monitor.d.ts +6 -6
  26. package/core/gather/driver/network-monitor.js +3 -3
  27. package/core/gather/driver/network.d.ts +2 -2
  28. package/core/gather/driver/network.js +1 -1
  29. package/core/gather/driver/prepare.d.ts +10 -10
  30. package/core/gather/driver/prepare.js +10 -10
  31. package/core/gather/driver/service-workers.d.ts +4 -4
  32. package/core/gather/driver/service-workers.js +2 -2
  33. package/core/gather/driver/storage.d.ts +6 -6
  34. package/core/gather/driver/storage.js +3 -3
  35. package/core/gather/driver/target-manager.d.ts +6 -5
  36. package/core/gather/driver/target-manager.js +3 -3
  37. package/core/gather/driver/wait-for-condition.d.ts +14 -14
  38. package/core/gather/driver/wait-for-condition.js +8 -8
  39. package/core/gather/driver.d.ts +4 -4
  40. package/core/gather/driver.js +3 -3
  41. package/core/gather/fetcher.d.ts +3 -3
  42. package/core/gather/fetcher.js +1 -1
  43. package/core/gather/gatherers/accessibility.d.ts +4 -4
  44. package/core/gather/gatherers/accessibility.js +3 -3
  45. package/core/gather/gatherers/anchor-elements.d.ts +4 -4
  46. package/core/gather/gatherers/anchor-elements.js +4 -4
  47. package/core/gather/gatherers/bf-cache-failures.d.ts +8 -14
  48. package/core/gather/gatherers/bf-cache-failures.js +5 -14
  49. package/core/gather/gatherers/cache-contents.d.ts +4 -4
  50. package/core/gather/gatherers/cache-contents.js +3 -3
  51. package/core/gather/gatherers/console-messages.d.ts +6 -6
  52. package/core/gather/gatherers/console-messages.js +4 -4
  53. package/core/gather/gatherers/css-usage.d.ts +14 -14
  54. package/core/gather/gatherers/css-usage.js +9 -9
  55. package/core/gather/gatherers/devtools-log-compat.d.ts +5 -5
  56. package/core/gather/gatherers/devtools-log-compat.js +4 -4
  57. package/core/gather/gatherers/devtools-log.d.ts +6 -6
  58. package/core/gather/gatherers/devtools-log.js +4 -4
  59. package/core/gather/gatherers/dobetterweb/doctype.d.ts +4 -4
  60. package/core/gather/gatherers/dobetterweb/doctype.js +3 -3
  61. package/core/gather/gatherers/dobetterweb/domstats.d.ts +4 -4
  62. package/core/gather/gatherers/dobetterweb/domstats.js +3 -3
  63. package/core/gather/gatherers/dobetterweb/optimized-images.d.ts +10 -22
  64. package/core/gather/gatherers/dobetterweb/optimized-images.js +10 -27
  65. package/core/gather/gatherers/dobetterweb/response-compression.d.ts +6 -12
  66. package/core/gather/gatherers/dobetterweb/response-compression.js +6 -15
  67. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.d.ts +8 -14
  68. package/core/gather/gatherers/dobetterweb/tags-blocking-first-paint.js +5 -14
  69. package/core/gather/gatherers/full-page-screenshot.d.ts +10 -10
  70. package/core/gather/gatherers/full-page-screenshot.js +6 -6
  71. package/core/gather/gatherers/global-listeners.d.ts +4 -4
  72. package/core/gather/gatherers/global-listeners.js +3 -3
  73. package/core/gather/gatherers/iframe-elements.d.ts +4 -4
  74. package/core/gather/gatherers/iframe-elements.js +3 -3
  75. package/core/gather/gatherers/image-elements.d.ts +10 -10
  76. package/core/gather/gatherers/image-elements.js +6 -6
  77. package/core/gather/gatherers/inputs.d.ts +4 -4
  78. package/core/gather/gatherers/inputs.js +3 -3
  79. package/core/gather/gatherers/inspector-issues.d.ts +8 -19
  80. package/core/gather/gatherers/inspector-issues.js +9 -26
  81. package/core/gather/gatherers/installability-errors.d.ts +6 -6
  82. package/core/gather/gatherers/installability-errors.js +4 -4
  83. package/core/gather/gatherers/js-usage.d.ts +6 -6
  84. package/core/gather/gatherers/js-usage.js +4 -4
  85. package/core/gather/gatherers/link-elements.d.ts +8 -20
  86. package/core/gather/gatherers/link-elements.js +7 -24
  87. package/core/gather/gatherers/main-document-content.d.ts +4 -16
  88. package/core/gather/gatherers/main-document-content.js +5 -23
  89. package/core/gather/gatherers/meta-elements.d.ts +4 -4
  90. package/core/gather/gatherers/meta-elements.js +3 -3
  91. package/core/gather/gatherers/network-user-agent.d.ts +5 -5
  92. package/core/gather/gatherers/network-user-agent.js +4 -4
  93. package/core/gather/gatherers/script-elements.d.ts +6 -11
  94. package/core/gather/gatherers/script-elements.js +4 -13
  95. package/core/gather/gatherers/scripts.d.ts +6 -6
  96. package/core/gather/gatherers/scripts.js +4 -4
  97. package/core/gather/gatherers/seo/embedded-content.d.ts +4 -4
  98. package/core/gather/gatherers/seo/embedded-content.js +3 -3
  99. package/core/gather/gatherers/seo/font-size.d.ts +6 -6
  100. package/core/gather/gatherers/seo/font-size.js +5 -5
  101. package/core/gather/gatherers/seo/robots-txt.d.ts +4 -4
  102. package/core/gather/gatherers/seo/robots-txt.js +3 -3
  103. package/core/gather/gatherers/seo/tap-targets.d.ts +8 -8
  104. package/core/gather/gatherers/seo/tap-targets.js +5 -5
  105. package/core/gather/gatherers/service-worker.d.ts +4 -10
  106. package/core/gather/gatherers/service-worker.js +3 -15
  107. package/core/gather/gatherers/source-maps.d.ts +12 -12
  108. package/core/gather/gatherers/source-maps.js +7 -7
  109. package/core/gather/gatherers/stacks.d.ts +7 -7
  110. package/core/gather/gatherers/stacks.js +6 -6
  111. package/core/gather/gatherers/trace-compat.d.ts +5 -5
  112. package/core/gather/gatherers/trace-compat.js +4 -4
  113. package/core/gather/gatherers/trace-elements.d.ts +13 -25
  114. package/core/gather/gatherers/trace-elements.js +13 -30
  115. package/core/gather/gatherers/trace.d.ts +8 -8
  116. package/core/gather/gatherers/trace.js +5 -5
  117. package/core/gather/gatherers/viewport-dimensions.d.ts +4 -4
  118. package/core/gather/gatherers/viewport-dimensions.js +3 -3
  119. package/core/gather/gatherers/web-app-manifest.d.ts +8 -8
  120. package/core/gather/gatherers/web-app-manifest.js +5 -5
  121. package/core/gather/navigation-runner.d.ts +9 -9
  122. package/core/gather/navigation-runner.js +6 -6
  123. package/core/gather/runner-helpers.d.ts +3 -3
  124. package/core/gather/runner-helpers.js +12 -4
  125. package/core/gather/session.d.ts +2 -2
  126. package/core/gather/session.js +1 -1
  127. package/core/gather/snapshot-runner.d.ts +2 -2
  128. package/core/gather/snapshot-runner.js +1 -1
  129. package/core/gather/timespan-runner.d.ts +2 -2
  130. package/core/gather/timespan-runner.js +1 -1
  131. package/core/index.cjs +0 -7
  132. package/core/index.d.ts +0 -15
  133. package/core/index.js +2 -40
  134. package/core/lib/asset-saver.js +8 -4
  135. package/core/lib/axe.js +1 -1
  136. package/core/lib/emulation.d.ts +14 -14
  137. package/core/lib/emulation.js +7 -7
  138. package/core/lib/page-functions.d.ts +2 -0
  139. package/core/lib/page-functions.js +10 -0
  140. package/core/lib/sentry.js +9 -2
  141. package/core/runner.d.ts +8 -30
  142. package/core/runner.js +6 -39
  143. package/core/user-flow.d.ts +4 -4
  144. package/core/user-flow.js +2 -2
  145. package/dist/report/bundle.esm.js +2221 -5832
  146. package/dist/report/flow.js +2631 -235
  147. package/dist/report/standalone.js +2586 -234
  148. package/package.json +8 -15
  149. package/third-party/esbuild-plugins-polyfills/LICENSE +3 -0
  150. package/third-party/esbuild-plugins-polyfills/README.md +7 -0
  151. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.d.ts +9 -0
  152. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.js +129 -0
  153. package/tsconfig.json +1 -0
  154. package/types/artifacts.d.ts +12 -45
  155. package/types/config.d.ts +10 -52
  156. package/types/externs.d.ts +0 -2
  157. package/types/gatherer.d.ts +20 -45
  158. package/types/lh.d.ts +0 -2
  159. package/core/gather/gatherers/gatherer.d.ts +0 -46
  160. package/core/gather/gatherers/gatherer.js +0 -58
  161. package/core/legacy/config/config.d.ts +0 -107
  162. package/core/legacy/config/config.js +0 -566
  163. package/core/legacy/config/legacy-default-config.d.ts +0 -4
  164. package/core/legacy/config/legacy-default-config.js +0 -87
  165. package/core/legacy/gather/connections/connection.d.ts +0 -77
  166. package/core/legacy/gather/connections/connection.js +0 -196
  167. package/core/legacy/gather/connections/cri.d.ts +0 -27
  168. package/core/legacy/gather/connections/cri.js +0 -162
  169. package/core/legacy/gather/connections/raw.d.ts +0 -20
  170. package/core/legacy/gather/connections/raw.js +0 -57
  171. package/core/legacy/gather/driver.d.ts +0 -216
  172. package/core/legacy/gather/driver.js +0 -480
  173. package/core/legacy/gather/gather-runner.d.ts +0 -166
  174. package/core/legacy/gather/gather-runner.js +0 -590
@@ -1,46 +0,0 @@
1
- /**
2
- * @license Copyright 2016 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
- /**
7
- * Base class for all gatherers; defines pass lifecycle methods. The artifact
8
- * from the gatherer is the last not-undefined value returned by a lifecycle
9
- * method. All methods can return the artifact value directly or return a
10
- * Promise that resolves to that value.
11
- *
12
- * If an Error is thrown (or a Promise that rejects on an Error),
13
- * the runner will treat it as an error internal to the gatherer and
14
- * continue execution of any remaining gatherers.
15
- *
16
- * @implements {LH.Gatherer.GathererInstance}
17
- */
18
- export class Gatherer implements LH.Gatherer.GathererInstance {
19
- /**
20
- * @return {keyof LH.GathererArtifacts}
21
- */
22
- get name(): keyof import("../..").GathererArtifacts;
23
- /**
24
- * Called before navigation to target url.
25
- * @param {LH.Gatherer.PassContext} passContext
26
- * @return {LH.Gatherer.PhaseResult}
27
- */
28
- beforePass(passContext: LH.Gatherer.PassContext): LH.Gatherer.PhaseResult;
29
- /**
30
- * Called after target page is loaded. If a trace is enabled for this pass,
31
- * the trace is still being recorded.
32
- * @param {LH.Gatherer.PassContext} passContext
33
- * @return {LH.Gatherer.PhaseResult}
34
- */
35
- pass(passContext: LH.Gatherer.PassContext): LH.Gatherer.PhaseResult;
36
- /**
37
- * Called after target page is loaded, all gatherer `pass` methods have been
38
- * executed, and — if generated in this pass — the trace is ended. The trace
39
- * and record of network activity are provided in `loadData`.
40
- * @param {LH.Gatherer.PassContext} passContext
41
- * @param {LH.Gatherer.LoadData} loadData
42
- * @return {LH.Gatherer.PhaseResult}
43
- */
44
- afterPass(passContext: LH.Gatherer.PassContext, loadData: LH.Gatherer.LoadData): LH.Gatherer.PhaseResult;
45
- }
46
- //# sourceMappingURL=gatherer.d.ts.map
@@ -1,58 +0,0 @@
1
- /**
2
- * @license Copyright 2016 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
-
7
- /**
8
- * Base class for all gatherers; defines pass lifecycle methods. The artifact
9
- * from the gatherer is the last not-undefined value returned by a lifecycle
10
- * method. All methods can return the artifact value directly or return a
11
- * Promise that resolves to that value.
12
- *
13
- * If an Error is thrown (or a Promise that rejects on an Error),
14
- * the runner will treat it as an error internal to the gatherer and
15
- * continue execution of any remaining gatherers.
16
- *
17
- * @implements {LH.Gatherer.GathererInstance}
18
- */
19
- class Gatherer {
20
- /**
21
- * @return {keyof LH.GathererArtifacts}
22
- */
23
- get name() {
24
- // @ts-expect-error - assume that class name has been added to LH.GathererArtifacts.
25
- return this.constructor.name;
26
- }
27
-
28
- /* eslint-disable no-unused-vars */
29
-
30
- /**
31
- * Called before navigation to target url.
32
- * @param {LH.Gatherer.PassContext} passContext
33
- * @return {LH.Gatherer.PhaseResult}
34
- */
35
- beforePass(passContext) { }
36
-
37
- /**
38
- * Called after target page is loaded. If a trace is enabled for this pass,
39
- * the trace is still being recorded.
40
- * @param {LH.Gatherer.PassContext} passContext
41
- * @return {LH.Gatherer.PhaseResult}
42
- */
43
- pass(passContext) { }
44
-
45
- /**
46
- * Called after target page is loaded, all gatherer `pass` methods have been
47
- * executed, and — if generated in this pass — the trace is ended. The trace
48
- * and record of network activity are provided in `loadData`.
49
- * @param {LH.Gatherer.PassContext} passContext
50
- * @param {LH.Gatherer.LoadData} loadData
51
- * @return {LH.Gatherer.PhaseResult}
52
- */
53
- afterPass(passContext, loadData) { }
54
-
55
- /* eslint-enable no-unused-vars */
56
- }
57
-
58
- export {Gatherer};
@@ -1,107 +0,0 @@
1
- export type GathererConstructor = typeof import('../../gather/gatherers/gatherer.js').Gatherer;
2
- export type Gatherer = InstanceType<GathererConstructor>;
3
- /**
4
- * @implements {LH.Config.LegacyResolvedConfig}
5
- */
6
- export class LegacyResolvedConfig implements LH.Config.LegacyResolvedConfig {
7
- /**
8
- * Resolves the provided config (inherits from extended config, if set), resolves
9
- * all referenced modules, and validates.
10
- * @param {LH.Config=} config If not provided, uses the default config.
11
- * @param {LH.Flags=} flags
12
- * @return {Promise<LegacyResolvedConfig>}
13
- */
14
- static fromJson(config?: LH.Config | undefined, flags?: LH.Flags | undefined): Promise<LegacyResolvedConfig>;
15
- /**
16
- * @param {LH.Config} baseJSON The JSON of the configuration to extend
17
- * @param {LH.Config} extendJSON The JSON of the extensions
18
- * @return {LH.Config}
19
- */
20
- static extendConfigJSON(baseJSON: LH.Config, extendJSON: LH.Config): LH.Config;
21
- /**
22
- * @param {LH.Config['passes']} passes
23
- * @return {?Array<Required<LH.Config.PassJson>>}
24
- */
25
- static augmentPassesWithDefaults(passes: LH.Config['passes']): Array<Required<LH.Config.PassJson>> | null;
26
- /**
27
- * Observed throttling methods (devtools/provided) require at least 5s of quiet for the metrics to
28
- * be computed. This method adjusts the quiet thresholds to the required minimums if necessary.
29
- * @param {LH.Config.Settings} settings
30
- * @param {?Array<Required<LH.Config.PassJson>>} passes
31
- */
32
- static adjustDefaultPassForThrottling(settings: LH.Config.Settings, passes: Array<Required<LH.Config.PassJson>> | null): void;
33
- /**
34
- * Filter out any unrequested items from the config, based on requested categories or audits.
35
- * @param {LegacyResolvedConfig} config
36
- */
37
- static filterConfigIfNeeded(config: LegacyResolvedConfig): void;
38
- /**
39
- * Filter out any unrequested categories or audits from the categories object.
40
- * @param {LegacyResolvedConfig['categories']} oldCategories
41
- * @param {LH.Config.Settings} settings
42
- * @return {{categories: LegacyResolvedConfig['categories'], requestedAuditNames: Set<string>}}
43
- */
44
- static filterCategoriesAndAudits(oldCategories: LegacyResolvedConfig['categories'], settings: LH.Config.Settings): {
45
- categories: LegacyResolvedConfig['categories'];
46
- requestedAuditNames: Set<string>;
47
- };
48
- /**
49
- * From some requested audits, return names of all required and optional artifacts
50
- * @param {LegacyResolvedConfig['audits']} audits
51
- * @return {Set<string>}
52
- */
53
- static getGatherersRequestedByAudits(audits: LegacyResolvedConfig['audits']): Set<string>;
54
- /**
55
- * Filters to only requested passes and gatherers, returning a new passes array.
56
- * @param {LegacyResolvedConfig['passes']} passes
57
- * @param {Set<string>} requestedGatherers
58
- * @return {LegacyResolvedConfig['passes']}
59
- */
60
- static generatePassesNeededByGatherers(passes: LegacyResolvedConfig['passes'], requestedGatherers: Set<string>): LegacyResolvedConfig['passes'];
61
- /**
62
- * Take an array of audits and audit paths and require any paths (possibly
63
- * relative to the optional `configDir`) using `resolveModulePath`,
64
- * leaving only an array of AuditDefns.
65
- * @param {LH.Config['audits']} audits
66
- * @param {string=} configDir
67
- * @return {Promise<LegacyResolvedConfig['audits']>}
68
- */
69
- static requireAudits(audits: LH.Config['audits'], configDir?: string | undefined): Promise<LegacyResolvedConfig['audits']>;
70
- /**
71
- * Takes an array of passes with every property now initialized except the
72
- * gatherers and requires them, (relative to the optional `configDir` if
73
- * provided) using `resolveModulePath`, returning an array of full Passes.
74
- * @param {?Array<Required<LH.Config.PassJson>>} passes
75
- * @param {string=} configDir
76
- * @return {Promise<LegacyResolvedConfig['passes']>}
77
- */
78
- static requireGatherers(passes: Array<Required<LH.Config.PassJson>> | null, configDir?: string | undefined): Promise<LegacyResolvedConfig['passes']>;
79
- /**
80
- * @deprecated `LegacyResolvedConfig.fromJson` should be used instead.
81
- * @constructor
82
- * @param {LH.Config} config
83
- * @param {{settings: LH.Config.Settings, passes: ?LH.Config.Pass[], audits: ?LH.Config.AuditDefn[]}} opts
84
- */
85
- constructor(config: LH.Config, opts: {
86
- settings: LH.Config.Settings;
87
- passes: LH.Config.Pass[] | null;
88
- audits: LH.Config.AuditDefn[] | null;
89
- });
90
- /** @type {LH.Config.Settings} */
91
- settings: LH.Config.Settings;
92
- /** @type {?Array<LH.Config.Pass>} */
93
- passes: Array<LH.Config.Pass> | null;
94
- /** @type {?Array<LH.Config.AuditDefn>} */
95
- audits: Array<LH.Config.AuditDefn> | null;
96
- /** @type {?Record<string, LH.Config.Category>} */
97
- categories: Record<string, LH.Config.Category> | null;
98
- /** @type {?Record<string, LH.Config.Group>} */
99
- groups: Record<string, LH.Config.Group> | null;
100
- /**
101
- * Provides a cleaned-up, stringified version of this config. Gatherer and
102
- * Audit `implementation` and `instance` do not survive this process.
103
- * @return {string}
104
- */
105
- getPrintString(): string;
106
- }
107
- //# sourceMappingURL=config.d.ts.map