Skip to main content

Using Lighthouse with Node CLI

Last week in my blog i mentioned working on integrating Lighthouse CI into our course project. The goal was to provide a tool for contributors working on the front-end side of the project. With lighthouse, our contributors could run some diagnostics test to know which parts of the front-end could be improved upon.

So for the last week, I have been reading documentation and blogs/articles for lighthouse ci. One of the things i picked up was that for a future project i could use lighthouse ci and integrate it with my server, and also i can use Github Actions to automatically run diagnostics and produce reports.

But this wasn't the solution we needed for our course project. So i came across the CLI documents. With the Lighthouse CLI, I would be able to set up it up and test the files locally.

Using npm i installed the API:
npm install -g @lhci/cli
Afterward, i used collect the run the diagnostics tests and store lighthouse reports in the .lighthouseci/ folder. Using the command-line flag --staticDistDir allowed for us to specify where the HTML files to run the test are located.
lhci collect --staticDistDir=./src/frontend
 After running the command, the reports are generated as JSON files in the local file. This wasn't what we wanted as we were looking for HTML generated files. Uploading the reports using the upload command wasn't an option for us either. Uploading would generate URLs for us to view the reports.

So after consulting my course instructor, we came to the conclusion that i would instead do some research with Lighthouse and scrap the work on Lighthouse CI.

So for the following week, i will be trying to figure out how we could use Lighthouse.


Comments

Popular posts from this blog

Whiteboard Application: Built with Open Source Projects

I just took my first steps into the open source world and it was amazing. As my first project, I built a note taking application with the help of some open source projects and Github. I’m going to admit, I was a bit scared at first because I hadn’t touched web development in months so I was I rusty in Javascript and other web technologies. Thanks to my instructor, I was able to set-up everything on Github with ease and execute git commands that I had forgotten. All in all it was a good experience and was nice to get back into coding after a long break from it. Whiteboard Application The point of this application is to allow users to takes notes on a webpage. There are also features such as saving what you have written on the whiteboard or clearing the whiteboard all at once. The application was built using the following open source projects: ·          Filer ·          PaperCSS ·   ...

Here i come Hacktoberfest

An amazing opportunity has appeared for me, giving me the chance to get involved in the open-source community. Its  Hacktoberfest  in a few days and I'm super excited to get my hands wet with some code! Hackertoberfest is an event hosted by Digital Ocean every October to get people involved and contribute to open source projects. As a beginner in the realm of open source, I will be participating in this event to reach the two goals I have set for myself. Click here for more information about Hacktoberfest Goals Git The first goal is learning more about how to use git. If you have been reading my previous blogs, I'm new to using Git and I have been learning the basics for over the past few weeks. But I feel like there's still more to learn and experience with Git. Participating in this event will help me utilizes that and help me become proficient in it.  C# & TypeScript The second goal is to learn a new programming language. My focus will be on C...

Steps Into Open Source

Visual Studio Code is the project I plan to use to help me get involved within the open source community. Developed by Microsoft, it has become one of the most popular source-code editor out there. An editor with beneficial features built in such as: ·            Debugging ·           IntelliSense ·           Git source control ·           Integrated terminal ·           Extension marketplace Plus there’s so much more that I haven’t mentioned. The application is written in Typescript and supports Windows, OS and Linux. During my internship I came across the release notes of Visual Studio Code for the month of August. Out of curiosity I quickly scanned the notes and reached the bottom of the page. I was amazed at the number of contribu...