diff --git a/src/Browser.ts b/src/Browser.ts index 10f7e727..562bfd30 100644 --- a/src/Browser.ts +++ b/src/Browser.ts @@ -54,7 +54,6 @@ export class Browser extends EventEmitter { _closeCallback: BrowserCloseCallback; _defaultContext: BrowserContext; _contexts: Map; - // TODO: once Target is in TypeScript we can type this properly. _targets: Map; constructor( diff --git a/src/Puppeteer.ts b/src/Puppeteer.ts index 0e92a2ec..44a53dfb 100644 --- a/src/Puppeteer.ts +++ b/src/Puppeteer.ts @@ -13,14 +13,14 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Launcher from './Launcher'; +import Launcher from './node/Launcher'; import { LaunchOptions, ChromeArgOptions, BrowserOptions, -} from './launcher/LaunchOptions'; -import { ProductLauncher } from './Launcher'; -import { BrowserFetcher, BrowserFetcherOptions } from './BrowserFetcher'; +} from './node/LaunchOptions'; +import { ProductLauncher } from './node/Launcher'; +import { BrowserFetcher, BrowserFetcherOptions } from './node/BrowserFetcher'; import { puppeteerErrors, PuppeteerErrors } from './Errors'; import { ConnectionTransport } from './ConnectionTransport'; diff --git a/src/api-docs-entry.ts b/src/api-docs-entry.ts index e114d555..488f3b49 100644 --- a/src/api-docs-entry.ts +++ b/src/api-docs-entry.ts @@ -25,7 +25,7 @@ */ export * from './Accessibility'; export * from './Browser'; -export * from './BrowserFetcher'; +export * from './node/BrowserFetcher'; export * from './Connection'; export * from './ConsoleMessage'; export * from './Coverage'; diff --git a/src/api.ts b/src/api.ts index e9cd57f5..5ac8f07d 100644 --- a/src/api.ts +++ b/src/api.ts @@ -22,7 +22,7 @@ module.exports = { Accessibility: require('./Accessibility').Accessibility, Browser: require('./Browser').Browser, BrowserContext: require('./Browser').BrowserContext, - BrowserFetcher: require('./BrowserFetcher').BrowserFetcher, + BrowserFetcher: require('./node/BrowserFetcher').BrowserFetcher, CDPSession: require('./Connection').CDPSession, ConsoleMessage: require('./ConsoleMessage').ConsoleMessage, Coverage: require('./Coverage').Coverage, diff --git a/src/BrowserFetcher.ts b/src/node/BrowserFetcher.ts similarity index 99% rename from src/BrowserFetcher.ts rename to src/node/BrowserFetcher.ts index 11b063ca..c4002095 100644 --- a/src/BrowserFetcher.ts +++ b/src/node/BrowserFetcher.ts @@ -23,13 +23,13 @@ import * as https from 'https'; import * as http from 'http'; import extractZip from 'extract-zip'; -import { debug } from './Debug'; +import { debug } from '../Debug'; import removeRecursive from 'rimraf'; import * as URL from 'url'; import ProxyAgent from 'https-proxy-agent'; import { getProxyForUrl } from 'proxy-from-env'; -import { assert } from './assert'; -import { helper } from './helper'; +import { assert } from '../assert'; +import { helper } from '../helper'; const debugFetcher = debug(`puppeteer:fetcher`); const downloadURLs = { diff --git a/src/launcher/BrowserRunner.ts b/src/node/BrowserRunner.ts similarity index 99% rename from src/launcher/BrowserRunner.ts rename to src/node/BrowserRunner.ts index 80dcac38..baf5f61d 100644 --- a/src/launcher/BrowserRunner.ts +++ b/src/node/BrowserRunner.ts @@ -23,7 +23,7 @@ import { helper, debugError } from '../helper'; import { LaunchOptions } from './LaunchOptions'; import { Connection } from '../Connection'; import { WebSocketTransport } from '../WebSocketTransport'; -import { PipeTransport } from '../PipeTransport'; +import { PipeTransport } from './PipeTransport'; import * as readline from 'readline'; import { TimeoutError } from '../Errors'; diff --git a/src/launcher/LaunchOptions.ts b/src/node/LaunchOptions.ts similarity index 100% rename from src/launcher/LaunchOptions.ts rename to src/node/LaunchOptions.ts diff --git a/src/Launcher.ts b/src/node/Launcher.ts similarity index 98% rename from src/Launcher.ts rename to src/node/Launcher.ts index 60e977cd..63409ed3 100644 --- a/src/Launcher.ts +++ b/src/node/Launcher.ts @@ -21,13 +21,13 @@ import * as URL from 'url'; import * as fs from 'fs'; import { BrowserFetcher } from './BrowserFetcher'; -import { Connection } from './Connection'; -import { Browser } from './Browser'; -import { assert } from './assert'; -import { helper, debugError } from './helper'; -import { ConnectionTransport } from './ConnectionTransport'; -import { WebSocketTransport } from './WebSocketTransport'; -import { BrowserRunner } from './launcher/BrowserRunner'; +import { Connection } from '../Connection'; +import { Browser } from '../Browser'; +import { assert } from '../assert'; +import { helper, debugError } from '../helper'; +import { ConnectionTransport } from '../ConnectionTransport'; +import { WebSocketTransport } from '../WebSocketTransport'; +import { BrowserRunner } from './BrowserRunner'; const mkdtempAsync = helper.promisify(fs.mkdtemp); const writeFileAsync = helper.promisify(fs.writeFile); @@ -36,7 +36,7 @@ import { ChromeArgOptions, LaunchOptions, BrowserOptions, -} from './launcher/LaunchOptions'; +} from './LaunchOptions'; export interface ProductLauncher { launch(object); diff --git a/src/PipeTransport.ts b/src/node/PipeTransport.ts similarity index 94% rename from src/PipeTransport.ts rename to src/node/PipeTransport.ts index 71cdc889..52b2a0f1 100644 --- a/src/PipeTransport.ts +++ b/src/node/PipeTransport.ts @@ -13,8 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import { helper, debugError, PuppeteerEventListener } from './helper'; -import { ConnectionTransport } from './ConnectionTransport'; +import { helper, debugError, PuppeteerEventListener } from '../helper'; +import { ConnectionTransport } from '../ConnectionTransport'; export class PipeTransport implements ConnectionTransport { _pipeWrite: NodeJS.WritableStream; diff --git a/utils/doclint/cli.js b/utils/doclint/cli.js index 8384ffcf..dc214eb4 100755 --- a/utils/doclint/cli.js +++ b/utils/doclint/cli.js @@ -61,7 +61,7 @@ async function run() { * 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')), + ...(await Source.readdir(path.join(PROJECT_DIR, 'src', 'node'), 'ts')), ]; const tsSourcesNoDefinitions = tsSources.filter(