lighthouse 9.4.0-dev.20220219 → 9.4.0-dev.20220222
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/run.js +5 -1
- package/lighthouse-core/fraggle-rock/config/config.js +1 -1
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +2 -0
- package/lighthouse-core/fraggle-rock/gather/snapshot-runner.js +3 -0
- package/lighthouse-core/fraggle-rock/gather/timespan-runner.js +3 -0
- package/package.json +1 -1
- package/types/config.d.ts +1 -1
package/lighthouse-cli/run.js
CHANGED
|
@@ -207,7 +207,11 @@ async function runLighthouseWithFraggleRock(url, flags, config, launchedChrome)
|
|
|
207
207
|
const browser = await puppeteer.connect({browserURL: `http://localhost:${launchedChrome.port}`});
|
|
208
208
|
const page = await browser.newPage();
|
|
209
209
|
flags.channel = 'fraggle-rock-cli';
|
|
210
|
-
const configContext = {
|
|
210
|
+
const configContext = {
|
|
211
|
+
configPath: flags.configPath,
|
|
212
|
+
settingsOverrides: flags,
|
|
213
|
+
logLevel: flags.logLevel,
|
|
214
|
+
};
|
|
211
215
|
return fraggleRock.navigation(url, {page, config, configContext});
|
|
212
216
|
}
|
|
213
217
|
|
|
@@ -30,7 +30,7 @@ const {
|
|
|
30
30
|
} = require('../../config/config-helpers.js');
|
|
31
31
|
const defaultConfigPath = path.join(__dirname, './default-config.js');
|
|
32
32
|
|
|
33
|
-
/** @typedef {
|
|
33
|
+
/** @typedef {LH.Config.FRContext & {gatherMode: LH.Gatherer.GatherMode}} ConfigContext */
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* @param {LH.Config.Json|undefined} configJSON
|
|
@@ -292,6 +292,8 @@ async function _cleanup({requestedUrl, driver, config}) {
|
|
|
292
292
|
*/
|
|
293
293
|
async function navigation(requestor, options) {
|
|
294
294
|
const {page, configContext = {}} = options;
|
|
295
|
+
log.setLevel(configContext.logLevel || 'error');
|
|
296
|
+
|
|
295
297
|
const {config} = initializeConfig(options.config, {...configContext, gatherMode: 'navigation'});
|
|
296
298
|
const computedCache = new Map();
|
|
297
299
|
const internalOptions = {
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
+
const log = require('lighthouse-logger');
|
|
8
9
|
const Driver = require('./driver.js');
|
|
9
10
|
const Runner = require('../../runner.js');
|
|
10
11
|
const {
|
|
@@ -18,6 +19,8 @@ const {getBaseArtifacts, finalizeArtifacts} = require('./base-artifacts.js');
|
|
|
18
19
|
/** @param {{page: import('puppeteer').Page, config?: LH.Config.Json, configContext?: LH.Config.FRContext}} options */
|
|
19
20
|
async function snapshot(options) {
|
|
20
21
|
const {configContext = {}} = options;
|
|
22
|
+
log.setLevel(configContext.logLevel || 'error');
|
|
23
|
+
|
|
21
24
|
const {config} = initializeConfig(options.config, {...configContext, gatherMode: 'snapshot'});
|
|
22
25
|
const driver = new Driver(options.page);
|
|
23
26
|
await driver.connect();
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
'use strict';
|
|
7
7
|
|
|
8
|
+
const log = require('lighthouse-logger');
|
|
8
9
|
const Driver = require('./driver.js');
|
|
9
10
|
const Runner = require('../../runner.js');
|
|
10
11
|
const {
|
|
@@ -22,6 +23,8 @@ const {getBaseArtifacts, finalizeArtifacts} = require('./base-artifacts.js');
|
|
|
22
23
|
*/
|
|
23
24
|
async function startTimespan(options) {
|
|
24
25
|
const {configContext = {}} = options;
|
|
26
|
+
log.setLevel(configContext.logLevel || 'error');
|
|
27
|
+
|
|
25
28
|
const {config} = initializeConfig(options.config, {...configContext, gatherMode: 'timespan'});
|
|
26
29
|
const driver = new Driver(options.page);
|
|
27
30
|
await driver.connect();
|
package/package.json
CHANGED
package/types/config.d.ts
CHANGED
|
@@ -62,10 +62,10 @@ declare module Config {
|
|
|
62
62
|
* This information is typically set by the CLI or other channel integrations.
|
|
63
63
|
*/
|
|
64
64
|
interface FRContext {
|
|
65
|
-
gatherMode?: Gatherer.GatherMode;
|
|
66
65
|
configPath?: string;
|
|
67
66
|
settingsOverrides?: SharedFlagsSettings & Pick<LH.Flags, 'plugins'>;
|
|
68
67
|
skipAboutBlank?: boolean;
|
|
68
|
+
logLevel?: string;
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
interface SharedPassNavigationJson {
|