lighthouse 13.5.0-dev.20261016 → 13.5.0-dev.20261020

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 (102) hide show
  1. package/.agents/skills/update-trace-engine/SKILL.md +154 -0
  2. package/cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +1 -1
  3. package/commitlint.config.js +1 -1
  4. package/core/audits/baseline.js +1 -1
  5. package/core/audits/insights/insight-audit.js +3 -2
  6. package/core/audits/script-treemap-data.js +12 -2
  7. package/core/computed/metrics/time-to-first-byte.js +5 -3
  8. package/core/computed/navigation-insights.js +3 -2
  9. package/core/computed/trace-engine-result.js +22 -4
  10. package/core/config/config-helpers.js +2 -3
  11. package/core/config/config.js +1 -2
  12. package/core/gather/base-artifacts.js +6 -0
  13. package/core/gather/gatherers/full-page-screenshot.js +2 -2
  14. package/core/gather/gatherers/inspector-issues.js +2 -0
  15. package/core/gather/gatherers/js-usage.js +2 -0
  16. package/core/gather/gatherers/scripts.d.ts +16 -3
  17. package/core/gather/gatherers/scripts.js +157 -14
  18. package/core/gather/gatherers/stylesheets.js +2 -0
  19. package/core/gather/gatherers/trace-elements.js +2 -1
  20. package/core/lib/cdt/Common.d.ts +1 -1
  21. package/core/lib/cdt/Common.js +2 -2
  22. package/core/lib/cdt/Platform.d.ts +7 -7
  23. package/core/lib/cdt/Platform.js +11 -8
  24. package/core/lib/cdt/SDK.d.ts +5 -1
  25. package/core/lib/cdt/SDK.js +4 -2
  26. package/core/lib/cdt/generated/ParsedURL.d.ts +0 -1
  27. package/core/lib/cdt/generated/ParsedURL.js +3 -9
  28. package/core/lib/cdt/generated/SourceMap.d.ts +24 -25
  29. package/core/lib/cdt/generated/SourceMap.js +7 -15
  30. package/core/lib/i18n/i18n.d.ts +0 -1
  31. package/core/lib/i18n/i18n.js +17 -11
  32. package/core/lib/legacy-javascript/legacy-javascript.d.ts +2 -2
  33. package/core/lib/legacy-javascript/legacy-javascript.js +1 -1
  34. package/core/lib/sentry.d.ts +1 -0
  35. package/core/lib/sentry.js +3 -0
  36. package/core/runner.js +2 -2
  37. package/dist/report/flow.js +4 -4
  38. package/package.json +16 -41
  39. package/report/generator/flow-report-assets.js +1 -3
  40. package/report/generator/report-assets.js +1 -2
  41. package/shared/esm-utils.d.ts +0 -8
  42. package/shared/esm-utils.js +0 -18
  43. package/shared/localization/format.js +1 -2
  44. package/shared/localization/locales/ar-XB.json +0 -6
  45. package/shared/localization/locales/ar.json +0 -6
  46. package/shared/localization/locales/bg.json +0 -6
  47. package/shared/localization/locales/ca.json +0 -6
  48. package/shared/localization/locales/cs.json +0 -6
  49. package/shared/localization/locales/da.json +0 -6
  50. package/shared/localization/locales/de.json +0 -6
  51. package/shared/localization/locales/el.json +0 -6
  52. package/shared/localization/locales/en-GB.json +0 -6
  53. package/shared/localization/locales/en-US.json +4 -7
  54. package/shared/localization/locales/en-XL.json +4 -7
  55. package/shared/localization/locales/es-419.json +22 -28
  56. package/shared/localization/locales/es.json +0 -6
  57. package/shared/localization/locales/fi.json +0 -6
  58. package/shared/localization/locales/fil.json +0 -6
  59. package/shared/localization/locales/fr.json +0 -6
  60. package/shared/localization/locales/he.json +127 -133
  61. package/shared/localization/locales/hi.json +0 -6
  62. package/shared/localization/locales/hr.json +0 -6
  63. package/shared/localization/locales/hu.json +0 -6
  64. package/shared/localization/locales/id.json +0 -6
  65. package/shared/localization/locales/it.json +0 -6
  66. package/shared/localization/locales/ja.json +115 -121
  67. package/shared/localization/locales/ko.json +2 -8
  68. package/shared/localization/locales/lt.json +0 -6
  69. package/shared/localization/locales/lv.json +0 -6
  70. package/shared/localization/locales/nl.json +0 -6
  71. package/shared/localization/locales/no.json +0 -6
  72. package/shared/localization/locales/pl.json +0 -6
  73. package/shared/localization/locales/pt-PT.json +0 -6
  74. package/shared/localization/locales/pt.json +0 -6
  75. package/shared/localization/locales/ro.json +3 -9
  76. package/shared/localization/locales/ru.json +3 -9
  77. package/shared/localization/locales/sk.json +0 -6
  78. package/shared/localization/locales/sl.json +0 -6
  79. package/shared/localization/locales/sr-Latn.json +0 -6
  80. package/shared/localization/locales/sr.json +0 -6
  81. package/shared/localization/locales/sv.json +0 -6
  82. package/shared/localization/locales/ta.json +0 -6
  83. package/shared/localization/locales/te.json +0 -6
  84. package/shared/localization/locales/th.json +0 -6
  85. package/shared/localization/locales/tr.json +0 -6
  86. package/shared/localization/locales/uk.json +0 -6
  87. package/shared/localization/locales/vi.json +0 -6
  88. package/shared/localization/locales/zh-HK.json +18 -24
  89. package/shared/localization/locales/zh-TW.json +60 -66
  90. package/shared/localization/locales/zh.json +2 -8
  91. package/shared/root.js +1 -3
  92. package/tsconfig.json +0 -2
  93. package/types/artifacts.d.ts +8 -1
  94. package/types/internal/test.d.ts +1 -0
  95. package/core/lib/cdt/package.json +0 -4
  96. package/eslint-local-rules.d.cts +0 -9
  97. package/eslint.config.mjs +0 -242
  98. package/third-party/esbuild-plugins-polyfills/LICENSE +0 -3
  99. package/third-party/esbuild-plugins-polyfills/README.md +0 -7
  100. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.d.ts +0 -9
  101. package/third-party/esbuild-plugins-polyfills/esbuild-polyfills.js +0 -129
  102. package/types/internal/lookup-closest-locale.d.ts +0 -13
package/eslint.config.mjs DELETED
@@ -1,242 +0,0 @@
1
- import path from 'node:path';
2
- import {fileURLToPath} from 'node:url';
3
-
4
- import localRules from 'eslint-plugin-local-rules';
5
- import _import from 'eslint-plugin-import';
6
- import {fixupPluginRules} from '@eslint/compat';
7
- import globals from 'globals';
8
- import tsParser from '@typescript-eslint/parser';
9
- import js from '@eslint/js';
10
- import {FlatCompat} from '@eslint/eslintrc';
11
-
12
- const __filename = fileURLToPath(import.meta.url);
13
- const __dirname = path.dirname(__filename);
14
- const compat = new FlatCompat({
15
- baseDirectory: __dirname,
16
- recommendedConfig: js.configs.recommended,
17
- allConfig: js.configs.all,
18
- });
19
-
20
- // See https://eslint.org/docs/latest/use/configure/configuration-files
21
- export default [{
22
- files: [
23
- '**/*.cjs',
24
- '**/*.js',
25
- '**/*.mjs',
26
- '**/*.ts',
27
- '**/*.tsx',
28
- ],
29
- }, {
30
- // Global ignores.
31
- ignores: [
32
- '.cz-config.js',
33
- '**/.tmp',
34
- '**/*.d.cts', // ignore d.ts files until we can properly lint them
35
- '**/*.d.ts',
36
- '**/dist',
37
- '**/fixtures/**',
38
- '**/node_modules/**',
39
- '**/source-maps/**',
40
- '**/third_party/**',
41
- '**/third-party/**',
42
- 'build/test/page-functions-test-case*out*.js',
43
- 'core/scripts/legacy-javascript/variants/**',
44
- 'coverage/**',
45
- ],
46
- }, ...compat.extends('eslint:recommended', 'google'), {
47
- plugins: {
48
- 'local-rules': localRules,
49
- 'import': fixupPluginRules(_import),
50
- },
51
-
52
- languageOptions: {
53
- globals: {
54
- ...globals.node,
55
- },
56
-
57
- parser: tsParser,
58
- ecmaVersion: 2020,
59
- sourceType: 'module',
60
-
61
- parserOptions: {
62
- ecmaFeatures: {
63
- globalReturn: true,
64
- jsx: false,
65
- },
66
- },
67
- },
68
-
69
- rules: {
70
- 'import/order': [2, {
71
- 'groups': ['builtin', 'external', ['sibling', 'parent'], 'index', 'object', 'type'],
72
- 'newlines-between': 'always',
73
- }],
74
-
75
- 'import/group-exports': 2,
76
- 'import/exports-last': 2,
77
- 'eqeqeq': 2,
78
- 'no-console': 2,
79
-
80
- 'indent': [2, 2, {
81
- SwitchCase: 1,
82
- VariableDeclarator: 2,
83
-
84
- CallExpression: {
85
- arguments: 'off',
86
- },
87
-
88
- MemberExpression: 'off',
89
-
90
- FunctionExpression: {
91
- body: 1,
92
- parameters: 2,
93
- },
94
-
95
- ignoredNodes: [
96
- 'ConditionalExpression > :matches(.consequent, .alternate)',
97
- 'VariableDeclarator > ArrowFunctionExpression > :expression.body',
98
- 'CallExpression > ArrowFunctionExpression > :expression.body',
99
- ],
100
- }],
101
-
102
- 'no-floating-decimal': 2,
103
-
104
- 'max-len': [2, 100, {
105
- ignorePattern: 'readJson\\(|^import ',
106
- ignoreComments: true,
107
- ignoreUrls: true,
108
- tabWidth: 2,
109
- }],
110
-
111
- 'no-empty': [2, {
112
- allowEmptyCatch: true,
113
- }],
114
-
115
- 'no-implicit-coercion': [2, {
116
- boolean: false,
117
- number: true,
118
- string: true,
119
- }],
120
-
121
- 'no-unused-expressions': [2, {
122
- allowShortCircuit: true,
123
- allowTernary: false,
124
- }],
125
-
126
- 'no-unused-vars': [2, {
127
- vars: 'all',
128
- args: 'after-used',
129
- caughtErrors: 'none', // TODO: remove for new "all" default.
130
- argsIgnorePattern: '(^reject$|^_+$)',
131
- varsIgnorePattern: '(^_$|^LH$|^Lantern$|^TraceEngine$|^Protocol$)',
132
- }],
133
-
134
- 'no-cond-assign': 2,
135
- 'space-infix-ops': 2,
136
- 'strict': [2, 'global'],
137
- 'prefer-const': 2,
138
- 'curly': [2, 'multi-line'],
139
-
140
- 'comma-dangle': [2, {
141
- arrays: 'always-multiline',
142
- objects: 'always-multiline',
143
- imports: 'always-multiline',
144
- exports: 'always-multiline',
145
- functions: 'never',
146
- }],
147
-
148
- 'operator-linebreak': ['error', 'after', {
149
- overrides: {
150
- '?': 'ignore',
151
- ':': 'ignore',
152
- },
153
- }],
154
-
155
- 'local-rules/require-file-extension': 2,
156
- 'require-jsdoc': 0,
157
- 'valid-jsdoc': 0,
158
- 'arrow-parens': 0,
159
- },
160
- }, {
161
- files: ['cli/test/smokehouse/test-definitions/**'],
162
-
163
- rules: {
164
- 'max-len': 0,
165
- },
166
- }, {
167
- files: [
168
- '**/build/**',
169
- '**/scripts/**',
170
- '**/test/**',
171
- ],
172
-
173
- rules: {
174
- 'no-console': 0,
175
- },
176
- }, {
177
- files: [
178
- 'docs/recipes/auth/**',
179
- ],
180
-
181
- rules: {
182
- 'new-cap': 0,
183
- 'no-console': 0,
184
- 'no-unused-vars': 0,
185
- },
186
- }, {
187
- files: [
188
- '**/test/**',
189
- 'docs/recipes/**',
190
- ],
191
-
192
- languageOptions: {
193
- globals: {
194
- ...globals.jest,
195
- ...globals.mocha,
196
- },
197
- },
198
- }, {
199
- files: [
200
- 'clients/**',
201
- 'core/gather/gatherers/**',
202
- 'docs/recipes/auth/**',
203
- 'flow-report/**',
204
- 'report/**',
205
- 'treemap/**',
206
- 'viewer/**',
207
- ],
208
- ignores: [
209
- 'report/generator/**',
210
- 'report/test/generator/**',
211
- ],
212
-
213
- languageOptions: {
214
- globals: {
215
- ...globals.browser,
216
- },
217
- },
218
- }, {
219
- files: [
220
- 'clients/**',
221
- ],
222
-
223
- languageOptions: {
224
- globals: {
225
- chrome: true,
226
- __lighthouse: true,
227
- },
228
- },
229
- }, {
230
- files: ['flow-report/**'],
231
-
232
- languageOptions: {
233
- globals: {
234
- ...globals.browser,
235
- ...globals.node,
236
- },
237
- },
238
-
239
- rules: {
240
- 'no-undef': 'off',
241
- },
242
- }];
@@ -1,3 +0,0 @@
1
- MIT
2
-
3
- https://github.com/remorses/esbuild-plugins/blob/d757c3bf5dff37a754d254168d4a3d88611e8175/package.json#L37
@@ -1,7 +0,0 @@
1
- # @esbuild-plugins/node-modules-polyfill
2
-
3
- This is `@esbuild-plugins/node-modules-polyfill`, with the following changes:
4
-
5
- - using a better library for polyfills as proposed by this PR ... https://github.com/remorses/esbuild-plugins/pull/19
6
- - ...but there are a couple correctness changes on top of the above PR, as described here: https://github.com/remorses/esbuild-plugins/pull/19#discussion_r990493080 (the PR has landed but is still broken for our use case)
7
- - File converted from TS to JS
@@ -1,9 +0,0 @@
1
- export function nodeModulesPolyfillPlugin(options?: {}): {
2
- name: any;
3
- setup: ({ onLoad, onResolve, initialOptions }: {
4
- onLoad: any;
5
- onResolve: any;
6
- initialOptions: any;
7
- }) => void;
8
- };
9
- //# sourceMappingURL=esbuild-polyfills.d.ts.map
@@ -1,129 +0,0 @@
1
- // @ts-nocheck
2
- /* eslint-disable */
3
-
4
- import path from 'path';
5
-
6
- import escapeStringRegexp from 'escape-string-regexp';
7
- import {getModules as builtinsPolyfills} from 'rollup-plugin-polyfill-node/dist/modules.js';
8
- import polyfillLib from 'rollup-plugin-polyfill-node/dist/polyfills.js';
9
-
10
- const NAME = 'node-modules-polyfills';
11
- const NAMESPACE = NAME;
12
-
13
- function removeEndingSlash(importee) {
14
- if (importee && importee.slice(-1) === '/') {
15
- importee = importee.slice(0, -1);
16
- }
17
- return importee;
18
- }
19
-
20
- function nodeModulesPolyfillPlugin(
21
- options = {}
22
- ) {
23
- const {namespace = NAMESPACE, name = NAME} = options;
24
- if (namespace.endsWith('commonjs')) {
25
- throw new Error(`namespace ${namespace} must not end with commonjs`);
26
- }
27
- // this namespace is needed to make ES modules expose their default export to require: require('assert') will give you import('assert').default
28
- const commonjsNamespace = namespace + '-commonjs';
29
- const polyfilledBuiltins = builtinsPolyfills();
30
- const polyfilledBuiltinsNames = [...polyfilledBuiltins.keys()];
31
-
32
- return {
33
- name,
34
- setup: function setup({onLoad, onResolve, initialOptions}) {
35
- // polyfills contain global keyword, it must be defined
36
- if (initialOptions?.define && !initialOptions.define?.global) {
37
- initialOptions.define['global'] = 'globalThis';
38
- } else if (!initialOptions?.define) {
39
- initialOptions.define = {global: 'globalThis'};
40
- }
41
-
42
- // TODO these polyfill module cannot import anything, is that ok?
43
- async function loader(
44
- args
45
- ) {
46
- try {
47
- const isCommonjs = args.namespace.endsWith('commonjs');
48
-
49
- const key = removeEndingSlash(args.path);
50
- const contents = polyfilledBuiltins.get(key) || polyfillLib[key + '.js'];
51
- const resolveDir = path.dirname(key);
52
-
53
- if (isCommonjs) {
54
- return {
55
- loader: 'js',
56
- contents: commonJsTemplate({
57
- importPath: args.path,
58
- }),
59
- resolveDir,
60
- };
61
- }
62
- return {
63
- loader: 'js',
64
- contents,
65
- resolveDir,
66
- };
67
- } catch (e) {
68
- console.error('node-modules-polyfill', e);
69
- return {
70
- contents: `export {}`,
71
- loader: 'js',
72
- };
73
- }
74
- }
75
- onLoad({filter: /.*/, namespace}, loader);
76
- onLoad({filter: /.*/, namespace: commonjsNamespace}, loader);
77
- const filter = new RegExp(
78
- polyfilledBuiltinsNames.map(escapeStringRegexp).join('|') // TODO builtins could end with slash, keep in mind in regex
79
- );
80
- async function resolver(args) {
81
- const ignoreRequire = args.namespace === commonjsNamespace;
82
-
83
- let key;
84
- if (args.path.startsWith('\0polyfill-node.')) {
85
- key = args.path.replace('\0polyfill-node.', '');
86
- } else {
87
- if (args.path.startsWith('.')) {
88
- key = path.join(path.dirname(args.importer), args.path);
89
- } else {
90
- key = args.path;
91
- }
92
- }
93
-
94
- if (!polyfilledBuiltins.has(key) && !polyfillLib[key + '.js']) {
95
- return;
96
- }
97
-
98
- const isCommonjs =
99
- !ignoreRequire && args.kind === 'require-call';
100
-
101
- return {
102
- namespace: isCommonjs ? commonjsNamespace : namespace,
103
- path: key,
104
- };
105
- }
106
- onResolve({filter}, resolver);
107
- onResolve({filter: /.*/, namespace}, resolver);
108
- },
109
- };
110
- }
111
-
112
- function commonJsTemplate({importPath}) {
113
- return `
114
- const polyfill = require('${importPath}')
115
-
116
- if (polyfill && polyfill.default) {
117
- module.exports = polyfill.default
118
- for (let k in polyfill) {
119
- module.exports[k] = polyfill[k]
120
- }
121
- } else if (polyfill) {
122
- module.exports = polyfill
123
- }
124
-
125
-
126
- `;
127
- }
128
-
129
- export {nodeModulesPolyfillPlugin};
@@ -1,13 +0,0 @@
1
- /**
2
- * @license
3
- * Copyright 2018 Google LLC
4
- * SPDX-License-Identifier: Apache-2.0
5
- */
6
-
7
- type Locale = import('../lhr/settings.js').Locale;
8
-
9
- declare module 'lookup-closest-locale' {
10
- function lookupClosestLocale(locale: string[]|string|undefined, available: Record<Locale, any>): Locale|undefined;
11
-
12
- export = lookupClosestLocale;
13
- }