lighthouse 13.0.3 → 13.2.0

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 (139) hide show
  1. package/CONTRIBUTING.md +1 -1
  2. package/cli/bin.js +5 -0
  3. package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +10 -10
  4. package/cli/test/smokehouse/config/exclusions.js +44 -0
  5. package/cli/test/smokehouse/frontends/smokehouse-bin.js +5 -4
  6. package/cli/test/smokehouse/lighthouse-runners/devtools-mcp.d.ts +14 -0
  7. package/cli/test/smokehouse/lighthouse-runners/devtools-mcp.js +141 -0
  8. package/core/audits/accessibility/autocomplete-valid.d.ts +10 -0
  9. package/core/audits/accessibility/autocomplete-valid.js +44 -0
  10. package/core/audits/accessibility/presentation-role-conflict.d.ts +10 -0
  11. package/core/audits/accessibility/presentation-role-conflict.js +46 -0
  12. package/core/audits/accessibility/svg-img-alt.d.ts +10 -0
  13. package/core/audits/accessibility/svg-img-alt.js +44 -0
  14. package/core/audits/agentic/agent-accessibility-tree.d.ts +19 -0
  15. package/core/audits/agentic/agent-accessibility-tree.js +115 -0
  16. package/core/audits/agentic/llms-txt.d.ts +20 -0
  17. package/core/audits/agentic/llms-txt.js +111 -0
  18. package/core/audits/baseline.d.ts +25 -0
  19. package/core/audits/baseline.js +190 -0
  20. package/core/audits/insights/insight-audit.d.ts +2 -2
  21. package/core/audits/insights/insight-audit.js +16 -6
  22. package/core/audits/layout-shifts.js +1 -1
  23. package/core/audits/server-response-time.js +3 -3
  24. package/core/audits/webmcp-form-coverage.d.ts +16 -0
  25. package/core/audits/webmcp-form-coverage.js +90 -0
  26. package/core/audits/webmcp-registered-tools.d.ts +21 -0
  27. package/core/audits/webmcp-registered-tools.js +149 -0
  28. package/core/audits/webmcp-schema-validity.d.ts +22 -0
  29. package/core/audits/webmcp-schema-validity.js +141 -0
  30. package/core/computed/document-urls.js +4 -2
  31. package/core/computed/main-resource.js +5 -3
  32. package/core/computed/metrics/lantern-metric.js +4 -4
  33. package/core/computed/metrics/lcp-breakdown.js +1 -1
  34. package/core/computed/metrics/time-to-first-byte.js +1 -1
  35. package/core/computed/navigation-insights.js +2 -1
  36. package/core/computed/network-analysis.js +3 -1
  37. package/core/config/agentic-browsing-config.d.ts +12 -0
  38. package/core/config/agentic-browsing-config.js +73 -0
  39. package/core/config/default-config.js +8 -0
  40. package/core/gather/driver/wait-for-condition.js +11 -1
  41. package/core/gather/gatherers/accessibility.js +5 -1
  42. package/core/gather/gatherers/agentic/llms-txt.d.ts +10 -0
  43. package/core/gather/gatherers/agentic/llms-txt.js +28 -0
  44. package/core/gather/gatherers/inputs.js +2 -0
  45. package/core/gather/gatherers/meta-elements.js +1 -1
  46. package/core/gather/gatherers/trace-elements.js +1 -1
  47. package/core/gather/gatherers/trace.js +3 -0
  48. package/core/gather/gatherers/webmcp-schema.d.ts +25 -0
  49. package/core/gather/gatherers/webmcp-schema.js +105 -0
  50. package/core/gather/gatherers/webmcp.d.ts +58 -0
  51. package/core/gather/gatherers/webmcp.js +159 -0
  52. package/core/index.d.ts +1 -0
  53. package/core/index.js +1 -0
  54. package/core/lib/baseline/web-features-metadata.json +3 -0
  55. package/core/lib/cdt/generated/SourceMap.js +2 -2
  56. package/core/lib/deprecations-strings.d.ts +169 -89
  57. package/core/lib/deprecations-strings.js +119 -24
  58. package/core/lib/navigation-error.js +5 -2
  59. package/core/lib/network-recorder.js +2 -1
  60. package/core/lib/page-functions.d.ts +3 -3
  61. package/core/lib/page-functions.js +11 -4
  62. package/core/lib/tracehouse/trace-processor.d.ts +5 -4
  63. package/core/lib/tracehouse/trace-processor.js +85 -19
  64. package/core/runner.js +3 -0
  65. package/core/scoring.d.ts +25 -0
  66. package/dist/report/bundle.esm.js +31 -3
  67. package/dist/report/flow.js +32 -4
  68. package/dist/report/standalone.js +32 -4
  69. package/flow-report/src/summary/category.tsx +1 -1
  70. package/package.json +12 -11
  71. package/report/assets/styles.css +28 -0
  72. package/report/renderer/category-renderer.js +1 -1
  73. package/report/renderer/components.js +1 -1
  74. package/report/renderer/details-renderer.d.ts +5 -0
  75. package/report/renderer/details-renderer.js +16 -0
  76. package/report/renderer/report-utils.d.ts +2 -1
  77. package/report/renderer/report-utils.js +7 -2
  78. package/report/types/report-renderer.d.ts +1 -1
  79. package/report/types/report-result.d.ts +1 -1
  80. package/shared/localization/locales/ar-XB.json +72 -36
  81. package/shared/localization/locales/ar.json +72 -36
  82. package/shared/localization/locales/bg.json +72 -36
  83. package/shared/localization/locales/ca.json +72 -36
  84. package/shared/localization/locales/cs.json +72 -36
  85. package/shared/localization/locales/da.json +74 -38
  86. package/shared/localization/locales/de.json +72 -36
  87. package/shared/localization/locales/el.json +73 -37
  88. package/shared/localization/locales/en-GB.json +74 -38
  89. package/shared/localization/locales/en-US.json +257 -17
  90. package/shared/localization/locales/en-XL.json +257 -17
  91. package/shared/localization/locales/es-419.json +72 -36
  92. package/shared/localization/locales/es.json +73 -37
  93. package/shared/localization/locales/fi.json +72 -36
  94. package/shared/localization/locales/fil.json +74 -38
  95. package/shared/localization/locales/fr.json +162 -126
  96. package/shared/localization/locales/he.json +74 -38
  97. package/shared/localization/locales/hi.json +73 -37
  98. package/shared/localization/locales/hr.json +72 -36
  99. package/shared/localization/locales/hu.json +73 -37
  100. package/shared/localization/locales/id.json +74 -38
  101. package/shared/localization/locales/it.json +72 -36
  102. package/shared/localization/locales/ja.json +72 -36
  103. package/shared/localization/locales/ko.json +72 -36
  104. package/shared/localization/locales/lt.json +72 -36
  105. package/shared/localization/locales/lv.json +72 -36
  106. package/shared/localization/locales/nl.json +73 -37
  107. package/shared/localization/locales/no.json +72 -36
  108. package/shared/localization/locales/pl.json +72 -36
  109. package/shared/localization/locales/pt-PT.json +72 -36
  110. package/shared/localization/locales/pt.json +74 -38
  111. package/shared/localization/locales/ro.json +72 -36
  112. package/shared/localization/locales/ru.json +72 -36
  113. package/shared/localization/locales/sk.json +72 -36
  114. package/shared/localization/locales/sl.json +72 -36
  115. package/shared/localization/locales/sr-Latn.json +73 -37
  116. package/shared/localization/locales/sr.json +73 -37
  117. package/shared/localization/locales/sv.json +75 -39
  118. package/shared/localization/locales/ta.json +73 -37
  119. package/shared/localization/locales/te.json +72 -36
  120. package/shared/localization/locales/th.json +73 -37
  121. package/shared/localization/locales/tr.json +72 -36
  122. package/shared/localization/locales/uk.json +72 -36
  123. package/shared/localization/locales/vi.json +74 -38
  124. package/shared/localization/locales/zh-HK.json +72 -36
  125. package/shared/localization/locales/zh-TW.json +74 -38
  126. package/shared/localization/locales/zh.json +75 -39
  127. package/tsconfig.json +2 -0
  128. package/types/artifacts.d.ts +66 -30
  129. package/types/audit.d.ts +1 -1
  130. package/types/config.d.ts +2 -1
  131. package/types/gatherer.d.ts +1 -1
  132. package/types/lhr/audit-details.d.ts +10 -4
  133. package/types/lhr/flow-result.d.ts +1 -1
  134. package/types/lhr/lhr.d.ts +12 -1
  135. package/types/lhr/treemap.d.ts +1 -1
  136. package/types/protocol.d.ts +1 -1
  137. package/types/puppeteer.d.ts +1 -1
  138. package/types/user-flow.d.ts +1 -1
  139. package/types/utility-types.d.ts +1 -1
package/types/config.d.ts CHANGED
@@ -28,7 +28,7 @@ interface Config {
28
28
  plugins?: Array<string>;
29
29
  }
30
30
 
31
- declare module Config {
31
+ declare namespace Config {
32
32
  /**
33
33
  * The normalized and fully resolved config.
34
34
  */
@@ -59,6 +59,7 @@ declare module Config {
59
59
  description?: string | IcuMessage;
60
60
  manualDescription?: string | IcuMessage;
61
61
  supportedModes?: Gatherer.GatherMode[];
62
+ categoryScoreDisplayMode?: Result.CategoryScoreDisplayMode;
62
63
  }
63
64
 
64
65
  interface GroupJson {
@@ -22,7 +22,7 @@ import * as Lantern from '../core/lib/lantern/lantern.js';
22
22
  type CrdpEvents = CrdpMappings.Events;
23
23
  type CrdpCommands = CrdpMappings.Commands;
24
24
 
25
- declare module Gatherer {
25
+ declare namespace Gatherer {
26
26
  /** The Lighthouse wrapper around a raw CDP session. */
27
27
  interface ProtocolSession {
28
28
  setTargetInfo(targetInfo: Crdp.Target.TargetInfo): void;
@@ -26,7 +26,7 @@ type Details =
26
26
  Details.Table;
27
27
 
28
28
  // Details namespace.
29
- declare module Details {
29
+ declare namespace Details {
30
30
  type NetworkNode = {
31
31
  [id: string]: {
32
32
  url: string;
@@ -97,7 +97,7 @@ declare module Details {
97
97
  // NOTE: any `Details` type *should* be usable in `items`, but check
98
98
  // styles/report-ui-features are good before adding.
99
99
  type ListableDetail = Table | Checklist | NetworkTree | NodeValue | TextValue | DebugData;
100
-
100
+
101
101
  interface ListSectionItem {
102
102
  type: 'list-section';
103
103
  title?: IcuMessage | string;
@@ -195,10 +195,10 @@ declare module Details {
195
195
  }
196
196
 
197
197
  /** String enum of possible types of values found within table items. */
198
- type ItemValueType = 'bytes' | 'code' | 'link' | 'ms' | 'multi' | 'node' | 'source-location' | 'numeric' | 'text' | 'thumbnail' | 'timespanMs' | 'url';
198
+ type ItemValueType = 'bytes' | 'code' | 'link' | 'ms' | 'multi' | 'node' | 'source-location' | 'numeric' | 'text' | 'thumbnail' | 'timespanMs' | 'url' | 'baseline-status';
199
199
 
200
200
  /** Possible types of values found within table items. */
201
- type ItemValue = string | number | boolean | DebugData | NodeValue | SourceLocationValue | LinkValue | UrlValue | CodeValue | NumericValue | TextValue | IcuMessage | TableSubItems;
201
+ type ItemValue = string | number | boolean | DebugData | NodeValue | SourceLocationValue | LinkValue | UrlValue | CodeValue | NumericValue | TextValue | IcuMessage | TableSubItems | BaselineStatusValue;
202
202
 
203
203
  interface TableColumnHeading {
204
204
  /**
@@ -363,6 +363,12 @@ declare module Details {
363
363
  type: 'text',
364
364
  value: IcuMessage | string,
365
365
  }
366
+
367
+ interface BaselineStatusValue {
368
+ type: 'baseline-status',
369
+ status: 'high' | 'low' | 'limited' | string,
370
+ displayString: IcuMessage | string,
371
+ }
366
372
  }
367
373
 
368
374
  export default Details;
@@ -6,7 +6,7 @@
6
6
 
7
7
  import Result from './lhr.js';
8
8
 
9
- declare module FlowResult {
9
+ declare namespace FlowResult {
10
10
  interface Step {
11
11
  /** Lighthouse report for this flow step. */
12
12
  lhr: Result;
@@ -70,7 +70,7 @@ interface Result {
70
70
  }
71
71
 
72
72
  // Result namespace
73
- declare module Result {
73
+ declare namespace Result {
74
74
  interface Environment {
75
75
  /** The user agent string of the version of Chrome used. */
76
76
  hostUserAgent: string;
@@ -97,6 +97,15 @@ declare module Result {
97
97
  gather?: boolean;
98
98
  }
99
99
 
100
+ interface CategoryScoreDisplayModes {
101
+ /** Scores of 0-1 (map to displayed scores of 0-100). */
102
+ GAUGE: 'gauge';
103
+ /** Display as a fraction (x/y). */
104
+ FRACTION: 'fraction';
105
+ }
106
+
107
+ type CategoryScoreDisplayMode = CategoryScoreDisplayModes[keyof CategoryScoreDisplayModes];
108
+
100
109
  interface Category {
101
110
  /** The string identifier of the category. */
102
111
  id: string;
@@ -112,6 +121,8 @@ declare module Result {
112
121
  auditRefs: AuditRef[];
113
122
  /** An array of all the modes supported by the category. */
114
123
  supportedModes?: Result.GatherMode[];
124
+ /** How to display the category score. */
125
+ categoryScoreDisplayMode?: CategoryScoreDisplayMode;
115
126
  }
116
127
 
117
128
  interface AuditRef {
@@ -7,7 +7,7 @@
7
7
  import {Result as AuditResult} from './audit-result.js';
8
8
  import {Locale} from './settings.js';
9
9
 
10
- declare module Treemap {
10
+ declare namespace Treemap {
11
11
  interface Options {
12
12
  lhr: {
13
13
  mainDocumentUrl?: string;
@@ -9,7 +9,7 @@ import {ProtocolMapping as CrdpMappings} from 'devtools-protocol/types/protocol-
9
9
  type CrdpEvents = CrdpMappings.Events;
10
10
  type CrdpCommands = CrdpMappings.Commands;
11
11
 
12
- declare module Protocol {
12
+ declare namespace Protocol {
13
13
  type TargetType = 'page' | 'iframe' | 'worker';
14
14
 
15
15
  /**
@@ -13,7 +13,7 @@ import * as puppeteerCore from 'puppeteer-core';
13
13
 
14
14
  type IfNotAny<T> = [T & 0] extends [1] ? never : T;
15
15
 
16
- declare module Puppeteer {
16
+ declare namespace Puppeteer {
17
17
  // @ts-ignore Puppeteer is an optional dependency. `IfNotAny` will handle the `any` type if it's not installed.
18
18
  export type Browser = puppeteerCore.Browser | IfNotAny<import('puppeteer').Browser>;
19
19
  // @ts-ignore Puppeteer is an optional dependency. `IfNotAny` will handle the `any` type if it's not installed.
@@ -9,7 +9,7 @@ import Config from './config.js';
9
9
  import {Flags} from './externs.js';
10
10
  import {Artifacts} from './artifacts.js';
11
11
 
12
- declare module UserFlow {
12
+ declare namespace UserFlow {
13
13
  export interface FlowArtifacts {
14
14
  gatherSteps: GatherStep[];
15
15
  name?: string;
@@ -4,7 +4,7 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
 
7
- declare module Util {
7
+ declare namespace Util {
8
8
  /** Make properties K in T optional. */
9
9
  type MakeOptional<T, K extends keyof T> = {
10
10
  [P in Exclude<keyof T, K>]: T[P]