diff --git a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js index d3de80f8d691..33e2b37eac11 100644 --- a/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js +++ b/lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js @@ -15,7 +15,7 @@ const expectations = [ Stacks: [{ id: 'jquery', }, { - id: 'jquery', + id: 'jquery-fast', name: 'jQuery (Fast path)', }, { id: 'wordpress', diff --git a/lighthouse-core/lib/stack-collector.js b/lighthouse-core/lib/stack-collector.js index 984d8b1dca60..8fd8633fecbc 100644 --- a/lighthouse-core/lib/stack-collector.js +++ b/lighthouse-core/lib/stack-collector.js @@ -20,7 +20,8 @@ const libDetectorSource = fs.readFileSync( /** @typedef {false | {version: string|null}} JSLibraryDetectorTestResult */ /** * @typedef JSLibraryDetectorTest - * @property {string} icon Essentially an id, useful if no npm name is detected. + * @property {string} id + * @property {string} icon * @property {string} url * @property {string|null} npm npm module name, if applicable to library. * @property {function(Window): JSLibraryDetectorTestResult | Promise} test Returns false if library is not present, otherwise returns an object that contains the library version (set to null if the version is not detected). @@ -28,8 +29,8 @@ const libDetectorSource = fs.readFileSync( /** * @typedef JSLibrary + * @property {string} id * @property {string} name - * @property {string} icon * @property {string|null} version * @property {string|null} npm */ @@ -53,8 +54,8 @@ async function detectLibraries() { const result = await lib.test(window); if (result) { libraries.push({ + id: lib.id, name: name, - icon: lib.icon, version: result.version, npm: lib.npm, }); @@ -80,7 +81,7 @@ async function collectStacks(passContext) { return jsLibraries.map(lib => ({ detector: /** @type {'js'} */ ('js'), - id: lib.npm || lib.icon, + id: lib.id, name: lib.name, version: lib.version || undefined, npm: lib.npm || undefined, diff --git a/package.json b/package.json index 35a07748f6ae..e0cb48605b61 100644 --- a/package.json +++ b/package.json @@ -140,7 +140,7 @@ "intl-messageformat": "^4.4.0", "intl-pluralrules": "^1.0.3", "jpeg-js": "0.1.2", - "js-library-detector": "^5.5.0", + "js-library-detector": "^5.6.0", "jsonld": "^1.5.0", "jsonlint-mod": "^1.7.5", "lighthouse-logger": "^1.2.0", diff --git a/yarn.lock b/yarn.lock index 1e20d91d6cb8..6603af34f883 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4679,10 +4679,10 @@ jpeg-js@0.1.2, jpeg-js@^0.1.2: resolved "https://registry.yarnpkg.com/jpeg-js/-/jpeg-js-0.1.2.tgz#135b992c0575c985cfa0f494a3227ed238583ece" integrity sha1-E1uZLAV1yYXPoPSUoyJ+0jhYPs4= -js-library-detector@^5.5.0: - version "5.5.0" - resolved "https://registry.yarnpkg.com/js-library-detector/-/js-library-detector-5.5.0.tgz#3cf17128f6eaaf594d3d6b4c631d18eca059bfdc" - integrity sha512-rLRizuKBAYFmCQM7Efjdbf8u8EoJnfuTlKYUBLQ/2bj9Raw2tr09guQoto/4NIOGmpAYLrzJQ0fmPUqxABCM5w== +js-library-detector@^5.6.0: + version "5.6.0" + resolved "https://registry.yarnpkg.com/js-library-detector/-/js-library-detector-5.6.0.tgz#a44c95237870b5e4f66f0aff948270df7ec9f277" + integrity sha512-s9LeTXee2J+7qXQHJ1EHPbK4Mk5ZU820Wrw+EOxDRQcn2Tay4n+SvZaqJa6T8UpKu5mIomSh6nXoyuP1j2DzUw== js-tokens@^1.0.1: version "1.0.3"