diff --git a/build/build-bundle.js b/build/build-bundle.js index 20963e5abdf6..9fab54dacdad 100644 --- a/build/build-bundle.js +++ b/build/build-bundle.js @@ -16,9 +16,8 @@ import {createRequire} from 'module'; import esMain from 'es-main'; import {rollup} from 'rollup'; -// TODO(esmodules): convert pubads to esm -// // @ts-expect-error: plugin has no types. -// import PubAdsPlugin from 'lighthouse-plugin-publisher-ads/plugin.js'; +// @ts-expect-error: plugin has no types. +import PubAdsPlugin from 'lighthouse-plugin-publisher-ads'; import * as rollupPlugins from './rollup-plugins.js'; import {Runner} from '../core/runner.js'; @@ -37,8 +36,8 @@ const GIT_READABLE_REF = // HACK: manually include the lighthouse-plugin-publisher-ads audits. /** @type {Array} */ -// // @ts-expect-error -// const pubAdsAudits = PubAdsPlugin.audits.map(a => a.path); +// @ts-expect-error +const pubAdsAudits = PubAdsPlugin.audits.map(a => a.path); /** @param {string} file */ const isDevtools = file => @@ -89,12 +88,12 @@ async function buildBundle(entryPath, distPath, opts = {minify: true}) { ]; // Include lighthouse-plugin-publisher-ads. - // if (isDevtools(entryPath) || isLightrider(entryPath)) { - // dynamicModulePaths.push('lighthouse-plugin-publisher-ads'); - // pubAdsAudits.forEach(pubAdAudit => { - // dynamicModulePaths.push(pubAdAudit); - // }); - // } + if (isDevtools(entryPath) || isLightrider(entryPath)) { + dynamicModulePaths.push('lighthouse-plugin-publisher-ads'); + pubAdsAudits.forEach(pubAdAudit => { + dynamicModulePaths.push(pubAdAudit); + }); + } const bundledMapEntriesCode = dynamicModulePaths.map(modulePath => { const pathNoExt = modulePath.replace('.js', ''); diff --git a/cli/test/smokehouse/core-tests.js b/cli/test/smokehouse/core-tests.js index f8756b5b1d34..da4efe426450 100644 --- a/cli/test/smokehouse/core-tests.js +++ b/cli/test/smokehouse/core-tests.js @@ -42,7 +42,7 @@ import perfFonts from './test-definitions/perf-fonts.js'; import perfFrameMetrics from './test-definitions/perf-frame-metrics.js'; import perfPreload from './test-definitions/perf-preload.js'; import perfTraceElements from './test-definitions/perf-trace-elements.js'; -// import pubads from './test-definitions/pubads.js'; +import pubads from './test-definitions/pubads.js'; import pwaAirhorner from './test-definitions/pwa-airhorner.js'; import pwaCaltrain from './test-definitions/pwa-caltrain.js'; import pwaChromestatus from './test-definitions/pwa-chromestatus.js'; @@ -103,8 +103,7 @@ const smokeTests = [ perfFrameMetrics, perfPreload, perfTraceElements, - // TODO(esmodules): enable when pubads is bundled again - // pubads, + pubads, pwaAirhorner, pwaChromestatus, pwaSvgomg, diff --git a/clients/devtools/devtools-entry.js b/clients/devtools/devtools-entry.js index e53fe4806834..ca3abb1294f9 100644 --- a/clients/devtools/devtools-entry.js +++ b/clients/devtools/devtools-entry.js @@ -52,8 +52,7 @@ function createConfig(categoryIDs, device) { return { extends: 'lighthouse:default', - // TODO(esmodules): re-enable when pubads works again - // plugins: ['lighthouse-plugin-publisher-ads'], + plugins: ['lighthouse-plugin-publisher-ads'], settings, }; } diff --git a/core/scripts/release/package-test.sh b/core/scripts/release/package-test.sh index 2d3952e496cc..d2f653bafc45 100644 --- a/core/scripts/release/package-test.sh +++ b/core/scripts/release/package-test.sh @@ -20,7 +20,7 @@ cd /tmp/lighthouse-local-test npm init -y npm install "$LH_ROOT/lighthouse-$VERSION.tgz" -npm install lighthouse-plugin-publisher-ads +npm install lighthouse-plugin-publisher-ads@next npm explore lighthouse -- npm run fast -- http://example.com # Packaged smokehouse/lighthouse using root's static-server and test fixtures. diff --git a/package.json b/package.json index 14c6a58d3c54..7b3497b5a905 100644 --- a/package.json +++ b/package.json @@ -159,7 +159,7 @@ "jsdom": "^12.2.0", "jsonld": "^5.2.0", "jsonlint-mod": "^1.7.6", - "lighthouse-plugin-publisher-ads": "^1.5.6", + "lighthouse-plugin-publisher-ads": "1.5.7-beta", "magic-string": "^0.25.7", "mime-types": "^2.1.30", "mocha": "^10.0.0", diff --git a/yarn.lock b/yarn.lock index b6885b06dc9f..45dde63d8697 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5094,10 +5094,10 @@ lighthouse-logger@^1.0.0, lighthouse-logger@^1.3.0: debug "^2.6.9" marky "^1.2.2" -lighthouse-plugin-publisher-ads@^1.5.6: - version "1.5.6" - resolved "https://registry.yarnpkg.com/lighthouse-plugin-publisher-ads/-/lighthouse-plugin-publisher-ads-1.5.6.tgz#243ccb77bed4985229c7238f902d4398ba963851" - integrity sha512-EejkyHMy3m+f4AgsyufijoNaH052+7Y258gjJ0NRohGjokpsU/D41L2MZEPNWjJm+n0+IbY+nJEsH3AyS43irA== +lighthouse-plugin-publisher-ads@1.5.7-beta: + version "1.5.7-beta" + resolved "https://registry.yarnpkg.com/lighthouse-plugin-publisher-ads/-/lighthouse-plugin-publisher-ads-1.5.7-beta.tgz#ac35b0d8f9ee01c774d45a18fee109cded6395ec" + integrity sha512-Wh9A0RNEPtJowJ34LflMX/g8IDtJh4/ie757UIrsBLc1swWCrKvl2bVzuXRuzmr9ErTkNlqtm8wbdXEoD6bDCw== dependencies: "@tusbar/cache-control" "^0.3.1" esprima "^4.0.1" @@ -6128,7 +6128,6 @@ query-string@^4.1.0: quibble@^0.6.7, quibble@connorjclark/quibble#mod-cache: version "0.6.14" - uid "68d53b087d4c9117cc86c7e5f19e7953a219582b" resolved "https://codeload.github.com/connorjclark/quibble/tar.gz/68d53b087d4c9117cc86c7e5f19e7953a219582b" dependencies: lodash "^4.17.21"