Git Product home page Git Product logo

auto-lighthouse's Introduction

auto-lighthouse's People

Contributors

cesasol avatar dependabot-preview[bot] avatar dependabot[bot] avatar eegli avatar l00cyph3r avatar tgiles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

auto-lighthouse's Issues

Is it possible to view the core web vitals for each page?

This is a really cool tool!

I'm interested to see the metrics for each individual page that was crawled. The generated report appears to be an aggregate of all the pages. Is that correct? I'd love to see a CSV file with each page/link as a row. Is something like this already possible.

Silent mode

Is your feature request related to a problem? Please describe.
I would like to be able to have a shorter output from the program for large websites. It's hard to track progress when there's a giant wall of report generations.

Describe the solution you'd like
Create a silent mode that doesn't tell when reports are generated, just that they're all done, and only tells the total number of endpoints to be tested.

Describe alternatives you've considered
Alternately, just update a tally of how many have been generated, i.e. Created X/1492 reports, and just show the total tally that has been pushed to test as 746 endpoints to test.

Can I crawl links in all pages

Hi, this is a really cool tool, thanks for building it.

When I crawl the website, i'd like it to crawl all pages, not only the ones linked to from the first page. For example, if my index page links to a blog page and the blog page has 5 posts, i'd like for the 5 posts to be queued for reporting as well.

Is this possible at the moment?

Thanks!

Cannot pass multiple sites to -u

Describe the bug
Passing either a space-delimited or comma-delimited list of URLS causes the app to only run against the first site.

To Reproduce
Steps to reproduce the behavior:

  1. npx auto-lighthouse -u <URL_1> <URL_2>
  2. ???
  3. Profit.

Expected behavior
Passing multiple websites as an arg should cause each site to be tested.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome.
  • Version Latest

Additional context
Running in PowerShell

aggregateCSVReports test intermittently fails on Windows machines

Describe the bug
Title

To Reproduce
Run npm run test.
NOTE: Only reproducible on Github's build machines

Expected behavior
The test does not fail.

Additional context
Seems to be solved by adding a log. My initial guess is that there's some timing issue in the test, not sure though.

Related to PR #141

aggregateCSVReportsTwo should create two aggregate reports

Describe the bug
There's an intermittent bug (that I can't reproduce locally) that involves aggregateCSVReportsTwo should create two aggregate reports.

To Reproduce
I wish I knew how to consistently reproduce. I have no idea why this is happening.

Expected behavior
The test should consistently pass (or consistently fail if new code breaks the existing behavior).

Additional context
If anyone else is able to reproduce this consistently, I'd be very grateful. I can't reproduce on my Windows box or Linux VM, only seems to happen on the CI servers.

Running `auto-lighthouse` without arguments should print help screen

Is your feature request related to a problem? Please describe.
Running auto-lighthouse without arguments currently scans your website.

Describe the solution you'd like
I would personally expect it to run the --help script

Describe alternatives you've considered
Nope ๐Ÿ˜œ

Additional context
๐Ÿค–

Passing multiple URLS has no effect

Describe the bug
A clear and concise description of what the bug is.
Passing either a space-delimited or comma-delimited list of URLS causes the app to only run against the first site.

To Reproduce
Steps to reproduce the behavior:

  1. npx auto-lighthouse -u <URL_1> <URL_2>
  2. ???
  3. Profit.

Expected behavior
Passing multiple websites as an arg should cause each site to be tested.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser Chrome.
  • Version Latest

Additional context
Running in PowerShell

add CLI

To add some more value, create a CLI that allows an end user to:

  • Modify the starting URL through a param
  • Set whether generated reports open automatically or not
  • Execute the main functionality

add simple tests

Need some automated tests for the API so that I know I didn't break things during development.

Missing reports from large sites

Describe the bug
I'm trying generate reports for a large site (~6760 pages) and it is only producing 437 report files.

To Reproduce
Steps to reproduce the behavior:

  1. git clone ...
  2. npm install
  3. cd ./auto-lighthouse
  4. npm run start -- -u https://example.com --format=csv --respectRobots=false

Expected behavior
I expect the crawler to find ~6760 pages, then generate 13522 report files (extra two for aggregated).

Instead, I find ~437 report files and an error in the console.

  • The terminal shows Pushed: ... 6760 times.
  • It then says Generating 13522 reports! (so far so good)
  • Then I see Wrote ... 437 times, followed by an error.
  • There are 437 files in the expected directory. This included two aggregate reports.

It appears that the script is chocking on something before it finishes writing all the files. It may have something to do with the race condition mentioned in this unmerged PR.

Here's an abridged version of the full transcript:

~/Code/auto-lighthouse[master]$ npm run start -- -u https://example.com --format=csv --respectRobots=false

> [email protected] start /Users/emerson/Code/auto-lighthouse
> node cli "-u" "https://example.com" "--format=csv" "--respectRobots=false"

Not automatically opening reports when done!
Starting simple crawler on https://example.com!
Pushed: https://example.com/page1
Pushed: https://example.com/page2
...
Generating 13522 reports!
Wrote desktop report:  https://example.com/ at:  /Users/emerson/Code/auto-lighthouse/lighthouse/7_22_2020_3_59_16PM
...
Wrote desktop report:  https://example.com/page1 at:  /Users/emerson/Code/auto-lighthouse/lighthouse/7_22_2020_3_59_16PM
Error: not opened
    at WebSocket.send (/Users/emerson/Code/auto-lighthouse/node_modules/ws/lib/WebSocket.js:344:18)
    at CriConnection.sendRawMessage (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/connections/cri.js:167:14)
    at CriConnection.sendCommand (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/connections/connection.js:66:10)
    at Driver._innerSendCommand (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:397:29)
    at /Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:359:35
    at new Promise (<anonymous>)
    at Driver.sendCommandToSession (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:350:12)
    at Driver.sendCommand (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:377:17)
    at /Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:983:22
    at async Driver.gotoURL (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:1134:26) {
  friendlyMessage: undefined
}
TypeError: Cannot read property 'categories' of undefined
    at Function.generateReportCSV (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/report/report-generator.js:72:37)
    at /Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/report/report-generator.js:105:32
    at Array.map (<anonymous>)
    at Function.generateReport (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/report/report-generator.js:98:32)
    at processResults (/Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:96:33)
    at /Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:76:21
    at async processReports (/Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:68:13)
    at async /Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:131:9
    at async Promise.all (index 0)
    at async /Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:213:13
TypeError: Cannot read property 'categories' of undefined
    at Function.generateReportCSV (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/report/report-generator.js:72:37)
    at /Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/report/report-generator.js:105:32
    at Array.map (<anonymous>)
    at Function.generateReport (/Users/emerson/Code/auto-lighthouse/node_modules/lighthouse/lighthouse-core/report/report-generator.js:98:32)
    at processResults (/Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:96:33)
    at /Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:76:21
    at async processReports (/Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:68:13)
    at async /Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:131:9
    at async Promise.all (index 0)
    at async /Users/emerson/Code/auto-lighthouse/lighthouse_runner.js:213:13
Done with reports!


Husky does not automagically work as expected

Describe the bug
When contributing to this repository, husky does not automatically lint commit messages. This causes me to nit commit messages instead of having a tool do it for me.

To Reproduce
Steps to reproduce the behavior:

  1. Clone auto-lighthouse on a device that does not have husky's hooks enabled
  2. Create test branch
  3. Create junk commit with a failing commit message

Expected behavior
Husky prevents this commit message from being committed.

Error while trying to crawl any url

Describe the bug
As a new consumer of this package, I am trying to run a basic command auto-lighthouse -u https://www.google.com and it gives me the below error in versions 2.0.1 and 2.0.2. Same command works fine in 2.0.0

\node_modules\auto-lighthouse\helpers.js:172
    throw new Error('No URL given, quitting!');
    ^

Error: No URL given, quitting!

To Reproduce
The above description covers the steps to reproduce and the error as well

Expected behavior
I would expect a happy path :)

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS] Windows
  • Browser [e.g. chrome, safari] Chrome
  • Version [e.g. 22] 2.0.2, 2.0.1

Summary Reports

Is your feature request related to a problem? Please describe.
Now that we have multiple reports, we have a report for each page, have we considered creating a summary report for an overview.

Describe the solution you'd like
Do you think we could develop a PDF summary?

Describe alternatives you've considered
There is a CSV collated example on the web.

Additional context
A solution could be using the JSON data (or indeed CSV) and collate with weighted averages. i.e. go through each JSON document generated and produce a summary based on that data.

I had started looking a weekend ago, would that be of benefit to you?

Create CI

Is your feature request related to a problem? Please describe.
What's the point of writing tests if I can't use them to validate against the build server??

Describe the solution you'd like
A CI gate that appears on my pull request

Not compatible with lighthouse 8.1.0

Describe the bug
The latest release of lighthouse removes / moves the report-generator module.
PR #269 is likely failing due to this error.

To Reproduce
Steps to reproduce the behavior:

  1. Install / update lighthouse 8.1.0 via npm
  2. install auto-lighthouse
  3. run auto-lighthouse --version
  4. See error code MODULE_NOT_FOUND

Expected behavior
The current version of auto-lighthouse

Desktop (please complete the following information):

  • OS: macOS
  • Version 11.4
  • Version of auto-lighthouse 2.0.3

Full error output

node:internal/modules/cjs/loader:930
  throw err;
  ^

Error: Cannot find module 'lighthouse/lighthouse-core/report/report-generator'
Require stack:
- /opt/homebrew/lib/node_modules/auto-lighthouse/lighthouse_runner.js
- /opt/homebrew/lib/node_modules/auto-lighthouse/cli.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:927:15)
    at Function.Module._load (node:internal/modules/cjs/loader:772:27)
    at Module.require (node:internal/modules/cjs/loader:999:19)
    at require (node:internal/modules/cjs/helpers:93:18)
    at Object.<anonymous> (/opt/homebrew/lib/node_modules/auto-lighthouse/lighthouse_runner.js:3:24)
    at Module._compile (node:internal/modules/cjs/loader:1095:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1124:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.Module._load (node:internal/modules/cjs/loader:816:12)
    at Module.require (node:internal/modules/cjs/loader:999:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/opt/homebrew/lib/node_modules/auto-lighthouse/lighthouse_runner.js',
    '/opt/homebrew/lib/node_modules/auto-lighthouse/cli.js'
  ]
}

Add documentation to possible configurations

Due to the use of third party libraries, I want to add documentation for 3rd party configurations to speed up the development/use process.

These docs will live on the github pages for this project.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.