@studyportals/goldeneye-lighthouse
v1.0.3
Published
<h1 align="center" style="border-bottom: none;">goldeneye-lighthouse 💡</h1> <h3 align="center">AWS CDK Library</h3> <p align="center"> <a href="https://github.com/studyportals/goldeneye-lighthouse/actions/workflows/test.yml"> <img alt="Build states
Downloads
94
Maintainers
Keywords
Readme
Overview
GoldenEye Lighthouse is an AWS CDK (Cloud Development Kit) library designed to seamlessly integrate Google Lighthouse tests into web applications onboarded into GoldenEye within an AWS CodePipeline. This allows you to automate the performance auditing process as part of your CI/CD pipeline.
Features
- Integration with AWS CodePipeline: Easily add Lighthouse tests as part of your CodePipeline.
- Detailed Reports: Access detailed reports generated by Google Lighthouse to identify performance bottlenecks.
Getting Started
Prerequisites
- AWS CLI installed and configured
- Node.js and npm installed
- AWS CDK installed (
npm install -g aws-cdk
)
Installation
Install the Lighthouse library using npm:
npm i @studyportals/goldeneye-lighthouse
Usage
import * as cdk from '@aws-cdk/core';
import { LighthouseTests } from '@studyportals/goldeneye-lighthouse';
const app = new cdk.App();
const stack = new cdk.Stack(app, 'LighthouseTestsStack');
new LighthouseTests(stack, 'MyLighthouseTests', {
lhci: {
categories: ['accessibility', 'best-practices', 'seo'],
chromeFlags: ['--no-sandbox', '--headless'],
extraHeaders: JSON.stringify({ 'x-foo': 'bar' }),
runs: 1,
urls: ['https://example.com']
},
persistResults: true,
serviceDescriptor: 'my-service',
serviceEnvironment: 'PR',
sourceArtifact: mySourceArtifact,
testReportsBucket: myTestReportsBucket
});
Useful commands
npm run build
compile TypeScript to JavaScriptnpm run watch
watch for changes and compilenpm run test
perform the jest unit tests