From aa2766a2db09bd4af0646a4b5a5270bde663e06c Mon Sep 17 00:00:00 2001 From: housseindjirdeh Date: Fri, 25 Oct 2019 12:20:13 -0400 Subject: [PATCH 1/4] connects lib via ids --- lighthouse-core/lib/stack-collector.js | 7 +++++-- package.json | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lighthouse-core/lib/stack-collector.js b/lighthouse-core/lib/stack-collector.js index 984d8b1dca60..b943eb4477c9 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,6 +29,7 @@ const libDetectorSource = fs.readFileSync( /** * @typedef JSLibrary + * @property {string} id * @property {string} name * @property {string} icon * @property {string|null} version @@ -53,6 +55,7 @@ async function detectLibraries() { const result = await lib.test(window); if (result) { libraries.push({ + id: lib.id, name: name, icon: lib.icon, version: result.version, @@ -80,7 +83,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", From bea0a99b8ea5eb8703cede26b4661486d15b7764 Mon Sep 17 00:00:00 2001 From: housseindjirdeh Date: Fri, 25 Oct 2019 16:26:20 -0400 Subject: [PATCH 2/4] removes unecessary id --- lighthouse-core/lib/stack-collector.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/lighthouse-core/lib/stack-collector.js b/lighthouse-core/lib/stack-collector.js index b943eb4477c9..8fd8633fecbc 100644 --- a/lighthouse-core/lib/stack-collector.js +++ b/lighthouse-core/lib/stack-collector.js @@ -31,7 +31,6 @@ const libDetectorSource = fs.readFileSync( * @typedef JSLibrary * @property {string} id * @property {string} name - * @property {string} icon * @property {string|null} version * @property {string|null} npm */ @@ -57,7 +56,6 @@ async function detectLibraries() { libraries.push({ id: lib.id, name: name, - icon: lib.icon, version: result.version, npm: lib.npm, }); From c931f99f82bcff07c80c3f2720441b5772937993 Mon Sep 17 00:00:00 2001 From: housseindjirdeh Date: Tue, 29 Oct 2019 17:56:06 -0400 Subject: [PATCH 3/4] updates yarn lock --- yarn.lock | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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" From 5d508b21c26dbbd9c4df0f127a3636068caec2a4 Mon Sep 17 00:00:00 2001 From: housseindjirdeh Date: Tue, 29 Oct 2019 18:04:26 -0400 Subject: [PATCH 4/4] updates smoke test with newer id --- lighthouse-cli/test/smokehouse/dobetterweb/dbw-expectations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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',