lighthouse 9.5.0-dev.20220621 → 9.5.0-dev.20220622
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/lighthouse-cli/bin.js +8 -2
- package/lighthouse-cli/test/smokehouse/__snapshots__/report-assert-test.js.snap +43 -0
- package/lighthouse-cli/test/smokehouse/report-assert-test.js +96 -30
- package/lighthouse-cli/test/smokehouse/report-assert.js +36 -35
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +1 -1
- package/lighthouse-core/config/config-helpers.js +15 -0
- package/lighthouse-core/fraggle-rock/config/config.js +45 -1
- package/lighthouse-core/fraggle-rock/gather/driver.js +13 -5
- package/lighthouse-core/fraggle-rock/gather/session.js +23 -67
- package/lighthouse-core/gather/driver/navigation.js +1 -1
- package/lighthouse-core/gather/driver/network-monitor.js +14 -59
- package/lighthouse-core/gather/driver/target-manager.js +110 -45
- package/lighthouse-core/gather/driver.js +24 -16
- package/lighthouse-core/gather/gatherers/devtools-log.js +7 -11
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +1 -1
- package/lighthouse-core/index.js +24 -9
- package/lighthouse-core/lib/cdt/Common.js +13 -0
- package/lighthouse-core/lib/cdt/Platform.js +3 -0
- package/lighthouse-core/lib/cdt/generated/ParsedURL.js +178 -0
- package/lighthouse-core/lib/cdt/generated/SourceMap.js +155 -62
- package/package.json +2 -2
- package/third-party/devtools-tests/README.md +14 -0
- package/third-party/devtools-tests/e2e/lighthouse/generate-report_test.ts +29 -0
- package/third-party/devtools-tests/e2e/lighthouse/indexeddb-warning_test.ts +29 -0
- package/third-party/devtools-tests/e2e/resources/lighthouse/lighthouse-storage.html +11 -0
- package/third-party/download-content-shell/README.md +1 -0
- package/third-party/download-content-shell/download-content-shell.js +6 -1
- package/types/gatherer.d.ts +5 -2
- package/types/protocol.d.ts +19 -17
|
@@ -34,7 +34,6 @@ function main() {
|
|
|
34
34
|
console.log('Unable to download because of error:', error);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
main();
|
|
38
37
|
|
|
39
38
|
function onUploadedCommitPosition(commitPosition) {
|
|
40
39
|
const contentShellDirPath = path.resolve(CACHE_PATH, commitPosition, 'out', TARGET);
|
|
@@ -176,3 +175,9 @@ function getContentShellBinaryPath(dirPath) {
|
|
|
176
175
|
return path.resolve(dirPath, 'Content Shell.app', 'Contents', 'MacOS', 'Content Shell');
|
|
177
176
|
}
|
|
178
177
|
}
|
|
178
|
+
|
|
179
|
+
if (process.argv[2] === '--resolve-executable-path') {
|
|
180
|
+
console.log(getContentShellBinaryPath(process.argv[3]));
|
|
181
|
+
} else {
|
|
182
|
+
main();
|
|
183
|
+
}
|
package/types/gatherer.d.ts
CHANGED
|
@@ -28,8 +28,6 @@ declare module Gatherer {
|
|
|
28
28
|
setNextProtocolTimeout(ms: number): void;
|
|
29
29
|
on<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
|
|
30
30
|
once<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
|
|
31
|
-
addProtocolMessageListener(callback: (payload: Protocol.RawEventMessage) => void): void
|
|
32
|
-
removeProtocolMessageListener(callback: (payload: Protocol.RawEventMessage) => void): void
|
|
33
31
|
off<TEvent extends keyof LH.CrdpEvents>(event: TEvent, callback: (...args: LH.CrdpEvents[TEvent]) => void): void;
|
|
34
32
|
sendCommand<TMethod extends keyof LH.CrdpCommands>(method: TMethod, ...params: LH.CrdpCommands[TMethod]['paramsType']): Promise<LH.CrdpCommands[TMethod]['returnType']>;
|
|
35
33
|
dispose(): Promise<void>;
|
|
@@ -41,6 +39,11 @@ declare module Gatherer {
|
|
|
41
39
|
executionContext: ExecutionContext;
|
|
42
40
|
fetcher: Fetcher;
|
|
43
41
|
url: () => Promise<string>;
|
|
42
|
+
targetManager: {
|
|
43
|
+
rootSession(): FRProtocolSession;
|
|
44
|
+
on(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void
|
|
45
|
+
off(event: 'protocolevent', callback: (payload: Protocol.RawEventMessage) => void): void
|
|
46
|
+
};
|
|
44
47
|
}
|
|
45
48
|
|
|
46
49
|
/** The limited context interface shared between pre and post Fraggle Rock Lighthouse. */
|
package/types/protocol.d.ts
CHANGED
|
@@ -5,6 +5,23 @@
|
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
7
|
declare module Protocol {
|
|
8
|
+
/**
|
|
9
|
+
* An intermediate type, used to create a record of all possible Crdp raw event
|
|
10
|
+
* messages, keyed on method. e.g. {
|
|
11
|
+
* 'Domain.method1Name': {method: 'Domain.method1Name', params: EventPayload1},
|
|
12
|
+
* 'Domain.method2Name': {method: 'Domain.method2Name', params: EventPayload2},
|
|
13
|
+
* }
|
|
14
|
+
*/
|
|
15
|
+
type RawEventMessageRecord = {
|
|
16
|
+
[K in keyof LH.CrdpEvents]: {
|
|
17
|
+
method: K,
|
|
18
|
+
// Drop [] for `undefined` (so a JS value is valid).
|
|
19
|
+
params: LH.CrdpEvents[K] extends [] ? undefined: LH.CrdpEvents[K][number]
|
|
20
|
+
// If sessionId is not set, it means the event was from the root target.
|
|
21
|
+
sessionId?: string;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
8
25
|
/**
|
|
9
26
|
* Union of raw (over the wire) message format of all possible Crdp events,
|
|
10
27
|
* of the form `{method: 'Domain.event', params: eventPayload}`.
|
|
@@ -50,24 +67,9 @@ declare module Protocol {
|
|
|
50
67
|
once<E extends keyof TEventRecord>(event: E, listener: (...args: TEventRecord[E]) => void): void;
|
|
51
68
|
|
|
52
69
|
emit<E extends keyof TEventRecord>(event: E, ...request: TEventRecord[E]): void;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
70
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
* messages, keyed on method. e.g. {
|
|
59
|
-
* 'Domain.method1Name': {method: 'Domain.method1Name', params: EventPayload1},
|
|
60
|
-
* 'Domain.method2Name': {method: 'Domain.method2Name', params: EventPayload2},
|
|
61
|
-
* }
|
|
62
|
-
*/
|
|
63
|
-
type RawEventMessageRecord = {
|
|
64
|
-
[K in keyof LH.CrdpEvents]: {
|
|
65
|
-
method: K,
|
|
66
|
-
// Drop [] for `undefined` (so a JS value is valid).
|
|
67
|
-
params: LH.CrdpEvents[K] extends [] ? undefined: LH.CrdpEvents[K][number]
|
|
68
|
-
// If sessionId is not set, it means the event was from the root target.
|
|
69
|
-
sessionId?: string;
|
|
70
|
-
};
|
|
71
|
+
listenerCount<E extends keyof TEventRecord>(event: E): number;
|
|
72
|
+
}
|
|
71
73
|
}
|
|
72
74
|
|
|
73
75
|
export default Protocol;
|