chore: extract BrowserRunner into its own module (#5850)

* chore: extract `BrowserRunner` into its own module

`src/Launcher.ts` is large and hard to work in. It has multiple objects
defined in it:

* ChromeLauncher
* FirefoxLauncher
* BrowserRunner
* Launcher

This change moves BrowserRunner into its own module. More refactorings
like this will follow but this is the first step.
This commit is contained in:
Jack Franklin
2020-05-12 16:30:13 +01:00
committed by GitHub
parent b38bb4334f
commit c6d01c950e
6 changed files with 305 additions and 255 deletions

View File

@@ -55,7 +55,14 @@ async function run() {
const browser = await puppeteer.launch();
const page = await browser.newPage();
const checkPublicAPI = require('./check_public_api');
const tsSources = await Source.readdir(path.join(PROJECT_DIR, 'src'), 'ts');
const tsSources = [
/* Source.readdir doesn't deal with nested directories well.
* Rather than invest time here when we're going to remove this Doc tooling soon
* we'll just list the directories manually.
*/
...(await Source.readdir(path.join(PROJECT_DIR, 'src'), 'ts')),
...(await Source.readdir(path.join(PROJECT_DIR, 'src', 'launcher'), 'ts')),
];
const tsSourcesNoDefinitions = tsSources.filter(
(source) => !source.filePath().endsWith('.d.ts')