lighthouse 9.5.0-dev.20221114 → 9.5.0-dev.20221116
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/cli/cli-flags.js +1 -1
- package/cli/printer.js +1 -1
- package/cli/test/smokehouse/frontends/smokehouse-bin.js +1 -1
- package/core/audits/byte-efficiency/render-blocking-resources.js +1 -1
- package/core/audits/byte-efficiency/uses-long-cache-ttl.js +87 -88
- package/core/audits/critical-request-chains.js +41 -42
- package/core/audits/is-on-https.js +38 -39
- package/core/audits/metrics/first-contentful-paint-3g.js +1 -1
- package/core/audits/performance-budget.js +1 -1
- package/core/audits/seo/is-crawlable.js +51 -54
- package/core/audits/timing-budget.js +1 -1
- package/core/audits/user-timings.js +42 -43
- package/core/computed/computed-artifact.js +3 -3
- package/core/computed/load-simulator.js +1 -1
- package/core/computed/metrics/responsiveness.js +1 -1
- package/core/computed/metrics/timing-summary.js +2 -2
- package/core/computed/network-analysis.js +1 -1
- package/core/computed/resource-summary.js +2 -2
- package/core/config/budget.js +2 -2
- package/core/config/config-helpers.js +2 -2
- package/core/gather/gatherers/full-page-screenshot.js +3 -1
- package/core/index.js +81 -2
- package/core/lib/lantern-trace-saver.js +1 -1
- package/core/lib/network-request.js +1 -1
- package/package.json +1 -1
- package/report/generator/report-generator.js +19 -5
- package/report/test/generator/report-generator-test.js +18 -0
- package/types/artifacts.d.ts +5 -3
- package/types/audit.d.ts +2 -1
- package/types/externs.d.ts +0 -95
- package/types/global-lh.d.ts +3 -0
- package/types/node.d.ts +32 -0
- package/types/utility-types.d.ts +72 -0
- package/core/api.js +0 -80
package/core/api.js
DELETED
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license Copyright 2020 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
|
-
|
|
7
|
-
import {UserFlow, auditGatherSteps} from './user-flow.js';
|
|
8
|
-
import {snapshotGather} from './gather/snapshot-runner.js';
|
|
9
|
-
import {startTimespanGather} from './gather/timespan-runner.js';
|
|
10
|
-
import {navigationGather} from './gather/navigation-runner.js';
|
|
11
|
-
import {ReportGenerator} from '../report/generator/report-generator.js';
|
|
12
|
-
import {Runner} from './runner.js';
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* @param {LH.Puppeteer.Page} page
|
|
16
|
-
* @param {LH.UserFlow.Options} [options]
|
|
17
|
-
*/
|
|
18
|
-
async function startFlow(page, options) {
|
|
19
|
-
return new UserFlow(page, options);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @param {LH.Puppeteer.Page|undefined} page
|
|
24
|
-
* @param {LH.NavigationRequestor|undefined} requestor
|
|
25
|
-
* @param {{config?: LH.Config.Json, flags?: LH.Flags}} [options]
|
|
26
|
-
* @return {Promise<LH.RunnerResult|undefined>}
|
|
27
|
-
*/
|
|
28
|
-
async function navigation(page, requestor, options) {
|
|
29
|
-
const gatherResult = await navigationGather(page, requestor, options);
|
|
30
|
-
return Runner.audit(gatherResult.artifacts, gatherResult.runnerOptions);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* @param {LH.Puppeteer.Page} page
|
|
35
|
-
* @param {{config?: LH.Config.Json, flags?: LH.Flags}} [options]
|
|
36
|
-
* @return {Promise<LH.RunnerResult|undefined>}
|
|
37
|
-
*/
|
|
38
|
-
async function snapshot(page, options) {
|
|
39
|
-
const gatherResult = await snapshotGather(page, options);
|
|
40
|
-
return Runner.audit(gatherResult.artifacts, gatherResult.runnerOptions);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* @param {LH.Puppeteer.Page} page
|
|
45
|
-
* @param {{config?: LH.Config.Json, flags?: LH.Flags}} [options]
|
|
46
|
-
* @return {Promise<{endTimespan: () => Promise<LH.RunnerResult|undefined>}>}
|
|
47
|
-
*/
|
|
48
|
-
async function startTimespan(page, options) {
|
|
49
|
-
const {endTimespanGather} = await startTimespanGather(page, options);
|
|
50
|
-
const endTimespan = async () => {
|
|
51
|
-
const gatherResult = await endTimespanGather();
|
|
52
|
-
return Runner.audit(gatherResult.artifacts, gatherResult.runnerOptions);
|
|
53
|
-
};
|
|
54
|
-
return {endTimespan};
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
/**
|
|
58
|
-
* @param {LH.FlowResult} flowResult
|
|
59
|
-
*/
|
|
60
|
-
async function generateFlowReport(flowResult) {
|
|
61
|
-
return ReportGenerator.generateFlowReportHtml(flowResult);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* @param {LH.UserFlow.FlowArtifacts} flowArtifacts
|
|
66
|
-
* @param {LH.Config.Json} [config]
|
|
67
|
-
*/
|
|
68
|
-
async function auditFlowArtifacts(flowArtifacts, config) {
|
|
69
|
-
const {gatherSteps, name} = flowArtifacts;
|
|
70
|
-
return await auditGatherSteps(gatherSteps, {name, config});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
export {
|
|
74
|
-
snapshot,
|
|
75
|
-
startTimespan,
|
|
76
|
-
navigation,
|
|
77
|
-
startFlow,
|
|
78
|
-
generateFlowReport,
|
|
79
|
-
auditFlowArtifacts,
|
|
80
|
-
};
|