Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: remove legacy domhtml output #4176

Merged
merged 2 commits into from
Jan 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions lighthouse-cli/cli-flags.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,8 @@ function getFlags(manualArgv) {
'Additional categories to capture with the trace (comma-delimited).',
'config-path': 'The path to the config JSON.',
'chrome-flags':
`Custom flags to pass to Chrome (space-delimited). For a full list of flags, see http://peter.sh/experiments/chromium-command-line-switches/.

Environment variables:
CHROME_PATH: Explicit path of intended Chrome binary. If set must point to an executable of a build of Chromium version 54.0 or later. By default, any detected Chrome Canary or Chrome (stable) will be launched.
`,
`Custom flags to pass to Chrome (space-delimited). For a full list of flags, see http://bit.ly/chrome-flags
Additionally, use the CHROME_PATH environment variable to use a specific Chrome binary. Requires Chromium version 54.0 or later. If omitted, any detected Chrome Canary or Chrome stable will be used.`,
'perf': 'Use a performance-test-only configuration',
'hostname': 'The hostname to use for the debugging protocol.',
'port': 'The port to use for the debugging protocol. Use 0 for a random port',
Expand Down Expand Up @@ -110,7 +107,7 @@ function getFlags(manualArgv) {
// default values
.default('chrome-flags', '')
.default('disable-cpu-throttling', false)
.default('output', 'domhtml')
.default('output', 'html')
.default('port', 0)
.default('hostname', 'localhost')
.default('max-wait-for-load', Driver.MAX_WAIT_FOR_FULLY_LOADED)
Expand Down
4 changes: 1 addition & 3 deletions lighthouse-cli/printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ const log = require('lighthouse-logger');
* An enumeration of acceptable output modes:
* 'json': JSON formatted results
* 'html': An HTML report
* 'domhtml': Alias for 'html' report
*/
const OutputMode = {
json: 'json',
html: 'html',
domhtml: 'domhtml',
};

/**
Expand All @@ -42,7 +40,7 @@ function checkOutputPath(path) {
*/
function createOutput(results, outputMode) {
// HTML report.
if (outputMode === OutputMode.domhtml || outputMode === OutputMode.html) {
if (outputMode === OutputMode.html) {
return new ReportGenerator().generateReportHtml(results);
}
// JSON report.
Expand Down
7 changes: 3 additions & 4 deletions lighthouse-cli/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,16 @@ function saveResults(results, artifacts, flags) {
return promise.then(_ => {
if (Array.isArray(flags.output)) {
return flags.output.reduce((innerPromise, outputType) => {
const extension = outputType === 'domhtml' ? 'html' : outputType;
const extension = outputType;
const outputPath = `${resolvedPath}.report.${extension}`;
return innerPromise.then(() => Printer.write(results, outputType, outputPath));
}, Promise.resolve());
} else {
const extension = flags.output === 'domhtml' ? 'html' : flags.output;
const extension = flags.output;
const outputPath =
flags.outputPath || `${resolvedPath}.report.${extension}`;
return Printer.write(results, flags.output, outputPath).then(_ => {
if (flags.output === Printer.OutputMode[Printer.OutputMode.html] ||
flags.output === Printer.OutputMode[Printer.OutputMode.domhtml]) {
if (flags.output === Printer.OutputMode[Printer.OutputMode.html]) {
if (flags.view) {
opn(outputPath, {wait: false});
} else {
Expand Down