diff --git a/DeviceDescriptors.js b/DeviceDescriptors.js index 05135a11536..9b5345d4bdb 100644 --- a/DeviceDescriptors.js +++ b/DeviceDescriptors.js @@ -14,4 +14,4 @@ * limitations under the License. */ -module.exports = require('./lib/DeviceDescriptors'); +module.exports = require('./lib/common/DeviceDescriptors'); diff --git a/Errors.js b/Errors.js index 4779e1d8508..e4bdabb1e94 100644 --- a/Errors.js +++ b/Errors.js @@ -14,4 +14,4 @@ * limitations under the License. */ -module.exports = require('./lib/Errors'); +module.exports = require('./lib/common/Errors'); diff --git a/src/api-docs-entry.ts b/src/api-docs-entry.ts index 488f3b497ce..f5ee597ee9d 100644 --- a/src/api-docs-entry.ts +++ b/src/api-docs-entry.ts @@ -23,26 +23,25 @@ * * Once we have migrated to API Extractor and removed DocLint we can remove the duplication and use this file. */ -export * from './Accessibility'; -export * from './Browser'; +export * from './common/Accessibility'; +export * from './common/Browser'; export * from './node/BrowserFetcher'; -export * from './Connection'; -export * from './ConsoleMessage'; -export * from './Coverage'; -export * from './Dialog'; -export * from './JSHandle'; -export * from './ExecutionContext'; -export * from './EventEmitter'; -export * from './FileChooser'; -export * from './FrameManager'; -export * from './JSHandle'; -export * from './Input'; -export * from './Page'; -export * from './Puppeteer'; -export * from './HTTPRequest'; -export * from './HTTPResponse'; -export * from './SecurityDetails'; -export * from './Target'; -export * from './Errors'; -export * from './Tracing'; -export * from './WebWorker'; +export * from './common/Connection'; +export * from './common/ConsoleMessage'; +export * from './common/Coverage'; +export * from './common/Dialog'; +export * from './common/JSHandle'; +export * from './common/ExecutionContext'; +export * from './common/EventEmitter'; +export * from './common/FileChooser'; +export * from './common/FrameManager'; +export * from './common/Input'; +export * from './common/Page'; +export * from './common/Puppeteer'; +export * from './common/HTTPRequest'; +export * from './common/HTTPResponse'; +export * from './common/SecurityDetails'; +export * from './common/Target'; +export * from './common/Errors'; +export * from './common/Tracing'; +export * from './common/WebWorker'; diff --git a/src/api.ts b/src/api.ts index 5ac8f07d6a6..ac5b5228dc4 100644 --- a/src/api.ts +++ b/src/api.ts @@ -19,30 +19,30 @@ * 2) index.js uses it to iterate through all methods and call helper.installAsyncStackHooks on */ module.exports = { - Accessibility: require('./Accessibility').Accessibility, - Browser: require('./Browser').Browser, - BrowserContext: require('./Browser').BrowserContext, + Accessibility: require('./common/Accessibility').Accessibility, + Browser: require('./common/Browser').Browser, + BrowserContext: require('./common/Browser').BrowserContext, BrowserFetcher: require('./node/BrowserFetcher').BrowserFetcher, - CDPSession: require('./Connection').CDPSession, - ConsoleMessage: require('./ConsoleMessage').ConsoleMessage, - Coverage: require('./Coverage').Coverage, - Dialog: require('./Dialog').Dialog, - ElementHandle: require('./JSHandle').ElementHandle, - ExecutionContext: require('./ExecutionContext').ExecutionContext, - EventEmitter: require('./EventEmitter').EventEmitter, - FileChooser: require('./FileChooser').FileChooser, - Frame: require('./FrameManager').Frame, - JSHandle: require('./JSHandle').JSHandle, - Keyboard: require('./Input').Keyboard, - Mouse: require('./Input').Mouse, - Page: require('./Page').Page, - Puppeteer: require('./Puppeteer').Puppeteer, - HTTPRequest: require('./HTTPRequest').HTTPRequest, - HTTPResponse: require('./HTTPResponse').HTTPResponse, - SecurityDetails: require('./SecurityDetails').SecurityDetails, - Target: require('./Target').Target, - TimeoutError: require('./Errors').TimeoutError, - Touchscreen: require('./Input').Touchscreen, - Tracing: require('./Tracing').Tracing, - WebWorker: require('./WebWorker').WebWorker, + CDPSession: require('./common/Connection').CDPSession, + ConsoleMessage: require('./common/ConsoleMessage').ConsoleMessage, + Coverage: require('./common/Coverage').Coverage, + Dialog: require('./common/Dialog').Dialog, + ElementHandle: require('./common/JSHandle').ElementHandle, + ExecutionContext: require('./common/ExecutionContext').ExecutionContext, + EventEmitter: require('./common/EventEmitter').EventEmitter, + FileChooser: require('./common/FileChooser').FileChooser, + Frame: require('./common/FrameManager').Frame, + JSHandle: require('./common/JSHandle').JSHandle, + Keyboard: require('./common/Input').Keyboard, + Mouse: require('./common/Input').Mouse, + Page: require('./common/Page').Page, + Puppeteer: require('./common/Puppeteer').Puppeteer, + HTTPRequest: require('./common/HTTPRequest').HTTPRequest, + HTTPResponse: require('./common/HTTPResponse').HTTPResponse, + SecurityDetails: require('./common/SecurityDetails').SecurityDetails, + Target: require('./common/Target').Target, + TimeoutError: require('./common/Errors').TimeoutError, + Touchscreen: require('./common/Input').Touchscreen, + Tracing: require('./common/Tracing').Tracing, + WebWorker: require('./common/WebWorker').WebWorker, }; diff --git a/src/Accessibility.ts b/src/common/Accessibility.ts similarity index 99% rename from src/Accessibility.ts rename to src/common/Accessibility.ts index 2746119f825..23f5627a8e8 100644 --- a/src/Accessibility.ts +++ b/src/common/Accessibility.ts @@ -16,7 +16,7 @@ import { CDPSession } from './Connection'; import { ElementHandle } from './JSHandle'; -import Protocol from './protocol'; +import Protocol from '../protocol'; /** * Represents a Node and the properties of it that are relevant to Accessibility. diff --git a/src/Browser.ts b/src/common/Browser.ts similarity index 99% rename from src/Browser.ts rename to src/common/Browser.ts index 562bfd30fff..8aa7d7a291a 100644 --- a/src/Browser.ts +++ b/src/common/Browser.ts @@ -19,7 +19,7 @@ import { helper } from './helper'; import { Target } from './Target'; import { EventEmitter } from './EventEmitter'; import { Events } from './Events'; -import Protocol from './protocol'; +import Protocol from '../protocol'; import { Connection } from './Connection'; import { Page } from './Page'; import { ChildProcess } from 'child_process'; diff --git a/src/Connection.ts b/src/common/Connection.ts similarity index 99% rename from src/Connection.ts rename to src/common/Connection.ts index a8c99fd9676..9ef4ab6ccd2 100644 --- a/src/Connection.ts +++ b/src/common/Connection.ts @@ -19,7 +19,7 @@ import { debug } from './Debug'; const debugProtocolSend = debug('puppeteer:protocol:SEND ►'); const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀'); -import Protocol from './protocol'; +import Protocol from '../protocol'; import { ConnectionTransport } from './ConnectionTransport'; import { EventEmitter } from './EventEmitter'; diff --git a/src/ConnectionTransport.ts b/src/common/ConnectionTransport.ts similarity index 100% rename from src/ConnectionTransport.ts rename to src/common/ConnectionTransport.ts diff --git a/src/ConsoleMessage.ts b/src/common/ConsoleMessage.ts similarity index 100% rename from src/ConsoleMessage.ts rename to src/common/ConsoleMessage.ts diff --git a/src/Coverage.ts b/src/common/Coverage.ts similarity index 99% rename from src/Coverage.ts rename to src/common/Coverage.ts index 5f8bff84630..4b2d5a046d7 100644 --- a/src/Coverage.ts +++ b/src/common/Coverage.ts @@ -16,7 +16,7 @@ import { assert } from './assert'; import { helper, debugError, PuppeteerEventListener } from './helper'; -import Protocol from './protocol'; +import Protocol from '../protocol'; import { CDPSession } from './Connection'; import { EVALUATION_SCRIPT_URL } from './ExecutionContext'; diff --git a/src/DOMWorld.ts b/src/common/DOMWorld.ts similarity index 100% rename from src/DOMWorld.ts rename to src/common/DOMWorld.ts diff --git a/src/Debug.ts b/src/common/Debug.ts similarity index 100% rename from src/Debug.ts rename to src/common/Debug.ts diff --git a/src/DeviceDescriptors.ts b/src/common/DeviceDescriptors.ts similarity index 100% rename from src/DeviceDescriptors.ts rename to src/common/DeviceDescriptors.ts diff --git a/src/Dialog.ts b/src/common/Dialog.ts similarity index 98% rename from src/Dialog.ts rename to src/common/Dialog.ts index 775d10dbb1c..7675ad4d4b0 100644 --- a/src/Dialog.ts +++ b/src/common/Dialog.ts @@ -16,7 +16,7 @@ import { assert } from './assert'; import { CDPSession } from './Connection'; -import Protocol from './protocol'; +import Protocol from '../protocol'; /** * Dialog instances are dispatched by the {@link Page} via the `dialog` event. diff --git a/src/EmulationManager.ts b/src/common/EmulationManager.ts similarity index 98% rename from src/EmulationManager.ts rename to src/common/EmulationManager.ts index 8ff36b4667b..3231aa1bc9c 100644 --- a/src/EmulationManager.ts +++ b/src/common/EmulationManager.ts @@ -15,7 +15,7 @@ */ import { CDPSession } from './Connection'; import { Viewport } from './PuppeteerViewport'; -import Protocol from './protocol'; +import Protocol from '../protocol'; export class EmulationManager { _client: CDPSession; diff --git a/src/Errors.ts b/src/common/Errors.ts similarity index 100% rename from src/Errors.ts rename to src/common/Errors.ts diff --git a/src/EventEmitter.ts b/src/common/EventEmitter.ts similarity index 100% rename from src/EventEmitter.ts rename to src/common/EventEmitter.ts diff --git a/src/Events.ts b/src/common/Events.ts similarity index 100% rename from src/Events.ts rename to src/common/Events.ts diff --git a/src/ExecutionContext.ts b/src/common/ExecutionContext.ts similarity index 99% rename from src/ExecutionContext.ts rename to src/common/ExecutionContext.ts index 32db1a0c906..b653895e4e7 100644 --- a/src/ExecutionContext.ts +++ b/src/common/ExecutionContext.ts @@ -20,7 +20,7 @@ import { createJSHandle, JSHandle, ElementHandle } from './JSHandle'; import { CDPSession } from './Connection'; import { DOMWorld } from './DOMWorld'; import { Frame } from './FrameManager'; -import Protocol from './protocol'; +import Protocol from '../protocol'; export const EVALUATION_SCRIPT_URL = '__puppeteer_evaluation_script__'; const SOURCE_URL_REGEX = /^[\040\t]*\/\/[@#] sourceURL=\s*(\S*?)\s*$/m; diff --git a/src/FileChooser.ts b/src/common/FileChooser.ts similarity index 97% rename from src/FileChooser.ts rename to src/common/FileChooser.ts index 99a2b142812..d23ab7c4f70 100644 --- a/src/FileChooser.ts +++ b/src/common/FileChooser.ts @@ -15,7 +15,7 @@ */ import { ElementHandle } from './JSHandle'; -import Protocol from './protocol'; +import Protocol from '../protocol'; import { assert } from './assert'; export class FileChooser { diff --git a/src/FrameManager.ts b/src/common/FrameManager.ts similarity index 99% rename from src/FrameManager.ts rename to src/common/FrameManager.ts index e50617bff20..243c6c3da4d 100644 --- a/src/FrameManager.ts +++ b/src/common/FrameManager.ts @@ -28,7 +28,7 @@ import { JSHandle, ElementHandle } from './JSHandle'; import { MouseButtonInput } from './Input'; import { Page } from './Page'; import { HTTPResponse } from './HTTPResponse'; -import Protocol from './protocol'; +import Protocol from '../protocol'; const UTILITY_WORLD_NAME = '__puppeteer_utility_world__'; diff --git a/src/HTTPRequest.ts b/src/common/HTTPRequest.ts similarity index 99% rename from src/HTTPRequest.ts rename to src/common/HTTPRequest.ts index 7df17ee24ee..a11250f34b0 100644 --- a/src/HTTPRequest.ts +++ b/src/common/HTTPRequest.ts @@ -18,7 +18,7 @@ import { Frame } from './FrameManager'; import { HTTPResponse } from './HTTPResponse'; import { assert } from './assert'; import { helper, debugError } from './helper'; -import Protocol from './protocol'; +import Protocol from '../protocol'; export class HTTPRequest { _requestId: string; diff --git a/src/HTTPResponse.ts b/src/common/HTTPResponse.ts similarity index 99% rename from src/HTTPResponse.ts rename to src/common/HTTPResponse.ts index b595486d83a..a8f1ad249a5 100644 --- a/src/HTTPResponse.ts +++ b/src/common/HTTPResponse.ts @@ -17,7 +17,7 @@ import { CDPSession } from './Connection'; import { Frame } from './FrameManager'; import { HTTPRequest } from './HTTPRequest'; import { SecurityDetails } from './SecurityDetails'; -import Protocol from './protocol'; +import Protocol from '../protocol'; interface RemoteAddress { ip: string; diff --git a/src/Input.ts b/src/common/Input.ts similarity index 100% rename from src/Input.ts rename to src/common/Input.ts diff --git a/src/JSHandle.ts b/src/common/JSHandle.ts similarity index 99% rename from src/JSHandle.ts rename to src/common/JSHandle.ts index 38e814eea84..78aef768087 100644 --- a/src/JSHandle.ts +++ b/src/common/JSHandle.ts @@ -22,7 +22,7 @@ import { CDPSession } from './Connection'; import { KeyInput } from './USKeyboardLayout'; import { FrameManager, Frame } from './FrameManager'; import { getQueryHandlerAndSelector } from './QueryHandler'; -import Protocol from './protocol'; +import Protocol from '../protocol'; interface BoxModel { content: Array<{ x: number; y: number }>; diff --git a/src/LifecycleWatcher.ts b/src/common/LifecycleWatcher.ts similarity index 100% rename from src/LifecycleWatcher.ts rename to src/common/LifecycleWatcher.ts diff --git a/src/NetworkManager.ts b/src/common/NetworkManager.ts similarity index 99% rename from src/NetworkManager.ts rename to src/common/NetworkManager.ts index 46ed595ba81..2ed5c7a9297 100644 --- a/src/NetworkManager.ts +++ b/src/common/NetworkManager.ts @@ -16,7 +16,7 @@ import { EventEmitter } from './EventEmitter'; import { assert } from './assert'; import { helper, debugError } from './helper'; -import Protocol from './protocol'; +import Protocol from '../protocol'; import { Events } from './Events'; import { CDPSession } from './Connection'; import { FrameManager } from './FrameManager'; diff --git a/src/Page.ts b/src/common/Page.ts similarity index 99% rename from src/Page.ts rename to src/common/Page.ts index 79bb1d51f8d..2e93eb01720 100644 --- a/src/Page.ts +++ b/src/common/Page.ts @@ -40,7 +40,7 @@ import { TimeoutSettings } from './TimeoutSettings'; import { FileChooser } from './FileChooser'; import { ConsoleMessage } from './ConsoleMessage'; import { PuppeteerLifeCycleEvent } from './LifecycleWatcher'; -import Protocol from './protocol'; +import Protocol from '../protocol'; const writeFileAsync = helper.promisify(fs.writeFile); diff --git a/src/Puppeteer.ts b/src/common/Puppeteer.ts similarity index 93% rename from src/Puppeteer.ts rename to src/common/Puppeteer.ts index 44a53dfb0e3..0a8a0a8c6ad 100644 --- a/src/Puppeteer.ts +++ b/src/common/Puppeteer.ts @@ -13,19 +13,19 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -import Launcher from './node/Launcher'; +import Launcher from '../node/Launcher'; import { LaunchOptions, ChromeArgOptions, BrowserOptions, -} from './node/LaunchOptions'; -import { ProductLauncher } from './node/Launcher'; -import { BrowserFetcher, BrowserFetcherOptions } from './node/BrowserFetcher'; +} from '../node/LaunchOptions'; +import { ProductLauncher } from '../node/Launcher'; +import { BrowserFetcher, BrowserFetcherOptions } from '../node/BrowserFetcher'; import { puppeteerErrors, PuppeteerErrors } from './Errors'; import { ConnectionTransport } from './ConnectionTransport'; import { devicesMap } from './DeviceDescriptors'; -import { DevicesMap } from './/DeviceDescriptors'; +import { DevicesMap } from './DeviceDescriptors'; import { Browser } from './Browser'; import { registerCustomQueryHandler, @@ -102,7 +102,7 @@ export class Puppeteer { ) { // @ts-ignore // eslint-disable-next-line @typescript-eslint/no-var-requires - const packageJson = require('../package.json'); + const packageJson = require('../../package.json'); switch (this._productName) { case 'firefox': this._preferredRevision = packageJson.puppeteer.firefox_revision; diff --git a/src/PuppeteerViewport.ts b/src/common/PuppeteerViewport.ts similarity index 100% rename from src/PuppeteerViewport.ts rename to src/common/PuppeteerViewport.ts diff --git a/src/QueryHandler.ts b/src/common/QueryHandler.ts similarity index 100% rename from src/QueryHandler.ts rename to src/common/QueryHandler.ts diff --git a/src/SecurityDetails.ts b/src/common/SecurityDetails.ts similarity index 97% rename from src/SecurityDetails.ts rename to src/common/SecurityDetails.ts index eb622016a4f..b99a271eee2 100644 --- a/src/SecurityDetails.ts +++ b/src/common/SecurityDetails.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import Protocol from './protocol'; +import Protocol from '../protocol'; export class SecurityDetails { private _subjectName: string; diff --git a/src/Target.ts b/src/common/Target.ts similarity index 99% rename from src/Target.ts rename to src/common/Target.ts index b4c71b19aeb..1578fee3701 100644 --- a/src/Target.ts +++ b/src/common/Target.ts @@ -20,7 +20,7 @@ import { WebWorker } from './WebWorker'; import { CDPSession } from './Connection'; import { Browser, BrowserContext } from './Browser'; import { Viewport } from './PuppeteerViewport'; -import Protocol from './protocol'; +import Protocol from '../protocol'; export class Target { _targetInfo: Protocol.Target.TargetInfo; diff --git a/src/TimeoutSettings.ts b/src/common/TimeoutSettings.ts similarity index 100% rename from src/TimeoutSettings.ts rename to src/common/TimeoutSettings.ts diff --git a/src/Tracing.ts b/src/common/Tracing.ts similarity index 100% rename from src/Tracing.ts rename to src/common/Tracing.ts diff --git a/src/USKeyboardLayout.ts b/src/common/USKeyboardLayout.ts similarity index 100% rename from src/USKeyboardLayout.ts rename to src/common/USKeyboardLayout.ts diff --git a/src/WebSocketTransport.ts b/src/common/WebSocketTransport.ts similarity index 100% rename from src/WebSocketTransport.ts rename to src/common/WebSocketTransport.ts diff --git a/src/WebWorker.ts b/src/common/WebWorker.ts similarity index 99% rename from src/WebWorker.ts rename to src/common/WebWorker.ts index 9960d2e7318..4dccdbe4301 100644 --- a/src/WebWorker.ts +++ b/src/common/WebWorker.ts @@ -18,7 +18,7 @@ import { debugError } from './helper'; import { ExecutionContext } from './ExecutionContext'; import { JSHandle } from './JSHandle'; import { CDPSession } from './Connection'; -import Protocol from './protocol'; +import Protocol from '../protocol'; type ConsoleAPICalledCallback = ( eventType: string, diff --git a/src/assert.ts b/src/common/assert.ts similarity index 100% rename from src/assert.ts rename to src/common/assert.ts diff --git a/src/helper.ts b/src/common/helper.ts similarity index 99% rename from src/helper.ts rename to src/common/helper.ts index bc2f58163c3..71ff4536599 100644 --- a/src/helper.ts +++ b/src/common/helper.ts @@ -18,7 +18,7 @@ import { debug } from './Debug'; import * as fs from 'fs'; import { CDPSession } from './Connection'; import { promisify } from 'util'; -import Protocol from './protocol'; +import Protocol from '../protocol'; import { CommonEventEmitter } from './EventEmitter'; import { assert } from './assert'; diff --git a/src/index.ts b/src/index.ts index 3d039eb93a1..a083eacbcc7 100644 --- a/src/index.ts +++ b/src/index.ts @@ -19,9 +19,9 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires const api = require('./api'); -import { helper } from './helper'; -import { Page } from './Page'; -import { Puppeteer } from './Puppeteer'; +import { helper } from './common/helper'; +import { Page } from './common/Page'; +import { Puppeteer } from './common/Puppeteer'; interface InitOptions { packageJson: { diff --git a/src/node/BrowserFetcher.ts b/src/node/BrowserFetcher.ts index c4002095071..b4082a771f8 100644 --- a/src/node/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 '../common/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 '../common/assert'; +import { helper } from '../common/helper'; const debugFetcher = debug(`puppeteer:fetcher`); const downloadURLs = { diff --git a/src/node/BrowserRunner.ts b/src/node/BrowserRunner.ts index baf5f61dde9..6a2e921107f 100644 --- a/src/node/BrowserRunner.ts +++ b/src/node/BrowserRunner.ts @@ -14,18 +14,18 @@ * limitations under the License. */ -import { debug } from '../Debug'; +import { debug } from '../common/Debug'; import removeFolder from 'rimraf'; import * as childProcess from 'child_process'; -import { assert } from '../assert'; -import { helper, debugError } from '../helper'; +import { assert } from '../common/assert'; +import { helper, debugError } from '../common/helper'; import { LaunchOptions } from './LaunchOptions'; -import { Connection } from '../Connection'; -import { WebSocketTransport } from '../WebSocketTransport'; +import { Connection } from '../common/Connection'; +import { WebSocketTransport } from '../common/WebSocketTransport'; import { PipeTransport } from './PipeTransport'; import * as readline from 'readline'; -import { TimeoutError } from '../Errors'; +import { TimeoutError } from '../common/Errors'; const removeFolderAsync = helper.promisify(removeFolder); const debugLauncher = debug('puppeteer:launcher'); diff --git a/src/node/LaunchOptions.ts b/src/node/LaunchOptions.ts index 9e5e537baa2..81548c9c26e 100644 --- a/src/node/LaunchOptions.ts +++ b/src/node/LaunchOptions.ts @@ -14,7 +14,7 @@ * limitations under the License. */ -import { Viewport } from '../PuppeteerViewport'; +import { Viewport } from '../common/PuppeteerViewport'; export interface ChromeArgOptions { headless?: boolean; diff --git a/src/node/Launcher.ts b/src/node/Launcher.ts index 63409ed3817..d95d6b0fc24 100644 --- a/src/node/Launcher.ts +++ b/src/node/Launcher.ts @@ -21,12 +21,12 @@ 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 { Connection } from '../common/Connection'; +import { Browser } from '../common/Browser'; +import { assert } from '../common/assert'; +import { helper, debugError } from '../common/helper'; +import { ConnectionTransport } from '../common/ConnectionTransport'; +import { WebSocketTransport } from '../common/WebSocketTransport'; import { BrowserRunner } from './BrowserRunner'; const mkdtempAsync = helper.promisify(fs.mkdtemp); diff --git a/src/node/PipeTransport.ts b/src/node/PipeTransport.ts index 52b2a0f1d46..9711e23ea84 100644 --- a/src/node/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 '../common/helper'; +import { ConnectionTransport } from '../common/ConnectionTransport'; export class PipeTransport implements ConnectionTransport { _pipeWrite: NodeJS.WritableStream; diff --git a/test/EventEmitter.spec.js b/test/EventEmitter.spec.js index 446e6db1e86..b6fcc919524 100644 --- a/test/EventEmitter.spec.js +++ b/test/EventEmitter.spec.js @@ -1,4 +1,4 @@ -const { EventEmitter } = require('../lib/EventEmitter'); +const { EventEmitter } = require('../lib/common/EventEmitter'); const sinon = require('sinon'); const expect = require('expect'); diff --git a/test/coverage-utils.js b/test/coverage-utils.js index 221aaaef4cf..cff80d7e1d3 100644 --- a/test/coverage-utils.js +++ b/test/coverage-utils.js @@ -104,7 +104,7 @@ const trackCoverage = () => { before(() => { const api = require('../lib/api'); - const events = require('../lib/Events'); + const events = require('../lib/common/Events'); for (const [className, classType] of Object.entries(api)) traceAPICoverage(coverageMap, events, className, classType); }); diff --git a/test/launcher.spec.js b/test/launcher.spec.js index 960d1e6ba7b..7c031f5c9fa 100644 --- a/test/launcher.spec.js +++ b/test/launcher.spec.js @@ -17,7 +17,7 @@ const fs = require('fs'); const os = require('os'); const path = require('path'); const sinon = require('sinon'); -const { helper } = require('../lib/helper'); +const { helper } = require('../lib/common/helper'); const rmAsync = helper.promisify(require('rimraf')); const mkdtempAsync = helper.promisify(fs.mkdtemp); const readFileAsync = helper.promisify(fs.readFile); diff --git a/utils/doclint/cli.js b/utils/doclint/cli.js index dc214eb4f69..51387b5a494 100755 --- a/utils/doclint/cli.js +++ b/utils/doclint/cli.js @@ -61,6 +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', 'common'), 'ts')), ...(await Source.readdir(path.join(PROJECT_DIR, 'src', 'node'), 'ts')), ]; @@ -68,7 +69,11 @@ async function run() { (source) => !source.filePath().endsWith('.d.ts') ); - const jsSources = await Source.readdir(path.join(PROJECT_DIR, 'lib')); + const jsSources = [ + ...(await Source.readdir(path.join(PROJECT_DIR, 'lib'))), + ...(await Source.readdir(path.join(PROJECT_DIR, 'lib', 'common'))), + ...(await Source.readdir(path.join(PROJECT_DIR, 'lib', 'node'))), + ]; const allSrcCode = [...jsSources, ...tsSourcesNoDefinitions]; messages.push(...(await checkPublicAPI(page, mdSources, allSrcCode)));