lighthouse 8.5.1 → 8.6.0-dev.20211016
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/changelog.md +5490 -0
- package/dist/report/flow.js +35 -12
- package/dist/report/standalone.js +20 -21
- package/flow-report/.eslintrc.cjs +49 -0
- package/flow-report/assets/styles.css +272 -9
- package/flow-report/jest.config.js +1 -1
- package/flow-report/package.json +4 -0
- package/flow-report/src/app.tsx +31 -9
- package/flow-report/src/common.tsx +86 -7
- package/flow-report/src/header.tsx +88 -0
- package/flow-report/src/help-dialog.tsx +120 -0
- package/flow-report/src/i18n/i18n.tsx +52 -0
- package/flow-report/src/i18n/localized-strings.js +11 -0
- package/flow-report/src/i18n/ui-strings.js +134 -0
- package/flow-report/src/icons.tsx +20 -3
- package/flow-report/src/sidebar/sidebar.tsx +11 -16
- package/flow-report/src/summary/category.tsx +39 -24
- package/flow-report/src/summary/summary.tsx +35 -32
- package/flow-report/src/topbar.tsx +54 -4
- package/flow-report/src/util.ts +26 -1
- package/flow-report/src/wrappers/report-renderer.tsx +1 -1
- package/flow-report/src/wrappers/report.tsx +6 -21
- package/flow-report/test/app-test.tsx +17 -13
- package/flow-report/test/common-test.tsx +89 -0
- package/flow-report/test/header-test.tsx +55 -0
- package/flow-report/test/sample-flow.ts +17 -0
- package/flow-report/test/setup/env-setup.ts +1 -0
- package/flow-report/test/sidebar/flow-test.tsx +6 -12
- package/flow-report/test/sidebar/sidebar-test.tsx +7 -13
- package/flow-report/test/summary/category-test.tsx +83 -34
- package/flow-report/test/summary/summary-test.tsx +12 -18
- package/flow-report/test/topbar-test.tsx +68 -0
- package/flow-report/test/util-test.tsx +1 -12
- package/flow-report/tsconfig.json +2 -0
- package/flow-report/types/flow-report.d.ts +2 -1
- package/jest.config.js +1 -15
- package/lighthouse-cli/bin.js +5 -0
- package/lighthouse-cli/cli-flags.js +10 -3
- package/lighthouse-cli/commands/commands.js +1 -0
- package/lighthouse-cli/commands/list-locales.js +16 -0
- package/lighthouse-cli/run.js +2 -2
- package/lighthouse-cli/test/smokehouse/frontends/smokehouse-bin.js +0 -0
- package/lighthouse-cli/test/smokehouse/report-assert.js +20 -4
- package/lighthouse-core/audits/byte-efficiency/byte-efficiency-audit.js +2 -1
- package/lighthouse-core/audits/byte-efficiency/unused-javascript.js +1 -1
- package/lighthouse-core/audits/seo/crawlable-anchors.js +10 -12
- package/lighthouse-core/computed/js-bundles.js +1 -2
- package/lighthouse-core/computed/unused-javascript-summary.js +3 -3
- package/lighthouse-core/config/config-helpers.js +1 -0
- package/lighthouse-core/config/config.js +2 -2
- package/lighthouse-core/config/default-config.js +5 -0
- package/lighthouse-core/fraggle-rock/api.js +10 -0
- package/lighthouse-core/fraggle-rock/config/filters.js +22 -3
- package/lighthouse-core/fraggle-rock/gather/driver.js +4 -0
- package/lighthouse-core/fraggle-rock/gather/navigation-runner.js +2 -2
- package/lighthouse-core/fraggle-rock/user-flow.js +35 -6
- package/lighthouse-core/gather/driver/navigation.js +5 -0
- package/lighthouse-core/gather/driver/prepare.js +14 -0
- package/lighthouse-core/gather/driver/storage.js +5 -0
- package/lighthouse-core/gather/gather-runner.js +2 -2
- package/lighthouse-core/gather/gatherers/dobetterweb/response-compression.js +5 -1
- package/lighthouse-core/gather/gatherers/full-page-screenshot.js +30 -24
- package/lighthouse-core/lib/cdt/Platform.js +55 -0
- package/lighthouse-core/lib/cdt/SDK.js +3 -123
- package/lighthouse-core/lib/cdt/generated/SourceMap.js +148 -312
- package/lighthouse-core/lib/csp-evaluator.js +2 -1
- package/lighthouse-core/lib/i18n/README.md +6 -6
- package/lighthouse-core/lib/i18n/i18n.js +26 -348
- package/lighthouse-core/lib/page-functions.js +4 -4
- package/lighthouse-core/lib/stack-packs.js +1 -13
- package/lighthouse-core/runner.js +6 -6
- package/lighthouse-core/scripts/manual-chrome-launcher.js +4 -1
- package/lighthouse-core/scripts/package.json +4 -0
- package/lighthouse-core/util-commonjs.js +20 -4
- package/package.json +19 -16
- package/readme.md +1 -1
- package/report/assets/standalone-template.html +0 -1
- package/report/assets/styles.css +16 -41
- package/report/assets/templates.html +42 -4
- package/report/clients/psi.js +1 -0
- package/report/clients/standalone.js +1 -2
- package/report/generator/file-namer.js +17 -8
- package/report/generator/report-generator.js +0 -1
- package/report/renderer/category-renderer.js +4 -16
- package/report/renderer/components.js +107 -71
- package/report/renderer/dom.js +19 -0
- package/report/renderer/logger.js +35 -2
- package/report/renderer/performance-category-renderer.js +23 -21
- package/report/renderer/pwa-category-renderer.js +1 -2
- package/report/renderer/report-renderer.js +21 -0
- package/report/renderer/report-ui-features.js +7 -19
- package/report/renderer/swap-locale-feature.js +82 -0
- package/report/renderer/util.js +20 -4
- package/report/test/clients/psi-test.js +0 -4
- package/report/test/generator/file-namer-test.js +2 -2
- package/report/test/renderer/category-renderer-test.js +1 -1
- package/report/test/renderer/performance-category-renderer-test.js +12 -0
- package/report/test/renderer/report-renderer-axe-test.js +86 -0
- package/report/test/renderer/report-renderer-test.js +0 -55
- package/report/test/renderer/util-test.js +68 -8
- package/report/test-assets/faux-psi-template.html +0 -1
- package/report/tsconfig.json +2 -1
- package/report/types/html-renderer.d.ts +2 -1
- package/root.js +18 -0
- package/shared/localization/format.js +455 -0
- package/{lighthouse-core/lib/cdt/Common.js → shared/localization/i18n-module.js} +3 -8
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ar-XB.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ar.json +141 -6
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/bg.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ca.json +140 -5
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/cs.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/da.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/de.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/el.json +141 -6
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/en-GB.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/en-US.json +129 -0
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/en-XA.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/en-XL.json +129 -0
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/es-419.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/es.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/fi.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/fil.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/fr.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/he.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/hi.json +142 -7
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/hr.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/hu.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/id.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/it.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ja.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ko.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/lt.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/lv.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/nl.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/no.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/pl.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/pt-PT.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/pt.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ro.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ru.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/sk.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/sl.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/sr-Latn.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/sr.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/sv.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/ta.json +146 -11
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/te.json +179 -44
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/th.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/tr.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/uk.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/vi.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/zh-HK.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/zh-TW.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales/zh.json +139 -4
- package/{lighthouse-core/lib/i18n → shared/localization}/locales.js +8 -1
- package/shared/localization/swap-flow-locale.js +20 -0
- package/{lighthouse-core/lib/i18n → shared/localization}/swap-locale.js +9 -7
- package/shared/test/localization/format-test.js +421 -0
- package/shared/test/localization/locales-test.js +47 -0
- package/shared/test/localization/swap-locale-test.js +140 -0
- package/shared/tsconfig.json +22 -0
- package/{lighthouse-core/lib → shared}/type-verifiers.js +0 -0
- package/shared/types/shared.d.ts +24 -0
- package/third-party/chromium-synchronization/inspector-issueAdded-types-test.js +5 -3
- package/third-party/chromium-synchronization/installability-errors-test.js +2 -1
- package/tsconfig-all.json +1 -0
- package/tsconfig-base.json +1 -1
- package/tsconfig.json +2 -3
- package/types/config.d.ts +1 -0
- package/types/es-main.d.ts +18 -0
- package/types/externs.d.ts +2 -0
- package/types/lhr/flow.d.ts +7 -0
- package/types/lhr/i18n.d.ts +0 -3
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
const fs = require('fs');
|
|
9
9
|
const fetch = require('node-fetch');
|
|
10
|
-
const {LH_ROOT} = require('
|
|
10
|
+
const {LH_ROOT} = require('../../root.js');
|
|
11
11
|
|
|
12
12
|
const inspectorIssuesGathererPath = LH_ROOT +
|
|
13
13
|
'/lighthouse-core/gather/gatherers/inspector-issues.js';
|
|
@@ -31,7 +31,8 @@ describe('issueAdded types', () => {
|
|
|
31
31
|
.sort();
|
|
32
32
|
});
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
// TODO: https://github.com/GoogleChrome/lighthouse/issues/13147
|
|
35
|
+
it.skip('should notify us if something changed', () => {
|
|
35
36
|
expect(inspectorIssueDetailsTypes).toMatchInlineSnapshot(`
|
|
36
37
|
Array [
|
|
37
38
|
"blockedByResponseIssueDetails",
|
|
@@ -44,7 +45,8 @@ describe('issueAdded types', () => {
|
|
|
44
45
|
`);
|
|
45
46
|
});
|
|
46
47
|
|
|
47
|
-
|
|
48
|
+
// TODO: https://github.com/GoogleChrome/lighthouse/issues/13147
|
|
49
|
+
it.skip('are each handled explicitly in the gatherer', () => {
|
|
48
50
|
// Regex relies on the typecasts
|
|
49
51
|
const sourceTypeMatches = inspectorIssuesGathererSource.matchAll(
|
|
50
52
|
/LH\.Crdp\.Audits\.(.*?Details)>/g
|
|
@@ -74,7 +74,8 @@ Array [
|
|
|
74
74
|
`);
|
|
75
75
|
});
|
|
76
76
|
|
|
77
|
-
|
|
77
|
+
// TODO: https://github.com/GoogleChrome/lighthouse/issues/13147
|
|
78
|
+
it.skip('are each handled explicitly in the gatherer', () => {
|
|
78
79
|
const errorStrings = Object.keys(InstallableManifestAudit.UIStrings)
|
|
79
80
|
.filter(key => chromiumErrorIds.includes(key))
|
|
80
81
|
.sort();
|
package/tsconfig-all.json
CHANGED
package/tsconfig-base.json
CHANGED
package/tsconfig.json
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
{"path": "./types/lhr/"},
|
|
11
11
|
{"path": "./report/"},
|
|
12
12
|
{"path": "./report/generator/"},
|
|
13
|
+
{"path": "./shared/"},
|
|
13
14
|
],
|
|
14
15
|
"include": [
|
|
15
16
|
"root.js",
|
|
@@ -22,13 +23,13 @@
|
|
|
22
23
|
|
|
23
24
|
// TODO(esmodules): JSON files included via resolveJsonModule. Removable on the switch to ES Modules.
|
|
24
25
|
"package.json",
|
|
25
|
-
"lighthouse-core/lib/i18n/locales/en-US.json",
|
|
26
26
|
"lighthouse-core/test/results/sample_v2.json",
|
|
27
27
|
"lighthouse-core/lib/sd-validation/assets/*.json",
|
|
28
28
|
"lighthouse-core/test/fixtures/unresolved-perflog.json",
|
|
29
29
|
"lighthouse-core/test/fixtures/traces/lcp-m78.devtools.log.json",
|
|
30
30
|
"third-party/snyk/snapshot.json",
|
|
31
31
|
"lighthouse-core/audits/byte-efficiency/polyfill-graph-data.json",
|
|
32
|
+
"shared/localization/locales/en-US.json",
|
|
32
33
|
],
|
|
33
34
|
"exclude": [
|
|
34
35
|
"lighthouse-core/test/audits/**/*.js",
|
|
@@ -79,8 +80,6 @@
|
|
|
79
80
|
"lighthouse-core/test/lib/dependency-graph/simulator/simulator-test.js",
|
|
80
81
|
"lighthouse-core/test/lib/emulation-test.js",
|
|
81
82
|
"lighthouse-core/test/lib/i18n/i18n-test.js",
|
|
82
|
-
"lighthouse-core/test/lib/i18n/locales-test.js",
|
|
83
|
-
"lighthouse-core/test/lib/i18n/swap-locale-test.js",
|
|
84
83
|
"lighthouse-core/test/lib/icons-test.js",
|
|
85
84
|
"lighthouse-core/test/lib/lh-element-test.js",
|
|
86
85
|
"lighthouse-core/test/lib/manifest-parser-test.js",
|
package/types/config.d.ts
CHANGED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license Copyright 2021 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
|
+
/**
|
|
8
|
+
* @fileoverview Types for the `es-main` npm module.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Test if an ES module is run directly with Node.js.
|
|
13
|
+
* @param importMeta `import.meta`
|
|
14
|
+
*/
|
|
15
|
+
declare function esMain(importMeta: ImportMeta): boolean;
|
|
16
|
+
declare module 'es-main' {
|
|
17
|
+
export = esMain;
|
|
18
|
+
}
|
package/types/externs.d.ts
CHANGED
|
@@ -155,6 +155,8 @@ export interface CliFlags extends Flags {
|
|
|
155
155
|
enableErrorReporting?: boolean;
|
|
156
156
|
/** Flag to print a list of all audits + categories. */
|
|
157
157
|
listAllAudits: boolean;
|
|
158
|
+
/** Flag to print a list of all supported locales. */
|
|
159
|
+
listLocales: boolean;
|
|
158
160
|
/** Flag to print a list of all required trace categories. */
|
|
159
161
|
listTraceCategories: boolean;
|
|
160
162
|
/** A preset audit of selected audit categories to run. */
|
package/types/lhr/flow.d.ts
CHANGED
|
@@ -11,6 +11,11 @@ declare module FlowResult {
|
|
|
11
11
|
lhr: Result;
|
|
12
12
|
name: string;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
interface LhrRef {
|
|
16
|
+
value: Result;
|
|
17
|
+
index: number;
|
|
18
|
+
}
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
/**
|
|
@@ -19,6 +24,8 @@ declare module FlowResult {
|
|
|
19
24
|
interface FlowResult {
|
|
20
25
|
/** Ordered list of flow steps, each corresponding to a navigation, timespan, or snapshot. */
|
|
21
26
|
steps: FlowResult.Step[];
|
|
27
|
+
/** Name given to this user flow. */
|
|
28
|
+
name: string;
|
|
22
29
|
}
|
|
23
30
|
|
|
24
31
|
export default FlowResult;
|
package/types/lhr/i18n.d.ts
CHANGED
|
@@ -4,9 +4,6 @@
|
|
|
4
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
5
|
*/
|
|
6
6
|
|
|
7
|
-
// TODO(bckenny): i18n types should not be necessary for the LHR, but too difficult
|
|
8
|
-
// to unravel from audit-details right now.
|
|
9
|
-
|
|
10
7
|
export type IcuMessage = {
|
|
11
8
|
// NOTE: `i18nId` rather than just `id` to make tsc typing easier (vs type branding which won't survive JSON roundtrip).
|
|
12
9
|
/** The id locating this message in the locale message json files. */
|