From 81df76b33eb79e55ef0e4c4cd64f559dc2634e3d Mon Sep 17 00:00:00 2001 From: Matthias Kretschmann Date: Sun, 9 Jun 2019 22:53:15 +0200 Subject: [PATCH] lighthousebot setup --- .travis.yml | 3 ++- gatsby-node.js | 3 ++- package.json | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index ebec289..077a2f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ language: node_js node_js: node cache: + npm: true directories: - - node_modules - public # will run `npm install` automatically here @@ -31,6 +31,7 @@ after_success: - pip install --user awscli - export PATH=$PATH:$HOME/.local/bin - npm run deploy + - npm run lh -- https://beta.matthiaskretschmann.com notifications: email: false diff --git a/gatsby-node.js b/gatsby-node.js index fb13b3f..f5cadd6 100644 --- a/gatsby-node.js +++ b/gatsby-node.js @@ -28,7 +28,8 @@ function truncate(n, useWordBoundary) { // async function getGithubRepos(data) { const allRepos = await axios.get( - `https://api.github.com/users/${data.user}/repos?per_page=100` + `https://api.github.com/users/${data.user}/repos?per_page=100`, + { headers: { 'User-Agent': 'kremalicious/portfolio' } } ) const repos = allRepos.data // filter by what's defined in content/repos.yml diff --git a/package.json b/package.json index b6e5cb7..02e2cb7 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,8 @@ "test": "npm run lint && jest --coverage", "test:watch": "npm run lint && jest --coverage --watch", "deploy": "./scripts/deploy.sh", - "new": "babel-node ./scripts/new.js" + "new": "babel-node ./scripts/new.js", + "lh": "lighthousebot --pwa=90 --perf=90 --a11y=90 --bp=90 --seo 90 --runner=wpt" }, "dependencies": { "axios": "^0.19.0", @@ -77,6 +78,7 @@ "jest": "^24.7.1", "jest-canvas-mock": "^2.0.0", "jest-dom": "^3.4.0", + "lighthousebot": "git+https://github.com/GoogleChromeLabs/lighthousebot.git", "ora": "^3.4.0", "prepend": "^1.0.2", "prettier": "^1.18.2",