chore: Add EsLint rule import/order (#9685)

This commit is contained in:
Nikolay Vitkov 2023-02-16 00:09:31 +01:00 committed by GitHub
parent e8e18ae081
commit eefe9583d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
156 changed files with 504 additions and 291 deletions

View File

@ -110,6 +110,14 @@ module.exports = {
], ],
'import/extensions': ['error', 'ignorePackages'], 'import/extensions': ['error', 'ignorePackages'],
'import/order': [
'error',
{
'newlines-between': 'always',
alphabetize: {order: 'asc', caseInsensitive: true},
},
],
'no-restricted-syntax': [ 'no-restricted-syntax': [
'error', 'error',
// Don't allow underscored declarations on camelCased variables/properties. // Don't allow underscored declarations on camelCased variables/properties.

View File

@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import yargs from 'yargs';
import ProgressBar from 'progress'; import ProgressBar from 'progress';
import yargs from 'yargs';
import {hideBin} from 'yargs/helpers'; import {hideBin} from 'yargs/helpers';
import {Browser, BrowserPlatform} from './browsers/types.js'; import {Browser, BrowserPlatform} from './browsers/types.js';
import {fetch} from './fetch.js'; import {fetch} from './fetch.js';

View File

@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {Browser, BrowserPlatform} from './browsers/types.js';
import path from 'path'; import path from 'path';
import {Browser, BrowserPlatform} from './browsers/types.js';
/** /**
* The cache used by Puppeteer relies on the following structure: * The cache used by Puppeteer relies on the following structure:
* *

View File

@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {BrowserPlatform} from './types.js';
import path from 'path'; import path from 'path';
import {BrowserPlatform} from './types.js';
function archive(platform: BrowserPlatform, revision: string): string { function archive(platform: BrowserPlatform, revision: string): string {
switch (platform) { switch (platform) {
case BrowserPlatform.LINUX: case BrowserPlatform.LINUX:

View File

@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {BrowserPlatform} from './types.js';
import path from 'path'; import path from 'path';
import {BrowserPlatform} from './types.js';
function archive(platform: BrowserPlatform, revision: string): string { function archive(platform: BrowserPlatform, revision: string): string {
switch (platform) { switch (platform) {
case BrowserPlatform.LINUX: case BrowserPlatform.LINUX:

View File

@ -15,6 +15,7 @@
*/ */
import os from 'os'; import os from 'os';
import {BrowserPlatform} from './browsers/browsers.js'; import {BrowserPlatform} from './browsers/browsers.js';
export function detectBrowserPlatform(): BrowserPlatform | undefined { export function detectBrowserPlatform(): BrowserPlatform | undefined {

View File

@ -14,18 +14,18 @@
* limitations under the License. * limitations under the License.
*/ */
import assert from 'assert';
import {existsSync} from 'fs'; import {existsSync} from 'fs';
import {mkdir, unlink} from 'fs/promises'; import {mkdir, unlink} from 'fs/promises';
import os from 'os'; import os from 'os';
import path from 'path'; import path from 'path';
import {debug} from './debug.js';
import {Browser, BrowserPlatform, downloadUrls} from './browsers/browsers.js'; import {Browser, BrowserPlatform, downloadUrls} from './browsers/browsers.js';
import {downloadFile, headHttpRequest} from './httpUtil.js';
import assert from 'assert';
import {unpackArchive} from './fileUtil.js';
import {detectBrowserPlatform} from './detectPlatform.js';
import {CacheStructure} from './CacheStructure.js'; import {CacheStructure} from './CacheStructure.js';
import {debug} from './debug.js';
import {detectBrowserPlatform} from './detectPlatform.js';
import {unpackArchive} from './fileUtil.js';
import {downloadFile, headHttpRequest} from './httpUtil.js';
const debugFetch = debug('puppeteer:browsers:fetcher'); const debugFetch = debug('puppeteer:browsers:fetcher');

View File

@ -14,14 +14,15 @@
* limitations under the License. * limitations under the License.
*/ */
import * as path from 'path';
import {exec as execChildProcess} from 'child_process'; import {exec as execChildProcess} from 'child_process';
import extractZip from 'extract-zip';
import {createReadStream} from 'fs'; import {createReadStream} from 'fs';
import {mkdir, readdir} from 'fs/promises'; import {mkdir, readdir} from 'fs/promises';
import * as path from 'path';
import {promisify} from 'util';
import extractZip from 'extract-zip';
import tar from 'tar-fs'; import tar from 'tar-fs';
import bzip from 'unbzip2-stream'; import bzip from 'unbzip2-stream';
import {promisify} from 'util';
const exec = promisify(execChildProcess); const exec = promisify(execChildProcess);

View File

@ -14,12 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
import {createWriteStream} from 'fs';
import * as http from 'http'; import * as http from 'http';
import * as https from 'https'; import * as https from 'https';
import {URL} from 'url'; import {URL} from 'url';
import createHttpsProxyAgent from 'https-proxy-agent'; import createHttpsProxyAgent from 'https-proxy-agent';
import {getProxyForUrl} from 'proxy-from-env'; import {getProxyForUrl} from 'proxy-from-env';
import {createWriteStream} from 'fs';
export function headHttpRequest(url: URL): Promise<boolean> { export function headHttpRequest(url: URL): Promise<boolean> {
return new Promise(resolve => { return new Promise(resolve => {

View File

@ -14,15 +14,16 @@
* limitations under the License. * limitations under the License.
*/ */
import os from 'os';
import path from 'path';
import { import {
Browser, Browser,
BrowserPlatform, BrowserPlatform,
executablePathByBrowser, executablePathByBrowser,
} from './browsers/browsers.js'; } from './browsers/browsers.js';
import {detectBrowserPlatform} from './detectPlatform.js';
import os from 'os';
import path from 'path';
import {CacheStructure} from './CacheStructure.js'; import {CacheStructure} from './CacheStructure.js';
import {detectBrowserPlatform} from './detectPlatform.js';
/** /**
* @public * @public

View File

@ -14,13 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
import assert from 'assert';
import path from 'path';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import { import {
resolveDownloadUrl, resolveDownloadUrl,
relativeExecutablePath, relativeExecutablePath,
} from '../../lib/cjs/browsers/chrome.js'; } from '../../lib/cjs/browsers/chrome.js';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import assert from 'assert';
import path from 'path';
describe('Chrome', () => { describe('Chrome', () => {
it('should resolve download URLs', () => { it('should resolve download URLs', () => {

View File

@ -14,11 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
import {CLI} from '../../lib/cjs/CLI.js';
import fs from 'fs';
import path from 'path';
import os from 'os';
import assert from 'assert'; import assert from 'assert';
import fs from 'fs';
import os from 'os';
import path from 'path';
import {CLI} from '../../lib/cjs/CLI.js';
describe('CLI', function () { describe('CLI', function () {
this.timeout(60000); this.timeout(60000);

View File

@ -14,13 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
import {fetch, canFetch} from '../../lib/cjs/fetch.js';
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import fs from 'fs';
import path from 'path';
import os from 'os';
import assert from 'assert'; import assert from 'assert';
import fs from 'fs';
import os from 'os';
import path from 'path';
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import {fetch, canFetch} from '../../lib/cjs/fetch.js';
/** /**
* Tests in this spec use real download URLs and unpack live browser archives * Tests in this spec use real download URLs and unpack live browser archives

View File

@ -14,13 +14,14 @@
* limitations under the License. * limitations under the License.
*/ */
import assert from 'assert';
import path from 'path';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import { import {
relativeExecutablePath, relativeExecutablePath,
resolveDownloadUrl, resolveDownloadUrl,
} from '../../lib/cjs/browsers/firefox.js'; } from '../../lib/cjs/browsers/firefox.js';
import {BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import assert from 'assert';
import path from 'path';
describe('Firefox', () => { describe('Firefox', () => {
it('should resolve download URLs', () => { it('should resolve download URLs', () => {

View File

@ -14,12 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
import {computeExecutablePath} from '../../lib/cjs/launcher.js';
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import assert from 'assert'; import assert from 'assert';
import path from 'path'; import path from 'path';
import {Browser, BrowserPlatform} from '../../lib/cjs/browsers/browsers.js';
import {computeExecutablePath} from '../../lib/cjs/launcher.js';
describe('launcher', () => { describe('launcher', () => {
it('should compute executable path for Chrome', () => { it('should compute executable path for Chrome', () => {
assert.strictEqual( assert.strictEqual(

View File

@ -1,3 +1,5 @@
import {spawn} from 'child_process';
import { import {
createBuilder, createBuilder,
BuilderContext, BuilderContext,
@ -6,7 +8,6 @@ import {
BuilderRun, BuilderRun,
} from '@angular-devkit/architect'; } from '@angular-devkit/architect';
import {JsonObject} from '@angular-devkit/core'; import {JsonObject} from '@angular-devkit/core';
import {spawn} from 'child_process';
import {PuppeteerBuilderOptions} from './types.js'; import {PuppeteerBuilderOptions} from './types.js';

View File

@ -16,14 +16,15 @@
import {chain, Rule, SchematicContext, Tree} from '@angular-devkit/schematics'; import {chain, Rule, SchematicContext, Tree} from '@angular-devkit/schematics';
import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks'; import {NodePackageInstallTask} from '@angular-devkit/schematics/tasks';
import {concatMap, map, scan} from 'rxjs/operators';
import {of} from 'rxjs'; import {of} from 'rxjs';
import {concatMap, map, scan} from 'rxjs/operators';
import { import {
addBaseFiles, addBaseFiles,
addFrameworkFiles, addFrameworkFiles,
getNgCommandName, getNgCommandName,
} from '../utils/files.js'; } from '../utils/files.js';
import {getAngularConfig} from '../utils/json.js';
import { import {
addPackageJsonDependencies, addPackageJsonDependencies,
addPackageJsonScripts, addPackageJsonScripts,
@ -33,9 +34,7 @@ import {
type NodePackage, type NodePackage,
updateAngularJsonScripts, updateAngularJsonScripts,
} from '../utils/packages.js'; } from '../utils/packages.js';
import {type SchematicsOptions} from '../utils/types.js'; import {type SchematicsOptions} from '../utils/types.js';
import {getAngularConfig} from '../utils/json.js';
// You don't have to export the function as default. You can also have more than one rule // You don't have to export the function as default. You can also have more than one rule
// factory per file. // factory per file.

View File

@ -14,6 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import {relative, resolve} from 'path';
import {getSystemPath, normalize, strings} from '@angular-devkit/core'; import {getSystemPath, normalize, strings} from '@angular-devkit/core';
import { import {
SchematicContext, SchematicContext,
@ -26,7 +28,7 @@ import {
move, move,
url, url,
} from '@angular-devkit/schematics'; } from '@angular-devkit/schematics';
import {relative, resolve} from 'path';
import {SchematicsOptions, TestingFramework} from './types.js'; import {SchematicsOptions, TestingFramework} from './types.js';
export interface FilesOptions { export interface FilesOptions {

View File

@ -14,15 +14,17 @@
* limitations under the License. * limitations under the License.
*/ */
import {Tree} from '@angular-devkit/schematics';
import {get} from 'https'; import {get} from 'https';
import {SchematicsOptions, TestingFramework} from './types.js';
import {Tree} from '@angular-devkit/schematics';
import {getNgCommandName, getScriptFromOptions} from './files.js';
import { import {
getAngularConfig, getAngularConfig,
getJsonFileAsObject, getJsonFileAsObject,
getObjectAsJson, getObjectAsJson,
} from './json.js'; } from './json.js';
import {getNgCommandName, getScriptFromOptions} from './files.js'; import {SchematicsOptions, TestingFramework} from './types.js';
export interface NodePackage { export interface NodePackage {
name: string; name: string;
version: string; version: string;

View File

@ -1,12 +1,13 @@
import expect from 'expect';
import sinon from 'sinon';
import https from 'https'; import https from 'https';
import {join} from 'path'; import {join} from 'path';
import {JsonObject} from '@angular-devkit/core';
import { import {
SchematicTestRunner, SchematicTestRunner,
UnitTestTree, UnitTestTree,
} from '@angular-devkit/schematics/testing/schematic-test-runner'; } from '@angular-devkit/schematics/testing/schematic-test-runner';
import {JsonObject} from '@angular-devkit/core'; import expect from 'expect';
import sinon from 'sinon';
const WORKSPACE_OPTIONS = { const WORKSPACE_OPTIONS = {
name: 'workspace', name: 'workspace',

View File

@ -17,11 +17,14 @@
/* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable @typescript-eslint/no-unused-vars */
import {ChildProcess} from 'child_process'; import {ChildProcess} from 'child_process';
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {EventEmitter} from '../common/EventEmitter.js'; import {EventEmitter} from '../common/EventEmitter.js';
import type {Page} from './Page.js'; // TODO: move to ./api
import type {Target} from '../common/Target.js'; // TODO: move to ./api import type {Target} from '../common/Target.js'; // TODO: move to ./api
import type {BrowserContext} from './BrowserContext.js'; import type {BrowserContext} from './BrowserContext.js';
import type {Page} from './Page.js'; // TODO: move to ./api
/** /**
* BrowserContext options. * BrowserContext options.

View File

@ -15,9 +15,10 @@
*/ */
import {EventEmitter} from '../common/EventEmitter.js'; import {EventEmitter} from '../common/EventEmitter.js';
import {Page} from './Page.js';
import {Target} from '../common/Target.js'; import {Target} from '../common/Target.js';
import type {Permission, Browser} from './Browser.js'; import type {Permission, Browser} from './Browser.js';
import {Page} from './Page.js';
/** /**
* BrowserContexts provide a way to operate multiple independent browser * BrowserContexts provide a way to operate multiple independent browser

View File

@ -15,6 +15,7 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {CDPSession} from '../common/Connection.js'; import {CDPSession} from '../common/Connection.js';
import {ExecutionContext} from '../common/ExecutionContext.js'; import {ExecutionContext} from '../common/ExecutionContext.js';
import {Frame} from '../common/Frame.js'; import {Frame} from '../common/Frame.js';
@ -27,6 +28,7 @@ import {
NodeFor, NodeFor,
} from '../common/types.js'; } from '../common/types.js';
import {KeyInput} from '../common/USKeyboardLayout.js'; import {KeyInput} from '../common/USKeyboardLayout.js';
import {JSHandle} from './JSHandle.js'; import {JSHandle} from './JSHandle.js';
import {ScreenshotOptions} from './Page.js'; import {ScreenshotOptions} from './Page.js';

View File

@ -15,9 +15,11 @@
*/ */
import Protocol from 'devtools-protocol'; import Protocol from 'devtools-protocol';
import {CDPSession} from '../common/Connection.js'; import {CDPSession} from '../common/Connection.js';
import {ExecutionContext} from '../common/ExecutionContext.js'; import {ExecutionContext} from '../common/ExecutionContext.js';
import {EvaluateFuncWith, HandleFor, HandleOr} from '../common/types.js'; import {EvaluateFuncWith, HandleFor, HandleOr} from '../common/types.js';
import {ElementHandle} from './ElementHandle.js'; import {ElementHandle} from './ElementHandle.js';
declare const __JSHandleSymbol: unique symbol; declare const __JSHandleSymbol: unique symbol;

View File

@ -14,8 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {Protocol} from 'devtools-protocol';
import type {Readable} from 'stream'; import type {Readable} from 'stream';
import {Protocol} from 'devtools-protocol';
import type {Accessibility} from '../common/Accessibility.js'; import type {Accessibility} from '../common/Accessibility.js';
import type {ConsoleMessage} from '../common/ConsoleMessage.js'; import type {ConsoleMessage} from '../common/ConsoleMessage.js';
import type {Coverage} from '../common/Coverage.js'; import type {Coverage} from '../common/Coverage.js';
@ -51,6 +53,7 @@ import type {
NodeFor, NodeFor,
} from '../common/types.js'; } from '../common/types.js';
import type {WebWorker} from '../common/WebWorker.js'; import type {WebWorker} from '../common/WebWorker.js';
import type {Browser} from './Browser.js'; import type {Browser} from './Browser.js';
import type {BrowserContext} from './BrowserContext.js'; import type {BrowserContext} from './BrowserContext.js';
import type {ElementHandle} from './ElementHandle.js'; import type {ElementHandle} from './ElementHandle.js';

View File

@ -15,9 +15,11 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {CDPSession} from './Connection.js';
import {ElementHandle} from '../api/ElementHandle.js'; import {ElementHandle} from '../api/ElementHandle.js';
import {CDPSession} from './Connection.js';
/** /**
* Represents a Node and the properties of it that are relevant to Accessibility. * Represents a Node and the properties of it that are relevant to Accessibility.
* @public * @public

View File

@ -19,6 +19,7 @@ import {Protocol} from 'devtools-protocol';
import {ElementHandle} from '../api/ElementHandle.js'; import {ElementHandle} from '../api/ElementHandle.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {QueryHandler, QuerySelector} from './QueryHandler.js'; import {QueryHandler, QuerySelector} from './QueryHandler.js';
import {AwaitableIterable} from './types.js'; import {AwaitableIterable} from './types.js';

View File

@ -1,5 +1,6 @@
import {JSHandle} from '../api/JSHandle.js'; import {JSHandle} from '../api/JSHandle.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {ExecutionContext} from './ExecutionContext.js'; import {ExecutionContext} from './ExecutionContext.js';
import {debugError} from './util.js'; import {debugError} from './util.js';

View File

@ -15,17 +15,9 @@
*/ */
import {ChildProcess} from 'child_process'; import {ChildProcess} from 'child_process';
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {assert} from '../util/assert.js';
import {CDPSession, Connection, ConnectionEmittedEvents} from './Connection.js';
import {waitWithTimeout} from './util.js';
import {Page} from '../api/Page.js';
import {Viewport} from './PuppeteerViewport.js';
import {Target} from './Target.js';
import {TaskQueue} from './TaskQueue.js';
import {TargetManager, TargetManagerEmittedEvents} from './TargetManager.js';
import {ChromeTargetManager} from './ChromeTargetManager.js';
import {FirefoxTargetManager} from './FirefoxTargetManager.js';
import { import {
Browser as BrowserBase, Browser as BrowserBase,
BrowserCloseCallback, BrowserCloseCallback,
@ -39,6 +31,17 @@ import {
Permission, Permission,
} from '../api/Browser.js'; } from '../api/Browser.js';
import {BrowserContext} from '../api/BrowserContext.js'; import {BrowserContext} from '../api/BrowserContext.js';
import {Page} from '../api/Page.js';
import {assert} from '../util/assert.js';
import {ChromeTargetManager} from './ChromeTargetManager.js';
import {CDPSession, Connection, ConnectionEmittedEvents} from './Connection.js';
import {FirefoxTargetManager} from './FirefoxTargetManager.js';
import {Viewport} from './PuppeteerViewport.js';
import {Target} from './Target.js';
import {TargetManager, TargetManagerEmittedEvents} from './TargetManager.js';
import {TaskQueue} from './TaskQueue.js';
import {waitWithTimeout} from './util.js';
/** /**
* @internal * @internal

View File

@ -14,18 +14,18 @@
* limitations under the License. * limitations under the License.
*/ */
import {debugError} from './util.js'; import {IsPageTargetCallback, TargetFilterCallback} from '../api/Browser.js';
import {isErrorLike} from '../util/ErrorLike.js';
import {isNode} from '../environment.js'; import {isNode} from '../environment.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {IsPageTargetCallback, TargetFilterCallback} from '../api/Browser.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {CDPBrowser} from './Browser.js'; import {CDPBrowser} from './Browser.js';
import {Connection} from './Connection.js'; import {Connection} from './Connection.js';
import {ConnectionTransport} from './ConnectionTransport.js'; import {ConnectionTransport} from './ConnectionTransport.js';
import {getFetch} from './fetch.js'; import {getFetch} from './fetch.js';
import {Viewport} from './PuppeteerViewport.js';
import type {ConnectOptions} from './Puppeteer.js'; import type {ConnectOptions} from './Puppeteer.js';
import {Viewport} from './PuppeteerViewport.js';
import {debugError} from './util.js';
/** /**
* Generic browser options that can be passed when launching any browser or when * Generic browser options that can be passed when launching any browser or when
* connecting to an existing browser instance. * connecting to an existing browser instance.

View File

@ -15,18 +15,20 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {TargetFilterCallback} from '../api/Browser.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {CDPSession, Connection} from './Connection.js'; import {CDPSession, Connection} from './Connection.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {Target} from './Target.js'; import {Target} from './Target.js';
import {debugError} from './util.js';
import {TargetFilterCallback} from '../api/Browser.js';
import { import {
TargetInterceptor, TargetInterceptor,
TargetFactory, TargetFactory,
TargetManager, TargetManager,
TargetManagerEmittedEvents, TargetManagerEmittedEvents,
} from './TargetManager.js'; } from './TargetManager.js';
import {debugError} from './util.js';
/** /**
* ChromeTargetManager uses the CDP's auto-attach mechanism to intercept * ChromeTargetManager uses the CDP's auto-attach mechanism to intercept

View File

@ -13,16 +13,20 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable import/order */
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {debug} from './Debug.js'; import {debug} from './Debug.js';
const debugProtocolSend = debug('puppeteer:protocol:SEND ►'); const debugProtocolSend = debug('puppeteer:protocol:SEND ►');
const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀'); const debugProtocolReceive = debug('puppeteer:protocol:RECV ◀');
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
import {ConnectionTransport} from './ConnectionTransport.js'; import {ConnectionTransport} from './ConnectionTransport.js';
import {EventEmitter} from './EventEmitter.js';
import {ProtocolError} from './Errors.js'; import {ProtocolError} from './Errors.js';
import {EventEmitter} from './EventEmitter.js';
/** /**
* @public * @public

View File

@ -14,12 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
import {assert} from '../util/assert.js';
import {addEventListener, debugError, PuppeteerEventListener} from './util.js';
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {CDPSession} from './Connection.js';
import {assert} from '../util/assert.js';
import {CDPSession} from './Connection.js';
import {EVALUATION_SCRIPT_URL} from './ExecutionContext.js'; import {EVALUATION_SCRIPT_URL} from './ExecutionContext.js';
import {addEventListener, debugError, PuppeteerEventListener} from './util.js';
import {removeEventListeners} from './util.js'; import {removeEventListeners} from './util.js';
/** /**

View File

@ -17,6 +17,7 @@
import type PuppeteerUtil from '../injected/injected.js'; import type PuppeteerUtil from '../injected/injected.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {interpolateFunction, stringifyFunction} from '../util/Function.js'; import {interpolateFunction, stringifyFunction} from '../util/Function.js';
import {QueryHandler, QuerySelector, QuerySelectorAll} from './QueryHandler.js'; import {QueryHandler, QuerySelector, QuerySelectorAll} from './QueryHandler.js';
import {scriptInjector} from './ScriptInjector.js'; import {scriptInjector} from './ScriptInjector.js';

View File

@ -14,10 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
import {assert} from '../util/assert.js';
import {CDPSession} from './Connection.js';
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {assert} from '../util/assert.js';
import {CDPSession} from './Connection.js';
/** /**
* Dialog instances are dispatched by the {@link Page} via the `dialog` event. * Dialog instances are dispatched by the {@link Page} via the `dialog` event.
* *

View File

@ -15,6 +15,7 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import { import {
BoundingBox, BoundingBox,
BoxModel, BoxModel,
@ -27,13 +28,15 @@ import {
import {JSHandle} from '../api/JSHandle.js'; import {JSHandle} from '../api/JSHandle.js';
import {Page, ScreenshotOptions} from '../api/Page.js'; import {Page, ScreenshotOptions} from '../api/Page.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {ExecutionContext} from './ExecutionContext.js'; import {ExecutionContext} from './ExecutionContext.js';
import {Frame} from './Frame.js'; import {Frame} from './Frame.js';
import {FrameManager} from './FrameManager.js'; import {FrameManager} from './FrameManager.js';
import {getQueryHandlerAndSelector} from './GetQueryHandler.js'; import {getQueryHandlerAndSelector} from './GetQueryHandler.js';
import {WaitForSelectorOptions} from './IsolatedWorld.js'; import {WaitForSelectorOptions} from './IsolatedWorld.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {CDPJSHandle} from './JSHandle.js';
import {CDPPage} from './Page.js'; import {CDPPage} from './Page.js';
import { import {
ElementFor, ElementFor,
@ -44,7 +47,6 @@ import {
} from './types.js'; } from './types.js';
import {KeyInput} from './USKeyboardLayout.js'; import {KeyInput} from './USKeyboardLayout.js';
import {debugError, isString} from './util.js'; import {debugError, isString} from './util.js';
import {CDPJSHandle} from './JSHandle.js';
const applyOffsetsToQuad = ( const applyOffsetsToQuad = (
quad: Point[], quad: Point[],

View File

@ -13,9 +13,10 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {Protocol} from 'devtools-protocol';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {Viewport} from './PuppeteerViewport.js'; import {Viewport} from './PuppeteerViewport.js';
import {Protocol} from 'devtools-protocol';
/** /**
* @internal * @internal

View File

@ -15,15 +15,19 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import type {ElementHandle} from '../api/ElementHandle.js'; import type {ElementHandle} from '../api/ElementHandle.js';
import {JSHandle} from '../api/JSHandle.js'; import {JSHandle} from '../api/JSHandle.js';
import type PuppeteerUtil from '../injected/injected.js'; import type PuppeteerUtil from '../injected/injected.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
import {stringifyFunction} from '../util/Function.js'; import {stringifyFunction} from '../util/Function.js';
import {ARIAQueryHandler} from './AriaQueryHandler.js'; import {ARIAQueryHandler} from './AriaQueryHandler.js';
import {Binding} from './Binding.js'; import {Binding} from './Binding.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {CDPElementHandle} from './ElementHandle.js';
import {IsolatedWorld} from './IsolatedWorld.js'; import {IsolatedWorld} from './IsolatedWorld.js';
import {CDPJSHandle} from './JSHandle.js';
import {LazyArg} from './LazyArg.js'; import {LazyArg} from './LazyArg.js';
import {scriptInjector} from './ScriptInjector.js'; import {scriptInjector} from './ScriptInjector.js';
import {EvaluateFunc, HandleFor} from './types.js'; import {EvaluateFunc, HandleFor} from './types.js';
@ -33,8 +37,6 @@ import {
isString, isString,
valueFromRemoteObject, valueFromRemoteObject,
} from './util.js'; } from './util.js';
import {CDPJSHandle} from './JSHandle.js';
import {CDPElementHandle} from './ElementHandle.js';
/** /**
* @public * @public

View File

@ -15,8 +15,9 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {assert} from '../util/assert.js';
import {ElementHandle} from '../api/ElementHandle.js'; import {ElementHandle} from '../api/ElementHandle.js';
import {assert} from '../util/assert.js';
/** /**
* File choosers let you react to the page requesting for a file. * File choosers let you react to the page requesting for a file.

View File

@ -15,17 +15,19 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {assert} from '../util/assert.js';
import {CDPSession, Connection} from './Connection.js';
import {Target} from './Target.js';
import {TargetFilterCallback} from '../api/Browser.js'; import {TargetFilterCallback} from '../api/Browser.js';
import {assert} from '../util/assert.js';
import {CDPSession, Connection} from './Connection.js';
import {EventEmitter} from './EventEmitter.js';
import {Target} from './Target.js';
import { import {
TargetFactory, TargetFactory,
TargetInterceptor, TargetInterceptor,
TargetManagerEmittedEvents, TargetManagerEmittedEvents,
TargetManager, TargetManager,
} from './TargetManager.js'; } from './TargetManager.js';
import {EventEmitter} from './EventEmitter.js';
/** /**
* FirefoxTargetManager implements target management using * FirefoxTargetManager implements target management using

View File

@ -15,9 +15,11 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {ElementHandle} from '../api/ElementHandle.js'; import {ElementHandle} from '../api/ElementHandle.js';
import {Page} from '../api/Page.js'; import {Page} from '../api/Page.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {ExecutionContext} from './ExecutionContext.js'; import {ExecutionContext} from './ExecutionContext.js';
import {FrameManager} from './FrameManager.js'; import {FrameManager} from './FrameManager.js';

View File

@ -15,8 +15,11 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {Page} from '../api/Page.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {CDPSession, isTargetClosedError} from './Connection.js'; import {CDPSession, isTargetClosedError} from './Connection.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {EVALUATION_SCRIPT_URL, ExecutionContext} from './ExecutionContext.js'; import {EVALUATION_SCRIPT_URL, ExecutionContext} from './ExecutionContext.js';
@ -25,7 +28,6 @@ import {FrameTree} from './FrameTree.js';
import {IsolatedWorld} from './IsolatedWorld.js'; import {IsolatedWorld} from './IsolatedWorld.js';
import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js'; import {MAIN_WORLD, PUPPETEER_WORLD} from './IsolatedWorlds.js';
import {NetworkManager} from './NetworkManager.js'; import {NetworkManager} from './NetworkManager.js';
import {Page} from '../api/Page.js';
import {Target} from './Target.js'; import {Target} from './Target.js';
import {TimeoutSettings} from './TimeoutSettings.js'; import {TimeoutSettings} from './TimeoutSettings.js';
import {debugError} from './util.js'; import {debugError} from './util.js';

View File

@ -18,6 +18,7 @@ import {
createDeferredPromise, createDeferredPromise,
DeferredPromise, DeferredPromise,
} from '../util/DeferredPromise.js'; } from '../util/DeferredPromise.js';
import type {Frame} from './Frame.js'; import type {Frame} from './Frame.js';
/** /**

View File

@ -15,12 +15,14 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {ProtocolError} from './Errors.js'; import {ProtocolError} from './Errors.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {Frame} from './Frame.js'; import {Frame} from './Frame.js';
import {debugError, isString} from './util.js';
import {HTTPResponse} from './HTTPResponse.js'; import {HTTPResponse} from './HTTPResponse.js';
import {debugError, isString} from './util.js';
/** /**
* @public * @public

View File

@ -13,14 +13,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
import {Protocol} from 'devtools-protocol';
import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; import {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
import {ProtocolError} from './Errors.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {Frame} from './Frame.js'; import {Frame} from './Frame.js';
import {HTTPRequest} from './HTTPRequest.js'; import {HTTPRequest} from './HTTPRequest.js';
import {SecurityDetails} from './SecurityDetails.js'; import {SecurityDetails} from './SecurityDetails.js';
import {Protocol} from 'devtools-protocol';
import {ProtocolError} from './Errors.js';
/** /**
* @public * @public

View File

@ -15,6 +15,7 @@
*/ */
import {JSHandle} from '../api/JSHandle.js'; import {JSHandle} from '../api/JSHandle.js';
import {AwaitableIterable, HandleFor} from './types.js'; import {AwaitableIterable, HandleFor} from './types.js';
const DEFAULT_BATCH_SIZE = 20; const DEFAULT_BATCH_SIZE = 20;

View File

@ -14,11 +14,13 @@
* limitations under the License. * limitations under the License.
*/ */
import {Protocol} from 'devtools-protocol';
import {Point} from '../api/ElementHandle.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {_keyDefinitions, KeyDefinition, KeyInput} from './USKeyboardLayout.js'; import {_keyDefinitions, KeyDefinition, KeyInput} from './USKeyboardLayout.js';
import {Protocol} from 'devtools-protocol';
import {Point} from '../api/ElementHandle.js';
type KeyDescription = Required< type KeyDescription = Required<
Pick<KeyDefinition, 'keyCode' | 'key' | 'text' | 'code' | 'location'> Pick<KeyDefinition, 'keyCode' | 'key' | 'text' | 'code' | 'location'>

View File

@ -15,9 +15,13 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import type {ElementHandle} from '../api/ElementHandle.js';
import {JSHandle} from '../api/JSHandle.js'; import {JSHandle} from '../api/JSHandle.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {createDeferredPromise} from '../util/DeferredPromise.js'; import {createDeferredPromise} from '../util/DeferredPromise.js';
import {Binding} from './Binding.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {ExecutionContext} from './ExecutionContext.js'; import {ExecutionContext} from './ExecutionContext.js';
import {Frame} from './Frame.js'; import {Frame} from './Frame.js';
@ -37,9 +41,6 @@ import {
import {addPageBinding, createJSHandle, debugError} from './util.js'; import {addPageBinding, createJSHandle, debugError} from './util.js';
import {TaskManager, WaitTask} from './WaitTask.js'; import {TaskManager, WaitTask} from './WaitTask.js';
import type {ElementHandle} from '../api/ElementHandle.js';
import {Binding} from './Binding.js';
/** /**
* @public * @public
*/ */

View File

@ -15,8 +15,10 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {JSHandle} from '../api/JSHandle.js'; import {JSHandle} from '../api/JSHandle.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import type {CDPElementHandle} from './ElementHandle.js'; import type {CDPElementHandle} from './ElementHandle.js';
import {ExecutionContext} from './ExecutionContext.js'; import {ExecutionContext} from './ExecutionContext.js';

View File

@ -15,22 +15,23 @@
*/ */
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {
DeferredPromise,
createDeferredPromise,
} from '../util/DeferredPromise.js';
import {CDPSessionEmittedEvents} from './Connection.js';
import {TimeoutError} from './Errors.js';
import {Frame} from './Frame.js';
import {FrameManager, FrameManagerEmittedEvents} from './FrameManager.js';
import {HTTPRequest} from './HTTPRequest.js';
import {HTTPResponse} from './HTTPResponse.js';
import {NetworkManagerEmittedEvents} from './NetworkManager.js';
import { import {
addEventListener, addEventListener,
PuppeteerEventListener, PuppeteerEventListener,
removeEventListeners, removeEventListeners,
} from './util.js'; } from './util.js';
import {
DeferredPromise,
createDeferredPromise,
} from '../util/DeferredPromise.js';
import {TimeoutError} from './Errors.js';
import {FrameManager, FrameManagerEmittedEvents} from './FrameManager.js';
import {Frame} from './Frame.js';
import {HTTPRequest} from './HTTPRequest.js';
import {HTTPResponse} from './HTTPResponse.js';
import {NetworkManagerEmittedEvents} from './NetworkManager.js';
import {CDPSessionEmittedEvents} from './Connection.js';
/** /**
* @public * @public
*/ */

View File

@ -15,6 +15,7 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {HTTPRequest} from './HTTPRequest.js'; import {HTTPRequest} from './HTTPRequest.js';
/** /**

View File

@ -15,16 +15,18 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {createDebuggableDeferredPromise} from '../util/DebuggableDeferredPromise.js';
import {DeferredPromise} from '../util/DeferredPromise.js';
import {CDPSession} from './Connection.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {Frame} from './Frame.js'; import {Frame} from './Frame.js';
import {HTTPRequest} from './HTTPRequest.js'; import {HTTPRequest} from './HTTPRequest.js';
import {HTTPResponse} from './HTTPResponse.js'; import {HTTPResponse} from './HTTPResponse.js';
import {FetchRequestId, NetworkEventManager} from './NetworkEventManager.js'; import {FetchRequestId, NetworkEventManager} from './NetworkEventManager.js';
import {debugError, isString} from './util.js'; import {debugError, isString} from './util.js';
import {DeferredPromise} from '../util/DeferredPromise.js';
import {createDebuggableDeferredPromise} from '../util/DebuggableDeferredPromise.js';
import {CDPSession} from './Connection.js';
/** /**
* @public * @public

View File

@ -14,6 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import NodeWebSocket from 'ws'; import NodeWebSocket from 'ws';
import {ConnectionTransport} from '../common/ConnectionTransport.js'; import {ConnectionTransport} from '../common/ConnectionTransport.js';
import {packageVersion} from '../generated/version.js'; import {packageVersion} from '../generated/version.js';

View File

@ -14,8 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {Protocol} from 'devtools-protocol';
import type {Readable} from 'stream'; import type {Readable} from 'stream';
import {Protocol} from 'devtools-protocol';
import type {Browser} from '../api/Browser.js'; import type {Browser} from '../api/Browser.js';
import type {BrowserContext} from '../api/BrowserContext.js'; import type {BrowserContext} from '../api/BrowserContext.js';
import {ElementHandle} from '../api/ElementHandle.js'; import {ElementHandle} from '../api/ElementHandle.js';
@ -37,6 +39,7 @@ import {
DeferredPromise, DeferredPromise,
} from '../util/DeferredPromise.js'; } from '../util/DeferredPromise.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {Accessibility} from './Accessibility.js'; import {Accessibility} from './Accessibility.js';
import {Binding} from './Binding.js'; import {Binding} from './Binding.js';
import { import {

View File

@ -15,6 +15,7 @@
*/ */
import type PuppeteerUtil from '../injected/injected.js'; import type PuppeteerUtil from '../injected/injected.js';
import {QueryHandler} from './QueryHandler.js'; import {QueryHandler} from './QueryHandler.js';
/** /**

View File

@ -15,6 +15,7 @@
*/ */
import {Browser} from '../api/Browser.js'; import {Browser} from '../api/Browser.js';
import { import {
BrowserConnectOptions, BrowserConnectOptions,
_connectToCDPBrowser, _connectToCDPBrowser,

View File

@ -19,6 +19,7 @@ import type PuppeteerUtil from '../injected/injected.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {interpolateFunction, stringifyFunction} from '../util/Function.js'; import {interpolateFunction, stringifyFunction} from '../util/Function.js';
import type {Frame} from './Frame.js'; import type {Frame} from './Frame.js';
import {transposeIterableHandle} from './HandleIterator.js'; import {transposeIterableHandle} from './HandleIterator.js';
import type {WaitForSelectorOptions} from './IsolatedWorld.js'; import type {WaitForSelectorOptions} from './IsolatedWorld.js';

View File

@ -14,16 +14,18 @@
* limitations under the License. * limitations under the License.
*/ */
import {Page, PageEmittedEvents} from '../api/Page.js'; import {Protocol} from 'devtools-protocol';
import {WebWorker} from './WebWorker.js';
import {CDPSession} from './Connection.js';
import type {Browser, IsPageTargetCallback} from '../api/Browser.js'; import type {Browser, IsPageTargetCallback} from '../api/Browser.js';
import type {BrowserContext} from '../api/BrowserContext.js'; import type {BrowserContext} from '../api/BrowserContext.js';
import {Viewport} from './PuppeteerViewport.js'; import {Page, PageEmittedEvents} from '../api/Page.js';
import {Protocol} from 'devtools-protocol';
import {TaskQueue} from './TaskQueue.js'; import {CDPSession} from './Connection.js';
import {TargetManager} from './TargetManager.js';
import {CDPPage} from './Page.js'; import {CDPPage} from './Page.js';
import {Viewport} from './PuppeteerViewport.js';
import {TargetManager} from './TargetManager.js';
import {TaskQueue} from './TaskQueue.js';
import {WebWorker} from './WebWorker.js';
/** /**
* Target represents a * Target represents a

View File

@ -15,6 +15,7 @@
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {Target} from './Target.js'; import {Target} from './Target.js';

View File

@ -14,9 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {getReadableAsBuffer, getReadableFromProtocolStream} from './util.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {getReadableAsBuffer, getReadableFromProtocolStream} from './util.js';
/** /**
* @public * @public

View File

@ -19,6 +19,7 @@ import {JSHandle} from '../api/JSHandle.js';
import type {Poller} from '../injected/Poller.js'; import type {Poller} from '../injected/Poller.js';
import {createDeferredPromise} from '../util/DeferredPromise.js'; import {createDeferredPromise} from '../util/DeferredPromise.js';
import {stringifyFunction} from '../util/Function.js'; import {stringifyFunction} from '../util/Function.js';
import {TimeoutError} from './Errors.js'; import {TimeoutError} from './Errors.js';
import {IsolatedWorld} from './IsolatedWorld.js'; import {IsolatedWorld} from './IsolatedWorld.js';
import {LazyArg} from './LazyArg.js'; import {LazyArg} from './LazyArg.js';

View File

@ -14,15 +14,17 @@
* limitations under the License. * limitations under the License.
*/ */
import {Protocol} from 'devtools-protocol'; import {Protocol} from 'devtools-protocol';
import {JSHandle} from '../api/JSHandle.js';
import {createDeferredPromise} from '../util/DeferredPromise.js';
import {CDPSession} from './Connection.js'; import {CDPSession} from './Connection.js';
import {ConsoleMessageType} from './ConsoleMessage.js'; import {ConsoleMessageType} from './ConsoleMessage.js';
import {EvaluateFunc, HandleFor} from './types.js';
import {EventEmitter} from './EventEmitter.js'; import {EventEmitter} from './EventEmitter.js';
import {ExecutionContext} from './ExecutionContext.js'; import {ExecutionContext} from './ExecutionContext.js';
import {JSHandle} from '../api/JSHandle.js';
import {CDPJSHandle} from './JSHandle.js'; import {CDPJSHandle} from './JSHandle.js';
import {EvaluateFunc, HandleFor} from './types.js';
import {debugError} from './util.js'; import {debugError} from './util.js';
import {createDeferredPromise} from '../util/DeferredPromise.js';
/** /**
* @internal * @internal

View File

@ -1,10 +1,12 @@
import {CDPSession, Connection as CDPPPtrConnection} from '../Connection.js';
import {Connection as BidiPPtrConnection} from './Connection.js';
import * as BidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js'; import * as BidiMapper from 'chromium-bidi/lib/cjs/bidiMapper/bidiMapper.js';
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js'; import type {ProtocolMapping} from 'devtools-protocol/types/protocol-mapping.js';
import {CDPSession, Connection as CDPPPtrConnection} from '../Connection.js';
import {Handler} from '../EventEmitter.js'; import {Handler} from '../EventEmitter.js';
import {Connection as BidiPPtrConnection} from './Connection.js';
type CdpEvents = { type CdpEvents = {
[Property in keyof ProtocolMapping.Events]: ProtocolMapping.Events[Property][0]; [Property in keyof ProtocolMapping.Events]: ProtocolMapping.Events[Property][0];
}; };

View File

@ -14,15 +14,17 @@
* limitations under the License. * limitations under the License.
*/ */
import {ChildProcess} from 'child_process';
import { import {
Browser as BrowserBase, Browser as BrowserBase,
BrowserCloseCallback, BrowserCloseCallback,
BrowserContextOptions, BrowserContextOptions,
} from '../../api/Browser.js'; } from '../../api/Browser.js';
import {BrowserContext as BrowserContextBase} from '../../api/BrowserContext.js'; import {BrowserContext as BrowserContextBase} from '../../api/BrowserContext.js';
import {Connection} from './Connection.js';
import {ChildProcess} from 'child_process';
import {BrowserContext} from './BrowserContext.js'; import {BrowserContext} from './BrowserContext.js';
import {Connection} from './Connection.js';
/** /**
* @internal * @internal

View File

@ -16,6 +16,7 @@
import {BrowserContext as BrowserContextBase} from '../../api/BrowserContext.js'; import {BrowserContext as BrowserContextBase} from '../../api/BrowserContext.js';
import {Page as PageBase} from '../../api/Page.js'; import {Page as PageBase} from '../../api/Page.js';
import {Connection} from './Connection.js'; import {Connection} from './Connection.js';
import {Page} from './Page.js'; import {Page} from './Page.js';

View File

@ -14,14 +14,16 @@
* limitations under the License. * limitations under the License.
*/ */
/* eslint-disable import/order */
import {debug} from '../Debug.js'; import {debug} from '../Debug.js';
const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►'); const debugProtocolSend = debug('puppeteer:webDriverBiDi:SEND ►');
const debugProtocolReceive = debug('puppeteer:webDriverBiDi:RECV ◀'); const debugProtocolReceive = debug('puppeteer:webDriverBiDi:RECV ◀');
import {ConnectionTransport} from '../ConnectionTransport.js'; import {ConnectionTransport} from '../ConnectionTransport.js';
import {EventEmitter} from '../EventEmitter.js';
import {ProtocolError} from '../Errors.js'; import {ProtocolError} from '../Errors.js';
import {EventEmitter} from '../EventEmitter.js';
import {ConnectionCallback} from '../Connection.js'; import {ConnectionCallback} from '../Connection.js';
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
/** /**

View File

@ -14,15 +14,17 @@
* limitations under the License. * limitations under the License.
*/ */
import {ElementHandle} from '../../api/ElementHandle.js';
import {EvaluateFuncWith, HandleFor, HandleOr} from '../../common/types.js';
import {releaseReference} from './utils.js';
import {Page} from './Page.js';
import {JSHandle as BaseJSHandle} from '../../api/JSHandle.js';
import {BidiSerializer} from './Serializer.js';
import {Connection} from './Connection.js';
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import {ElementHandle} from '../../api/ElementHandle.js';
import {JSHandle as BaseJSHandle} from '../../api/JSHandle.js';
import {EvaluateFuncWith, HandleFor, HandleOr} from '../../common/types.js';
import {Connection} from './Connection.js';
import {Page} from './Page.js';
import {BidiSerializer} from './Serializer.js';
import {releaseReference} from './utils.js';
export class JSHandle<T = unknown> extends BaseJSHandle<T> { export class JSHandle<T = unknown> extends BaseJSHandle<T> {
#disposed = false; #disposed = false;
#context; #context;

View File

@ -15,13 +15,14 @@
*/ */
import {Page as PageBase} from '../../api/Page.js'; import {Page as PageBase} from '../../api/Page.js';
import {Connection} from './Connection.js'; import {stringifyFunction} from '../../util/Function.js';
import type {EvaluateFunc, HandleFor} from '../types.js'; import type {EvaluateFunc, HandleFor} from '../types.js';
import {isString} from '../util.js'; import {isString} from '../util.js';
import {BidiSerializer} from './Serializer.js';
import {Connection} from './Connection.js';
import {JSHandle} from './JSHandle.js'; import {JSHandle} from './JSHandle.js';
import {BidiSerializer} from './Serializer.js';
import {Reference} from './types.js'; import {Reference} from './types.js';
import {stringifyFunction} from '../../util/Function.js';
/** /**
* @internal * @internal

View File

@ -1,5 +1,7 @@
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import {debugError, isDate, isPlainObject, isRegExp} from '../util.js'; import {debugError, isDate, isPlainObject, isRegExp} from '../util.js';
import {JSHandle} from './JSHandle.js'; import {JSHandle} from './JSHandle.js';
import {Page} from './Page.js'; import {Page} from './Page.js';

View File

@ -14,8 +14,10 @@
* limitations under the License. * limitations under the License.
*/ */
import {debug} from '../Debug.js';
import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js'; import * as Bidi from 'chromium-bidi/lib/cjs/protocol/protocol.js';
import {debug} from '../Debug.js';
import {Connection} from './Connection.js'; import {Connection} from './Connection.js';
/** /**

View File

@ -14,8 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
import type {JSHandle} from '../api/JSHandle.js';
import type {ElementHandle} from '../api/ElementHandle.js'; import type {ElementHandle} from '../api/ElementHandle.js';
import type {JSHandle} from '../api/JSHandle.js';
import type {LazyArg} from './LazyArg.js'; import type {LazyArg} from './LazyArg.js';
/** /**

View File

@ -14,13 +14,16 @@
* limitations under the License. * limitations under the License.
*/ */
import type {Protocol} from 'devtools-protocol';
import type {Readable} from 'stream'; import type {Readable} from 'stream';
import type {Protocol} from 'devtools-protocol';
import type {ElementHandle} from '../api/ElementHandle.js'; import type {ElementHandle} from '../api/ElementHandle.js';
import type {JSHandle} from '../api/JSHandle.js'; import type {JSHandle} from '../api/JSHandle.js';
import {isNode} from '../environment.js'; import {isNode} from '../environment.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import type {CDPSession} from './Connection.js'; import type {CDPSession} from './Connection.js';
import {debug} from './Debug.js'; import {debug} from './Debug.js';
import {CDPElementHandle} from './ElementHandle.js'; import {CDPElementHandle} from './ElementHandle.js';

View File

@ -1,6 +1,7 @@
import type {AwaitableIterable} from '../common/types.js'; import type {AwaitableIterable} from '../common/types.js';
import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js'; import {AsyncIterableUtil} from '../util/AsyncIterableUtil.js';
import {isErrorLike} from '../util/ErrorLike.js'; import {isErrorLike} from '../util/ErrorLike.js';
import {ariaQuerySelectorAll} from './ARIAQuerySelector.js'; import {ariaQuerySelectorAll} from './ARIAQuerySelector.js';
import {customQuerySelectors} from './CustomQuerySelector.js'; import {customQuerySelectors} from './CustomQuerySelector.js';
import {parsePSelectors, PSelector} from './PSelectorParser.js'; import {parsePSelectors, PSelector} from './PSelectorParser.js';

View File

@ -16,16 +16,17 @@
import {createDeferredPromise} from '../util/DeferredPromise.js'; import {createDeferredPromise} from '../util/DeferredPromise.js';
import {createFunction} from '../util/Function.js'; import {createFunction} from '../util/Function.js';
import * as ARIAQuerySelector from './ARIAQuerySelector.js'; import * as ARIAQuerySelector from './ARIAQuerySelector.js';
import * as CustomQuerySelectors from './CustomQuerySelector.js'; import * as CustomQuerySelectors from './CustomQuerySelector.js';
import * as PierceQuerySelector from './PierceQuerySelector.js'; import * as PierceQuerySelector from './PierceQuerySelector.js';
import {IntervalPoller, MutationPoller, RAFPoller} from './Poller.js'; import {IntervalPoller, MutationPoller, RAFPoller} from './Poller.js';
import * as PQuerySelector from './PQuerySelector.js';
import { import {
createTextContent, createTextContent,
isSuitableNodeForTextMatching, isSuitableNodeForTextMatching,
} from './TextContent.js'; } from './TextContent.js';
import * as TextQuerySelector from './TextQuerySelector.js'; import * as TextQuerySelector from './TextQuerySelector.js';
import * as PQuerySelector from './PQuerySelector.js';
import * as util from './util.js'; import * as util from './util.js';
import * as XPathQuerySelector from './XPathQuerySelector.js'; import * as XPathQuerySelector from './XPathQuerySelector.js';

View File

@ -15,24 +15,26 @@
*/ */
import {exec as execChildProcess} from 'child_process'; import {exec as execChildProcess} from 'child_process';
import extractZip from 'extract-zip';
import {createReadStream, createWriteStream, existsSync, readdirSync} from 'fs'; import {createReadStream, createWriteStream, existsSync, readdirSync} from 'fs';
import {chmod, mkdir, readdir, unlink} from 'fs/promises'; import {chmod, mkdir, readdir, unlink} from 'fs/promises';
import * as http from 'http'; import * as http from 'http';
import * as https from 'https'; import * as https from 'https';
import * as os from 'os';
import * as path from 'path';
import * as URL from 'url';
import * as util from 'util';
import {promisify} from 'util';
import extractZip from 'extract-zip';
import createHttpsProxyAgent, { import createHttpsProxyAgent, {
HttpsProxyAgent, HttpsProxyAgent,
HttpsProxyAgentOptions, HttpsProxyAgentOptions,
} from 'https-proxy-agent'; } from 'https-proxy-agent';
import * as os from 'os';
import * as path from 'path';
import {getProxyForUrl} from 'proxy-from-env'; import {getProxyForUrl} from 'proxy-from-env';
import removeRecursive from 'rimraf'; import removeRecursive from 'rimraf';
import tar from 'tar-fs'; import tar from 'tar-fs';
import bzip from 'unbzip2-stream'; import bzip from 'unbzip2-stream';
import * as URL from 'url';
import * as util from 'util';
import {promisify} from 'util';
import {debug} from '../common/Debug.js'; import {debug} from '../common/Debug.js';
import {Product} from '../common/Product.js'; import {Product} from '../common/Product.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';

View File

@ -18,8 +18,10 @@ import * as childProcess from 'child_process';
import * as fs from 'fs'; import * as fs from 'fs';
import * as path from 'path'; import * as path from 'path';
import * as readline from 'readline'; import * as readline from 'readline';
import removeFolder from 'rimraf';
import {promisify} from 'util'; import {promisify} from 'util';
import removeFolder from 'rimraf';
import type {Connection as BiDiConnection} from '../common/bidi/bidi.js'; import type {Connection as BiDiConnection} from '../common/bidi/bidi.js';
import {Connection} from '../common/Connection.js'; import {Connection} from '../common/Connection.js';
import {debug} from '../common/Debug.js'; import {debug} from '../common/Debug.js';
@ -34,6 +36,7 @@ import {
} from '../common/util.js'; } from '../common/util.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {isErrnoException, isErrorLike} from '../util/ErrorLike.js'; import {isErrnoException, isErrorLike} from '../util/ErrorLike.js';
import {LaunchOptions} from './LaunchOptions.js'; import {LaunchOptions} from './LaunchOptions.js';
import {PipeTransport} from './PipeTransport.js'; import {PipeTransport} from './PipeTransport.js';

View File

@ -2,10 +2,12 @@ import {accessSync} from 'fs';
import {mkdtemp} from 'fs/promises'; import {mkdtemp} from 'fs/promises';
import os from 'os'; import os from 'os';
import path from 'path'; import path from 'path';
import {Browser} from '../api/Browser.js'; import {Browser} from '../api/Browser.js';
import {assert} from '../util/assert.js';
import {BrowserRunner} from './BrowserRunner.js';
import {CDPBrowser} from '../common/Browser.js'; import {CDPBrowser} from '../common/Browser.js';
import {assert} from '../util/assert.js';
import {BrowserRunner} from './BrowserRunner.js';
import { import {
BrowserLaunchArgumentOptions, BrowserLaunchArgumentOptions,
ChromeReleaseChannel, ChromeReleaseChannel,

View File

@ -1,9 +1,11 @@
import fs from 'fs'; import fs from 'fs';
import os from 'os'; import os from 'os';
import path from 'path'; import path from 'path';
import {Browser} from '../api/Browser.js'; import {Browser} from '../api/Browser.js';
import {CDPBrowser} from '../common/Browser.js'; import {CDPBrowser} from '../common/Browser.js';
import {assert} from '../util/assert.js'; import {assert} from '../util/assert.js';
import {BrowserRunner} from './BrowserRunner.js'; import {BrowserRunner} from './BrowserRunner.js';
import { import {
BrowserLaunchArgumentOptions, BrowserLaunchArgumentOptions,

View File

@ -16,8 +16,10 @@
import {existsSync} from 'fs'; import {existsSync} from 'fs';
import os, {tmpdir} from 'os'; import os, {tmpdir} from 'os';
import {join} from 'path'; import {join} from 'path';
import {Browser} from '../api/Browser.js'; import {Browser} from '../api/Browser.js';
import {Product} from '../common/Product.js'; import {Product} from '../common/Product.js';
import { import {
BrowserLaunchArgumentOptions, BrowserLaunchArgumentOptions,
ChromeReleaseChannel, ChromeReleaseChannel,

View File

@ -15,16 +15,18 @@
*/ */
import {join} from 'path'; import {join} from 'path';
import {Browser} from '../api/Browser.js'; import {Browser} from '../api/Browser.js';
import {BrowserConnectOptions} from '../common/BrowserConnector.js'; import {BrowserConnectOptions} from '../common/BrowserConnector.js';
import {Configuration} from '../common/Configuration.js';
import {Product} from '../common/Product.js'; import {Product} from '../common/Product.js';
import { import {
CommonPuppeteerSettings, CommonPuppeteerSettings,
ConnectOptions, ConnectOptions,
Puppeteer, Puppeteer,
} from '../common/Puppeteer.js'; } from '../common/Puppeteer.js';
import {Configuration} from '../common/Configuration.js';
import {PUPPETEER_REVISIONS} from '../revisions.js'; import {PUPPETEER_REVISIONS} from '../revisions.js';
import {BrowserFetcher, BrowserFetcherOptions} from './BrowserFetcher.js'; import {BrowserFetcher, BrowserFetcherOptions} from './BrowserFetcher.js';
import {ChromeLauncher} from './ChromeLauncher.js'; import {ChromeLauncher} from './ChromeLauncher.js';
import {FirefoxLauncher} from './FirefoxLauncher.js'; import {FirefoxLauncher} from './FirefoxLauncher.js';

View File

@ -1,4 +1,5 @@
import {DEFERRED_PROMISE_DEBUG_TIMEOUT} from '../environment.js'; import {DEFERRED_PROMISE_DEBUG_TIMEOUT} from '../environment.js';
import {DeferredPromise, createDeferredPromise} from './DeferredPromise.js'; import {DeferredPromise, createDeferredPromise} from './DeferredPromise.js';
/** /**

View File

@ -34,10 +34,10 @@
*/ */
// eslint-disable-next-line import/extensions // eslint-disable-next-line import/extensions
import {PUPPETEER_REVISIONS} from '../src/revisions.js';
import {execSync} from 'child_process'; import {execSync} from 'child_process';
import packageJson from '../package.json'; import packageJson from '../package.json';
import {PUPPETEER_REVISIONS} from '../src/revisions.js';
const currentProtocolPackageInstalledVersion = const currentProtocolPackageInstalledVersion =
packageJson.dependencies['devtools-protocol']; packageJson.dependencies['devtools-protocol'];

View File

@ -1,8 +1,10 @@
#!/usr/bin/env node #!/usr/bin/env node
import esbuild from 'esbuild';
import {mkdir, mkdtemp, readFile, rm, writeFile} from 'fs/promises'; import {mkdir, mkdtemp, readFile, rm, writeFile} from 'fs/promises';
import path, {join, resolve} from 'path'; import path, {join, resolve} from 'path';
import {chdir} from 'process'; import {chdir} from 'process';
import esbuild from 'esbuild';
import {job} from '../../../tools/internal/job.js'; import {job} from '../../../tools/internal/job.js';
const packageRoot = resolve(join(__dirname, '..')); const packageRoot = resolve(join(__dirname, '..'));

View File

@ -24,9 +24,9 @@
* necessary. * necessary.
*/ */
const path = require('path');
const fs = require('fs');
const {execSync} = require('child_process'); const {execSync} = require('child_process');
const fs = require('fs');
const path = require('path');
// Need to ensure TS is compiled before loading the installer // Need to ensure TS is compiled before loading the installer
if (!fs.existsSync(path.join(__dirname, 'lib'))) { if (!fs.existsSync(path.join(__dirname, 'lib'))) {

View File

@ -1,6 +1,7 @@
import {cosmiconfigSync} from 'cosmiconfig';
import {homedir} from 'os'; import {homedir} from 'os';
import {join} from 'path'; import {join} from 'path';
import {cosmiconfigSync} from 'cosmiconfig';
import {Configuration, Product} from 'puppeteer-core'; import {Configuration, Product} from 'puppeteer-core';
/** /**

View File

@ -15,12 +15,14 @@
*/ */
import https, {RequestOptions} from 'https'; import https, {RequestOptions} from 'https';
import URL from 'url';
import createHttpsProxyAgent, {HttpsProxyAgentOptions} from 'https-proxy-agent'; import createHttpsProxyAgent, {HttpsProxyAgentOptions} from 'https-proxy-agent';
import ProgressBar from 'progress'; import ProgressBar from 'progress';
import {getProxyForUrl} from 'proxy-from-env'; import {getProxyForUrl} from 'proxy-from-env';
import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js'; import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js';
import {PUPPETEER_REVISIONS} from 'puppeteer-core/internal/revisions.js'; import {PUPPETEER_REVISIONS} from 'puppeteer-core/internal/revisions.js';
import URL from 'url';
import {getConfiguration} from '../getConfiguration.js'; import {getConfiguration} from '../getConfiguration.js';
/** /**

View File

@ -19,6 +19,7 @@ export {Protocol} from 'puppeteer-core';
export * from 'puppeteer-core/internal/puppeteer-core.js'; export * from 'puppeteer-core/internal/puppeteer-core.js';
import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js'; import {PuppeteerNode} from 'puppeteer-core/internal/node/PuppeteerNode.js';
import {getConfiguration} from './getConfiguration.js'; import {getConfiguration} from './getConfiguration.js';
const configuration = getConfiguration(); const configuration = getConfiguration();

View File

@ -28,13 +28,14 @@ import {
Server as HttpsServer, Server as HttpsServer,
ServerOptions as HttpsServerOptions, ServerOptions as HttpsServerOptions,
} from 'https'; } from 'https';
import {getType as getMimeType} from 'mime';
import {AddressInfo} from 'net'; import {AddressInfo} from 'net';
import {join} from 'path'; import {join} from 'path';
import {Duplex} from 'stream'; import {Duplex} from 'stream';
import {Server as WebSocketServer, WebSocket} from 'ws';
import {gzip} from 'zlib'; import {gzip} from 'zlib';
import {getType as getMimeType} from 'mime';
import {Server as WebSocketServer, WebSocket} from 'ws';
interface Subscriber { interface Subscriber {
resolve: (msg: IncomingMessage) => void; resolve: (msg: IncomingMessage) => void;
reject: (err?: Error) => void; reject: (err?: Error) => void;

View File

@ -14,10 +14,11 @@
* limitations under the License. * limitations under the License.
*/ */
import glob from 'glob';
import {dirname, join, resolve} from 'path'; import {dirname, join, resolve} from 'path';
import {fileURLToPath} from 'url'; import {fileURLToPath} from 'url';
import glob from 'glob';
export const PUPPETEER_CORE_PACKAGE_PATH = resolve( export const PUPPETEER_CORE_PACKAGE_PATH = resolve(
glob.sync('puppeteer-core-*.tgz')[0]! glob.sync('puppeteer-core-*.tgz')[0]!
); );

View File

@ -18,6 +18,7 @@ import {createHash} from 'crypto';
import {mkdtemp, rm, writeFile} from 'fs/promises'; import {mkdtemp, rm, writeFile} from 'fs/promises';
import {tmpdir} from 'os'; import {tmpdir} from 'os';
import {join} from 'path'; import {join} from 'path';
import { import {
PUPPETEER_CORE_PACKAGE_PATH, PUPPETEER_CORE_PACKAGE_PATH,
PUPPETEER_PACKAGE_PATH, PUPPETEER_PACKAGE_PATH,

View File

@ -17,6 +17,7 @@
import assert from 'assert'; import assert from 'assert';
import {readdir, writeFile} from 'fs/promises'; import {readdir, writeFile} from 'fs/promises';
import {join} from 'path'; import {join} from 'path';
import {describeInstallation} from './describeInstallation.js'; import {describeInstallation} from './describeInstallation.js';
import {readAsset} from './util.js'; import {readAsset} from './util.js';

View File

@ -17,6 +17,7 @@
import assert from 'assert'; import assert from 'assert';
import {readdir} from 'fs/promises'; import {readdir} from 'fs/promises';
import {join} from 'path'; import {join} from 'path';
import {describeInstallation} from './describeInstallation.js'; import {describeInstallation} from './describeInstallation.js';
import {readAsset} from './util.js'; import {readAsset} from './util.js';

View File

@ -16,6 +16,7 @@
import {readFile, rm, writeFile} from 'fs/promises'; import {readFile, rm, writeFile} from 'fs/promises';
import {join} from 'path'; import {join} from 'path';
import {describeInstallation} from './describeInstallation.js'; import {describeInstallation} from './describeInstallation.js';
import {execFile, readAsset} from './util.js'; import {execFile, readAsset} from './util.js';

View File

@ -17,6 +17,7 @@
import assert from 'assert'; import assert from 'assert';
import {readdir} from 'fs/promises'; import {readdir} from 'fs/promises';
import {join} from 'path'; import {join} from 'path';
import {describeInstallation} from './describeInstallation.js'; import {describeInstallation} from './describeInstallation.js';
import {readAsset} from './util.js'; import {readAsset} from './util.js';

View File

@ -14,11 +14,12 @@
* limitations under the License. * limitations under the License.
*/ */
import {promisify} from 'util';
import {execFile as execFileAsync} from 'child_process'; import {execFile as execFileAsync} from 'child_process';
import {join} from 'path';
import {ASSETS_DIR} from './constants.js';
import {readFile} from 'fs/promises'; import {readFile} from 'fs/promises';
import {join} from 'path';
import {promisify} from 'util';
import {ASSETS_DIR} from './constants.js';
export const execFile = promisify(execFileAsync); export const execFile = promisify(execFileAsync);
export const readAsset = (...components: string[]): Promise<string> => { export const readAsset = (...components: string[]): Promise<string> => {

View File

@ -14,14 +14,15 @@
* limitations under the License. * limitations under the License.
*/ */
import {waitEvent} from './utils.js';
import expect from 'expect'; import expect from 'expect';
import {isErrorLike} from 'puppeteer-core/internal/util/ErrorLike.js';
import { import {
getTestState, getTestState,
setupTestBrowserHooks, setupTestBrowserHooks,
setupTestPageAndContextHooks, setupTestPageAndContextHooks,
} from './mocha-utils.js'; } from './mocha-utils.js';
import {isErrorLike} from 'puppeteer-core/internal/util/ErrorLike.js'; import {waitEvent} from './utils.js';
describe('Target.createCDPSession', function () { describe('Target.createCDPSession', function () {
setupTestBrowserHooks(); setupTestBrowserHooks();

View File

@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
import expect from 'expect';
import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js'; import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js';
import sinon from 'sinon'; import sinon from 'sinon';
import expect from 'expect';
describe('EventEmitter', () => { describe('EventEmitter', () => {
let emitter: EventEmitter; let emitter: EventEmitter;

View File

@ -15,14 +15,14 @@
*/ */
import expect from 'expect'; import expect from 'expect';
import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js';
import {Frame} from 'puppeteer-core/internal/common/Frame.js';
import {HTTPRequest} from 'puppeteer-core/internal/common/HTTPRequest.js';
import {HTTPResponse} from 'puppeteer-core/internal/common/HTTPResponse.js';
import { import {
NetworkManager, NetworkManager,
NetworkManagerEmittedEvents, NetworkManagerEmittedEvents,
} from 'puppeteer-core/internal/common/NetworkManager.js'; } from 'puppeteer-core/internal/common/NetworkManager.js';
import {HTTPRequest} from 'puppeteer-core/internal/common/HTTPRequest.js';
import {EventEmitter} from 'puppeteer-core/internal/common/EventEmitter.js';
import {Frame} from 'puppeteer-core/internal/common/Frame.js';
import {HTTPResponse} from 'puppeteer-core/internal/common/HTTPResponse.js';
class MockCDPSession extends EventEmitter { class MockCDPSession extends EventEmitter {
async send(): Promise<any> {} async send(): Promise<any> {}

View File

@ -14,16 +14,15 @@
* limitations under the License. * limitations under the License.
*/ */
import {getTestState} from './mocha-utils'; // eslint-disable-line import/extensions
import utils from './utils.js';
import expect from 'expect'; import expect from 'expect';
import { import {
CDPBrowser, CDPBrowser,
CDPBrowserContext, CDPBrowserContext,
} from 'puppeteer-core/internal/common/Browser.js'; } from 'puppeteer-core/internal/common/Browser.js';
import {getTestState} from './mocha-utils'; // eslint-disable-line import/extensions
import utils from './utils.js';
describe('TargetManager', () => { describe('TargetManager', () => {
/* We use a special browser for this test as we need the --site-per-process flag */ /* We use a special browser for this test as we need the --site-per-process flag */
let browser: CDPBrowser; let browser: CDPBrowser;

View File

@ -15,8 +15,10 @@
*/ */
import assert from 'assert'; import assert from 'assert';
import expect from 'expect'; import expect from 'expect';
import {SerializedAXNode} from 'puppeteer-core/internal/common/Accessibility.js'; import {SerializedAXNode} from 'puppeteer-core/internal/common/Accessibility.js';
import { import {
getTestState, getTestState,
setupTestBrowserHooks, setupTestBrowserHooks,

Some files were not shown because too many files have changed in this diff Show More