lighthouse-badges 1.1.14 → 1.1.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -26,7 +26,9 @@ jobs:
26
26
  yarn run lint
27
27
 
28
28
  - name: Docker Build
29
- run: yarn run docker:build
29
+ run: |
30
+ yarn run docker:pull
31
+ yarn run docker:build
30
32
 
31
33
  - name: Unit & Integration Test
32
34
  run: |
@@ -68,7 +70,7 @@ jobs:
68
70
 
69
71
  - name: Deploy to Dockerhub
70
72
  if: github.ref == 'refs/heads/master'
71
- run: echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ; yarn run docker:push
73
+ run: echo "$DOCKERHUB_TOKEN" | docker login -u "$DOCKERHUB_USERNAME" --password-stdin ; yarn run docker:push
72
74
  env:
73
- DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }}
74
- DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
75
+ DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
76
+ DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
package/Dockerfile CHANGED
@@ -1,4 +1,4 @@
1
- FROM node:15.5-alpine
1
+ FROM node:16-alpine
2
2
 
3
3
  ARG BUILD_DATE
4
4
  ARG VCS_REF
@@ -14,9 +14,7 @@ describe('test lighthouse badges', () => {
14
14
  it('should return correct metrics and no report', async () => {
15
15
  const url = 'https://emanuelemazzotta.com';
16
16
  const shouldSaveReport = false;
17
- const result = await processRawLighthouseResult(
18
- reportFixture, url, shouldSaveReport,
19
- );
17
+ const result = await processRawLighthouseResult(reportFixture, url, shouldSaveReport);
20
18
  expect({
21
19
  metrics: {
22
20
  'lighthouse performance': 98,
@@ -35,9 +33,7 @@ describe('test lighthouse badges', () => {
35
33
  const expectedHtmlReport = ReportGenerator.generateReportHtml(reportFixture);
36
34
  const url = 'https://emanuelemazzotta.com';
37
35
  const shouldSaveReport = true;
38
- const result = await processRawLighthouseResult(
39
- reportFixture, url, shouldSaveReport,
40
- );
36
+ const result = await processRawLighthouseResult(reportFixture, url, shouldSaveReport);
41
37
  expect({
42
38
  metrics: {
43
39
  'lighthouse performance': 98,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "lighthouse-badges",
3
- "version": "1.1.14",
3
+ "version": "1.1.18",
4
4
  "description": "🚦Generate gh-badges (shields.io) based on Lighthouse performance.",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -9,20 +9,21 @@
9
9
  "scripts": {
10
10
  "clean": "rm -f *.svg *.html",
11
11
  "docker:build": "docker build --build-arg VCS_REF=`git rev-parse --short HEAD` --build-arg BUILD_DATE=`date -u +\"%Y-%m-%dT%H:%M:%SZ\"` --build-arg VERSION=latest -t emazzotta/lighthouse-badges .",
12
+ "docker:pull": "docker pull emazzotta/lighthouse-badges",
12
13
  "docker:push": "docker push emazzotta/lighthouse-badges",
13
14
  "docker:system-test:run": "docker run emazzotta/lighthouse-badges /bin/sh -c 'lighthouse-badges -rsu https://google.com && EXEC_PATH=/home/chrome/reports npm run system-test:verify --prefix /home/lighthouse'",
14
15
  "lint": "eslint .",
15
16
  "lint:fix": "eslint --fix .",
17
+ "pre-push": "npm-run-all lint:fix test system-test:full-run",
16
18
  "reinstall": "npm uninstall -g . && npm i -g .",
17
19
  "run:global-installation": "[ -z ${PAGE} ] && PAGE=https://google.com ; lighthouse-badges -rsu ${PAGE}",
18
20
  "run:local-installation": "[ -z ${PAGE} ] && PAGE=https://google.com ; node ./src/index.js -rsu ${PAGE}",
19
- "system-test:start-server": "npx http-server -a 127.0.0.1 -p 8080 &",
20
21
  "system-test:full-run": "npm-run-all clean reinstall run:global-installation system-test:verify clean",
21
22
  "system-test:light-run": "npm-run-all clean run:local-installation system-test:verify clean",
23
+ "system-test:start-server": "npx http-server -a 127.0.0.1 -p 8080 &",
22
24
  "system-test:verify": "[ -z ${EXEC_PATH} ] && EXEC_PATH=$PWD ; grep -q '<svg xmlns' ${EXEC_PATH}/*.svg && grep -q '<title>Lighthouse Report</title>' ${EXEC_PATH}/*.html",
23
25
  "test": "jest",
24
- "test:related": "jest --findRelatedTests",
25
- "pre-push": "npm-run-all lint:fix test system-test:full-run"
26
+ "test:related": "jest --findRelatedTests"
26
27
  },
27
28
  "husky": {
28
29
  "hooks": {
@@ -43,21 +44,21 @@
43
44
  "argparse": "2.0.1",
44
45
  "badge-maker": "^3.3.1",
45
46
  "clui": "^0.3.6",
46
- "lighthouse": "^8.6.0",
47
- "ramda": "^0.27.0"
47
+ "lighthouse": "^9.3.1",
48
+ "ramda": "^0.28.0"
48
49
  },
49
50
  "devDependencies": {
50
- "@babel/core": "^7.15.8",
51
- "@babel/plugin-transform-runtime": "^7.15.8",
52
- "@babel/preset-env": "^7.15.8",
53
- "@babel/runtime": "^7.15.4",
54
- "babel-jest": "^27.3.1",
55
- "eslint": "^7.32.0",
56
- "eslint-config-airbnb-base": "^14.2.1",
57
- "eslint-plugin-import": "^2.24.2",
51
+ "@babel/core": "^7.16.12",
52
+ "@babel/plugin-transform-runtime": "^7.16.10",
53
+ "@babel/preset-env": "^7.16.11",
54
+ "@babel/runtime": "^7.16.7",
55
+ "babel-jest": "^27.4.6",
56
+ "eslint": "^8.8.0",
57
+ "eslint-config-airbnb-base": "^15.0.0",
58
+ "eslint-plugin-import": "^2.25.4",
58
59
  "husky": "^7.0.2",
59
- "jest": "^27.3.1",
60
- "lint-staged": "^11.2.4",
60
+ "jest": "^27.4.7",
61
+ "lint-staged": "^12.3.2",
61
62
  "npm-run-all": "^4.1.5"
62
63
  },
63
64
  "jest": {