lighthouse 13.4.0 → 13.4.1

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.
@@ -0,0 +1,25 @@
1
+ ---
2
+ name: lighthouse-verification
3
+ description: Instructions for how to validate changes made to Lighthouse. Must invoke when making changes to Lighthouse.
4
+ ---
5
+
6
+ # Lighthouse verification
7
+
8
+ Run a subset of the unit tests like this:
9
+
10
+ ```
11
+ yarn mocha test/files/to/run
12
+ ```
13
+
14
+ Don't run "yarn unit" - it takes too long.
15
+
16
+ Run typechecking and linter:
17
+
18
+ ```
19
+ yarn type-check
20
+ yarn lint --fix
21
+ ```
22
+
23
+ Make sure to run some unit tests and the type-checker / linter after making changes.
24
+
25
+ Always run `yarn update:sample-json` after making any change.
@@ -13,8 +13,9 @@ const UIStrings = {
13
13
  /** Title shown when one or more agent accessibility checks fail. */
14
14
  failureTitle: 'Accessibility tree is not well-formed',
15
15
  /** Description of a Lighthouse audit that tells the user *why* they need a well-formed accessibility tree. */
16
- description: 'A well-formed [accessibility tree](http://goo.gle/lighthouse-agentic-a11y) helps AI agents to ' +
17
- 'navigate and interact with the page.',
16
+ description: 'A well-formed ' +
17
+ '[accessibility tree](https://developer.chrome.com/docs/lighthouse/agentic-browsing/accessibility-for-agents) ' +
18
+ 'helps AI agents to navigate and interact with the page.',
18
19
  /** Label of a table column that identifies the accessibility rule that failed. */
19
20
  columnRule: 'Failing Rule',
20
21
  /** Label of a table column that identifies the HTML element that failed the rule. */
@@ -11,6 +11,7 @@ export namespace UIStrings {
11
11
  let failureTitle: string;
12
12
  let description: string;
13
13
  let displayValueHttpBadCode: string;
14
+ let explanationWithError: string;
14
15
  let explanation: string;
15
16
  let missingH1: string;
16
17
  let tooShort: string;
@@ -19,12 +19,18 @@ const UIStrings = {
19
19
  description: 'If your llms.txt file does not follow recommendations, ' +
20
20
  'large language models may not be able to ' +
21
21
  'understand how you want your website to be crawled or used for training. The ' +
22
- '[llms.txt](https://llmstxt.org/) file should be a Markdown file containing at least one H1 header.',
22
+ '[llms.txt](https://llmstxt.org/) file should be a Markdown file containing at least one H1 header. ' +
23
+ '[Learn more about the llms.txt audit](https://developer.chrome.com/docs/lighthouse/agentic-browsing/llms-txt).',
23
24
  /**
24
25
  * @description Label for the audit identifying that the request failed with a specific HTTP status code.
25
26
  * @example {500} statusCode
26
27
  * */
27
28
  displayValueHttpBadCode: 'Failed with HTTP status {statusCode}',
29
+ /**
30
+ * @description Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the llms.txt file for the site. Note: "llms.txt" is a canonical filename and should not be translated.
31
+ * @example {Timed out fetching resource} error
32
+ * */
33
+ explanationWithError: 'Fetch of llms.txt failed: {error}',
28
34
  /** Explanatory message stating that there was a failure in an audit caused by Lighthouse not being able to download the llms.txt file for the site. Note: "llms.txt" is a canonical filename and should not be translated. */
29
35
  explanation: 'Fetch of llms.txt failed',
30
36
  /** Message indicating that the file is missing a required H1 header. */
@@ -59,8 +65,16 @@ class LlmsTxt extends Audit {
59
65
  const {
60
66
  status,
61
67
  content,
68
+ errorMessage,
62
69
  } = artifacts.LlmsTxt;
63
70
 
71
+ if (errorMessage) {
72
+ return {
73
+ score: 0,
74
+ explanation: str_(UIStrings.explanationWithError, {error: errorMessage}),
75
+ };
76
+ }
77
+
64
78
  if (!status) {
65
79
  return {
66
80
  score: 0,