mirror of
https://github.com/puppeteer/puppeteer
synced 2024-06-14 14:02:48 +00:00
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:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user