lighthouse 9.5.0-dev.20220606 → 9.5.0-dev.20220609

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse",
3
- "version": "9.5.0-dev.20220606",
3
+ "version": "9.5.0-dev.20220609",
4
4
  "description": "Automated auditing, performance metrics, and best practices for the web.",
5
5
  "main": "./lighthouse-core/index.js",
6
6
  "bin": {
@@ -125,8 +125,8 @@
125
125
  "@types/ws": "^7.0.0",
126
126
  "@types/yargs": "^17.0.8",
127
127
  "@types/yargs-parser": "^20.2.1",
128
- "@typescript-eslint/eslint-plugin": "^5.6.0",
129
- "@typescript-eslint/parser": "^5.6.0",
128
+ "@typescript-eslint/eslint-plugin": "^5.26.0",
129
+ "@typescript-eslint/parser": "^5.26.0",
130
130
  "acorn": "^8.5.0",
131
131
  "angular": "^1.7.4",
132
132
  "archiver": "^3.0.0",
@@ -175,7 +175,7 @@
175
175
  "terser": "^5.3.8",
176
176
  "ts-jest": "^27.0.4",
177
177
  "typed-query-selector": "^2.6.1",
178
- "typescript": "^4.5.2",
178
+ "typescript": "^4.7.2",
179
179
  "wait-for-expect": "^3.0.2",
180
180
  "webtreemap-cdt": "^3.2.1"
181
181
  },
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "../../tsconfig-base.json",
3
3
  "compilerOptions": {
4
- "outDir": "../../.tmp/tsbuildinfo/report/generator",
5
-
6
4
  // Limit defs to base JS and DOM (for URL: https://github.com/DefinitelyTyped/DefinitelyTyped/issues/34960).
7
5
  "lib": ["es2020", "dom"],
8
6
  // Only include `@types/node` from node_modules/.
@@ -57,8 +57,8 @@ export class SwapLocaleFeature {
57
57
  const optionLocaleDisplay = new Intl.DisplayNames([locale], {type: 'language'});
58
58
 
59
59
  const optionLocaleName = optionLocaleDisplay.of(locale);
60
- const currentLocaleName = currentLocaleDisplay.of(locale);
61
- if (optionLocaleName !== currentLocaleName) {
60
+ const currentLocaleName = currentLocaleDisplay.of(locale) || locale;
61
+ if (optionLocaleName && optionLocaleName !== currentLocaleName) {
62
62
  optionEl.textContent = `${optionLocaleName} – ${currentLocaleName}`;
63
63
  } else {
64
64
  optionEl.textContent = currentLocaleName;
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "../tsconfig-base.json",
3
3
  "compilerOptions": {
4
- "outDir": "../.tmp/tsbuildinfo/report",
5
-
6
4
  // Limit to base JS and DOM defs.
7
5
  "lib": ["es2020", "dom", "dom.iterable"],
8
6
  // Don't include any types from node_modules/.
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "../tsconfig-base.json",
3
3
  "compilerOptions": {
4
- "outDir": "../../.tmp/tsbuildinfo/shared/",
5
-
6
4
  // Limit defs to base JS.
7
5
  "lib": ["es2020"],
8
6
  // Only include `@types/node` from node_modules/.
@@ -3,8 +3,13 @@
3
3
  {
4
4
  "compilerOptions": {
5
5
  "composite": true,
6
+
7
+ // Set up incremental builds. All sub-projects emit under outDir, maintaining
8
+ // directory structure relative to rootDir. No effect on include, exclude, etc.
6
9
  "emitDeclarationOnly": true,
7
10
  "declarationMap": true,
11
+ "outDir": ".tmp/tsbuildinfo/",
12
+ "rootDir": ".",
8
13
 
9
14
  "target": "es2020",
10
15
  "module": "es2020",
package/tsconfig.json CHANGED
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "./tsconfig-base.json",
3
3
  "compilerOptions": {
4
- "outDir": ".tmp/tsbuildinfo/",
5
-
6
4
  // TODO(esmodules): included to support require('file.json'). Remove on the switch to ES Modules.
7
5
  "resolveJsonModule": true,
8
6
  },
@@ -32,6 +30,7 @@
32
30
  "third-party/snyk/snapshot.json",
33
31
  "lighthouse-core/audits/byte-efficiency/polyfill-graph-data.json",
34
32
  "shared/localization/locales/en-US.json",
33
+ "esm-utils.mjs",
35
34
  ],
36
35
  "exclude": [
37
36
  "lighthouse-core/test/audits/**/*.js",
@@ -48,11 +47,11 @@
48
47
  "lighthouse-core/test/config/config-test.js",
49
48
  "lighthouse-core/test/config/default-config-test.js",
50
49
  "lighthouse-core/test/create-test-trace.js",
51
- "lighthouse-core/test/gather/devtools-log-test.js",
52
50
  "lighthouse-core/test/gather/driver/wait-for-condition-test.js",
53
51
  "lighthouse-core/test/gather/gatherers/accessibility-test.js",
54
52
  "lighthouse-core/test/gather/gatherers/cache-contents-test.js",
55
53
  "lighthouse-core/test/gather/gatherers/console-messages-test.js",
54
+ "lighthouse-core/test/gather/gatherers/devtools-log-test.js",
56
55
  "lighthouse-core/test/gather/gatherers/dobetterweb/optimized-images-test.js",
57
56
  "lighthouse-core/test/gather/gatherers/dobetterweb/password-inputs-with-prevented-paste-test.js",
58
57
  "lighthouse-core/test/gather/gatherers/dobetterweb/response-compression-test.js",
@@ -49,6 +49,8 @@ interface UniversalBaseArtifacts {
49
49
  LighthouseRunWarnings: Array<string | IcuMessage>;
50
50
  /** The benchmark index that indicates rough device class. */
51
51
  BenchmarkIndex: number;
52
+ /** Many benchmark indexes. Many. */
53
+ BenchmarkIndexes?: number[];
52
54
  /** An object containing information about the testing configuration used by Lighthouse. */
53
55
  settings: Config.Settings;
54
56
  /** The timing instrumentation of the gather portion of a run. */
@@ -30,8 +30,6 @@ declare module Gatherer {
30
30
  once<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
31
31
  addProtocolMessageListener(callback: (payload: Protocol.RawEventMessage) => void): void
32
32
  removeProtocolMessageListener(callback: (payload: Protocol.RawEventMessage) => void): void
33
- addSessionAttachedListener(callback: (session: FRProtocolSession) => void): void
34
- removeSessionAttachedListener(callback: (session: FRProtocolSession) => void): void
35
33
  off<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
36
34
  sendCommand<TMethod extends keyof LH.CrdpCommands>(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise<LH.CrdpCommands[TMethod]['returnType']>;
37
35
  dispose(): Promise<void>;
@@ -59,6 +59,8 @@ declare module Result {
59
59
  networkUserAgent: string;
60
60
  /** The benchmark index number that indicates rough device class. */
61
61
  benchmarkIndex: number;
62
+ /** Many benchmark indexes. */
63
+ benchmarkIndexes?: number[];
62
64
  /** The version of libraries with which these results were generated. Ex: axe-core. */
63
65
  credits?: Record<string, string|undefined>,
64
66
  }
@@ -1,8 +1,6 @@
1
1
  {
2
2
  "extends": "../../tsconfig-base.json",
3
3
  "compilerOptions": {
4
- "outDir": "../../.tmp/tsbuildinfo/types/lhr",
5
-
6
4
  // We only need the base JS definitions, no DOM, etc.
7
5
  "lib": ["esnext"],
8
6
  // Don't include any types from node_modules/.
@@ -11,6 +11,7 @@ declare module 'lighthouse-logger' {
11
11
  args?: any[];
12
12
  }
13
13
  export function setLevel(level: string): void;
14
+ export function isVerbose(): boolean;
14
15
  export function formatProtocol(prefix: string, data: Object, level?: string): void;
15
16
  export function log(title: string, ...args: any[]): void;
16
17
  export function warn(title: string, ...args: any[]): void;
@@ -1,61 +0,0 @@
1
- /**
2
- * @license Copyright 2017 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
- /**
9
- * @fileoverview This class saves all protocol messages whose method match a particular
10
- * regex filter. Used when saving assets for later analysis by another tool such as
11
- * Webpagetest.
12
- */
13
- class DevtoolsLog {
14
- /**
15
- * @param {RegExp=} regexFilter
16
- */
17
- constructor(regexFilter) {
18
- this._filter = regexFilter;
19
-
20
- /** @type {LH.DevtoolsLog} */
21
- this._messages = [];
22
- this._isRecording = false;
23
- }
24
-
25
- /**
26
- * @return {LH.DevtoolsLog}
27
- */
28
- get messages() {
29
- return this._messages;
30
- }
31
-
32
- reset() {
33
- this._messages = [];
34
- }
35
-
36
- beginRecording() {
37
- this._isRecording = true;
38
- }
39
-
40
- endRecording() {
41
- this._isRecording = false;
42
- }
43
-
44
- /**
45
- * Records a message if method matches filter and recording has been started.
46
- * @param {LH.Protocol.RawEventMessage} message
47
- */
48
- record(message) {
49
- // We're not recording, skip the rest of the checks.
50
- if (!this._isRecording) return;
51
- // The event was likely an internal puppeteer method that uses Symbols.
52
- if (typeof message.method !== 'string') return;
53
- // The event didn't pass our filter, do not record it.
54
- if (this._filter && !this._filter.test(message.method)) return;
55
-
56
- // We passed all the checks, record the message.
57
- this._messages.push(message);
58
- }
59
- }
60
-
61
- module.exports = DevtoolsLog;