cli(lifecycle): introduce report-only runs#4210
Conversation
patrickhulce
left a comment
There was a problem hiding this comment.
sweet, hurray no more report hacking script 🎉 :D
| return new Promise((resolve, reject) => { | ||
| const outputPath = checkOutputPath(path); | ||
| const output = createOutput(results, mode); | ||
| const outputPath = checkOutputPath(path); |
There was a problem hiding this comment.
this looks just like cleanup no functional change right?
There was a problem hiding this comment.
yup. though i remember some bizarre rejection problems were, i think, why we complicated this method. we'll see.
| promise = promise.then(_ => assetSaver.saveAssets(artifacts, results.audits, resolvedPath)); | ||
| } else if (flags.gatherMode || flags.auditMode) { | ||
| const latestPath = path.join(cwd, 'latest-run', 'lhr.json'); | ||
| promise = promise.then(_ => Printer.write(results, Printer.OutputMode.json, latestPath)); |
There was a problem hiding this comment.
will we be able to do this for just gatherMode? seems like we can only do this with auditMode or gatherMode === auditMode
There was a problem hiding this comment.
actually yah this should instead be
else if (flags.auditMode) {| * @return {!Promise<!LH.Results|void>} | ||
| */ | ||
| function runLighthouse(url, flags, config) { | ||
| if (flags.reportMode) { |
There was a problem hiding this comment.
this means you can't really do -GAR for the full thing and existence of -R forces report-only mode no matter what, is that what we want? I guess auditMode continues on to do what reportMode would do anyhow
There was a problem hiding this comment.
hmm that's true. let's talk about what's ideal here.
|
Definitely need to finish the GAR, but this patch is now super out of sync. Closing for now and with the hope that the next approach can be even simpler with our |
-GAor-Aeither one of the following, it will also save the LHR results json to disk within the./latest-run/folder, alongside the artifacts.-R, it'll read thatlatest-run/lhr.jsonfile and then generate a report and save that to disk. (It'll abide your output options or our defaults).Also
GAR!