-
Notifications
You must be signed in to change notification settings - Fork 9.3k
/
default-config.js
124 lines (115 loc) · 4.56 KB
/
default-config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
/**
* @license Copyright 2020 The Lighthouse Authors. All Rights Reserved.
* 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
* 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.
*/
'use strict';
const legacyDefaultConfig = require('../../config/default-config.js');
// Ensure all artifact IDs match the typedefs.
/** @type {Record<keyof LH.FRArtifacts, string>} */
const artifacts = {
DevtoolsLog: '',
Trace: '',
Accessibility: '',
AnchorElements: '',
AppCacheManifest: '',
CacheContents: '',
ConsoleMessages: '',
Doctype: '',
DOMStats: '',
EmbeddedContent: '',
FontSize: '',
FormElements: '',
GlobalListeners: '',
IFrameElements: '',
InstallabilityErrors: '',
MetaElements: '',
NetworkUserAgent: '',
PasswordInputsWithPreventedPaste: '',
RobotsTxt: '',
Stacks: '',
TapTargets: '',
TraceElements: '',
ViewportDimensions: '',
WebAppManifest: '',
devtoolsLogs: '',
traces: '',
};
for (const key of Object.keys(artifacts)) {
artifacts[/** @type {keyof typeof artifacts} */ (key)] = key;
}
/** @type {LH.Config.Json} */
const defaultConfig = {
artifacts: [
// Artifacts which can be depended on come first.
{id: artifacts.DevtoolsLog, gatherer: 'devtools-log'},
{id: artifacts.Trace, gatherer: 'trace'},
/* eslint-disable max-len */
{id: artifacts.Accessibility, gatherer: 'accessibility'},
{id: artifacts.AnchorElements, gatherer: 'anchor-elements'},
{id: artifacts.AppCacheManifest, gatherer: 'dobetterweb/appcache'},
{id: artifacts.CacheContents, gatherer: 'cache-contents'},
{id: artifacts.ConsoleMessages, gatherer: 'console-messages'},
{id: artifacts.Doctype, gatherer: 'dobetterweb/doctype'},
{id: artifacts.DOMStats, gatherer: 'dobetterweb/domstats'},
{id: artifacts.EmbeddedContent, gatherer: 'seo/embedded-content'},
{id: artifacts.FontSize, gatherer: 'seo/font-size'},
{id: artifacts.FormElements, gatherer: 'form-elements'},
{id: artifacts.GlobalListeners, gatherer: 'global-listeners'},
{id: artifacts.IFrameElements, gatherer: 'iframe-elements'},
{id: artifacts.InstallabilityErrors, gatherer: 'installability-errors'},
{id: artifacts.MetaElements, gatherer: 'meta-elements'},
{id: artifacts.NetworkUserAgent, gatherer: 'network-user-agent'},
{id: artifacts.PasswordInputsWithPreventedPaste, gatherer: 'dobetterweb/password-inputs-with-prevented-paste'},
{id: artifacts.RobotsTxt, gatherer: 'seo/robots-txt'},
{id: artifacts.Stacks, gatherer: 'stacks'},
{id: artifacts.TapTargets, gatherer: 'seo/tap-targets'},
{id: artifacts.TraceElements, gatherer: 'trace-elements'},
{id: artifacts.ViewportDimensions, gatherer: 'viewport-dimensions'},
{id: artifacts.WebAppManifest, gatherer: 'web-app-manifest'},
/* eslint-enable max-len */
// Artifact copies are renamed for compatibility with legacy artifacts.
{id: artifacts.devtoolsLogs, gatherer: 'devtools-log-compat'},
{id: artifacts.traces, gatherer: 'trace-compat'},
],
navigations: [
{
id: 'default',
artifacts: [
// Artifacts which can be depended on come first.
artifacts.DevtoolsLog,
artifacts.Trace,
artifacts.Accessibility,
artifacts.AnchorElements,
artifacts.AppCacheManifest,
artifacts.CacheContents,
artifacts.ConsoleMessages,
artifacts.Doctype,
artifacts.DOMStats,
artifacts.EmbeddedContent,
artifacts.FontSize,
artifacts.FormElements,
artifacts.GlobalListeners,
artifacts.IFrameElements,
artifacts.InstallabilityErrors,
artifacts.MetaElements,
artifacts.NetworkUserAgent,
artifacts.PasswordInputsWithPreventedPaste,
artifacts.RobotsTxt,
artifacts.Stacks,
artifacts.TapTargets,
artifacts.TraceElements,
artifacts.ViewportDimensions,
artifacts.WebAppManifest,
// Compat artifacts come last.
artifacts.devtoolsLogs,
artifacts.traces,
],
},
],
settings: legacyDefaultConfig.settings,
audits: legacyDefaultConfig.audits,
categories: legacyDefaultConfig.categories,
groups: legacyDefaultConfig.groups,
};
module.exports = defaultConfig;