From fb3368d0d4adf557d0f0973f6ac72aef5216be24 Mon Sep 17 00:00:00 2001 From: soulgalore Date: Wed, 30 Aug 2023 22:00:27 +0200 Subject: [PATCH] Use Coach 8.0.0 and display versions. https://github.com/sitespeedio/sitespeed.io/issues/3949 --- lib/plugins/browsertime/index.js | 13 ++++- .../html/templates/url/coach/index.pug | 3 +- .../html/templates/url/coach/technology.pug | 8 +++- .../html/templates/url/thirdparty/index.pug | 3 +- npm-shrinkwrap.json | 47 ++++++++++--------- package.json | 2 +- 6 files changed, 47 insertions(+), 29 deletions(-) diff --git a/lib/plugins/browsertime/index.js b/lib/plugins/browsertime/index.js index bd6791ded8..d80fa10696 100644 --- a/lib/plugins/browsertime/index.js +++ b/lib/plugins/browsertime/index.js @@ -10,7 +10,13 @@ import isEmpty from 'lodash.isempty'; import get from 'lodash.get'; import { Stats } from 'fast-stats'; import coach from 'coach-core'; -const { pickAPage, analyseHar, merge } = coach; +const { + pickAPage, + analyseHar, + merge, + getThirdPartyWebVersion, + getWappalyzerCoreVersion +} = coach; import { SitespeedioPlugin } from '@sitespeed.io/plugin'; import { summarizeStats } from '../../support/statsHelpers.js'; @@ -505,6 +511,11 @@ export default class BrowsertimePlugin extends SitespeedioPlugin { ); advice = merge(coachAdvice, harResult); } + const thirdPartyWebVersion = getThirdPartyWebVersion(); + const wappalyzerVersion = getWappalyzerCoreVersion(); + advice.thirdPartyWebVersion = thirdPartyWebVersion; + advice.wappalyzerVersion = wappalyzerVersion; + super.sendMessage('coach.run', advice, { url, group, diff --git a/lib/plugins/html/templates/url/coach/index.pug b/lib/plugins/html/templates/url/coach/index.pug index 0ee3b4824b..490936c2c1 100644 --- a/lib/plugins/html/templates/url/coach/index.pug +++ b/lib/plugins/html/templates/url/coach/index.pug @@ -54,6 +54,7 @@ mixin adviceInfo(name, id, perfectScore, node) p #{perfectScore} - const advice = pageInfo.data.coach.run ? pageInfo.data.coach.run.advice : pageInfo.data.coach.pageSummary.advice; +- const coachVersion = pageInfo.data.coach.run ? pageInfo.data.coach.run.version : pageInfo.data.coach.pageSummary.version; small if advice @@ -73,7 +74,7 @@ small h2 Coach p.small a(href='https://github.com/sitespeedio/coach') The coach - |  helps you find performance problems on your web page using web performance best practice rules. And gives you advice on privacy and best practices. + |  helps you find performance problems on your web page using web performance best practice rules. And gives you advice on privacy and best practices. Tested using Coach-core version #{coachVersion}. script(type='text/javascript'). function toggleRow(toggleElement) { diff --git a/lib/plugins/html/templates/url/coach/technology.pug b/lib/plugins/html/templates/url/coach/technology.pug index 7e0ad98588..b9d0613ba9 100644 --- a/lib/plugins/html/templates/url/coach/technology.pug +++ b/lib/plugins/html/templates/url/coach/technology.pug @@ -1,7 +1,11 @@ +- const wappalyserVersion = pageInfo.data.coach.run ? pageInfo.data.coach.run.wappalyzerVersion : pageInfo.data.coach.pageSummary.wappalyzerVersion; +- const thirdPartyWebVersion = pageInfo.data.coach.run ? pageInfo.data.coach.run.thirdPartyWebVersion : pageInfo.data.coach.pageSummary.thirdPartyWebVersion; + a#technology h2 Technologies used to build the page. p Data collected using - a(href='https://github.com/AliasIO/wappalyzer') Wappalyzer. + a(href='https://github.com/dochne/wappalyzer') Wappalyzer + | version #{wappalyserVersion}. | Use code --browsertime.firefox.includeResponseBodies html | or @@ -27,7 +31,7 @@ else if (advice.info.thirdparty && Object.keys(advice.info.thirdparty.toolsByCategory).length > 0) p Data collected using - a(href='https://github.com/patrickhulce/third-party-web') Third Party Web. + a(href='https://github.com/patrickhulce/third-party-web') Third Party Web #{thirdPartyWebVersion} table each data, category in advice.info.thirdparty.toolsByCategory diff --git a/lib/plugins/html/templates/url/thirdparty/index.pug b/lib/plugins/html/templates/url/thirdparty/index.pug index 812299b5ce..d88521a388 100644 --- a/lib/plugins/html/templates/url/thirdparty/index.pug +++ b/lib/plugins/html/templates/url/thirdparty/index.pug @@ -21,9 +21,10 @@ a#third-party a#third-party-categories h2 Third party +- const thirdPartyWebVersion = pageInfo.data.coach.run ? pageInfo.data.coach.run.thirdPartyWebVersion : pageInfo.data.coach.pageSummary.thirdPartyWebVersion; p Third party requests categorised by a(href='https://github.com/patrickhulce/third-party-web') Third party web - | . + |  version #{thirdPartyWebVersion}. if thirdparty.category && Object.keys(thirdparty.category).length > 0 .row diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index a8962d963e..8edcd25af2 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -17,7 +17,7 @@ "axe-core": "4.7.2", "browsertime": "17.15.0", "cli-color": "2.0.3", - "coach-core": "7.2.1", + "coach-core": "8.0.0", "concurrent-queue": "7.0.2", "dayjs": "1.11.9", "fast-crc32c": "2.0.0", @@ -2425,9 +2425,9 @@ } }, "node_modules/coach-core": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/coach-core/-/coach-core-7.2.1.tgz", - "integrity": "sha512-Mci7Pwf+jmUmpAuao07v1n1yyHs3rQJQwLfRh7xs8ixzl7i0t1XfYWWKF2rdM7UeVmkJUadTdw24N3QotYBWSQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/coach-core/-/coach-core-8.0.0.tgz", + "integrity": "sha512-Jq1n+utKMuXJA0KC1JjTyCBQJPQFEsPdTN/HiSwvW4U8p5B/pe9lxvrYNIc7Oc/VhkBjXgNlfdsxIbxtCfh0xw==", "dependencies": { "filter-files": "0.4.0", "json-stable-stringify": "1.0.2", @@ -2435,8 +2435,8 @@ "lodash.merge": "4.6.2", "lodash.sortby": "4.7.0", "pagexray": "4.4.2", - "third-party-web": "0.23.0", - "wappalyzer-core": "6.10.62" + "third-party-web": "0.24.0", + "wappalyzer-core": "6.10.66" }, "engines": { "node": ">=14.0.0" @@ -8781,9 +8781,9 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "node_modules/third-party-web": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.23.0.tgz", - "integrity": "sha512-JMN1CYDnalQKs4Iyp2/HH1bhy4Euw5Tt1SSAANxmIQCXHrsMiD0c46KNDiRteuKkghXNEOzFlGoXAp3ewXdCXQ==" + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.24.0.tgz", + "integrity": "sha512-mMkV7LE857QCG9DM/mkZoqsEEbJmtimnWBgm/bAmJuRlfVM29OLhPFse1ayrW1xmtJqg7bVU6ZBtjz8vVQGq2g==" }, "node_modules/through": { "version": "2.3.8", @@ -9125,9 +9125,10 @@ } }, "node_modules/wappalyzer-core": { - "version": "6.10.62", - "resolved": "https://registry.npmjs.org/wappalyzer-core/-/wappalyzer-core-6.10.62.tgz", - "integrity": "sha512-cCRWcH1L5E6UhCgnPw3w09bBfqH35OL87RjQri7QtQRqxjBlHr+BWKRObphAG0nBo1N01VZe/1EE/zRtEaUBHw==", + "version": "6.10.66", + "resolved": "https://registry.npmjs.org/wappalyzer-core/-/wappalyzer-core-6.10.66.tgz", + "integrity": "sha512-7EOYy4DpdRcfoW00SfCwKjJE3//AAbyl2dzuG6DgICKPoRf60ero/1fBHOB2ipVTmIxpnnlsJ8jY0r5McwRwtA==", + "deprecated": "Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.", "funding": [ { "url": "https://github.com/sponsors/aliasio" @@ -11239,9 +11240,9 @@ } }, "coach-core": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/coach-core/-/coach-core-7.2.1.tgz", - "integrity": "sha512-Mci7Pwf+jmUmpAuao07v1n1yyHs3rQJQwLfRh7xs8ixzl7i0t1XfYWWKF2rdM7UeVmkJUadTdw24N3QotYBWSQ==", + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/coach-core/-/coach-core-8.0.0.tgz", + "integrity": "sha512-Jq1n+utKMuXJA0KC1JjTyCBQJPQFEsPdTN/HiSwvW4U8p5B/pe9lxvrYNIc7Oc/VhkBjXgNlfdsxIbxtCfh0xw==", "requires": { "filter-files": "0.4.0", "json-stable-stringify": "1.0.2", @@ -11249,8 +11250,8 @@ "lodash.merge": "4.6.2", "lodash.sortby": "4.7.0", "pagexray": "4.4.2", - "third-party-web": "0.23.0", - "wappalyzer-core": "6.10.62" + "third-party-web": "0.24.0", + "wappalyzer-core": "6.10.66" } }, "code-excerpt": { @@ -16073,9 +16074,9 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=" }, "third-party-web": { - "version": "0.23.0", - "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.23.0.tgz", - "integrity": "sha512-JMN1CYDnalQKs4Iyp2/HH1bhy4Euw5Tt1SSAANxmIQCXHrsMiD0c46KNDiRteuKkghXNEOzFlGoXAp3ewXdCXQ==" + "version": "0.24.0", + "resolved": "https://registry.npmjs.org/third-party-web/-/third-party-web-0.24.0.tgz", + "integrity": "sha512-mMkV7LE857QCG9DM/mkZoqsEEbJmtimnWBgm/bAmJuRlfVM29OLhPFse1ayrW1xmtJqg7bVU6ZBtjz8vVQGq2g==" }, "through": { "version": "2.3.8", @@ -16351,9 +16352,9 @@ "dev": true }, "wappalyzer-core": { - "version": "6.10.62", - "resolved": "https://registry.npmjs.org/wappalyzer-core/-/wappalyzer-core-6.10.62.tgz", - "integrity": "sha512-cCRWcH1L5E6UhCgnPw3w09bBfqH35OL87RjQri7QtQRqxjBlHr+BWKRObphAG0nBo1N01VZe/1EE/zRtEaUBHw==" + "version": "6.10.66", + "resolved": "https://registry.npmjs.org/wappalyzer-core/-/wappalyzer-core-6.10.66.tgz", + "integrity": "sha512-7EOYy4DpdRcfoW00SfCwKjJE3//AAbyl2dzuG6DgICKPoRf60ero/1fBHOB2ipVTmIxpnnlsJ8jY0r5McwRwtA==" }, "webidl-conversions": { "version": "3.0.1", diff --git a/package.json b/package.json index da0733b5ea..b3e124cee5 100644 --- a/package.json +++ b/package.json @@ -84,7 +84,7 @@ "aws-sdk": "2.1327.0", "axe-core": "4.7.2", "browsertime": "17.15.0", - "coach-core": "7.2.1", + "coach-core": "8.0.0", "cli-color": "2.0.3", "concurrent-queue": "7.0.2", "dayjs": "1.11.9",