diff --git a/docs/releasing.md b/docs/releasing.md index 05f144291a12..c6695b9867cb 100644 --- a/docs/releasing.md +++ b/docs/releasing.md @@ -109,33 +109,3 @@ yarn deploy-viewer # * Tell the world!!! * echo "Complete the _Release publicity_ tasks documented above" ``` - -### Extension Canary release - -```sh -# Pull latest in a clean non-dev clone. - -yarn install-all - -# Update manifest_canary.json w/ version bumps. - -# branch and commit -git commmit -m "bump extension canary to 2.0.0.X" - -npm version prerelease # this will commit - - -# overwrite extension's manifest w/ manifest_canary. - -yarn build-all - -cd lighthouse-extension/ -gulp package -# upload zip to CWS and publish - -# verify you build-all'd for the typescript compile -# ... - -# publish to canary tag! -npm publish --tag canary -``` diff --git a/lighthouse-cli/run.js b/lighthouse-cli/run.js index 420eb3d5cfc3..fe84f7396566 100644 --- a/lighthouse-cli/run.js +++ b/lighthouse-cli/run.js @@ -160,8 +160,13 @@ function runLighthouse(url, flags, config) { const resultsP = chromeP.then(_ => { return lighthouse(url, flags, config).then(runnerResult => { return potentiallyKillChrome().then(_ => runnerResult); - }).then(runnerResult => { - return saveResults(runnerResult, flags).then(_ => runnerResult); + }).then(async runnerResult => { + // If in gatherMode only, there will be no runnerResult. + if (runnerResult) { + await saveResults(runnerResult, flags); + } + + return runnerResult; }); }); diff --git a/lighthouse-core/gather/connections/raw.js b/lighthouse-core/gather/connections/raw.js index b2c02ae01dfe..c165f039d1ea 100644 --- a/lighthouse-core/gather/connections/raw.js +++ b/lighthouse-core/gather/connections/raw.js @@ -10,22 +10,11 @@ const Connection = require('./connection.js'); /* eslint-disable no-unused-vars */ /** - * @interface + * @typedef {object} Port + * @property {(eventName: 'message'|'close', cb: ((arg: string) => void) | (() => void)) => void} on + * @property {(message: string) => void} send + * @property {() => void} close */ -class Port { - /** - * @param {'message' | 'close'} eventName - * @param {function(string)|function()} cb - */ - on(eventName, cb) { } - - /** - * @param {string} message - */ - send(message) { } - - close() { } -} /* eslint-enable no-unused-vars */ diff --git a/lighthouse-core/index.js b/lighthouse-core/index.js index b8f462d8c8cc..47b2e85b54ac 100644 --- a/lighthouse-core/index.js +++ b/lighthouse-core/index.js @@ -3,7 +3,6 @@ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ -// @ts-nocheck 'use strict'; const Runner = require('./runner'); @@ -28,23 +27,25 @@ const Config = require('./config/config'); /** * @param {string} url - * @param {LH.Flags} flags + * @param {LH.Flags=} flags * @param {LH.Config.Json|undefined} configJSON - * @return {Promise} + * @return {Promise} */ -function lighthouse(url, flags = {}, configJSON) { - return Promise.resolve().then(_ => { - // set logging preferences, assume quiet - flags.logLevel = flags.logLevel || 'error'; - log.setLevel(flags.logLevel); - - // Use ConfigParser to generate a valid config file - const config = new Config(configJSON, flags); - const connection = new ChromeProtocol(flags.port, flags.hostname); - - // kick off a lighthouse run - return Runner.run(connection, {url, config}); - }); +async function lighthouse(url, flags, configJSON) { + // TODO(bckenny): figure out Flags types. + flags = flags || /** @type {LH.Flags} */ ({}); + + // set logging preferences, assume quiet + flags.logLevel = flags.logLevel || 'error'; + log.setLevel(flags.logLevel); + + // Use ConfigParser to generate a valid config file + // @ts-ignore - TODO(bckenny): type checking for Config + const config = /** @type {LH.Config} */ (new Config(configJSON, flags)); + const connection = new ChromeProtocol(flags.port, flags.hostname); + + // kick off a lighthouse run + return Runner.run(connection, {url, config}); } lighthouse.getAuditList = Runner.getAuditList; diff --git a/lighthouse-extension/app/manifest.json b/lighthouse-extension/app/manifest.json index c68d1f86f284..b1509b5cf385 100644 --- a/lighthouse-extension/app/manifest.json +++ b/lighthouse-extension/app/manifest.json @@ -11,7 +11,6 @@ "default_locale": "en", "background": { "scripts": [ - "scripts/chromereload.js", "scripts/lighthouse-ext-background.js" ], "persistent": false diff --git a/lighthouse-extension/app/manifest_canary.json b/lighthouse-extension/app/manifest_canary.json deleted file mode 100644 index f40e0a1b4259..000000000000 --- a/lighthouse-extension/app/manifest_canary.json +++ /dev/null @@ -1,33 +0,0 @@ -{ - "name": "__MSG_appName__", - "version": "2.0.0.7", - "version_name": "2.0.0-alpha.7 2017-05-16", - "minimum_chrome_version": "56", - "manifest_version": 2, - "description": "__MSG_appDescription__", - "icons": { - "16": "images/lh_logo_canary_bg.png", - "128": "images/lh_logo_canary_bg.png" - }, - "default_locale": "en", - "background": { - "scripts": [ - "scripts/chromereload.js", - "scripts/lighthouse-ext-background.js" - ], - "persistent": false - }, - "permissions": [ - "activeTab", - "debugger", - "storage" - ], - "browser_action": { - "default_icon": { - "38": "images/lh_logo_canary_icon.png" - }, - "default_title": "Lighthouse", - "default_popup": "popup.html" - }, - "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'none'" -} diff --git a/lighthouse-extension/app/popup.html b/lighthouse-extension/app/popup.html index 572592c25dc9..8442b5e7218b 100644 --- a/lighthouse-extension/app/popup.html +++ b/lighthouse-extension/app/popup.html @@ -56,12 +56,6 @@

...