Carr1005 / lighthouse-batch-parallel

A module for helping collecting websites' Lighthouse audit data in batches. Get the report data stream in CSV, JS Object or JSON format. Also provide a cli-tool to generate the report file in CSV or JSON format directly.
Apache License 2.0
28 stars 10 forks source link

CLI doesn't seem to register custom audits config file #16

Closed cappe closed 3 years ago

cappe commented 3 years ago

I cannot seem to get the custom audits config to work with the --audits-config flag. My command is as follows:

lighthouse-batch-parallel -l sitemap.json -a config.csv OR lighthouse-batch-parallel -l sitemap.json -a config.json

for which the result is:

Total: 1 || Remain: 1
Device = mobile || URL = https://www.npmjs.com/package/lighthouse-batch-parallel
Total: 1 || Remain: 0
Total time to accomplish all tasks: 0 minutes 6 seconds

and the report.csv:

Device,URL,Performance,Accessibility,Best-practices,SEO,PWA,First Contentful Paint,First Meaningful Paint,Speed Index,Estimated Input Latency,Time to Interactive,First CPU Idle,Eliminate render-blocking resources,Preconnect to required origins,Enable text compression,Server response times are low (TTFB),Defer offscreen images,Serve images in next-gen formats,Efficiently encode images,Properly size images,Minify JavaScript,Preload key requests,Remove unused CSS,Use video formats for animated content,Minify CSS,Minimize main-thread work,Avoid an excessive DOM size,Serve static assets with an efficient cache policy,Reduce JavaScript execution time,Minimize Critical Requests Depth,User Timing marks and measures,All text remains visible during webfont loads,Avoids enormous network payloads
mobile,https://www.npmjs.com/package/lighthouse-batch-parallel,0.62,0.88,1,0.99,0.58,2.2 s,3.4 s,2.6 s,240 ms,9.3 s,9.3 s,190 ms (Potential savings of),740 ms (Potential savings of),1,80 ms (Root document took),1,1,1,1,1,1,25 KB (Potential savings of),1,6 KB (Potential savings of),2.6 s,"1,720 nodes",8 resources found,1.4 s,14 chains found,-1,0,882 KB (Total size was)

(note that the report lacks the Cumulative Layout Shift metric)

sitemap.json:

[
  {
    "Device": "mobile",
    "URL":    "https://www.npmjs.com/package/lighthouse-batch-parallel"
  }
]

config.csv:

cumulative-layout-shift, Cumulative Layout Shift

config.json:

{
  "cumulative-layout-shift": "Cumulative Layout Shift"
}

Tooling:

Have I missed something? Thank you, appreciate your help.

EDIT: The custom config was registered when running the lighthouse-batch-parallel via JS script (like in the example) so I'm suspecting the issue may be in the CLI.

Carr1005 commented 3 years ago

@cappe , so many thanks for your feedback and sry for the time you wasted, I just published the fix for both issues on NPM and here!

cappe commented 3 years ago

@Carr1005 Oh man, I should have picked up that typo too. Nasty little fucker.

Thank you so much for your responsiveness. Don't worry about spending anyones time. This tool will save time like 10x compared to running lighthouse analysis one by one.

Carr1005 commented 3 years ago

That's awful, I didn't know that it never worked until now lol, I really should write the tests. My bad, man. And yeah I am glad it helps, but you are helping it too, this is really a good motivation for me. Plz let me know if there are any more problems. 😀

Carr1005 commented 3 years ago

Note: Forgot to create the pr this time, the commits for the fix.

https://github.com/Carr1005/lighthouse-batch-parallel/commit/ad51bd44b12349725acf082652ce097b4d568c01 https://github.com/Carr1005/lighthouse-batch-parallel/commit/24cc2684b16ec71fccb18c6f5d296a8de3e4e55a