From 0b37dc63ac8e27ddd170b0f466d20f78ce7ddff3 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Mon, 22 Mar 2021 18:19:16 -0600 Subject: [PATCH 1/5] deps(puppeteer): upgrade to 8.0.0 --- clients/test/extension/popup-test.js | 2 +- .../fraggle-rock/gather/session.js | 2 + lighthouse-core/lib/network-request.js | 1 + .../test/fraggle-rock/gather/session-test.js | 8 +- lighthouse-core/test/gather/driver-test.js | 1 + lighthouse-treemap/test/treemap-test-pptr.js | 2 +- lighthouse-viewer/test/viewer-test-pptr.js | 2 +- package.json | 5 +- yarn.lock | 218 ++++++++++++------ 9 files changed, 163 insertions(+), 78 deletions(-) diff --git a/clients/test/extension/popup-test.js b/clients/test/extension/popup-test.js index a2f1b326aa6f..40654c78df94 100644 --- a/clients/test/extension/popup-test.js +++ b/clients/test/extension/popup-test.js @@ -8,7 +8,7 @@ /* eslint-env jest */ const path = require('path'); -const puppeteer = require('../../../node_modules/puppeteer/index.js'); +const puppeteer = require('puppeteer'); const {DEFAULT_CATEGORIES, STORAGE_KEYS} = require('../../extension/scripts/settings-controller.js'); diff --git a/lighthouse-core/fraggle-rock/gather/session.js b/lighthouse-core/fraggle-rock/gather/session.js index 26ebb9a4fff9..80a2eda37da5 100644 --- a/lighthouse-core/fraggle-rock/gather/session.js +++ b/lighthouse-core/fraggle-rock/gather/session.js @@ -102,6 +102,8 @@ class ProtocolSession { * @return {Promise} */ sendCommand(method, ...params) { + // @ts-expect-error: protocol typings in currently pinned puppeteer are + // often behind what we pin as `devtools-protocol`. return this._session.send(method, ...params); } } diff --git a/lighthouse-core/lib/network-request.js b/lighthouse-core/lib/network-request.js index 9a889f87d68d..018fa37eb854 100644 --- a/lighthouse-core/lib/network-request.js +++ b/lighthouse-core/lib/network-request.js @@ -67,6 +67,7 @@ const RESOURCE_TYPES = { SignedExchange: 'SignedExchange', Ping: 'Ping', CSPViolationReport: 'CSPViolationReport', + Preflight: 'Preflight', }; class NetworkRequest { diff --git a/lighthouse-core/test/fraggle-rock/gather/session-test.js b/lighthouse-core/test/fraggle-rock/gather/session-test.js index e112e9959cf8..f04d4ec62134 100644 --- a/lighthouse-core/test/fraggle-rock/gather/session-test.js +++ b/lighthouse-core/test/fraggle-rock/gather/session-test.js @@ -33,8 +33,8 @@ describe('ProtocolSession', () => { puppeteerSession.on('Foo', regularListener); puppeteerSession.on('*', allListener); - puppeteerSession.emit('Foo', 1, 2, 3); - puppeteerSession.emit('Bar', 1, 2, 3); + puppeteerSession.emit('Foo', 1); + puppeteerSession.emit('Bar', 1); expect(regularListener).toHaveBeenCalledTimes(1); expect(allListener).toHaveBeenCalledTimes(2); @@ -53,8 +53,8 @@ describe('ProtocolSession', () => { puppeteerSession.on('Foo', regularListener); puppeteerSession.on('*', allListener); - puppeteerSession.emit('Foo', 1, 2, 3); - puppeteerSession.emit('Bar', 1, 2, 3); + puppeteerSession.emit('Foo', 1); + puppeteerSession.emit('Bar', 1); expect(regularListener).toHaveBeenCalledTimes(1); expect(allListener).toHaveBeenCalledTimes(2); diff --git a/lighthouse-core/test/gather/driver-test.js b/lighthouse-core/test/gather/driver-test.js index b6855d6f9f51..0153bb301763 100644 --- a/lighthouse-core/test/gather/driver-test.js +++ b/lighthouse-core/test/gather/driver-test.js @@ -262,6 +262,7 @@ describe('.gotoURL', () => { id: 'ABC', loaderId: '', securityOrigin: '', mimeType: 'text/html', domainAndRegistry: '', secureContextType: /** @type {'Secure'} */ ('Secure'), crossOriginIsolatedContextType: /** @type {'Isolated'} */ ('Isolated'), + gatedAPIFeatures: [], }; navigate({...baseFrame, url: 'http://example.com'}); navigate({...baseFrame, url: 'https://example.com'}); diff --git a/lighthouse-treemap/test/treemap-test-pptr.js b/lighthouse-treemap/test/treemap-test-pptr.js index 9283552e15cd..953454a53e81 100644 --- a/lighthouse-treemap/test/treemap-test-pptr.js +++ b/lighthouse-treemap/test/treemap-test-pptr.js @@ -9,7 +9,7 @@ /* global document, window */ -const puppeteer = require('../../node_modules/puppeteer/index.js'); +const puppeteer = require('puppeteer'); const {server} = require('../../lighthouse-cli/test/fixtures/static-server.js'); const portNumber = 10200; const treemapUrl = `http://localhost:${portNumber}/dist/gh-pages/treemap/index.html`; diff --git a/lighthouse-viewer/test/viewer-test-pptr.js b/lighthouse-viewer/test/viewer-test-pptr.js index f1626ab062de..231848bf5602 100644 --- a/lighthouse-viewer/test/viewer-test-pptr.js +++ b/lighthouse-viewer/test/viewer-test-pptr.js @@ -10,7 +10,7 @@ const path = require('path'); const fs = require('fs'); const assert = require('assert').strict; -const puppeteer = require('../../node_modules/puppeteer/index.js'); +const puppeteer = require('puppeteer'); const {server} = require('../../lighthouse-cli/test/fixtures/static-server.js'); const portNumber = 10200; diff --git a/package.json b/package.json index ee721c68d79b..8e7e3e6553cc 100644 --- a/package.json +++ b/package.json @@ -109,7 +109,6 @@ "@types/lodash.isequal": "^4.5.2", "@types/lodash.set": "^4.3.6", "@types/node": "*", - "@types/puppeteer": "1.19.x", "@types/raven": "^2.5.1", "@types/resize-observer-browser": "^0.1.1", "@types/rimraf": "^2.0.2", @@ -133,7 +132,7 @@ "cpy": "^7.0.1", "cross-env": "^7.0.2", "csv-validator": "^0.0.3", - "devtools-protocol": "0.0.805376", + "devtools-protocol": "0.0.863986", "eslint": "^4.19.1", "eslint-config-google": "^0.9.1", "eslint-plugin-local-rules": "0.1.0", @@ -151,7 +150,7 @@ "package-json-versionify": "^1.0.4", "prettier": "^1.14.3", "pretty-json-stringify": "^0.0.2", - "puppeteer": "^1.19.0", + "puppeteer": "^8.0.0", "terser": "^5.3.8", "typed-query-selector": "^2.4.0", "typescript": "4.2.3", diff --git a/yarn.lock b/yarn.lock index d050686ea7e1..33d58f014454 100644 --- a/yarn.lock +++ b/yarn.lock @@ -663,13 +663,6 @@ resolved "https://registry.yarnpkg.com/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz#e486d0d97396d79beedd0a6e33f4534ff6b4973e" integrity sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA== -"@types/puppeteer@1.19.x": - version "1.19.1" - resolved "https://registry.yarnpkg.com/@types/puppeteer/-/puppeteer-1.19.1.tgz#942ca62288953a0f5fbbc25c103b5f2ba28b60ab" - integrity sha512-ReWZvoEfMiJIA3AG+eM+nCx5GKrU2ANVYY5TC0nbpeiTCtnJbcqnmBbR8TkXMBTvLBYcuTOAELbTcuX73siDNQ== - dependencies: - "@types/node" "*" - "@types/raven@^2.5.1": version "2.5.1" resolved "https://registry.yarnpkg.com/@types/raven/-/raven-2.5.1.tgz#62ef0a59e29691945e1f295b62ed199619cbd9b6" @@ -742,6 +735,13 @@ dependencies: "@types/yargs-parser" "*" +"@types/yauzl@^2.9.1": + version "2.9.1" + resolved "https://registry.yarnpkg.com/@types/yauzl/-/yauzl-2.9.1.tgz#d10f69f9f522eef3cf98e30afb684a1e1ec923af" + integrity sha512-A1b8SU4D10uoPjwb0lnHmmu8wZhR9d+9o2PKBQT2jU5YPTKsxac6M2qGAdY7VcL+dHHhARVUDmeg0rOrcd9EjA== + dependencies: + "@types/node" "*" + "@typescript-eslint/parser@4.16.1": version "4.16.1" resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-4.16.1.tgz#3bbd3234dd3c5b882b2bcd9899bc30e1e1586d2a" @@ -883,12 +883,12 @@ add-stream@^1.0.0: resolved "https://registry.yarnpkg.com/add-stream/-/add-stream-1.0.0.tgz#6a7990437ca736d5e1288db92bd3266d5f5cb2aa" integrity sha1-anmQQ3ynNtXhKI25K9MmbV9csqo= -agent-base@^4.3.0: - version "4.3.0" - resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-4.3.0.tgz#8165f01c436009bccad0b1d122f05ed770efc6ee" - integrity sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg== +agent-base@6: + version "6.0.2" + resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-6.0.2.tgz#49fff58577cfee3f37176feab4c22e00f86d7f77" + integrity sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ== dependencies: - es6-promisify "^5.0.0" + debug "4" aggregate-error@^3.0.0: version "3.0.1" @@ -1242,6 +1242,11 @@ base64-js@^1.0.2: resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.3.0.tgz#cab1e6118f051095e58b5281aea8c1cd22bfc0e3" integrity sha512-ccav/yGvoa80BQDljCxsmmQ3Xvx60/UpBIij5QN21W3wBi/hhIC9OoO+KLpu9IJTS9j4DRVJ3aDDF9cMSoa2lw== +base64-js@^1.3.1: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + base@^0.11.1: version "0.11.2" resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f" @@ -1270,6 +1275,15 @@ bl@^1.0.0: readable-stream "^2.3.5" safe-buffer "^5.1.1" +bl@^4.0.3: + version "4.1.0" + resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a" + integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w== + dependencies: + buffer "^5.5.0" + inherits "^2.0.4" + readable-stream "^3.4.0" + bn.js@^4.0.0, bn.js@^4.1.0, bn.js@^4.1.1, bn.js@^4.4.0: version "4.11.9" resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.11.9.tgz#26d556829458f9d1e81fc48952493d0ba3507828" @@ -1541,6 +1555,14 @@ buffer@^5.0.2, buffer@^5.1.0: base64-js "^1.0.2" ieee754 "^1.1.4" +buffer@^5.2.1, buffer@^5.5.0: + version "5.7.1" + resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0" + integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ== + dependencies: + base64-js "^1.3.1" + ieee754 "^1.1.13" + builtin-status-codes@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" @@ -1981,7 +2003,7 @@ concat-map@0.0.1: resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s= -concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@^1.6.2, concat-stream@~1.6.0: +concat-stream@^1.6.0, concat-stream@^1.6.1, concat-stream@~1.6.0: version "1.6.2" resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.6.2.tgz#904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34" integrity sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw== @@ -2437,7 +2459,14 @@ dateformat@^1.0.11, dateformat@^1.0.12: get-stdin "^4.0.1" meow "^3.3.0" -debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9: +debug@4: + version "4.3.1" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.1.tgz#f0d229c505e0c6d8c49ac553d1b13dc183f6b2ee" + integrity sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ== + dependencies: + ms "2.1.2" + +debug@^2.2.0, debug@^2.3.3, debug@^2.6.8: version "2.6.9" resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== @@ -2596,10 +2625,15 @@ detective@^5.0.2: defined "^1.0.0" minimist "^1.1.1" -devtools-protocol@0.0.805376: - version "0.0.805376" - resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.805376.tgz#7ea29e412bfea69e9f2e77bcbafe83c898ad23bd" - integrity sha512-hZBiZTkVOAiWN7eI3oL1ftYtSi/HN8qn7/QYtDUNf9qVCG9/8pt+KyhL3Qoat6nXgiYiyreaz0mr6iB9Edw/sw== +devtools-protocol@0.0.854822: + version "0.0.854822" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.854822.tgz#eac3a5260a6b3b4e729a09fdc0c77b0d322e777b" + integrity sha512-xd4D8kHQtB0KtWW0c9xBZD5LVtm9chkMOfs/3Yn01RhT/sFIsVtzTtypfKoFfWBaL+7xCYLxjOLkhwPXaX/Kcg== + +devtools-protocol@0.0.863986: + version "0.0.863986" + resolved "https://registry.yarnpkg.com/devtools-protocol/-/devtools-protocol-0.0.863986.tgz#a9f1b13daeb1dba671580e59f3a8aa9cb0c921c8" + integrity sha512-WMf5KuRLsLwJMp9JdawSvoEpxZPqyyNeOZ3YR8QF8lE9IVHbbpdWeuXV22SJxPUemFeznvVlwSBeQz91nL+41A== diff-sequences@^24.9.0: version "24.9.0" @@ -2715,7 +2749,7 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== -end-of-stream@^1.0.0, end-of-stream@^1.1.0: +end-of-stream@^1.0.0, end-of-stream@^1.1.0, end-of-stream@^1.4.1: version "1.4.4" resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0" integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q== @@ -2790,18 +2824,6 @@ es6-map@^0.1.5: es6-symbol "~3.1.1" event-emitter "~0.3.5" -es6-promise@^4.0.3: - version "4.2.8" - resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-4.2.8.tgz#4eb21594c972bc40553d276e510539143db53e0a" - integrity sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w== - -es6-promisify@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/es6-promisify/-/es6-promisify-5.0.0.tgz#5109d62f3e56ea967c4b63505aef08291c8a5203" - integrity sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM= - dependencies: - es6-promise "^4.0.3" - es6-set@^0.1.5, es6-set@~0.1.5: version "0.1.5" resolved "https://registry.yarnpkg.com/es6-set/-/es6-set-0.1.5.tgz#d2b3ec5d4d800ced818db538d28974db0a73ccb1" @@ -3116,15 +3138,16 @@ extglob@^2.0.4: snapdragon "^0.8.1" to-regex "^3.0.1" -extract-zip@^1.6.6: - version "1.7.0" - resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-1.7.0.tgz#556cc3ae9df7f452c493a0cfb51cc30277940927" - integrity sha512-xoh5G1W/PB0/27lXgMQyIhP5DSY/LhoCsOyZgb+6iMmRtCwVBo55uKaMoEYrDCKQhWvqEip5ZPKAc6eFNyf/MA== +extract-zip@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/extract-zip/-/extract-zip-2.0.1.tgz#663dca56fe46df890d5f131ef4a06d22bb8ba13a" + integrity sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg== dependencies: - concat-stream "^1.6.2" - debug "^2.6.9" - mkdirp "^0.5.4" + debug "^4.1.1" + get-stream "^5.1.0" yauzl "^2.10.0" + optionalDependencies: + "@types/yauzl" "^2.9.1" extsprintf@1.0.2: version "1.0.2" @@ -3267,7 +3290,7 @@ find-up@^3.0.0: dependencies: locate-path "^3.0.0" -find-up@^4.1.0: +find-up@^4.0.0, find-up@^4.1.0: version "4.1.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== @@ -3815,13 +3838,13 @@ https-browserify@^1.0.0: resolved "https://registry.yarnpkg.com/https-browserify/-/https-browserify-1.0.0.tgz#ec06c10e0a34c0f2faf199f7fd7fc78fffd03c73" integrity sha1-7AbBDgo0wPL68Zn3/X/Hj//QPHM= -https-proxy-agent@^2.2.1: - version "2.2.4" - resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b" - integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg== +https-proxy-agent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz#e2a90542abb68a762e0a0850f6c9edadfd8506b2" + integrity sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA== dependencies: - agent-base "^4.3.0" - debug "^3.1.0" + agent-base "6" + debug "4" humanize-url@^1.0.0: version "1.0.1" @@ -3843,6 +3866,11 @@ idb-keyval@2.2.0: resolved "https://registry.yarnpkg.com/idb-keyval/-/idb-keyval-2.2.0.tgz#b28020d53e3cf1621e3ec605e57e5305f37b195e" integrity sha1-soAg1T488WIePsYF5X5TBfN7GV4= +ieee754@^1.1.13: + version "1.2.1" + resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352" + integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA== + ieee754@^1.1.4: version "1.1.12" resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.1.12.tgz#50bf24e5b9c8bb98af4964c941cdb0918da7b60b" @@ -3916,7 +3944,7 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@~2.0.1, inherits@~2.0.3: +inherits@2, inherits@^2.0.1, inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.1, inherits@~2.0.3: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== @@ -5494,11 +5522,6 @@ mime-types@^2.1.12, mime-types@~2.1.19: dependencies: mime-db "~1.37.0" -mime@^2.0.3: - version "2.4.4" - resolved "https://registry.yarnpkg.com/mime/-/mime-2.4.4.tgz#bd7b91135fc6b01cde3e9bae33d659b63d8857e5" - integrity sha512-LRxmNwziLPT828z+4YkNzloCFC2YM4wrB99k+AV5ZbEyfGNWfG8SO1FUXLmLDBSo89NrJZ4DIWeLjy1CHGhMGA== - mimic-fn@^1.0.0: version "1.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" @@ -5569,7 +5592,12 @@ mixin-deep@^1.2.0: for-in "^1.0.2" is-extendable "^1.0.1" -mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.4: +mkdirp-classic@^0.5.2: + version "0.5.3" + resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113" + integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A== + +mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3: version "0.5.5" resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def" integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ== @@ -5627,7 +5655,7 @@ ms@2.0.0: resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= -ms@^2.1.1: +ms@2.1.2, ms@^2.1.1: version "2.1.2" resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== @@ -6328,6 +6356,13 @@ pkg-dir@^3.0.0: dependencies: find-up "^3.0.0" +pkg-dir@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-4.2.0.tgz#f099133df7ede422e81d1d8448270eeb3e4261f3" + integrity sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ== + dependencies: + find-up "^4.0.0" + pluralize@^7.0.0: version "7.0.0" resolved "https://registry.yarnpkg.com/pluralize/-/pluralize-7.0.0.tgz#298b89df8b93b0221dbf421ad2b1b1ea23fc6777" @@ -6401,10 +6436,10 @@ prompts@^2.0.1: kleur "^3.0.2" sisteransi "^1.0.0" -proxy-from-env@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.0.0.tgz#33c50398f70ea7eb96d21f7b817630a55791c7ee" - integrity sha1-M8UDmPcOp+uW0h97gXYwpVeRx+4= +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== ps-list@^7.2.0: version "7.2.0" @@ -6463,19 +6498,23 @@ pupa@^2.0.1: dependencies: escape-goat "^2.0.0" -puppeteer@^1.19.0: - version "1.20.0" - resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-1.20.0.tgz#e3d267786f74e1d87cf2d15acc59177f471bbe38" - integrity sha512-bt48RDBy2eIwZPrkgbcwHtb51mj2nKvHOPMaSH2IsWiv7lOG9k9zhaRzpDZafrk05ajMc3cu+lSQYYOfH2DkVQ== +puppeteer@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/puppeteer/-/puppeteer-8.0.0.tgz#a236669118aa795331c2d0ca19877159e7664705" + integrity sha512-D0RzSWlepeWkxPPdK3xhTcefj8rjah1791GE82Pdjsri49sy11ci/JQsAO8K2NRukqvwEtcI+ImP5F4ZiMvtIQ== dependencies: debug "^4.1.0" - extract-zip "^1.6.6" - https-proxy-agent "^2.2.1" - mime "^2.0.3" + devtools-protocol "0.0.854822" + extract-zip "^2.0.0" + https-proxy-agent "^5.0.0" + node-fetch "^2.6.1" + pkg-dir "^4.2.0" progress "^2.0.1" - proxy-from-env "^1.0.0" - rimraf "^2.6.1" - ws "^6.1.0" + proxy-from-env "^1.1.0" + rimraf "^3.0.2" + tar-fs "^2.0.0" + unbzip2-stream "^1.3.3" + ws "^7.2.3" q@^1.4.1: version "1.5.1" @@ -6645,6 +6684,15 @@ readable-stream@^2.0.0, readable-stream@^2.0.2, readable-stream@^2.0.5, readable string_decoder "~1.1.1" util-deprecate "~1.0.1" +readable-stream@^3.1.1, readable-stream@^3.4.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198" + integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA== + dependencies: + inherits "^2.0.3" + string_decoder "^1.1.1" + util-deprecate "^1.0.1" + realpath-native@^1.1.0: version "1.1.0" resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-1.1.0.tgz#2003294fea23fb0672f2476ebe22fcf498a2d65c" @@ -7615,6 +7663,16 @@ table@4.0.2: slice-ansi "1.0.0" string-width "^2.1.1" +tar-fs@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784" + integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng== + dependencies: + chownr "^1.1.1" + mkdirp-classic "^0.5.2" + pump "^3.0.0" + tar-stream "^2.1.4" + tar-stream@^1.5.0: version "1.6.2" resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.6.2.tgz#8ea55dab37972253d9a9af90fdcd559ae435c555" @@ -7628,6 +7686,17 @@ tar-stream@^1.5.0: to-buffer "^1.1.1" xtend "^4.0.0" +tar-stream@^2.1.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287" + integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ== + dependencies: + bl "^4.0.3" + end-of-stream "^1.4.1" + fs-constants "^1.0.0" + inherits "^2.0.3" + readable-stream "^3.1.1" + tar@^4: version "4.4.13" resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525" @@ -7717,7 +7786,7 @@ through2@^3.0.1: dependencies: readable-stream "2 || 3" -through@2, "through@>=2.2.7 <3", through@^2.3.6: +through@2, "through@>=2.2.7 <3", through@^2.3.6, through@^2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= @@ -7978,6 +8047,14 @@ unbox-primitive@^1.0.0: has-symbols "^1.0.0" which-boxed-primitive "^1.0.1" +unbzip2-stream@^1.3.3: + version "1.4.3" + resolved "https://registry.yarnpkg.com/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz#b0da04c4371311df771cdc215e87f2130991ace7" + integrity sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg== + dependencies: + buffer "^5.2.1" + through "^2.3.8" + undeclared-identifiers@^1.1.2: version "1.1.3" resolved "https://registry.yarnpkg.com/undeclared-identifiers/-/undeclared-identifiers-1.1.3.tgz#9254c1d37bdac0ac2b52de4b6722792d2a91e30f" @@ -8347,6 +8424,11 @@ ws@^6.1.0: dependencies: async-limiter "~1.0.0" +ws@^7.2.3: + version "7.4.4" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.4.tgz#383bc9742cb202292c9077ceab6f6047b17f2d59" + integrity sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw== + xdg-basedir@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/xdg-basedir/-/xdg-basedir-4.0.0.tgz#4bc8d9984403696225ef83a1573cbbcb4e79db13" From d6d5c4c555b1d4e1149926b45ac58f60630a841b Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Tue, 23 Mar 2021 17:12:58 -0600 Subject: [PATCH 2/5] update --- lighthouse-viewer/test/viewer-test-pptr.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lighthouse-viewer/test/viewer-test-pptr.js b/lighthouse-viewer/test/viewer-test-pptr.js index 231848bf5602..3c61c28029e5 100644 --- a/lighthouse-viewer/test/viewer-test-pptr.js +++ b/lighthouse-viewer/test/viewer-test-pptr.js @@ -163,10 +163,13 @@ describe('Lighthouse Viewer', () => { body: JSON.stringify({error: {message: 'Test error'}}), }; - // Sniffs just the request made to the PSI API. All other requests - // fall through. - // To set the mocked PSI response, assign `psiResponse`. - // To read the intercepted request, use `interceptedRequest`. + /** + * Sniffs just the request made to the PSI API. All other requests + * fall through. + * To set the mocked PSI response, assign `psiResponse`. + * To read the intercepted request, use `interceptedRequest`. + * @param {import('puppeteer').HTTPRequest} request + */ function onRequest(request) { if (request.url().includes('https://www.googleapis.com')) { interceptedRequest = request; From e5bf022388592cb4ebe89200fd5ca25bb254d21d Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Mon, 12 Apr 2021 15:16:08 -0600 Subject: [PATCH 3/5] timeout --- lighthouse-viewer/test/viewer-test-pptr.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lighthouse-viewer/test/viewer-test-pptr.js b/lighthouse-viewer/test/viewer-test-pptr.js index 3c61c28029e5..6f6563e281a6 100644 --- a/lighthouse-viewer/test/viewer-test-pptr.js +++ b/lighthouse-viewer/test/viewer-test-pptr.js @@ -201,7 +201,7 @@ describe('Lighthouse Viewer', () => { await viewerPage.goto(url); // Wait for report to render. - await viewerPage.waitForSelector('.lh-metrics-container'); + await viewerPage.waitForSelector('.lh-metrics-container', {timeout: 5000}); const interceptedUrl = new URL(interceptedRequest.url()); expect(interceptedUrl.origin + interceptedUrl.pathname) From 1969a3c64fa421e88d377e3b8b4d3c23c2682ee9 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 20 May 2021 17:56:59 -0700 Subject: [PATCH 4/5] yay --- lighthouse-viewer/test/viewer-test-pptr.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lighthouse-viewer/test/viewer-test-pptr.js b/lighthouse-viewer/test/viewer-test-pptr.js index 6f6563e281a6..c7c063b13714 100644 --- a/lighthouse-viewer/test/viewer-test-pptr.js +++ b/lighthouse-viewer/test/viewer-test-pptr.js @@ -148,19 +148,29 @@ describe('Lighthouse Viewer', () => { }); describe('PSI', () => { + /** @type {Partial} */ let interceptedRequest; + /** @type {Partial} */ let psiResponse; const sampleLhrJson = JSON.parse(fs.readFileSync(sampleLhr, 'utf-8')); + /** @type {Partial} */ const goodPsiResponse = { status: 200, contentType: 'application/json', body: JSON.stringify({lighthouseResult: sampleLhrJson}), + headers: { + 'Access-Control-Allow-Origin': '*', + }, }; + /** @type {Partial} */ const badPsiResponse = { status: 500, contentType: 'application/json', body: JSON.stringify({error: {message: 'Test error'}}), + headers: { + 'Access-Control-Allow-Origin': '*', + }, }; /** From fefebf18ece96e531459d762deadae8bef94da46 Mon Sep 17 00:00:00 2001 From: Connor Clark Date: Thu, 20 May 2021 18:18:42 -0700 Subject: [PATCH 5/5] tsc --- lighthouse-core/scripts/pptr-run-devtools.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lighthouse-core/scripts/pptr-run-devtools.js b/lighthouse-core/scripts/pptr-run-devtools.js index 578f17870467..7f7094474767 100644 --- a/lighthouse-core/scripts/pptr-run-devtools.js +++ b/lighthouse-core/scripts/pptr-run-devtools.js @@ -19,8 +19,6 @@ const fs = require('fs'); const readline = require('readline'); const yargs = require('yargs/yargs'); -/** @typedef {{result?: {value?: string, objectId?: number}, exceptionDetails?: object}} RuntimeEvaluateResponse */ - const argv = yargs(process.argv.slice(2)) .usage('$0 [url]') .help('help').alias('help', 'h') @@ -116,7 +114,7 @@ async function testPage(browser, url) { .catch(reject); }); - /** @type {RuntimeEvaluateResponse|undefined} */ + /** @type {Omit|undefined} */ let startLHResponse; while (!startLHResponse || startLHResponse.exceptionDetails) { startLHResponse = await session.send('Runtime.evaluate', { @@ -125,7 +123,7 @@ async function testPage(browser, url) { }).catch(err => ({exceptionDetails: err})); } - /** @type {RuntimeEvaluateResponse} */ + /** @type {puppeteer.Protocol.Runtime.EvaluateResponse} */ const remoteLhrResponse = await session.send('Runtime.evaluate', { expression: sniffLhr, awaitPromise: true,