From 403b6a95e41c0fb2535affb2d09046650260dd86 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 25 Sep 2017 14:50:37 -0700 Subject: [PATCH 1/2] switch to using standalone chrome-launcher package --- .eslintignore | 3 - .gitignore | 6 - .travis.yml | 2 - CONTRIBUTING.md | 12 - chrome-launcher/.clang-format | 6 - chrome-launcher/.npmignore | 17 - chrome-launcher/LICENSE | 202 --- chrome-launcher/README.md | 128 +- chrome-launcher/changelog.md | 32 - chrome-launcher/chrome-finder.ts | 228 --- chrome-launcher/chrome-launcher.ts | 336 ---- chrome-launcher/compiled-check.js | 14 - chrome-launcher/flags.ts | 28 - .../{test/random-port-test.ts => index.js} | 20 +- chrome-launcher/index.ts | 1 - chrome-launcher/manual-chrome-launcher.js | 16 +- chrome-launcher/package.json | 36 - chrome-launcher/random-port.ts | 23 - chrome-launcher/scripts/format.sh | 5 - chrome-launcher/test/check-formatting.sh | 15 - chrome-launcher/test/chrome-launcher-test.ts | 130 -- chrome-launcher/tsconfig.json | 20 - chrome-launcher/utils.ts | 44 - chrome-launcher/yarn.lock | 1490 ----------------- docs/headless-chrome.md | 2 +- docs/readme.md | 2 +- docs/recipes/gulp/gulpfile.js | 2 +- lighthouse-cli/run.ts | 2 +- .../scripts/generate-combined-coverage.sh | 3 +- lighthouse-core/scripts/run-mocha.sh | 5 +- package.json | 16 +- plots/measure.js | 2 +- readme.md | 4 +- yarn.lock | 33 + 34 files changed, 70 insertions(+), 2815 deletions(-) delete mode 100644 chrome-launcher/.clang-format delete mode 100644 chrome-launcher/.npmignore delete mode 100644 chrome-launcher/LICENSE delete mode 100644 chrome-launcher/changelog.md delete mode 100644 chrome-launcher/chrome-finder.ts delete mode 100644 chrome-launcher/chrome-launcher.ts delete mode 100644 chrome-launcher/compiled-check.js delete mode 100644 chrome-launcher/flags.ts rename chrome-launcher/{test/random-port-test.ts => index.js} (56%) delete mode 100644 chrome-launcher/index.ts delete mode 100644 chrome-launcher/package.json delete mode 100644 chrome-launcher/random-port.ts delete mode 100755 chrome-launcher/scripts/format.sh delete mode 100755 chrome-launcher/test/check-formatting.sh delete mode 100644 chrome-launcher/test/chrome-launcher-test.ts delete mode 100644 chrome-launcher/tsconfig.json delete mode 100644 chrome-launcher/utils.ts delete mode 100644 chrome-launcher/yarn.lock diff --git a/.eslintignore b/.eslintignore index 12dfc39952ca..bd6672795484 100644 --- a/.eslintignore +++ b/.eslintignore @@ -17,9 +17,6 @@ coverage/** lighthouse-cli/*.js lighthouse-cli/commands/*.js lighthouse-cli/types/*.js -!chrome-launcher/manual-chrome-launcher.js -!chrome-launcher/compiled-check.js -chrome-launcher/*.js # Generated files plots/out* diff --git a/.gitignore b/.gitignore index 87d56feaca6e..5a13686955c5 100644 --- a/.gitignore +++ b/.gitignore @@ -31,12 +31,6 @@ closure-error.log lighthouse-cli/*.map lighthouse-cli/*.js -!chrome-launcher/manual-chrome-launcher.js -!chrome-launcher/compiled-check.js -chrome-launcher/*.map -chrome-launcher/*.js -chrome-launcher/*.d.ts - lighthouse-cli/commands/*.map lighthouse-cli/commands/*.js diff --git a/.travis.yml b/.travis.yml index 4d47f39e3b74..588cbb262166 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,6 @@ cache: yarn: true directories: - node_modules - - chrome-launcher/node_modules - lighthouse-cli/node_modules - lighthouse-extension/node_modules - lighthouse-viewer/node_modules @@ -33,7 +32,6 @@ before_script: script: - yarn bundlesize - yarn test-cli-formatting - - yarn test-launcher-formatting - yarn lint - yarn unit - yarn closure diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6e9cbe49a723..602884891eaf 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -119,18 +119,6 @@ echo "Generate the release notes, and update the release page" echo "Inform various peoples" ``` -### Releasing chrome launcher. - -```sh -cd chrome-launcher -echo "build the launcher source code" -yarn build -yarn version --no-git-tag-version -git commit -am "launcher to 0.x.x" -echo "commit (but without a tag, as it gets mixed up with LH rls tags)" -npm publish -``` - ### Canary release ```sh diff --git a/chrome-launcher/.clang-format b/chrome-launcher/.clang-format deleted file mode 100644 index 0fd0ae038d39..000000000000 --- a/chrome-launcher/.clang-format +++ /dev/null @@ -1,6 +0,0 @@ ---- -BasedOnStyle: Google -Language: JavaScript -ColumnLimit: 100 -ReflowComments: false -SpacesBeforeTrailingComments: 1 diff --git a/chrome-launcher/.npmignore b/chrome-launcher/.npmignore deleted file mode 100644 index 106637c3da70..000000000000 --- a/chrome-launcher/.npmignore +++ /dev/null @@ -1,17 +0,0 @@ -# folders -.vscode/ -test/ - -# dev files -.appveyor.yml -.editorconfig -.eslintignore -.eslintrc.js -.travis.yml -gulpfile.js - -# exclude source TypeScript files -*.ts - -# allow TypeScript Declaration Files -!*.d.ts diff --git a/chrome-launcher/LICENSE b/chrome-launcher/LICENSE deleted file mode 100644 index a4c5efd822fb..000000000000 --- a/chrome-launcher/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright 2014 Google Inc. - - 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. diff --git a/chrome-launcher/README.md b/chrome-launcher/README.md index e300e18de648..3e00e74aef38 100644 --- a/chrome-launcher/README.md +++ b/chrome-launcher/README.md @@ -1,129 +1,3 @@ # Chrome Launcher [![NPM chrome-launcher package](https://img.shields.io/npm/v/chrome-launcher.svg)](https://npmjs.org/package/chrome-launcher) -Launch Google Chrome with ease from node. - -* [Disables many Chrome services](https://github.com/GoogleChrome/lighthouse/blob/master/chrome-launcher/flags.ts) that add noise to automated scenarios -* Opens up the browser's `remote-debugging-port` on an available port -* Automagically locates a Chrome binary to launch -* Uses a fresh Chrome profile for each launch, and cleans itself up on `kill()` -* Binds `Ctrl-C` (by default) to terminate the Chrome process -* Exposes a small set of [options](#api) for configurability over these details - -### Installing - -```sh -yarn add chrome-launcher - -# or with npm: -npm install chrome-launcher -``` - - -## API - -### `.launch([opts])` - -#### Launch options - -```js -{ - // (optional) remote debugging port number to use. If provided port is already busy, launch() will reject - // Default: an available port is autoselected - port: number; - - // (optional) Additional flags to pass to Chrome, for example: ['--headless', '--disable-gpu'] - // See all flags here: http://peter.sh/experiments/chromium-command-line-switches/ - // Do note, many flags are set by default: https://github.com/GoogleChrome/lighthouse/blob/master/chrome-launcher/flags.ts - chromeFlags: Array; - - // (optional) Close the Chrome process on `Ctrl-C` - // Default: true - handleSIGINT: boolean; - - // (optional) Explicit path of intended Chrome binary -  // * If this `chromePath` option is defined, it will be used. - // * Otherwise, the `CHROME_PATH` env variable will be used if set. (`LIGHTHOUSE_CHROMIUM_PATH` is deprecated) -  // * Otherwise, a detected Chrome Canary will be used if found - // * Otherwise, a detected Chrome (stable) will be used - chromePath: string; - - // (optional) Chrome profile path to use - // By default, a fresh Chrome profile will be created - userDataDir: string; - - // (optional) Starting URL to open the browser with - // Default: `about:blank` - startingUrl: string; - - // (optional) Logging level: verbose, info, error, silent - // Default: 'info' - logLevel: string; - - // (optional) Enable extension loading - // Default: false - enableExtensions: boolean -}; -``` - -#### Launched chrome interface - -#### `.launch().then(chrome => ...` - -```js -// The remote debugging port exposed by the launched chrome -chrome.port: number; - -// Method kill Chrome (and cleanup the profile folder) -chrome.kill: () => Promise<{}>; - -// The process id -chrome.pid: number; -``` - - -## Examples - -#### Launching chrome: - -```js -const chromeLauncher = require('chrome-launcher'); - -chromeLauncher.launch({ - startingUrl: 'https://google.com' -}).then(chrome => { - console.log(`Chrome debugging port running on ${chrome.port}`); -}); -``` - - -#### Launching headless chrome: - -```js -const chromeLauncher = require('chrome-launcher'); - -chromeLauncher.launch({ - startingUrl: 'https://google.com', - chromeFlags: ['--headless', '--disable-gpu'] -}).then(chrome => { - console.log(`Chrome debugging port running on ${chrome.port}`); -}); -``` - -### Continuous Integration - -In a CI environment like Travis, Chrome may not be installed. If you want to use `chrome-launcher`, you can install Chrome using Lighthouse's `download-chrome.sh` script: - -`curl -L https://raw.githubusercontent.com/GoogleChrome/lighthouse/v2.1.0/lighthouse-core/scripts/download-chrome.sh | bash` - -Then in `.travis.yml`, use it like so: - -```yaml -language: node_js -install: - - yarn install -before_script: - - export DISPLAY=:99.0 - - export CHROME_PATH="$(pwd)/chrome-linux/chrome" - - sh -e /etc/init.d/xvfb start - - curl -L https://raw.githubusercontent.com/GoogleChrome/lighthouse/v2.1.0/lighthouse-core/scripts/download-chrome.sh | bash -``` +Launch Google Chrome with ease from node. Package moved to https://npmjs.org/package/chrome-launcher. diff --git a/chrome-launcher/changelog.md b/chrome-launcher/changelog.md deleted file mode 100644 index e49cce4bcd1c..000000000000 --- a/chrome-launcher/changelog.md +++ /dev/null @@ -1,32 +0,0 @@ -## 0.6.0 (Thu, 17 Aug 2017) -* `43baee69` mute any audio (#3028) -* `ae6e9551` Better SIGINT handling (#2959) -* `3ab3a117` docs: add changelog to launcher (#2987) - -## 0.5.0 (Mon, 14 Aug 2017) -* `494f9911` clarify priority of chromePath options -* `1c11021a` add support for finding Chromium on Linux (#2950) -* `391e2043` Publish type definitions instead of source TypeScript files (#2898) -* `de408ad3` readme: update example using deprecated `LIGHTHOUSE_CHROMIUM_PATH` (#2929) -* `8bc6d18e` add license file to launcher package. (#2849) - -## 0.4.0 (Tue, 1 Aug 2017) -* `37fd38ce` pass --enable-extensions on from manual-chrome-launcher (#2735) -* `c942d17e` support enabling extension loading (#2650) - -## 0.3.2 (Wed, 19 Jul 2017) -* `112c2c7f` Fix chrome finder on linux/osx when process.env isn't populated (#2687) -* `5728695f` Added CHROME_PATH to readme (#2694) -* `fedc76a3` test: fix clang-format error (#2691) -* `a6bbcaba` nuke 'as string' -* `41df647f` cli: remove --select-chrome,--skip-autolaunch. Support CHROME_PATH env (#2659) -* `8c9724e2` fix launcher w/ arbitrary flags (#2670) -* `9c0c0788` Expose LHR to modules consuming cli/run.ts (#2654) -* `6df6b0e2` support custom port via chrome-debug binary (#2644) -* `3f143b19` log the specific chrome spawn command. - -## 0.3.1 (Wed, 5 Jul 2017) -* `ef081063` upgrade rimraf to latest (#2641) - -## 0.3.0 (Fri, 30 Jun 2017) -* `edbb40d9` fix(driver): move performance observer registration to setupDriver (#2611) diff --git a/chrome-launcher/chrome-finder.ts b/chrome-launcher/chrome-finder.ts deleted file mode 100644 index f442f3d5e41b..000000000000 --- a/chrome-launcher/chrome-finder.ts +++ /dev/null @@ -1,228 +0,0 @@ -/** - * @license Copyright 2016 Google Inc. All Rights Reserved. - * 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. - */ -'use strict'; - -const fs = require('fs'); -const path = require('path'); -const execSync = require('child_process').execSync; -const execFileSync = require('child_process').execFileSync; -const log = require('lighthouse-logger'); - -const newLineRegex = /\r?\n/; - -type Priorities = Array<{regex: RegExp, weight: number}>; - -export function darwin() { - const suffixes = ['/Contents/MacOS/Google Chrome Canary', '/Contents/MacOS/Google Chrome']; - - const LSREGISTER = '/System/Library/Frameworks/CoreServices.framework' + - '/Versions/A/Frameworks/LaunchServices.framework' + - '/Versions/A/Support/lsregister'; - - const installations: Array = []; - - const customChromePath = resolveChromePath(); - if (customChromePath) { - installations.push(customChromePath); - } - - execSync( - `${LSREGISTER} -dump` + - ' | grep -i \'google chrome\\( canary\\)\\?.app$\'' + - ' | awk \'{$1=""; print $0}\'') - .toString() - .split(newLineRegex) - .forEach((inst: string) => { - suffixes.forEach(suffix => { - const execPath = path.join(inst.trim(), suffix); - if (canAccess(execPath)) { - installations.push(execPath); - } - }); - }); - - // Retains one per line to maintain readability. - // clang-format off - const priorities: Priorities = [ - {regex: new RegExp(`^${process.env.HOME}/Applications/.*Chrome.app`), weight: 50}, - {regex: new RegExp(`^${process.env.HOME}/Applications/.*Chrome Canary.app`), weight: 51}, - {regex: /^\/Applications\/.*Chrome.app/, weight: 100}, - {regex: /^\/Applications\/.*Chrome Canary.app/, weight: 101}, - {regex: /^\/Volumes\/.*Chrome.app/, weight: -2}, - {regex: /^\/Volumes\/.*Chrome Canary.app/, weight: -1}, - ]; - - if (process.env.LIGHTHOUSE_CHROMIUM_PATH) { - priorities.push({regex: new RegExp(process.env.LIGHTHOUSE_CHROMIUM_PATH), weight: 150}); - } - - if (process.env.CHROME_PATH) { - priorities.push({regex: new RegExp(process.env.CHROME_PATH), weight: 151}); - } - - // clang-format on - return sort(installations, priorities); -} - -function resolveChromePath() { - if (canAccess(process.env.CHROME_PATH)) { - return process.env.CHROME_PATH; - } - - if (canAccess(process.env.LIGHTHOUSE_CHROMIUM_PATH)) { - log.warn( - 'ChromeLauncher', - 'LIGHTHOUSE_CHROMIUM_PATH is deprecated, use CHROME_PATH env variable instead.'); - return process.env.LIGHTHOUSE_CHROMIUM_PATH; - } - - return undefined; -} - -/** - * Look for linux executables in 3 ways - * 1. Look into CHROME_PATH env variable - * 2. Look into the directories where .desktop are saved on gnome based distro's - * 3. Look for google-chrome-stable & google-chrome executables by using the which command - */ -export function linux() { - let installations: string[] = []; - - // 1. Look into CHROME_PATH env variable - const customChromePath = resolveChromePath(); - if (customChromePath) { - installations.push(customChromePath); - } - - // 2. Look into the directories where .desktop are saved on gnome based distro's - const desktopInstallationFolders = [ - path.join(require('os').homedir(), '.local/share/applications/'), - '/usr/share/applications/', - ]; - desktopInstallationFolders.forEach(folder => { - installations = installations.concat(findChromeExecutables(folder)); - }); - - // Look for google-chrome(-stable) & chromium(-browser) executables by using the which command - const executables = [ - 'google-chrome-stable', - 'google-chrome', - 'chromium-browser', - 'chromium', - ]; - executables.forEach((executable: string) => { - try { - const chromePath = execFileSync('which', [executable]).toString().split(newLineRegex)[0]; - - if (canAccess(chromePath)) { - installations.push(chromePath); - } - } catch (e) { - // Not installed. - } - }); - - if (!installations.length) { - throw new Error( - 'The environment variable CHROME_PATH must be set to ' + - 'executable of a build of Chromium version 54.0 or later.'); - } - - const priorities: Priorities = [ - {regex: /chrome-wrapper$/, weight: 51}, - {regex: /google-chrome-stable$/, weight: 50}, - {regex: /google-chrome$/, weight: 49}, - {regex: /chromium-browser$/, weight: 48}, - {regex: /chromium$/, weight: 47}, - ]; - - if (process.env.LIGHTHOUSE_CHROMIUM_PATH) { - priorities.push({regex: new RegExp(process.env.LIGHTHOUSE_CHROMIUM_PATH), weight: 100}); - } - - if (process.env.CHROME_PATH) { - priorities.push({regex: new RegExp(process.env.CHROME_PATH), weight: 101}); - } - - return sort(uniq(installations.filter(Boolean)), priorities); -} - -export function win32() { - const installations: Array = []; - const suffixes = [ - '\\Google\\Chrome SxS\\Application\\chrome.exe', '\\Google\\Chrome\\Application\\chrome.exe' - ]; - const prefixes = - [process.env.LOCALAPPDATA, process.env.PROGRAMFILES, process.env['PROGRAMFILES(X86)']]; - - const customChromePath = resolveChromePath(); - if (customChromePath) { - installations.push(customChromePath); - } - - prefixes.forEach(prefix => suffixes.forEach(suffix => { - const chromePath = path.join(prefix, suffix); - if (canAccess(chromePath)) { - installations.push(chromePath); - } - })); - return installations; -} - -function sort(installations: string[], priorities: Priorities) { - const defaultPriority = 10; - return installations - // assign priorities - .map((inst: string) => { - for (const pair of priorities) { - if (pair.regex.test(inst)) { - return {path: inst, weight: pair.weight}; - } - } - return {path: inst, weight: defaultPriority}; - }) - // sort based on priorities - .sort((a, b) => (b.weight - a.weight)) - // remove priority flag - .map(pair => pair.path); -} - -function canAccess(file: string): Boolean { - if (!file) { - return false; - } - - try { - fs.accessSync(file); - return true; - } catch (e) { - return false; - } -} - -function uniq(arr: Array) { - return Array.from(new Set(arr)); -} - -function findChromeExecutables(folder: string): Array { - const argumentsRegex = /(^[^ ]+).*/; // Take everything up to the first space - const chromeExecRegex = '^Exec=\/.*\/(google|chrome|chromium)-.*'; - - let installations: Array = []; - if (canAccess(folder)) { - // Output of the grep & print looks like: - // /opt/google/chrome/google-chrome --profile-directory - // /home/user/Downloads/chrome-linux/chrome-wrapper %U - let execPaths = execSync(`grep -ER "${chromeExecRegex}" ${folder} | awk -F '=' '{print $2}'`) - .toString() - .split(newLineRegex) - .map((execPath: string) => execPath.replace(argumentsRegex, '$1')); - - execPaths.forEach((execPath: string) => canAccess(execPath) && installations.push(execPath)); - } - - return installations; -} diff --git a/chrome-launcher/chrome-launcher.ts b/chrome-launcher/chrome-launcher.ts deleted file mode 100644 index cf50d531c33f..000000000000 --- a/chrome-launcher/chrome-launcher.ts +++ /dev/null @@ -1,336 +0,0 @@ -/** - * @license Copyright 2016 Google Inc. All Rights Reserved. - * 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. - */ -'use strict'; - -import * as childProcess from 'child_process'; -import * as fs from 'fs'; -import * as net from 'net'; -import * as rimraf from 'rimraf'; -import * as chromeFinder from './chrome-finder'; -import {getRandomPort} from './random-port'; -import {DEFAULT_FLAGS} from './flags'; -import {makeTmpDir, defaults, delay} from './utils'; -const log = require('lighthouse-logger'); -const spawn = childProcess.spawn; -const execSync = childProcess.execSync; -const isWindows = process.platform === 'win32'; -const _SIGINT = 'SIGINT'; -const _SIGINT_EXIT_CODE = 130; -const _SUPPORTED_PLATFORMS = new Set(['darwin', 'linux', 'win32']); - -type SupportedPlatforms = 'darwin'|'linux'|'win32'; - -const instances = new Set(); - -export interface Options { - startingUrl?: string; - chromeFlags?: Array; - port?: number; - handleSIGINT?: boolean; - chromePath?: string; - userDataDir?: string; - logLevel?: string; - enableExtensions?: boolean; -} - -export interface LaunchedChrome { - pid: number; - port: number; - kill: () => Promise<{}>; -} - -export interface ModuleOverrides { - fs?: typeof fs; - rimraf?: typeof rimraf; - spawn?: typeof childProcess.spawn; -} - -const sigintListener = async () => { - for (const instance of instances) { - await instance.kill(); - } - process.exit(_SIGINT_EXIT_CODE); -}; - -export async function launch(opts: Options = {}): Promise { - opts.handleSIGINT = defaults(opts.handleSIGINT, true); - - const instance = new Launcher(opts); - - // Kill spawned Chrome process in case of ctrl-C. - if (opts.handleSIGINT && instances.size === 0) { - process.on(_SIGINT, sigintListener); - } - instances.add(instance); - - await instance.launch(); - - const kill = async () => { - instances.delete(instance); - if (instances.size === 0) { - process.removeListener(_SIGINT, sigintListener); - } - return instance.kill(); - }; - - return {pid: instance.pid!, port: instance.port!, kill}; -} - -export class Launcher { - private tmpDirandPidFileReady = false; - private pollInterval: number = 500; - private pidFile: string; - private startingUrl: string; - private outFile?: number; - private errFile?: number; - private chromePath?: string; - private enableExtensions?: boolean; - private chromeFlags: string[]; - private requestedPort?: number; - private chrome?: childProcess.ChildProcess; - private fs: typeof fs; - private rimraf: typeof rimraf; - private spawn: typeof childProcess.spawn; - - userDataDir?: string; - port?: number; - pid?: number; - - constructor(private opts: Options = {}, moduleOverrides: ModuleOverrides = {}) { - this.fs = moduleOverrides.fs || fs; - this.rimraf = moduleOverrides.rimraf || rimraf; - this.spawn = moduleOverrides.spawn || spawn; - - log.setLevel(defaults(this.opts.logLevel, 'silent')); - - // choose the first one (default) - this.startingUrl = defaults(this.opts.startingUrl, 'about:blank'); - this.chromeFlags = defaults(this.opts.chromeFlags, []); - this.requestedPort = defaults(this.opts.port, 0); - this.chromePath = this.opts.chromePath; - this.enableExtensions = defaults(this.opts.enableExtensions, false); - } - - private get flags() { - let flags = DEFAULT_FLAGS.concat([ - `--remote-debugging-port=${this.port}`, - // Place Chrome profile in a custom location we'll rm -rf later - `--user-data-dir=${this.userDataDir}` - ]); - - if (this.enableExtensions) { - flags = flags.filter(flag => flag !== '--disable-extensions'); - } - - if (process.platform === 'linux') { - flags.push('--disable-setuid-sandbox'); - } - - flags.push(...this.chromeFlags); - flags.push(this.startingUrl); - - return flags; - } - - // Wrapper function to enable easy testing. - makeTmpDir() { - return makeTmpDir(); - } - - prepare() { - const platform = process.platform as SupportedPlatforms; - if (!_SUPPORTED_PLATFORMS.has(platform)) { - throw new Error(`Platform ${platform} is not supported`); - } - - this.userDataDir = this.opts.userDataDir || this.makeTmpDir(); - this.outFile = this.fs.openSync(`${this.userDataDir}/chrome-out.log`, 'a'); - this.errFile = this.fs.openSync(`${this.userDataDir}/chrome-err.log`, 'a'); - - // fix for Node4 - // you can't pass a fd to fs.writeFileSync - this.pidFile = `${this.userDataDir}/chrome.pid`; - - log.verbose('ChromeLauncher', `created ${this.userDataDir}`); - - this.tmpDirandPidFileReady = true; - } - - async launch() { - if (this.requestedPort !== 0) { - this.port = this.requestedPort; - - // If an explict port is passed first look for an open connection... - try { - return await this.isDebuggerReady(); - } catch (err) { - log.log( - 'ChromeLauncher', - `No debugging port found on port ${this.port}, launching a new Chrome.`); - } - } - - if (!this.tmpDirandPidFileReady) { - this.prepare(); - } - - if (this.chromePath === undefined) { - const installations = await chromeFinder[process.platform as SupportedPlatforms](); - if (installations.length === 0) { - throw new Error('No Chrome Installations Found'); - } - - this.chromePath = installations[0]; - } - - this.pid = await this.spawnProcess(this.chromePath); - return Promise.resolve(); - } - - private async spawnProcess(execPath: string) { - // Typescript is losing track of the return type without the explict typing. - const spawnPromise: Promise = (async () => { - if (this.chrome) { - log.log('ChromeLauncher', `Chrome already running with pid ${this.chrome.pid}.`); - return this.chrome.pid; - } - - - // If a zero value port is set, it means the launcher - // is responsible for generating the port number. - // We do this here so that we can know the port before - // we pass it into chrome. - if (this.requestedPort === 0) { - this.port = await getRandomPort(); - } - - log.verbose( - 'ChromeLauncher', `Launching with command:\n"${execPath}" ${this.flags.join(' ')}`); - const chrome = this.spawn( - execPath, this.flags, {detached: true, stdio: ['ignore', this.outFile, this.errFile]}); - this.chrome = chrome; - - this.fs.writeFileSync(this.pidFile, chrome.pid.toString()); - - log.verbose('ChromeLauncher', `Chrome running with pid ${chrome.pid} on port ${this.port}.`); - return chrome.pid; - })(); - - const pid = await spawnPromise; - await this.waitUntilReady(); - return pid; - } - - private cleanup(client?: net.Socket) { - if (client) { - client.removeAllListeners(); - client.end(); - client.destroy(); - client.unref(); - } - } - - // resolves if ready, rejects otherwise - private isDebuggerReady(): Promise<{}> { - return new Promise((resolve, reject) => { - const client = net.createConnection(this.port!); - client.once('error', err => { - this.cleanup(client); - reject(err); - }); - client.once('connect', () => { - this.cleanup(client); - resolve(); - }); - }); - } - - // resolves when debugger is ready, rejects after 10 polls - private waitUntilReady() { - const launcher = this; - - return new Promise((resolve, reject) => { - let retries = 0; - let waitStatus = 'Waiting for browser.'; - - const poll = () => { - if (retries === 0) { - log.log('ChromeLauncher', waitStatus); - } - retries++; - waitStatus += '..'; - log.log('ChromeLauncher', waitStatus); - - launcher.isDebuggerReady() - .then(() => { - log.log('ChromeLauncher', waitStatus + `${log.greenify(log.tick)}`); - resolve(); - }) - .catch(err => { - if (retries > 10) { - log.error('ChromeLauncher', err.message); - const stderr = - this.fs.readFileSync(`${this.userDataDir}/chrome-err.log`, {encoding: 'utf-8'}); - log.error( - 'ChromeLauncher', `Logging contents of ${this.userDataDir}/chrome-err.log`); - log.error('ChromeLauncher', stderr); - return reject(err); - } - delay(launcher.pollInterval).then(poll); - }); - }; - poll(); - - }); - } - - kill() { - return new Promise(resolve => { - if (this.chrome) { - this.chrome.on('close', () => { - this.destroyTmp().then(resolve); - }); - - log.log('ChromeLauncher', 'Killing all Chrome Instances'); - try { - if (isWindows) { - execSync(`taskkill /pid ${this.chrome.pid} /T /F`); - } else { - process.kill(-this.chrome.pid); - } - } catch (err) { - log.warn('ChromeLauncher', `Chrome could not be killed ${err.message}`); - } - - delete this.chrome; - } else { - // fail silently as we did not start chrome - resolve(); - } - }); - } - - destroyTmp() { - return new Promise(resolve => { - // Only clean up the tmp dir if we created it. - if (this.userDataDir === undefined || this.opts.userDataDir !== undefined) { - return resolve(); - } - - if (this.outFile) { - this.fs.closeSync(this.outFile); - delete this.outFile; - } - - if (this.errFile) { - this.fs.closeSync(this.errFile); - delete this.errFile; - } - - this.rimraf(this.userDataDir, () => resolve()); - }); - } -}; diff --git a/chrome-launcher/compiled-check.js b/chrome-launcher/compiled-check.js deleted file mode 100644 index decd030656a2..000000000000 --- a/chrome-launcher/compiled-check.js +++ /dev/null @@ -1,14 +0,0 @@ -'use strict' - -const fs = require('fs'); -const path = require('path'); - -module.exports = function(filename) { - if (!fs.existsSync(path.join(__dirname, filename))) { - console.log( - 'Oops! Looks like the chrome-launcher files needs to be compiled. Please run:'); - console.log(' yarn install-launcher; yarn build-launcher;'); - console.log('More at: https://github.com/GoogleChrome/lighthouse#develop'); - process.exit(1); - } -} diff --git a/chrome-launcher/flags.ts b/chrome-launcher/flags.ts deleted file mode 100644 index 54bb58363206..000000000000 --- a/chrome-launcher/flags.ts +++ /dev/null @@ -1,28 +0,0 @@ -/** - * @license Copyright 2017 Google Inc. All Rights Reserved. - * 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. - */ -'use strict'; - -export const DEFAULT_FLAGS = [ - // Disable built-in Google Translate service - '--disable-translate', - // Disable all chrome extensions entirely - '--disable-extensions', - // Disable various background network services, including extension updating, - // safe browsing service, upgrade detector, translate, UMA - '--disable-background-networking', - // Disable fetching safebrowsing lists, likely redundant due to disable-background-networking - '--safebrowsing-disable-auto-update', - // Disable syncing to a Google account - '--disable-sync', - // Disable reporting to UMA, but allows for collection - '--metrics-recording-only', - // Disable installation of default apps on first run - '--disable-default-apps', - // Mute any audio - '--mute-audio', - // Skip first run wizards - '--no-first-run', -]; diff --git a/chrome-launcher/test/random-port-test.ts b/chrome-launcher/index.js similarity index 56% rename from chrome-launcher/test/random-port-test.ts rename to chrome-launcher/index.js index e5ffdce8119e..4dca808e38a3 100644 --- a/chrome-launcher/test/random-port-test.ts +++ b/chrome-launcher/index.js @@ -1,18 +1,16 @@ /** - * @license Copyright 2016 Google Inc. All Rights Reserved. + * @license Copyright 2017 Google Inc. All Rights Reserved. * 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. */ 'use strict'; -import * as assert from 'assert'; -import {getRandomPort} from '../random-port'; +/** + * chrome-launcher has moved to its own repository and npm package. + * https://github.com/GoogleChrome/chrome-launcher + * https://www.npmjs.com/package/chrome-launcher + * Forwarding stub provided here for users that have deep linked into this + * module, but file will be removed in next major release. + */ -describe('Random port generation', () => { - it('generates a valid random port number', () => { - return getRandomPort().then(port => { - // Verify generated port number is valid integer. - assert.ok(Number.isInteger(port) && port > 0 && port <= 0xFFFF); - }); - }); -}); +module.exports = require('chrome-launcher'); diff --git a/chrome-launcher/index.ts b/chrome-launcher/index.ts deleted file mode 100644 index 680ab0175a71..000000000000 --- a/chrome-launcher/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './chrome-launcher'; diff --git a/chrome-launcher/manual-chrome-launcher.js b/chrome-launcher/manual-chrome-launcher.js index be649de9a539..d81ece2db45e 100755 --- a/chrome-launcher/manual-chrome-launcher.js +++ b/chrome-launcher/manual-chrome-launcher.js @@ -1,6 +1,15 @@ #!/usr/bin/env node 'use strict'; + +/** + * chrome-launcher has moved to its own repository and npm package. + * https://github.com/GoogleChrome/chrome-launcher + * https://www.npmjs.com/package/chrome-launcher + * This script preserved for Lighthouse's chrome-debug binary, but but file and + * bin entry will be removed in next major release. + */ + /** * @fileoverview Script to launch a clean Chrome instance on-demand. * @@ -13,8 +22,7 @@ * chrome-debug --enable-extensions */ -require('./compiled-check.js')('chrome-launcher.js'); -const {launch} = require('./chrome-launcher'); +const {launch} = require('chrome-launcher'); const args = process.argv.slice(2); let chromeFlags; @@ -38,4 +46,6 @@ launch({ port, enableExtensions, chromeFlags, -}).then(v => console.log(`✨ Chrome debugging port: ${v.port}`)); +}) +// eslint-disable-next-line no-console +.then(v => console.log(`✨ Chrome debugging port: ${v.port}`)); diff --git a/chrome-launcher/package.json b/chrome-launcher/package.json deleted file mode 100644 index 6beba9fda5e4..000000000000 --- a/chrome-launcher/package.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "name": "chrome-launcher", - "main": "index.js", - "scripts": { - "build": "tsc", - "dev": "tsc -w", - "test": "mocha --require ts-node/register --reporter=dot test/**/*-test.ts --timeout=10000", - "coverage": "nyc yarn test && nyc report --reporter=text-lcov > lcov.info", - "test-formatting": "test/check-formatting.sh", - "format": "scripts/format.sh" - }, - "devDependencies": { - "@types/mocha": "^2.2.41", - "@types/sinon": "^2.3.1", - "clang-format": "^1.0.50", - "mocha": "^3.2.0", - "nyc": "^11.0.2", - "sinon": "^2.3.5", - "ts-node": "^3.0.4", - "typescript": "2.2.1" - }, - "dependencies": { - "@types/core-js": "^0.9.41", - "@types/mkdirp": "^0.3.29", - "@types/node": "6.0.66", - "@types/rimraf": "^0.0.28", - "lighthouse-logger": "^1.0.0", - "mkdirp": "0.5.1", - "rimraf": "^2.6.1" - }, - "version": "0.6.0", - "description": "Launch latest Chrome with the devtools-protocol port open", - "repository": "https://github.com/GoogleChrome/lighthouse/tree/master/chrome-launcher", - "author": "The Chromium Authors", - "license": "Apache-2.0" -} diff --git a/chrome-launcher/random-port.ts b/chrome-launcher/random-port.ts deleted file mode 100644 index 100670fa0c1a..000000000000 --- a/chrome-launcher/random-port.ts +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license Copyright 2016 Google Inc. All Rights Reserved. - * 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. - */ -'use strict'; - -import {createServer} from 'http'; - -/** - * Return a random, unused port. - */ -export function getRandomPort(): Promise { - return new Promise((resolve, reject) => { - const server = createServer(); - server.listen(0); - server.once('listening', () => { - const port = server.address().port; - server.close(() => resolve(port)); - }); - server.once('error', reject); - }); -} diff --git a/chrome-launcher/scripts/format.sh b/chrome-launcher/scripts/format.sh deleted file mode 100755 index cd4a410a2740..000000000000 --- a/chrome-launcher/scripts/format.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -FILES="`find . -type f \! -path '*node_modules*' \! -name '*.d.ts' -name '*.ts'`" - -./node_modules/.bin/clang-format -i -style=file $FILES diff --git a/chrome-launcher/test/check-formatting.sh b/chrome-launcher/test/check-formatting.sh deleted file mode 100755 index 2d063809865f..000000000000 --- a/chrome-launcher/test/check-formatting.sh +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env bash - -check_formatting () -{ - diff -u <(cat $1) <(./node_modules/.bin/clang-format -style=file $1) &>/dev/null - if [ $? -eq 1 ] - then - echo "Error: formatting is required for *.ts files:" - echo " cd chrome-launcher" - echo " yarn format" - exit 1 - fi -} - -check_formatting "`find . -type f \! -path '*node_modules*' \! -name '*.d.ts' -name '*.ts'`" diff --git a/chrome-launcher/test/chrome-launcher-test.ts b/chrome-launcher/test/chrome-launcher-test.ts deleted file mode 100644 index 4e5692626b27..000000000000 --- a/chrome-launcher/test/chrome-launcher-test.ts +++ /dev/null @@ -1,130 +0,0 @@ -/** - * @license Copyright 2016 Google Inc. All Rights Reserved. - * 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. - */ -'use strict'; - -import {Launcher} from '../chrome-launcher'; -import {spy, stub} from 'sinon'; -import * as assert from 'assert'; - -const log = require('lighthouse-logger'); -const fsMock = { - openSync: () => {}, - closeSync: () => {}, - writeFileSync: () => {} -}; - -describe('Launcher', () => { - beforeEach(() => { - log.setLevel('error'); - }); - - afterEach(() => { - log.setLevel(''); - }); - - it('sets default launching flags', async () => { - const spawnStub = stub().returns({pid: 'some_pid'}); - - const chromeInstance = new Launcher( - {userDataDir: 'some_path'}, - {fs: fsMock as any, rimraf: spy() as any, spawn: spawnStub as any}); - stub(chromeInstance, 'waitUntilReady').returns(Promise.resolve()); - - chromeInstance.prepare(); - - try { - await chromeInstance.launch(); - } catch (err) { - return Promise.reject(err); - } - - const chromeFlags = spawnStub.getCall(0).args[1] as string[]; - - assert.ok(chromeFlags.find(f => f.startsWith('--remote-debugging-port'))) - assert.ok(chromeFlags.find(f => f.startsWith('--disable-background-networking'))) - assert.strictEqual(chromeFlags[chromeFlags.length - 1], 'about:blank'); - }); - - it('accepts and uses a custom path', async () => { - const rimrafMock = spy(); - const chromeInstance = - new Launcher({userDataDir: 'some_path'}, {fs: fsMock as any, rimraf: rimrafMock as any}); - - chromeInstance.prepare(); - - await chromeInstance.destroyTmp(); - assert.strictEqual(rimrafMock.callCount, 0); - }); - - it('cleans up the tmp dir after closing', async () => { - const rimrafMock = stub().callsFake((_, done) => done()); - - const chromeInstance = new Launcher({}, {fs: fsMock as any, rimraf: rimrafMock as any}); - - chromeInstance.prepare(); - await chromeInstance.destroyTmp(); - assert.strictEqual(rimrafMock.callCount, 1); - }); - - it('does not delete created directory when custom path passed', () => { - const chromeInstance = new Launcher({userDataDir: 'some_path'}, {fs: fsMock as any}); - - chromeInstance.prepare(); - assert.equal(chromeInstance.userDataDir, 'some_path'); - }); - - it('defaults to genering a tmp dir when no data dir is passed', () => { - const chromeInstance = new Launcher({}, {fs: fsMock as any}); - const originalMakeTmp = chromeInstance.makeTmpDir; - chromeInstance.makeTmpDir = () => 'tmp_dir' - chromeInstance.prepare() - assert.equal(chromeInstance.userDataDir, 'tmp_dir'); - - // Restore the original fn. - chromeInstance.makeTmpDir = originalMakeTmp; - }); - - it('doesn\'t fail when killed twice', async () => { - const chromeInstance = new Launcher(); - await chromeInstance.launch(); - await chromeInstance.kill(); - await chromeInstance.kill(); - }); - - it('doesn\'t launch multiple chrome processes', async () => { - const chromeInstance = new Launcher(); - await chromeInstance.launch(); - let pid = chromeInstance.pid!; - await chromeInstance.launch(); - assert.strictEqual(pid, chromeInstance.pid); - await chromeInstance.kill(); - }); - - it('removes --disable-extensions from flags on enableExtensions', async () => { - const spawnStub = stub().returns({pid: 'some_pid'}); - - const chromeInstance = new Launcher( - {enableExtensions: true}, - {fs: fsMock as any, rimraf: spy() as any, spawn: spawnStub as any}); - stub(chromeInstance, 'waitUntilReady').returns(Promise.resolve()); - - chromeInstance.prepare(); - - try { - await chromeInstance.launch(); - } catch (err) { - return Promise.reject(err); - } - - const chromeFlags = spawnStub.getCall(0).args[1] as string[]; - assert.ok(!chromeFlags.includes('--disable-extensions')); - }); - - it('throws an error when chromePath is empty', (done) => { - const chromeInstance = new Launcher({chromePath: ''}); - chromeInstance.launch().catch(() => done()); - }); -}); diff --git a/chrome-launcher/tsconfig.json b/chrome-launcher/tsconfig.json deleted file mode 100644 index ecde405c0ea0..000000000000 --- a/chrome-launcher/tsconfig.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "compilerOptions": { - "module": "commonjs", - "target": "es2016", - "declaration": true, - "noImplicitAny": true, - "inlineSourceMap": true, - "noEmitOnError": false, - "strictNullChecks": true, - "noImplicitReturns": true, - "noUnusedLocals": true, - "noUnusedParameters": true - }, - "exclude": [ - "node_modules" - ], - "include": [ - "*.ts" - ] -} diff --git a/chrome-launcher/utils.ts b/chrome-launcher/utils.ts deleted file mode 100644 index b165b11a6334..000000000000 --- a/chrome-launcher/utils.ts +++ /dev/null @@ -1,44 +0,0 @@ -/** - * @license Copyright 2017 Google Inc. All Rights Reserved. - * 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. - */ -'use strict'; - -import {join} from 'path'; -import {execSync} from 'child_process'; -import * as mkdirp from 'mkdirp'; - -export function defaults(val: T | undefined, def: T): T { - return typeof val === 'undefined' ? def : val; -} - -export async function delay(time: number) { - return new Promise(resolve => setTimeout(resolve, time)); -} - -export function makeTmpDir() { - switch (process.platform) { - case 'darwin': - case 'linux': - return makeUnixTmpDir(); - case 'win32': - return makeWin32TmpDir(); - default: - throw new Error(`Platform ${process.platform} is not supported`); - } -} - -function makeUnixTmpDir() { - return execSync('mktemp -d -t lighthouse.XXXXXXX').toString().trim(); -} - -function makeWin32TmpDir() { - const winTmpPath = process.env.TEMP || process.env.TMP || - (process.env.SystemRoot || process.env.windir) + '\\temp'; - const randomNumber = Math.floor(Math.random() * 9e7 + 1e7); - const tmpdir = join(winTmpPath, 'lighthouse.' + randomNumber); - - mkdirp.sync(tmpdir); - return tmpdir; -} diff --git a/chrome-launcher/yarn.lock b/chrome-launcher/yarn.lock deleted file mode 100644 index 66acce452b0e..000000000000 --- a/chrome-launcher/yarn.lock +++ /dev/null @@ -1,1490 +0,0 @@ -# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. -# yarn lockfile v1 - - -"@types/core-js@^0.9.41": - version "0.9.41" - resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-0.9.41.tgz#cfeceb63c2beaa29f882252c7c18e0e9471ff4e2" - -"@types/mkdirp@^0.3.29": - version "0.3.29" - resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.3.29.tgz#7f2ad7ec55f914482fc9b1ec4bb1ae6028d46066" - -"@types/mocha@^2.2.41": - version "2.2.41" - resolved "https://registry.yarnpkg.com/@types/mocha/-/mocha-2.2.41.tgz#e27cf0817153eb9f2713b2d3f6c68f1e1c3ca608" - -"@types/node@6.0.66": - version "6.0.66" - resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.66.tgz#5680b74a6135d33d4c00447e7c3dc691a4601625" - -"@types/rimraf@^0.0.28": - version "0.0.28" - resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-0.0.28.tgz#5562519bc7963caca8abf7f128cae3b594d41d06" - -"@types/sinon@^2.3.1": - version "2.3.1" - resolved "https://registry.yarnpkg.com/@types/sinon/-/sinon-2.3.1.tgz#5e214093e9e2345219ab0f31bf310c9790ad0712" - -align-text@^0.1.1, align-text@^0.1.3: - version "0.1.4" - resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117" - dependencies: - kind-of "^3.0.2" - longest "^1.0.1" - repeat-string "^1.5.2" - -amdefine@>=0.0.4: - version "1.0.1" - resolved "https://registry.yarnpkg.com/amdefine/-/amdefine-1.0.1.tgz#4a5282ac164729e93619bcfd3ad151f817ce91f5" - -ansi-regex@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" - -ansi-styles@^2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" - -append-transform@^0.4.0: - version "0.4.0" - resolved "https://registry.yarnpkg.com/append-transform/-/append-transform-0.4.0.tgz#d76ebf8ca94d276e247a36bad44a4b74ab611991" - dependencies: - default-require-extensions "^1.0.0" - -archy@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/archy/-/archy-1.0.0.tgz#f9c8c13757cc1dd7bc379ac77b2c62a5c2868c40" - -arr-diff@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf" - dependencies: - arr-flatten "^1.0.1" - -arr-flatten@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.0.3.tgz#a274ed85ac08849b6bd7847c4580745dc51adfb1" - -array-unique@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53" - -arrify@^1.0.0, arrify@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" - -async@^1.4.0, async@^1.5.2: - version "1.5.2" - resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" - -babel-code-frame@^6.22.0: - version "6.22.0" - resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.22.0.tgz#027620bee567a88c32561574e7fd0801d33118e4" - dependencies: - chalk "^1.1.0" - esutils "^2.0.2" - js-tokens "^3.0.0" - -babel-generator@^6.18.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.25.0.tgz#33a1af70d5f2890aeb465a4a7793c1df6a9ea9fc" - dependencies: - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.25.0" - detect-indent "^4.0.0" - jsesc "^1.3.0" - lodash "^4.2.0" - source-map "^0.5.0" - trim-right "^1.0.1" - -babel-messages@^6.23.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e" - dependencies: - babel-runtime "^6.22.0" - -babel-runtime@^6.22.0: - version "6.23.0" - resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.23.0.tgz#0a9489f144de70efb3ce4300accdb329e2fc543b" - dependencies: - core-js "^2.4.0" - regenerator-runtime "^0.10.0" - -babel-template@^6.16.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.25.0.tgz#665241166b7c2aa4c619d71e192969552b10c071" - dependencies: - babel-runtime "^6.22.0" - babel-traverse "^6.25.0" - babel-types "^6.25.0" - babylon "^6.17.2" - lodash "^4.2.0" - -babel-traverse@^6.18.0, babel-traverse@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.25.0.tgz#2257497e2fcd19b89edc13c4c91381f9512496f1" - dependencies: - babel-code-frame "^6.22.0" - babel-messages "^6.23.0" - babel-runtime "^6.22.0" - babel-types "^6.25.0" - babylon "^6.17.2" - debug "^2.2.0" - globals "^9.0.0" - invariant "^2.2.0" - lodash "^4.2.0" - -babel-types@^6.18.0, babel-types@^6.25.0: - version "6.25.0" - resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.25.0.tgz#70afb248d5660e5d18f811d91c8303b54134a18e" - dependencies: - babel-runtime "^6.22.0" - esutils "^2.0.2" - lodash "^4.2.0" - to-fast-properties "^1.0.1" - -babylon@^6.13.0, babylon@^6.17.2: - version "6.17.3" - resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.17.3.tgz#1327d709950b558f204e5352587fd0290f8d8e48" - -balanced-match@^0.4.1: - version "0.4.2" - resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-0.4.2.tgz#cb3f3e3c732dc0f01ee70b403f302e61d7709838" - -brace-expansion@^1.1.7: - version "1.1.7" - resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.7.tgz#3effc3c50e000531fb720eaff80f0ae8ef23cf59" - dependencies: - balanced-match "^0.4.1" - concat-map "0.0.1" - -braces@^1.8.2: - version "1.8.5" - resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7" - dependencies: - expand-range "^1.8.1" - preserve "^0.2.0" - repeat-element "^1.1.2" - -browser-stdout@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.0.tgz#f351d32969d32fa5d7a5567154263d928ae3bd1f" - -builtin-modules@^1.0.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f" - -caching-transform@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/caching-transform/-/caching-transform-1.0.1.tgz#6dbdb2f20f8d8fbce79f3e94e9d1742dcdf5c0a1" - dependencies: - md5-hex "^1.2.0" - mkdirp "^0.5.1" - write-file-atomic "^1.1.4" - -camelcase@^1.0.2: - version "1.2.1" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39" - -camelcase@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a" - -camelcase@^4.1.0: - version "4.1.0" - resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-4.1.0.tgz#d545635be1e33c542649c69173e5de6acfae34dd" - -center-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad" - dependencies: - align-text "^0.1.3" - lazy-cache "^1.0.3" - -chalk@^1.1.0, chalk@^1.1.1: - version "1.1.3" - resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" - dependencies: - ansi-styles "^2.2.1" - escape-string-regexp "^1.0.2" - has-ansi "^2.0.0" - strip-ansi "^3.0.0" - supports-color "^2.0.0" - -clang-format@^1.0.50: - version "1.0.53" - resolved "https://registry.yarnpkg.com/clang-format/-/clang-format-1.0.53.tgz#ff3668c40ecceeeeaa3e977b61d50106d0b3fd46" - dependencies: - async "^1.5.2" - glob "^7.0.0" - resolve "^1.1.6" - -cliui@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1" - dependencies: - center-align "^0.1.1" - right-align "^0.1.1" - wordwrap "0.0.2" - -cliui@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/cliui/-/cliui-3.2.0.tgz#120601537a916d29940f934da3b48d585a39213d" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - wrap-ansi "^2.0.0" - -code-point-at@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" - -commander@2.9.0: - version "2.9.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.9.0.tgz#9c99094176e12240cb22d6c5146098400fe0f7d4" - dependencies: - graceful-readlink ">= 1.0.0" - -commondir@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/commondir/-/commondir-1.0.1.tgz#ddd800da0c66127393cca5950ea968a3aaf1253b" - -concat-map@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" - -convert-source-map@^1.3.0: - version "1.5.0" - resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.5.0.tgz#9acd70851c6d5dfdd93d9282e5edf94a03ff46b5" - -core-js@^2.4.0: - version "2.4.1" - resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e" - -cross-spawn@^4, cross-spawn@^4.0.0: - version "4.0.2" - resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-4.0.2.tgz#7b9247621c23adfdd3856004a823cbe397424d41" - dependencies: - lru-cache "^4.0.1" - which "^1.2.9" - -debug-log@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/debug-log/-/debug-log-1.0.1.tgz#2307632d4c04382b8df8a32f70b895046d52745f" - -debug@2.6.0: - version "2.6.0" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.0.tgz#bc596bcabe7617f11d9fa15361eded5608b8499b" - dependencies: - ms "0.7.2" - -debug@^2.2.0, debug@^2.6.3, debug@^2.6.8: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - -decamelize@^1.0.0, decamelize@^1.1.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" - -default-require-extensions@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/default-require-extensions/-/default-require-extensions-1.0.0.tgz#f37ea15d3e13ffd9b437d33e1a75b5fb97874cb8" - dependencies: - strip-bom "^2.0.0" - -detect-indent@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208" - dependencies: - repeating "^2.0.0" - -diff@3.2.0, diff@^3.1.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/diff/-/diff-3.2.0.tgz#c9ce393a4b7cbd0b058a725c93df299027868ff9" - -error-ex@^1.2.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" - dependencies: - is-arrayish "^0.2.1" - -escape-string-regexp@1.0.5, escape-string-regexp@^1.0.2: - version "1.0.5" - resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" - -esutils@^2.0.2: - version "2.0.2" - resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.2.tgz#0abf4f1caa5bcb1f7a9d8acc6dea4faaa04bac9b" - -execa@^0.5.0: - version "0.5.1" - resolved "https://registry.yarnpkg.com/execa/-/execa-0.5.1.tgz#de3fb85cb8d6e91c85bcbceb164581785cb57b36" - dependencies: - cross-spawn "^4.0.0" - get-stream "^2.2.0" - is-stream "^1.1.0" - npm-run-path "^2.0.0" - p-finally "^1.0.0" - signal-exit "^3.0.0" - strip-eof "^1.0.0" - -expand-brackets@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b" - dependencies: - is-posix-bracket "^0.1.0" - -expand-range@^1.8.1: - version "1.8.2" - resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337" - dependencies: - fill-range "^2.1.0" - -extglob@^0.3.1: - version "0.3.2" - resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1" - dependencies: - is-extglob "^1.0.0" - -filename-regex@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26" - -fill-range@^2.1.0: - version "2.2.3" - resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.3.tgz#50b77dfd7e469bc7492470963699fe7a8485a723" - dependencies: - is-number "^2.1.0" - isobject "^2.0.0" - randomatic "^1.1.3" - repeat-element "^1.1.2" - repeat-string "^1.5.2" - -find-cache-dir@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/find-cache-dir/-/find-cache-dir-0.1.1.tgz#c8defae57c8a52a8a784f9e31c57c742e993a0b9" - dependencies: - commondir "^1.0.1" - mkdirp "^0.5.1" - pkg-dir "^1.0.0" - -find-up@^1.0.0: - version "1.1.2" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-1.1.2.tgz#6b2e9822b1a2ce0a60ab64d610eccad53cb24d0f" - dependencies: - path-exists "^2.0.0" - pinkie-promise "^2.0.0" - -find-up@^2.0.0, find-up@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/find-up/-/find-up-2.1.0.tgz#45d1b7e506c717ddd482775a2b77920a3c0c57a7" - dependencies: - locate-path "^2.0.0" - -for-in@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80" - -for-own@^0.1.4: - version "0.1.5" - resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce" - dependencies: - for-in "^1.0.1" - -foreground-child@^1.5.3, foreground-child@^1.5.6: - version "1.5.6" - resolved "https://registry.yarnpkg.com/foreground-child/-/foreground-child-1.5.6.tgz#4fd71ad2dfde96789b980a5c0a295937cb2f5ce9" - dependencies: - cross-spawn "^4" - signal-exit "^3.0.0" - -formatio@1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/formatio/-/formatio-1.2.0.tgz#f3b2167d9068c4698a8d51f4f760a39a54d818eb" - dependencies: - samsam "1.x" - -fs.realpath@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" - -get-caller-file@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-1.0.2.tgz#f702e63127e7e231c160a80c1554acb70d5047e5" - -get-stream@^2.2.0: - version "2.3.1" - resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-2.3.1.tgz#5f38f93f346009666ee0150a054167f91bdd95de" - dependencies: - object-assign "^4.0.1" - pinkie-promise "^2.0.0" - -glob-base@^0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4" - dependencies: - glob-parent "^2.0.0" - is-glob "^2.0.0" - -glob-parent@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28" - dependencies: - is-glob "^2.0.0" - -glob@7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.1.tgz#805211df04faaf1c63a3600306cdf5ade50b2ec8" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.2" - once "^1.3.0" - path-is-absolute "^1.0.0" - -glob@^7.0.0, glob@^7.0.5, glob@^7.0.6: - version "7.1.2" - resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" - dependencies: - fs.realpath "^1.0.0" - inflight "^1.0.4" - inherits "2" - minimatch "^3.0.4" - once "^1.3.0" - path-is-absolute "^1.0.0" - -globals@^9.0.0: - version "9.18.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a" - -graceful-fs@^4.1.11, graceful-fs@^4.1.2: - version "4.1.11" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" - -"graceful-readlink@>= 1.0.0": - version "1.0.1" - resolved "https://registry.yarnpkg.com/graceful-readlink/-/graceful-readlink-1.0.1.tgz#4cafad76bc62f02fa039b2f94e9a3dd3a391a725" - -growl@1.9.2: - version "1.9.2" - resolved "https://registry.yarnpkg.com/growl/-/growl-1.9.2.tgz#0ea7743715db8d8de2c5ede1775e1b45ac85c02f" - -handlebars@^4.0.3: - version "4.0.10" - resolved "https://registry.yarnpkg.com/handlebars/-/handlebars-4.0.10.tgz#3d30c718b09a3d96f23ea4cc1f403c4d3ba9ff4f" - dependencies: - async "^1.4.0" - optimist "^0.6.1" - source-map "^0.4.4" - optionalDependencies: - uglify-js "^2.6" - -has-ansi@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" - dependencies: - ansi-regex "^2.0.0" - -has-flag@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-1.0.0.tgz#9d9e793165ce017a00f00418c43f942a7b1d11fa" - -hosted-git-info@^2.1.4: - version "2.4.2" - resolved "https://registry.yarnpkg.com/hosted-git-info/-/hosted-git-info-2.4.2.tgz#0076b9f46a270506ddbaaea56496897460612a67" - -imurmurhash@^0.1.4: - version "0.1.4" - resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" - -inflight@^1.0.4: - version "1.0.6" - resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" - dependencies: - once "^1.3.0" - wrappy "1" - -inherits@2: - version "2.0.3" - resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" - -invariant@^2.2.0: - version "2.2.2" - resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.2.tgz#9e1f56ac0acdb6bf303306f338be3b204ae60360" - dependencies: - loose-envify "^1.0.0" - -invert-kv@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/invert-kv/-/invert-kv-1.0.0.tgz#104a8e4aaca6d3d8cd157a8ef8bfab2d7a3ffdb6" - -is-arrayish@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" - -is-buffer@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.5.tgz#1f3b26ef613b214b88cbca23cc6c01d87961eecc" - -is-builtin-module@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-builtin-module/-/is-builtin-module-1.0.0.tgz#540572d34f7ac3119f8f76c30cbc1b1e037affbe" - dependencies: - builtin-modules "^1.0.0" - -is-dotfile@^1.0.0: - version "1.0.3" - resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1" - -is-equal-shallow@^0.1.3: - version "0.1.3" - resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534" - dependencies: - is-primitive "^2.0.0" - -is-extendable@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89" - -is-extglob@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0" - -is-finite@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.0.2.tgz#cc6677695602be550ef11e8b4aa6305342b6d0aa" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb" - dependencies: - number-is-nan "^1.0.0" - -is-fullwidth-code-point@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" - -is-glob@^2.0.0, is-glob@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863" - dependencies: - is-extglob "^1.0.0" - -is-number@^2.1.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f" - dependencies: - kind-of "^3.0.2" - -is-number@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195" - dependencies: - kind-of "^3.0.2" - -is-posix-bracket@^0.1.0: - version "0.1.1" - resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4" - -is-primitive@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575" - -is-stream@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-1.1.0.tgz#12d4a3dd4e68e0b79ceb8dbc84173ae80d91ca44" - -is-utf8@^0.2.0: - version "0.2.1" - resolved "https://registry.yarnpkg.com/is-utf8/-/is-utf8-0.2.1.tgz#4b0da1442104d1b336340e80797e865cf39f7d72" - -isarray@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" - -isarray@1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11" - -isexe@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" - -isobject@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89" - dependencies: - isarray "1.0.0" - -istanbul-lib-coverage@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-1.1.1.tgz#73bfb998885299415c93d38a3e9adf784a77a9da" - -istanbul-lib-hook@^1.0.7: - version "1.0.7" - resolved "https://registry.yarnpkg.com/istanbul-lib-hook/-/istanbul-lib-hook-1.0.7.tgz#dd6607f03076578fe7d6f2a630cf143b49bacddc" - dependencies: - append-transform "^0.4.0" - -istanbul-lib-instrument@^1.7.2: - version "1.7.2" - resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-1.7.2.tgz#6014b03d3470fb77638d5802508c255c06312e56" - dependencies: - babel-generator "^6.18.0" - babel-template "^6.16.0" - babel-traverse "^6.18.0" - babel-types "^6.18.0" - babylon "^6.13.0" - istanbul-lib-coverage "^1.1.1" - semver "^5.3.0" - -istanbul-lib-report@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz#f0e55f56655ffa34222080b7a0cd4760e1405fc9" - dependencies: - istanbul-lib-coverage "^1.1.1" - mkdirp "^0.5.1" - path-parse "^1.0.5" - supports-color "^3.1.2" - -istanbul-lib-source-maps@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/istanbul-lib-source-maps/-/istanbul-lib-source-maps-1.2.1.tgz#a6fe1acba8ce08eebc638e572e294d267008aa0c" - dependencies: - debug "^2.6.3" - istanbul-lib-coverage "^1.1.1" - mkdirp "^0.5.1" - rimraf "^2.6.1" - source-map "^0.5.3" - -istanbul-reports@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/istanbul-reports/-/istanbul-reports-1.1.1.tgz#042be5c89e175bc3f86523caab29c014e77fee4e" - dependencies: - handlebars "^4.0.3" - -js-tokens@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.1.tgz#08e9f132484a2c45a30907e9dc4d5567b7f114d7" - -jsesc@^1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b" - -json3@3.3.2: - version "3.3.2" - resolved "https://registry.yarnpkg.com/json3/-/json3-3.3.2.tgz#3c0434743df93e2f5c42aee7b19bcb483575f4e1" - -kind-of@^3.0.2: - version "3.2.2" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64" - dependencies: - is-buffer "^1.1.5" - -kind-of@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57" - dependencies: - is-buffer "^1.1.5" - -lazy-cache@^1.0.3: - version "1.0.4" - resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e" - -lcid@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lcid/-/lcid-1.0.0.tgz#308accafa0bc483a3867b4b6f2b9506251d1b835" - dependencies: - invert-kv "^1.0.0" - -lighthouse-logger@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/lighthouse-logger/-/lighthouse-logger-1.0.0.tgz#c6abdfbbbf0b4a541ab33864802cbad8944bcc8c" - dependencies: - debug "^2.6.8" - -load-json-file@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-1.1.0.tgz#956905708d58b4bab4c2261b04f59f31c99374c0" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - pinkie-promise "^2.0.0" - strip-bom "^2.0.0" - -load-json-file@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" - dependencies: - graceful-fs "^4.1.2" - parse-json "^2.2.0" - pify "^2.0.0" - strip-bom "^3.0.0" - -locate-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" - dependencies: - p-locate "^2.0.0" - path-exists "^3.0.0" - -lodash._baseassign@^3.0.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz#8c38a099500f215ad09e59f1722fd0c52bfe0a4e" - dependencies: - lodash._basecopy "^3.0.0" - lodash.keys "^3.0.0" - -lodash._basecopy@^3.0.0: - version "3.0.1" - resolved "https://registry.yarnpkg.com/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz#8da0e6a876cf344c0ad8a54882111dd3c5c7ca36" - -lodash._basecreate@^3.0.0: - version "3.0.3" - resolved "https://registry.yarnpkg.com/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz#1bc661614daa7fc311b7d03bf16806a0213cf821" - -lodash._getnative@^3.0.0: - version "3.9.1" - resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5" - -lodash._isiterateecall@^3.0.0: - version "3.0.9" - resolved "https://registry.yarnpkg.com/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz#5203ad7ba425fae842460e696db9cf3e6aac057c" - -lodash.create@3.1.1: - version "3.1.1" - resolved "https://registry.yarnpkg.com/lodash.create/-/lodash.create-3.1.1.tgz#d7f2849f0dbda7e04682bb8cd72ab022461debe7" - dependencies: - lodash._baseassign "^3.0.0" - lodash._basecreate "^3.0.0" - lodash._isiterateecall "^3.0.0" - -lodash.isarguments@^3.0.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a" - -lodash.isarray@^3.0.0: - version "3.0.4" - resolved "https://registry.yarnpkg.com/lodash.isarray/-/lodash.isarray-3.0.4.tgz#79e4eb88c36a8122af86f844aa9bcd851b5fbb55" - -lodash.keys@^3.0.0: - version "3.1.2" - resolved "https://registry.yarnpkg.com/lodash.keys/-/lodash.keys-3.1.2.tgz#4dbc0472b156be50a0b286855d1bd0b0c656098a" - dependencies: - lodash._getnative "^3.0.0" - lodash.isarguments "^3.0.0" - lodash.isarray "^3.0.0" - -lodash@^4.2.0: - version "4.17.4" - resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" - -lolex@^1.6.0: - version "1.6.0" - resolved "https://registry.yarnpkg.com/lolex/-/lolex-1.6.0.tgz#3a9a0283452a47d7439e72731b9e07d7386e49f6" - -longest@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097" - -loose-envify@^1.0.0: - version "1.3.1" - resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.3.1.tgz#d1a8ad33fa9ce0e713d65fdd0ac8b748d478c848" - dependencies: - js-tokens "^3.0.0" - -lru-cache@^4.0.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" - dependencies: - pseudomap "^1.0.2" - yallist "^2.1.2" - -make-error@^1.1.1: - version "1.3.0" - resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96" - -md5-hex@^1.2.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/md5-hex/-/md5-hex-1.3.0.tgz#d2c4afe983c4370662179b8cad145219135046c4" - dependencies: - md5-o-matic "^0.1.1" - -md5-o-matic@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/md5-o-matic/-/md5-o-matic-0.1.1.tgz#822bccd65e117c514fab176b25945d54100a03c3" - -mem@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mem/-/mem-1.1.0.tgz#5edd52b485ca1d900fe64895505399a0dfa45f76" - dependencies: - mimic-fn "^1.0.0" - -merge-source-map@^1.0.2: - version "1.0.3" - resolved "https://registry.yarnpkg.com/merge-source-map/-/merge-source-map-1.0.3.tgz#da1415f2722a5119db07b14c4f973410863a2abf" - dependencies: - source-map "^0.5.3" - -micromatch@^2.3.11: - version "2.3.11" - resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565" - dependencies: - arr-diff "^2.0.0" - array-unique "^0.2.1" - braces "^1.8.2" - expand-brackets "^0.1.4" - extglob "^0.3.1" - filename-regex "^2.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.1" - kind-of "^3.0.2" - normalize-path "^2.0.1" - object.omit "^2.0.0" - parse-glob "^3.0.4" - regex-cache "^0.4.2" - -mimic-fn@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.1.0.tgz#e667783d92e89dbd342818b5230b9d62a672ad18" - -minimatch@^3.0.2, minimatch@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" - dependencies: - brace-expansion "^1.1.7" - -minimist@0.0.8, minimist@~0.0.1: - version "0.0.8" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d" - -minimist@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" - -mkdirp@0.5.1, mkdirp@^0.5.0, mkdirp@^0.5.1: - version "0.5.1" - resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903" - dependencies: - minimist "0.0.8" - -mocha@^3.2.0: - version "3.4.2" - resolved "https://registry.yarnpkg.com/mocha/-/mocha-3.4.2.tgz#d0ef4d332126dbf18d0d640c9b382dd48be97594" - dependencies: - browser-stdout "1.3.0" - commander "2.9.0" - debug "2.6.0" - diff "3.2.0" - escape-string-regexp "1.0.5" - glob "7.1.1" - growl "1.9.2" - json3 "3.3.2" - lodash.create "3.1.1" - mkdirp "0.5.1" - supports-color "3.1.2" - -ms@0.7.2: - version "0.7.2" - resolved "https://registry.yarnpkg.com/ms/-/ms-0.7.2.tgz#ae25cf2512b3885a1d95d7f037868d8431124765" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - -native-promise-only@^0.8.1: - version "0.8.1" - resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11" - -normalize-package-data@^2.3.2: - version "2.3.8" - resolved "https://registry.yarnpkg.com/normalize-package-data/-/normalize-package-data-2.3.8.tgz#d819eda2a9dedbd1ffa563ea4071d936782295bb" - dependencies: - hosted-git-info "^2.1.4" - is-builtin-module "^1.0.0" - semver "2 || 3 || 4 || 5" - validate-npm-package-license "^3.0.1" - -normalize-path@^2.0.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9" - dependencies: - remove-trailing-separator "^1.0.1" - -npm-run-path@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/npm-run-path/-/npm-run-path-2.0.2.tgz#35a9232dfa35d7067b4cb2ddf2357b1871536c5f" - dependencies: - path-key "^2.0.0" - -number-is-nan@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d" - -nyc@^11.0.2: - version "11.0.2" - resolved "https://registry.yarnpkg.com/nyc/-/nyc-11.0.2.tgz#9e592a697186028253b668516c38f079c39c08f3" - dependencies: - archy "^1.0.0" - arrify "^1.0.1" - caching-transform "^1.0.0" - convert-source-map "^1.3.0" - debug-log "^1.0.1" - default-require-extensions "^1.0.0" - find-cache-dir "^0.1.1" - find-up "^2.1.0" - foreground-child "^1.5.3" - glob "^7.0.6" - istanbul-lib-coverage "^1.1.1" - istanbul-lib-hook "^1.0.7" - istanbul-lib-instrument "^1.7.2" - istanbul-lib-report "^1.1.1" - istanbul-lib-source-maps "^1.2.1" - istanbul-reports "^1.1.1" - md5-hex "^1.2.0" - merge-source-map "^1.0.2" - micromatch "^2.3.11" - mkdirp "^0.5.0" - resolve-from "^2.0.0" - rimraf "^2.5.4" - signal-exit "^3.0.1" - spawn-wrap "^1.3.6" - test-exclude "^4.1.1" - yargs "^8.0.1" - yargs-parser "^5.0.0" - -object-assign@^4.0.1, object-assign@^4.1.0: - version "4.1.1" - resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" - -object.omit@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa" - dependencies: - for-own "^0.1.4" - is-extendable "^0.1.1" - -once@^1.3.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" - dependencies: - wrappy "1" - -optimist@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/optimist/-/optimist-0.6.1.tgz#da3ea74686fa21a19a111c326e90eb15a0196686" - dependencies: - minimist "~0.0.1" - wordwrap "~0.0.2" - -os-homedir@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3" - -os-locale@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/os-locale/-/os-locale-2.0.0.tgz#15918ded510522b81ee7ae5a309d54f639fc39a4" - dependencies: - execa "^0.5.0" - lcid "^1.0.0" - mem "^1.1.0" - -p-finally@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" - -p-limit@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-1.1.0.tgz#b07ff2d9a5d88bec806035895a2bab66a27988bc" - -p-locate@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-2.0.0.tgz#20a0103b222a70c8fd39cc2e580680f3dde5ec43" - dependencies: - p-limit "^1.1.0" - -parse-glob@^3.0.4: - version "3.0.4" - resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c" - dependencies: - glob-base "^0.3.0" - is-dotfile "^1.0.0" - is-extglob "^1.0.0" - is-glob "^2.0.0" - -parse-json@^2.2.0: - version "2.2.0" - resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" - dependencies: - error-ex "^1.2.0" - -path-exists@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-2.1.0.tgz#0feb6c64f0fc518d9a754dd5efb62c7022761f4b" - dependencies: - pinkie-promise "^2.0.0" - -path-exists@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" - -path-is-absolute@^1.0.0: - version "1.0.1" - resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" - -path-key@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/path-key/-/path-key-2.0.1.tgz#411cadb574c5a140d3a4b1910d40d80cc9f40b40" - -path-parse@^1.0.5: - version "1.0.5" - resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" - -path-to-regexp@^1.7.0: - version "1.7.0" - resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-1.7.0.tgz#59fde0f435badacba103a84e9d3bc64e96b9937d" - dependencies: - isarray "0.0.1" - -path-type@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-1.1.0.tgz#59c44f7ee491da704da415da5a4070ba4f8fe441" - dependencies: - graceful-fs "^4.1.2" - pify "^2.0.0" - pinkie-promise "^2.0.0" - -path-type@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/path-type/-/path-type-2.0.0.tgz#f012ccb8415b7096fc2daa1054c3d72389594c73" - dependencies: - pify "^2.0.0" - -pify@^2.0.0: - version "2.3.0" - resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" - -pinkie-promise@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa" - dependencies: - pinkie "^2.0.0" - -pinkie@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870" - -pkg-dir@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/pkg-dir/-/pkg-dir-1.0.0.tgz#7a4b508a8d5bb2d629d447056ff4e9c9314cf3d4" - dependencies: - find-up "^1.0.0" - -preserve@^0.2.0: - version "0.2.0" - resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b" - -pseudomap@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" - -randomatic@^1.1.3: - version "1.1.7" - resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-1.1.7.tgz#c7abe9cc8b87c0baa876b19fde83fd464797e38c" - dependencies: - is-number "^3.0.0" - kind-of "^4.0.0" - -read-pkg-up@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-1.0.1.tgz#9d63c13276c065918d57f002a57f40a1b643fb02" - dependencies: - find-up "^1.0.0" - read-pkg "^1.0.0" - -read-pkg-up@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg-up/-/read-pkg-up-2.0.0.tgz#6b72a8048984e0c41e79510fd5e9fa99b3b549be" - dependencies: - find-up "^2.0.0" - read-pkg "^2.0.0" - -read-pkg@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-1.1.0.tgz#f5ffaa5ecd29cb31c0474bca7d756b6bb29e3f28" - dependencies: - load-json-file "^1.0.0" - normalize-package-data "^2.3.2" - path-type "^1.0.0" - -read-pkg@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/read-pkg/-/read-pkg-2.0.0.tgz#8ef1c0623c6a6db0dc6713c4bfac46332b2368f8" - dependencies: - load-json-file "^2.0.0" - normalize-package-data "^2.3.2" - path-type "^2.0.0" - -regenerator-runtime@^0.10.0: - version "0.10.5" - resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658" - -regex-cache@^0.4.2: - version "0.4.3" - resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.3.tgz#9b1a6c35d4d0dfcef5711ae651e8e9d3d7114145" - dependencies: - is-equal-shallow "^0.1.3" - is-primitive "^2.0.0" - -remove-trailing-separator@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.0.2.tgz#69b062d978727ad14dc6b56ba4ab772fd8d70511" - -repeat-element@^1.1.2: - version "1.1.2" - resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.2.tgz#ef089a178d1483baae4d93eb98b4f9e4e11d990a" - -repeat-string@^1.5.2: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - -repeating@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda" - dependencies: - is-finite "^1.0.0" - -require-directory@^2.1.1: - version "2.1.1" - resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" - -require-main-filename@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-1.0.1.tgz#97f717b69d48784f5f526a6c5aa8ffdda055a4d1" - -resolve-from@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-2.0.0.tgz#9480ab20e94ffa1d9e80a804c7ea147611966b57" - -resolve@^1.1.6: - version "1.3.3" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.3.3.tgz#655907c3469a8680dc2de3a275a8fdd69691f0e5" - dependencies: - path-parse "^1.0.5" - -right-align@^0.1.1: - version "0.1.3" - resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef" - dependencies: - align-text "^0.1.1" - -rimraf@^2.3.3, rimraf@^2.5.4, rimraf@^2.6.1: - version "2.6.1" - resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.6.1.tgz#c2338ec643df7a1b7fe5c54fa86f57428a55f33d" - dependencies: - glob "^7.0.5" - -samsam@1.x, samsam@^1.1.3: - version "1.2.1" - resolved "https://registry.yarnpkg.com/samsam/-/samsam-1.2.1.tgz#edd39093a3184370cb859243b2bdf255e7d8ea67" - -"semver@2 || 3 || 4 || 5", semver@^5.3.0: - version "5.3.0" - resolved "https://registry.yarnpkg.com/semver/-/semver-5.3.0.tgz#9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f" - -set-blocking@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" - -signal-exit@^3.0.0, signal-exit@^3.0.1, signal-exit@^3.0.2: - version "3.0.2" - resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" - -sinon@^2.3.5: - version "2.3.5" - resolved "https://registry.yarnpkg.com/sinon/-/sinon-2.3.5.tgz#9a2fc0ff8d526da716f30953aa2c65d518917f6c" - dependencies: - diff "^3.1.0" - formatio "1.2.0" - lolex "^1.6.0" - native-promise-only "^0.8.1" - path-to-regexp "^1.7.0" - samsam "^1.1.3" - text-encoding "0.6.4" - type-detect "^4.0.0" - -slide@^1.1.5: - version "1.1.6" - resolved "https://registry.yarnpkg.com/slide/-/slide-1.1.6.tgz#56eb027d65b4d2dce6cb2e2d32c4d4afc9e1d707" - -source-map-support@^0.4.0: - version "0.4.15" - resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.15.tgz#03202df65c06d2bd8c7ec2362a193056fef8d3b1" - dependencies: - source-map "^0.5.6" - -source-map@^0.4.4: - version "0.4.4" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.4.4.tgz#eba4f5da9c0dc999de68032d8b4f76173652036b" - dependencies: - amdefine ">=0.0.4" - -source-map@^0.5.0, source-map@^0.5.3, source-map@^0.5.6, source-map@~0.5.1: - version "0.5.6" - resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.6.tgz#75ce38f52bf0733c5a7f0c118d81334a2bb5f412" - -spawn-wrap@^1.3.6: - version "1.3.6" - resolved "https://registry.yarnpkg.com/spawn-wrap/-/spawn-wrap-1.3.6.tgz#ccec4a949d8ce7e2b1a35cf4671d683d2e76a1d1" - dependencies: - foreground-child "^1.5.6" - mkdirp "^0.5.0" - os-homedir "^1.0.1" - rimraf "^2.3.3" - signal-exit "^3.0.2" - which "^1.2.4" - -spdx-correct@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-1.0.2.tgz#4b3073d933ff51f3912f03ac5519498a4150db40" - dependencies: - spdx-license-ids "^1.0.2" - -spdx-expression-parse@~1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/spdx-expression-parse/-/spdx-expression-parse-1.0.4.tgz#9bdf2f20e1f40ed447fbe273266191fced51626c" - -spdx-license-ids@^1.0.2: - version "1.2.2" - resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-1.2.2.tgz#c9df7a3424594ade6bd11900d596696dc06bac57" - -string-width@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3" - dependencies: - code-point-at "^1.0.0" - is-fullwidth-code-point "^1.0.0" - strip-ansi "^3.0.0" - -string-width@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.0.0.tgz#635c5436cc72a6e0c387ceca278d4e2eec52687e" - dependencies: - is-fullwidth-code-point "^2.0.0" - strip-ansi "^3.0.0" - -strip-ansi@^3.0.0, strip-ansi@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" - dependencies: - ansi-regex "^2.0.0" - -strip-bom@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-2.0.0.tgz#6219a85616520491f35788bdbf1447a99c7e6b0e" - dependencies: - is-utf8 "^0.2.0" - -strip-bom@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" - -strip-eof@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/strip-eof/-/strip-eof-1.0.0.tgz#bb43ff5598a6eb05d89b59fcd129c983313606bf" - -strip-json-comments@^2.0.0: - version "2.0.1" - resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a" - -supports-color@3.1.2, supports-color@^3.1.2: - version "3.1.2" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-3.1.2.tgz#72a262894d9d408b956ca05ff37b2ed8a6e2a2d5" - dependencies: - has-flag "^1.0.0" - -supports-color@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" - -test-exclude@^4.1.1: - version "4.1.1" - resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-4.1.1.tgz#4d84964b0966b0087ecc334a2ce002d3d9341e26" - dependencies: - arrify "^1.0.1" - micromatch "^2.3.11" - object-assign "^4.1.0" - read-pkg-up "^1.0.1" - require-main-filename "^1.0.1" - -text-encoding@0.6.4: - version "0.6.4" - resolved "https://registry.yarnpkg.com/text-encoding/-/text-encoding-0.6.4.tgz#e399a982257a276dae428bb92845cb71bdc26d19" - -to-fast-properties@^1.0.1: - version "1.0.3" - resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47" - -trim-right@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003" - -ts-node@^3.0.4: - version "3.0.6" - resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-3.0.6.tgz#55127ff790c7eebf6ba68c1e6dde94b09aaa21e0" - dependencies: - arrify "^1.0.0" - chalk "^1.1.1" - diff "^3.1.0" - make-error "^1.1.1" - minimist "^1.2.0" - mkdirp "^0.5.1" - source-map-support "^0.4.0" - tsconfig "^6.0.0" - v8flags "^2.0.11" - yn "^2.0.0" - -tsconfig@^6.0.0: - version "6.0.0" - resolved "https://registry.yarnpkg.com/tsconfig/-/tsconfig-6.0.0.tgz#6b0e8376003d7af1864f8df8f89dd0059ffcd032" - dependencies: - strip-bom "^3.0.0" - strip-json-comments "^2.0.0" - -type-detect@^4.0.0: - version "4.0.3" - resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.3.tgz#0e3f2670b44099b0b46c284d136a7ef49c74c2ea" - -typescript@2.2.1: - version "2.2.1" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.2.1.tgz#4862b662b988a4c8ff691cc7969622d24db76ae9" - -uglify-js@^2.6: - version "2.8.29" - resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd" - dependencies: - source-map "~0.5.1" - yargs "~3.10.0" - optionalDependencies: - uglify-to-browserify "~1.0.0" - -uglify-to-browserify@~1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7" - -user-home@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190" - -v8flags@^2.0.11: - version "2.1.1" - resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4" - dependencies: - user-home "^1.1.1" - -validate-npm-package-license@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/validate-npm-package-license/-/validate-npm-package-license-3.0.1.tgz#2804babe712ad3379459acfbe24746ab2c303fbc" - dependencies: - spdx-correct "~1.0.0" - spdx-expression-parse "~1.0.0" - -which-module@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a" - -which@^1.2.4, which@^1.2.9: - version "1.2.14" - resolved "https://registry.yarnpkg.com/which/-/which-1.2.14.tgz#9a87c4378f03e827cecaf1acdf56c736c01c14e5" - dependencies: - isexe "^2.0.0" - -window-size@0.1.0: - version "0.1.0" - resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d" - -wordwrap@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f" - -wordwrap@~0.0.2: - version "0.0.3" - resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.3.tgz#a3d5da6cd5c0bc0008d37234bbaf1bed63059107" - -wrap-ansi@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-2.1.0.tgz#d8fc3d284dd05794fe84973caecdd1cf824fdd85" - dependencies: - string-width "^1.0.1" - strip-ansi "^3.0.1" - -wrappy@1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" - -write-file-atomic@^1.1.4: - version "1.3.4" - resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-1.3.4.tgz#f807a4f0b1d9e913ae7a48112e6cc3af1991b45f" - dependencies: - graceful-fs "^4.1.11" - imurmurhash "^0.1.4" - slide "^1.1.5" - -y18n@^3.2.1: - version "3.2.1" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-3.2.1.tgz#6d15fba884c08679c0d77e88e7759e811e07fa41" - -yallist@^2.1.2: - version "2.1.2" - resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" - -yargs-parser@^5.0.0: - version "5.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-5.0.0.tgz#275ecf0d7ffe05c77e64e7c86e4cd94bf0e1228a" - dependencies: - camelcase "^3.0.0" - -yargs-parser@^7.0.0: - version "7.0.0" - resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-7.0.0.tgz#8d0ac42f16ea55debd332caf4c4038b3e3f5dfd9" - dependencies: - camelcase "^4.1.0" - -yargs@^8.0.1: - version "8.0.2" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-8.0.2.tgz#6299a9055b1cefc969ff7e79c1d918dceb22c360" - dependencies: - camelcase "^4.1.0" - cliui "^3.2.0" - decamelize "^1.1.1" - get-caller-file "^1.0.1" - os-locale "^2.0.0" - read-pkg-up "^2.0.0" - require-directory "^2.1.1" - require-main-filename "^1.0.1" - set-blocking "^2.0.0" - string-width "^2.0.0" - which-module "^2.0.0" - y18n "^3.2.1" - yargs-parser "^7.0.0" - -yargs@~3.10.0: - version "3.10.0" - resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1" - dependencies: - camelcase "^1.0.2" - cliui "^2.1.0" - decamelize "^1.0.0" - window-size "0.1.0" - -yn@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/yn/-/yn-2.0.0.tgz#e5adabc8acf408f6385fc76495684c88e6af689a" diff --git a/docs/headless-chrome.md b/docs/headless-chrome.md index 59b56ccaf2b0..0536cf97e71b 100644 --- a/docs/headless-chrome.md +++ b/docs/headless-chrome.md @@ -72,7 +72,7 @@ Run it: ```javascript const lighthouse = require('lighthouse'); -const chromeLauncher = require('lighthouse/chrome-launcher'); +const chromeLauncher = require('chrome-launcher'); function launchChromeAndRunLighthouse(url, flags = {}, config = null) { return chromeLauncher.launch(flags).then(chrome => { diff --git a/docs/readme.md b/docs/readme.md index 2c91a87c84e2..72a2ff348e24 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -9,7 +9,7 @@ assumes you've installed Lighthouse as a dependency (`yarn add --dev lighthouse` ```javascript const lighthouse = require('lighthouse'); -const chromeLauncher = require('lighthouse/chrome-launcher'); +const chromeLauncher = require('chrome-launcher'); function launchChromeAndRunLighthouse(url, flags = {}, config = null) { return chromeLauncher.launch().then(chrome => { diff --git a/docs/recipes/gulp/gulpfile.js b/docs/recipes/gulp/gulpfile.js index ed05ec80fe46..683b99bf3519 100644 --- a/docs/recipes/gulp/gulpfile.js +++ b/docs/recipes/gulp/gulpfile.js @@ -9,7 +9,7 @@ const gulp = require('gulp'); const connect = require('gulp-connect'); const lighthouse = require('lighthouse'); -const chromeLauncher = require('lighthouse/chrome-launcher'); +const chromeLauncher = require('chrome-launcher'); const perfConfig = require('lighthouse/lighthouse-core/config/perf.json'); const PORT = 8080; diff --git a/lighthouse-cli/run.ts b/lighthouse-cli/run.ts index 4d3e85c9d9f2..ee7be40c4b92 100644 --- a/lighthouse-cli/run.ts +++ b/lighthouse-cli/run.ts @@ -10,7 +10,7 @@ import * as path from 'path'; import * as Printer from './printer'; import {Results} from './types/types'; import {Flags} from './cli-flags'; -import {launch, LaunchedChrome} from '../chrome-launcher/chrome-launcher'; +import {launch, LaunchedChrome} from 'chrome-launcher'; const yargs = require('yargs'); const lighthouse = require('../lighthouse-core'); diff --git a/lighthouse-core/scripts/generate-combined-coverage.sh b/lighthouse-core/scripts/generate-combined-coverage.sh index 88fa69329478..3c94a4b13b2a 100755 --- a/lighthouse-core/scripts/generate-combined-coverage.sh +++ b/lighthouse-core/scripts/generate-combined-coverage.sh @@ -6,9 +6,8 @@ # 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. ## -# run tests with coverage in both root and launcher +# run tests with coverage in both root and cli yarn run coverage -cd chrome-launcher && yarn run coverage && cd .. cd lighthouse-cli && yarn run coverage && cd .. # report to coveralls diff --git a/lighthouse-core/scripts/run-mocha.sh b/lighthouse-core/scripts/run-mocha.sh index e25c7fce3020..f1f33c750643 100755 --- a/lighthouse-core/scripts/run-mocha.sh +++ b/lighthouse-core/scripts/run-mocha.sh @@ -20,11 +20,8 @@ elif [ "$flag" == '--viewer' ]; then _runmocha 'lighthouse-viewer' elif [ "$flag" == '--core' ]; then _runmocha 'lighthouse-core' -elif [ "$flag" == '--launcher' ]; then - cd chrome-launcher && yarn test -- --timeout 60000 --reporter dot else echo "lighthouse-core tests" && _runmocha 'lighthouse-core' && \ echo "lighthouse-cli tests" && _runmocha 'lighthouse-cli' && \ - echo "lighthouse-viewer tests" && _runmocha 'lighthouse-viewer' && \ - echo "chrome-launcher tests" && cd chrome-launcher && yarn test -- --timeout 60000 --reporter dot + echo "lighthouse-viewer tests" && _runmocha 'lighthouse-viewer' fi diff --git a/package.json b/package.json index ec8d7ec095a9..41e909fecea2 100644 --- a/package.json +++ b/package.json @@ -12,17 +12,15 @@ }, "scripts": { "install-all": "npm-run-posix-or-windows install-all:task", - "install-all:task": "yarn & yarn install-launcher & yarn install-cli & yarn install-extension & yarn install-viewer & wait", - "install-all:task:windows": "yarn && yarn install-launcher && yarn install-cli && yarn install-extension && yarn install-viewer", - "install-launcher": "cd ./chrome-launcher && yarn install && yarn build", + "install-all:task": "yarn & yarn install-cli & yarn install-extension & yarn install-viewer & wait", + "install-all:task:windows": "yarn && yarn install-cli && yarn install-extension && yarn install-viewer", "install-cli": "cd ./lighthouse-cli && yarn install && yarn build", "install-extension": "cd ./lighthouse-extension && yarn install", "install-viewer": "cd ./lighthouse-viewer && yarn install", "build-all": "npm-run-posix-or-windows build-all:task", - "build-all:task": "yarn build-launcher & yarn build-cli & yarn build-extension & yarn build-viewer & wait", - "build-all:task:windows": "yarn build-launcher && yarn build-cli && yarn build-extension && yarn build-viewer", + "build-all:task": "yarn build-cli & yarn build-extension & yarn build-viewer & wait", + "build-all:task:windows": "yarn build-cli && yarn build-extension && yarn build-viewer", "build-cli": "cd ./lighthouse-cli && yarn build", - "build-launcher": "cd ./chrome-launcher && yarn build", "build-extension": "cd ./lighthouse-extension && yarn build", "build-viewer": "cd ./lighthouse-viewer && yarn build", "clean": "rimraf *.report.html *.report.dom.html *.report.json *.screenshots.html *.devtoolslog.json *.trace.json || true", @@ -30,15 +28,12 @@ "smoke": "bash lighthouse-cli/test/smokehouse/offline-local/run-tests.sh && bash lighthouse-cli/test/smokehouse/perf/run-tests.sh && bash lighthouse-cli/test/smokehouse/dobetterweb/run-tests.sh && bash lighthouse-cli/test/smokehouse/byte-efficiency/run-tests.sh && bash lighthouse-cli/test/smokehouse/tricky-ttci/run-tests.sh && bash lighthouse-cli/test/smokehouse/seo/run-tests.sh", "coverage": "istanbul cover -x \"**/third_party/**\" _mocha -- $(find */test -name '*-test.js') --timeout 10000 --reporter progress --report lcovonly", "start": "node ./lighthouse-cli/index.js", - "test": "yarn lint --silent && yarn unit && yarn closure && yarn test-cli-formatting && yarn test-launcher-formatting", + "test": "yarn lint --silent && yarn unit && yarn closure && yarn test-cli-formatting", "unit-core": "bash lighthouse-core/scripts/run-mocha.sh --core", "unit-cli": "bash lighthouse-core/scripts/run-mocha.sh --cli", "unit-viewer": "bash lighthouse-core/scripts/run-mocha.sh --viewer", - "unit-launcher": "bash lighthouse-core/scripts/run-mocha.sh --launcher", "unit": "bash lighthouse-core/scripts/run-mocha.sh --default", "test-cli-formatting": "cd lighthouse-cli && ./test/check-formatting.sh && cd ..", - "test-launcher-formatting": "cd chrome-launcher && ./test/check-formatting.sh && cd ..", - "launcher-unit": "yarn unit-launcher", "core-unit": "yarn unit-core", "cli-unit": "yarn unit-cli", "viewer-unit": "yarn unit-viewer", @@ -75,6 +70,7 @@ "dependencies": { "axe-core": "2.4.1", "chrome-devtools-frontend": "1.0.422034", + "chrome-launcher": "0.8.0", "devtools-timeline-model": "1.1.6", "jpeg-js": "0.1.2", "json-stringify-safe": "5.0.1", diff --git a/plots/measure.js b/plots/measure.js index aa9e2ba5639e..76c32e54b1bc 100644 --- a/plots/measure.js +++ b/plots/measure.js @@ -46,7 +46,7 @@ const constants = require('./constants.js'); const utils = require('./utils.js'); const config = require('../lighthouse-core/config/plots-config.js'); const lighthouse = require('../lighthouse-core/index.js'); -const ChromeLauncher = require('../chrome-launcher/chrome-launcher.js'); +const ChromeLauncher = require('chrome-launcher'); const Printer = require('../lighthouse-cli/printer'); const assetSaver = require('../lighthouse-core/lib/asset-saver.js'); diff --git a/readme.md b/readme.md index bde4b062d40d..ff4e961b6f93 100644 --- a/readme.md +++ b/readme.md @@ -194,11 +194,9 @@ yarn yarn install-all yarn build-all -# The CLI and Chrome Launcher are authored in TypeScript and require compilation. +# The CLI is authored in TypeScript and requires compilation. # If you need to make changes to the CLI, run the TS compiler in watch mode: # cd lighthouse-cli && yarn dev -# similarly, run the TS compiler for the launcher: -# cd chrome-launcher && yarn dev ``` ### Run diff --git a/yarn.lock b/yarn.lock index 71a822d761d1..7c83d47b413f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,10 +2,26 @@ # yarn lockfile v1 +"@types/core-js@^0.9.41": + version "0.9.43" + resolved "https://registry.yarnpkg.com/@types/core-js/-/core-js-0.9.43.tgz#65d646c5e8c0cd1bdee37065799f9d3d48748253" + +"@types/mkdirp@^0.3.29": + version "0.3.29" + resolved "https://registry.yarnpkg.com/@types/mkdirp/-/mkdirp-0.3.29.tgz#7f2ad7ec55f914482fc9b1ec4bb1ae6028d46066" + +"@types/node@6.0.66": + version "6.0.66" + resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.66.tgz#5680b74a6135d33d4c00447e7c3dc691a4601625" + "@types/node@^6.0.45": version "6.0.46" resolved "https://registry.yarnpkg.com/@types/node/-/node-6.0.46.tgz#8d9e48572831f05b11cc4c793754d43437219d62" +"@types/rimraf@^0.0.28": + version "0.0.28" + resolved "https://registry.yarnpkg.com/@types/rimraf/-/rimraf-0.0.28.tgz#5562519bc7963caca8abf7f128cae3b594d41d06" + abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" @@ -474,6 +490,19 @@ chrome-devtools-frontend@1.0.422034: version "1.0.422034" resolved "https://registry.yarnpkg.com/chrome-devtools-frontend/-/chrome-devtools-frontend-1.0.422034.tgz#071c8ce14466b7653032fcd1ad1a4a68d5e3cbd9" +chrome-launcher@0.8.0: + version "0.8.0" + resolved "https://registry.yarnpkg.com/chrome-launcher/-/chrome-launcher-0.8.0.tgz#5cdf3089015a441faeb36388489ab5494742f00f" + dependencies: + "@types/core-js" "^0.9.41" + "@types/mkdirp" "^0.3.29" + "@types/node" "6.0.66" + "@types/rimraf" "^0.0.28" + is-wsl "^1.1.0" + lighthouse-logger "^1.0.0" + mkdirp "0.5.1" + rimraf "^2.6.1" + ci-env@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/ci-env/-/ci-env-1.4.0.tgz#7e4c4ed1d10cedce734293e04dde94fcdfe74d67" @@ -1831,6 +1860,10 @@ is-windows@^0.2.0: version "0.2.0" resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-0.2.0.tgz#de1aa6d63ea29dd248737b69f1ff8b8002d2108c" +is-wsl@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-wsl/-/is-wsl-1.1.0.tgz#1f16e4aa22b04d1336b66188a66af3c600c3a66d" + isarray@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/isarray/-/isarray-0.0.1.tgz#8a18acfca9a8f4177e09abfc6038939b05d1eedf" From fcd39a6d11eabce9a43d299f7fe9801a91794d44 Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Mon, 25 Sep 2017 15:08:52 -0700 Subject: [PATCH 2/2] add chrome-launcher/chrome-launcher.js stub as well --- chrome-launcher/chrome-launcher.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 chrome-launcher/chrome-launcher.js diff --git a/chrome-launcher/chrome-launcher.js b/chrome-launcher/chrome-launcher.js new file mode 100644 index 000000000000..4dca808e38a3 --- /dev/null +++ b/chrome-launcher/chrome-launcher.js @@ -0,0 +1,16 @@ +/** + * @license Copyright 2017 Google Inc. All Rights Reserved. + * 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. + */ +'use strict'; + +/** + * chrome-launcher has moved to its own repository and npm package. + * https://github.com/GoogleChrome/chrome-launcher + * https://www.npmjs.com/package/chrome-launcher + * Forwarding stub provided here for users that have deep linked into this + * module, but file will be removed in next major release. + */ + +module.exports = require('chrome-launcher');