chore(typescript): enable esModuleInterop (#5409)

This commit is contained in:
Joel Einbinder 2021-02-11 06:36:15 -08:00 committed by GitHub
parent 6576bd8b31
commit d8f637c239
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
59 changed files with 100 additions and 99 deletions

View File

@ -17,7 +17,7 @@
import { LaunchServerOptions, Logger } from './client/types';
import { BrowserType } from './server/browserType';
import * as ws from 'ws';
import * as fs from 'fs';
import fs from 'fs';
import { Browser } from './server/browser';
import { ChildProcess } from 'child_process';
import { EventEmitter } from 'ws';

View File

@ -18,10 +18,10 @@
/* eslint-disable no-console */
import * as path from 'path';
import * as program from 'commander';
import * as os from 'os';
import * as fs from 'fs';
import path from 'path';
import program from 'commander';
import os from 'os';
import fs from 'fs';
import { runServer, printApiJson, installBrowsers } from './driver';
import { showTraceViewer } from './traceViewer/traceViewer';
import * as playwright from '../..';

View File

@ -16,8 +16,8 @@
/* eslint-disable no-console */
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import { DispatcherConnection } from '../dispatchers/dispatcher';
import { PlaywrightDispatcher } from '../dispatchers/playwrightDispatcher';
import { installBrowsersWithProgressBar } from '../install/installer';

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import * as playwright from '../../..';
import * as util from 'util';
import { actionById, ActionEntry, ContextEntry, TraceModel } from './traceModel';

View File

@ -15,8 +15,8 @@
*/
import * as http from 'http';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import type { TraceModel, trace, ContextEntry } from './traceModel';
import { TraceServer } from './traceServer';
import { NodeSnapshot } from '../../trace/traceTypes';

View File

@ -15,8 +15,8 @@
*/
import * as http from 'http';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import type { TraceModel } from './traceModel';
export type ServerRouteHandler = (request: http.IncomingMessage, response: http.ServerResponse) => boolean;

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import * as playwright from '../../..';
import * as util from 'util';
import { ScreenshotGenerator } from './screenshotGenerator';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import { isString } from '../utils/utils';
import * as channels from '../protocol/channels';

View File

@ -19,7 +19,7 @@ import { Page, BindingCall } from './page';
import * as network from './network';
import * as channels from '../protocol/channels';
import * as util from 'util';
import * as fs from 'fs';
import fs from 'fs';
import { ChannelOwner } from './channelOwner';
import { deprecate, evaluationScript, urlMatches } from './clientHelper';
import { Browser } from './browser';

View File

@ -19,9 +19,9 @@ import { Browser } from './browser';
import { BrowserContext, prepareBrowserContextOptions } from './browserContext';
import { ChannelOwner } from './channelOwner';
import { LaunchOptions, LaunchServerOptions, ConnectOptions, LaunchPersistentContextOptions } from './types';
import * as WebSocket from 'ws';
import * as path from 'path';
import * as fs from 'fs';
import WebSocket from 'ws';
import path from 'path';
import fs from 'fs';
import { Connection } from './connection';
import { serializeError } from '../protocol/serializers';
import { Events } from './events';

View File

@ -16,7 +16,7 @@
*/
import * as types from './types';
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import { isString, isRegExp } from '../utils/utils';

View File

@ -20,7 +20,7 @@ import { Readable } from 'stream';
import { Stream } from './stream';
import { Browser } from './browser';
import { BrowserContext } from './browserContext';
import * as fs from 'fs';
import fs from 'fs';
import { mkdirIfNeeded } from '../utils/utils';
import * as api from '../../types/types';

View File

@ -19,9 +19,9 @@ import { Frame } from './frame';
import { JSHandle, serializeArgument, parseResult } from './jsHandle';
import { ChannelOwner } from './channelOwner';
import { SelectOption, FilePayload, Rect, SelectOptionOptions } from './types';
import * as fs from 'fs';
import fs from 'fs';
import * as mime from 'mime';
import * as path from 'path';
import path from 'path';
import * as util from 'util';
import { assert, isString, mkdirIfNeeded } from '../utils/utils';
import * as api from '../../types/types';

View File

@ -20,7 +20,7 @@ import * as channels from '../protocol/channels';
import { ChannelOwner } from './channelOwner';
import { ElementHandle, convertSelectOptionValues, convertInputFiles } from './elementHandle';
import { assertMaxArguments, JSHandle, serializeArgument, parseResult } from './jsHandle';
import * as fs from 'fs';
import fs from 'fs';
import * as network from './network';
import * as util from 'util';
import { Page } from './page';

View File

@ -19,7 +19,7 @@ import * as channels from '../protocol/channels';
import { ChannelOwner } from './channelOwner';
import { Frame } from './frame';
import { Headers, WaitForEventOptions } from './types';
import * as fs from 'fs';
import fs from 'fs';
import * as mime from 'mime';
import * as util from 'util';
import { isString, headersObjectToArray, headersArrayToObject } from '../utils/utils';

View File

@ -38,8 +38,8 @@ import { ChromiumCoverage } from './chromiumCoverage';
import { Waiter } from './waiter';
import * as api from '../../types/types';
import * as structs from '../../types/structs';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import * as util from 'util';
import { Size, URLMatch, Headers, LifecycleEvent, WaitForEventOptions, SelectOption, SelectOptionOptions, FilePayload, WaitForFunctionOptions } from './types';
import { evaluationScript, urlMatches } from './clientHelper';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as path from 'path';
import path from 'path';
import { Page } from './page';
import * as api from '../../types/types';

View File

@ -18,7 +18,7 @@ import { Download } from '../server/download';
import * as channels from '../protocol/channels';
import { Dispatcher, DispatcherScope } from './dispatcher';
import { StreamDispatcher } from './streamDispatcher';
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import { mkdirIfNeeded } from '../utils/utils';

View File

@ -15,11 +15,11 @@
* limitations under the License.
*/
import * as extract from 'extract-zip';
import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as ProgressBar from 'progress';
import extract from 'extract-zip';
import fs from 'fs';
import os from 'os';
import path from 'path';
import ProgressBar from 'progress';
import { getProxyForUrl } from 'proxy-from-env';
import * as URL from 'url';
import * as util from 'util';

View File

@ -14,11 +14,11 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import * as util from 'util';
import * as removeFolder from 'rimraf';
import * as lockfile from 'proper-lockfile';
import fs from 'fs';
import path from 'path';
import util from 'util';
import removeFolder from 'rimraf';
import lockfile from 'proper-lockfile';
import {Registry, allBrowserNames, isBrowserDirectory, BrowserName, registryDirectory} from '../utils/registry';
import * as browserFetcher from './browserFetcher';
import { getAsBooleanFromENV, calculateSha1 } from '../utils/utils';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as WebSocket from 'ws';
import WebSocket from 'ws';
import { Connection } from '../client/connection';
import { Playwright } from '../client/playwright';

View File

@ -14,9 +14,9 @@
* limitations under the License.
*/
import * as debug from 'debug';
import debug from 'debug';
import * as http from 'http';
import * as WebSocket from 'ws';
import WebSocket from 'ws';
import { DispatcherConnection } from '../dispatchers/dispatcher';
import { PlaywrightDispatcher } from '../dispatchers/playwrightDispatcher';
import { createPlaywright } from '../server/playwright';

View File

@ -14,10 +14,10 @@
* limitations under the License.
*/
import * as debug from 'debug';
import debug from 'debug';
import * as types from '../types';
import { EventEmitter } from 'events';
import * as fs from 'fs';
import fs from 'fs';
import * as stream from 'stream';
import * as util from 'util';
import * as ws from 'ws';

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as assert from 'assert';
import * as debug from 'debug';
import assert from 'assert';
import debug from 'debug';
import * as net from 'net';
import { EventEmitter } from 'events';
import { Backend, DeviceBackend, SocketBackend } from './android';

View File

@ -26,7 +26,7 @@ import { Page, PageBinding, PageDelegate } from './page';
import { Progress } from './progress';
import { Selectors, serverSelectors } from './selectors';
import * as types from './types';
import * as path from 'path';
import path from 'path';
import { CallMetadata, SdkObject } from './instrumentation';
export class Video {

View File

@ -14,9 +14,9 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import path from 'path';
import * as util from 'util';
import { BrowserContext, normalizeProxySettings, validateBrowserContextOptions } from './browserContext';
import * as registry from '../utils/registry';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import * as path from 'path';
import path from 'path';
import { CRBrowser } from './crBrowser';
import { Env } from '../processLauncher';
import { kBrowserCloseMessageId } from './crConnection';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import { CRSession } from './crConnection';

View File

@ -27,7 +27,7 @@ import { Protocol } from './protocol';
import { toConsoleMessageLocation, exceptionToError, releaseObject } from './crProtocolHelper';
import * as dialog from '../dialog';
import { PageDelegate } from '../page';
import * as path from 'path';
import path from 'path';
import { RawMouseImpl, RawKeyboardImpl, RawTouchscreenImpl } from './crInput';
import { getAccessibilityTree } from './crAccessibility';
import { CRCoverage } from './crCoverage';

View File

@ -17,7 +17,7 @@
import { CRSession } from './crConnection';
import { Protocol } from './protocol';
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import * as types from '../types';
import { mkdirIfNeeded } from '../../utils/utils';

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as path from 'path';
import * as fs from 'fs';
import path from 'path';
import fs from 'fs';
import * as util from 'util';
import { Page } from './page';
import { assert } from '../utils/utils';

View File

@ -16,8 +16,8 @@
*/
import * as os from 'os';
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import { FFBrowser } from './ffBrowser';
import { kBrowserCloseMessageId } from './ffConnection';
import { BrowserType } from '../browserType';

View File

@ -16,8 +16,8 @@
*/
import { EventEmitter } from 'events';
import * as removeFolder from 'rimraf';
import * as util from 'util';
import removeFolder from 'rimraf';
import util from 'util';
import * as types from './types';
import { Progress } from './progress';
import { debugLogger } from '../utils/debugLogger';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as path from 'path';
import path from 'path';
import { Tracer } from '../trace/tracer';
import { Android } from './android/android';
import { AdbBackend } from './android/backendAdb';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import { BrowserContext } from '../../browserContext';
import { helper } from '../../helper';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as querystring from 'querystring';
import * as hljs from '../../../third_party/highlightjs/highlightjs';

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import * as util from 'util';
import { CRPage } from '../../chromium/crPage';
import { Page } from '../../page';

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import * as WebSocket from 'ws';
import WebSocket from 'ws';
import { Progress } from './progress';
import { makeWaitForNextTask } from '../utils/utils';

View File

@ -13,9 +13,9 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as util from 'util';
import * as path from 'path';
import path from 'path';
import * as os from 'os';
import { spawn } from 'child_process';
import { getUbuntuVersion } from '../utils/ubuntuVersion';

View File

@ -17,7 +17,7 @@
import { WKBrowser } from '../webkit/wkBrowser';
import { Env } from '../processLauncher';
import * as path from 'path';
import path from 'path';
import { kBrowserCloseMessageId } from './wkConnection';
import { BrowserType } from '../browserType';
import { ConnectionTransport } from '../transport';

View File

@ -16,7 +16,7 @@
*/
import * as jpeg from 'jpeg-js';
import * as path from 'path';
import path from 'path';
import * as png from 'pngjs';
import { assert, createGuid, debugAssert, headersArrayToObject, headersObjectToArray } from '../../utils/utils';
import * as accessibility from '../accessibility';

View File

@ -17,9 +17,9 @@
import { BrowserContext, Video } from '../server/browserContext';
import type { SnapshotterResource as SnapshotterResource, SnapshotterBlob, SnapshotterDelegate } from './snapshotter';
import * as trace from './traceTypes';
import * as path from 'path';
import path from 'path';
import * as util from 'util';
import * as fs from 'fs';
import fs from 'fs';
import { createGuid, getFromENV, mkdirIfNeeded, monotonicTime } from '../utils/utils';
import { Page } from '../server/page';
import { Snapshotter } from './snapshotter';

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
export function printDepsWindowsExecutable(): string | undefined {
return pathToExecutable(['bin', 'PrintDeps.exe']);

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as debug from 'debug';
import * as fs from 'fs';
import debug from 'debug';
import fs from 'fs';
const debugLoggerColorMap = {
'api': 45, // cyan

View File

@ -16,9 +16,9 @@
*/
import { execSync } from 'child_process';
import * as fs from 'fs';
import fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import path from 'path';
import * as util from 'util';
import { getUbuntuVersionSync } from './ubuntuVersion';
import { assert, getFromENV } from './utils';

View File

@ -14,9 +14,9 @@
* limitations under the License.
*/
import * as path from 'path';
import path from 'path';
import { StackFrame } from '../common/types';
const StackUtils = require('stack-utils');
import StackUtils from 'stack-utils';
const stackUtils = new StackUtils();

View File

@ -15,7 +15,7 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import * as os from 'os';
import * as util from 'util';

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as path from 'path';
import * as fs from 'fs';
import path from 'path';
import fs from 'fs';
import * as util from 'util';
import * as crypto from 'crypto';

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import * as fs from 'fs';
import fs from 'fs';
import { PNG } from 'pngjs';
import { folio } from './android.fixtures';

View File

@ -16,7 +16,7 @@
*/
import { it, expect } from './fixtures';
import * as fs from 'fs';
import fs from 'fs';
it('should capture local storage', async ({ context }) => {
const page1 = await context.newPage();

View File

@ -16,7 +16,7 @@
*/
import { folio } from './remoteServer.fixture';
import * as fs from 'fs';
import fs from 'fs';
const { it, expect, describe } = folio;
describe('connect', (suite, { mode }) => {

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as path from 'path';
import * as fs from 'fs';
import path from 'path';
import fs from 'fs';
import { folio } from './cli.fixtures';
const { it, expect } = folio;

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import { folio } from './cli.fixtures';
const { it, expect } = folio;

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import { folio } from './cli.fixtures';
const { it, expect } = folio;

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as fs from 'fs';
import * as path from 'path';
import fs from 'fs';
import path from 'path';
import { folio } from './cli.fixtures';
const { it, expect } = folio;

View File

@ -15,7 +15,7 @@
*/
import * as http from 'http';
import * as path from 'path';
import path from 'path';
import { ChildProcess, spawn } from 'child_process';
import { folio as baseFolio } from '../fixtures';
import type { Page, BrowserType, Browser, BrowserContext } from '../..';

View File

@ -16,7 +16,7 @@
*/
import { folio as baseFolio } from './fixtures';
import * as fs from 'fs';
import fs from 'fs';
import type * as har from '../src/server/supplements/har/har';
import type { BrowserContext, Page } from '../index';

View File

@ -16,8 +16,8 @@
import { it, expect } from './fixtures';
import type * as trace from '../src/trace/traceTypes';
import * as path from 'path';
import * as fs from 'fs';
import path from 'path';
import fs from 'fs';
it('should record trace', (test, { browserName, platform }) => {
test.fixme();
@ -128,4 +128,4 @@ it('should record trace with a debugName', (test, { browserName, platform }) =>
const contextEvent = traceEvents.find(event => event.type === 'context-created') as trace.ContextCreatedTraceEvent;
expect(contextEvent).toBeTruthy();
expect(contextEvent.debugName).toBe(debugName);
});
});

View File

@ -4,6 +4,7 @@
"module": "commonjs",
"lib": ["esnext", "dom", "DOM.Iterable"],
"sourceMap": true,
"esModuleInterop": true,
"rootDir": "./src",
"outDir": "./lib",
"strict": true,