cloudfour / lighthouse-parade

A Node.js command line tool that crawls a domain and gathers lighthouse performance data for every page.
MIT License
357 stars 14 forks source link

Set up new config structure and refactor lots #149

Closed calebeby closed 10 months ago

calebeby commented 11 months ago

What does this change (user-facing)?

What does this change (internally)?

The CLI parsing/typechecking is rewritten. Now the schemas for most of the input types are stored in config.ts and those get pulled into cli.ts when parsing CLI flags. The same schemas are used for parsing a config file, but the errors get presented differently

The interface for a crawler was simplified and refactored, to allow the crawler to be more easily replaced with a user-created one. No more AsyncIteratorQueue.

Screenshots

Screenshot 2023-08-09 at 3 20 00 PM Screenshot 2023-08-09 at 3 21 52 PM Screenshot 2023-08-09 at 2 51 05 PM Screenshot 2023-08-09 at 2 52 12 PM Screenshot 2023-08-09 at 2 56 40 PM Screenshot 2023-08-09 at 2 56 04 PM

Reviewing

I am mainly hoping that people can test it out and make sure that it works as expected and that any errors are helpful.

To test:

  1. git clone https://github.com/cloudfour/lighthouse-parade
  2. git checkout config
  3. npm ci
  4. npm run build
  5. node dist/cli.js --help - Hopefully the help text combined with the readme is enough info but if it's not I can add to it!

Also reviewing the documentation and help text would be helpful. Preview of updated README

There is a lot of code changed in this PR, sorry. If you don't have time to do a close review that's OK! Or if you have questions or want me to summarize some changes I am happy to!

changeset-bot[bot] commented 11 months ago

🦋 Changeset detected

Latest commit: 36d9de8039d74a7ee2a85cd4e6107aab955b0c2a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package | Name | Type | | ----------------- | ----- | | lighthouse-parade | Major |

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR