chore: flatten supplements (#13437)

This commit is contained in:
Pavel Feldman 2022-04-08 11:52:40 -08:00 committed by GitHub
parent d65263f151
commit f0156d057e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
38 changed files with 106 additions and 122 deletions

View File

@ -6,13 +6,11 @@
./ ./
./injected/ ./injected/
./isomorphic/ ./isomorphic/
./har/
./recorder/
./registry/ ./registry/
./supplements/
./trace/recorder/tracing.ts ./trace/recorder/tracing.ts
[browserContext.ts]
./supplements/har/
[playwright.ts] [playwright.ts]
./android/ ./android/
./chromium/ ./chromium/

View File

@ -33,10 +33,10 @@ import path from 'path';
import fs from 'fs'; import fs from 'fs';
import type { CallMetadata } from './instrumentation'; import type { CallMetadata } from './instrumentation';
import { serverSideCallMetadata, SdkObject } from './instrumentation'; import { serverSideCallMetadata, SdkObject } from './instrumentation';
import { Debugger } from './supplements/debugger'; import { Debugger } from './debugger';
import { Tracing } from './trace/recorder/tracing'; import { Tracing } from './trace/recorder/tracing';
import { HarRecorder } from './supplements/har/harRecorder'; import { HarRecorder } from './har/harRecorder';
import { RecorderSupplement } from './supplements/recorderSupplement'; import { Recorder } from './recorder';
import * as consoleApiSource from '../generated/consoleApiSource'; import * as consoleApiSource from '../generated/consoleApiSource';
import { BrowserContextAPIRequestContext } from './fetch'; import { BrowserContextAPIRequestContext } from './fetch';
@ -112,13 +112,13 @@ export abstract class BrowserContext extends SdkObject {
// When PWDEBUG=1, show inspector for each context. // When PWDEBUG=1, show inspector for each context.
if (debugMode() === 'inspector') if (debugMode() === 'inspector')
await RecorderSupplement.show(this, { pauseOnNextStatement: true }); await Recorder.show(this, { pauseOnNextStatement: true });
// When paused, show inspector. // When paused, show inspector.
if (contextDebugger.isPaused()) if (contextDebugger.isPaused())
RecorderSupplement.showInspector(this); Recorder.showInspector(this);
contextDebugger.on(Debugger.Events.PausedStateChanged, () => { contextDebugger.on(Debugger.Events.PausedStateChanged, () => {
RecorderSupplement.showInspector(this); Recorder.showInspector(this);
}); });
if (debugMode() === 'console') if (debugMode() === 'console')

View File

@ -15,10 +15,10 @@
*/ */
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { debugMode, isUnderTest, monotonicTime } from '../../utils'; import { debugMode, isUnderTest, monotonicTime } from '../utils';
import type { BrowserContext } from '../browserContext'; import type { BrowserContext } from './browserContext';
import type { CallMetadata, InstrumentationListener, SdkObject } from '../instrumentation'; import type { CallMetadata, InstrumentationListener, SdkObject } from './instrumentation';
import { commandsWithTracingSnapshots, pausesBeforeInputActions } from '../../protocol/channels'; import { commandsWithTracingSnapshots, pausesBeforeInputActions } from '../protocol/channels';
const symbol = Symbol('Debugger'); const symbol = Symbol('Debugger');

View File

@ -23,7 +23,7 @@ import type * as channels from '../../protocol/channels';
import { RouteDispatcher, RequestDispatcher, ResponseDispatcher, APIRequestContextDispatcher } from './networkDispatchers'; import { RouteDispatcher, RequestDispatcher, ResponseDispatcher, APIRequestContextDispatcher } from './networkDispatchers';
import { CRBrowserContext } from '../chromium/crBrowser'; import { CRBrowserContext } from '../chromium/crBrowser';
import { CDPSessionDispatcher } from './cdpSessionDispatcher'; import { CDPSessionDispatcher } from './cdpSessionDispatcher';
import { RecorderSupplement } from '../supplements/recorderSupplement'; import { Recorder } from '../recorder';
import type { CallMetadata } from '../instrumentation'; import type { CallMetadata } from '../instrumentation';
import { ArtifactDispatcher } from './artifactDispatcher'; import { ArtifactDispatcher } from './artifactDispatcher';
import type { Artifact } from '../artifact'; import type { Artifact } from '../artifact';
@ -197,7 +197,7 @@ export class BrowserContextDispatcher extends Dispatcher<BrowserContext, channel
} }
async recorderSupplementEnable(params: channels.BrowserContextRecorderSupplementEnableParams): Promise<void> { async recorderSupplementEnable(params: channels.BrowserContextRecorderSupplementEnableParams): Promise<void> {
await RecorderSupplement.show(this._context, params); await Recorder.show(this._context, params);
} }
async pause(params: channels.BrowserContextPauseParams, metadata: CallMetadata) { async pause(params: channels.BrowserContextPauseParams, metadata: CallMetadata) {

View File

@ -15,9 +15,9 @@
*/ */
import fs from 'fs'; import fs from 'fs';
import type { APIRequestContext } from '../../fetch'; import type { APIRequestContext } from '../fetch';
import { Artifact } from '../../artifact'; import { Artifact } from '../artifact';
import type { BrowserContext } from '../../browserContext'; import type { BrowserContext } from '../browserContext';
import type * as har from './har'; import type * as har from './har';
import { HarTracer } from './harTracer'; import { HarTracer } from './harTracer';

View File

@ -14,18 +14,19 @@
* limitations under the License. * limitations under the License.
*/ */
import { BrowserContext } from '../../browserContext'; import { BrowserContext } from '../browserContext';
import type { APIRequestEvent, APIRequestFinishedEvent } from '../../fetch'; import type { APIRequestEvent, APIRequestFinishedEvent } from '../fetch';
import { APIRequestContext } from '../../fetch'; import { APIRequestContext } from '../fetch';
import { helper } from '../../helper'; import { helper } from '../helper';
import * as network from '../../network'; import * as network from '../network';
import { Page } from '../../page'; import { Page } from '../page';
import type * as har from './har'; import type * as har from './har';
import { calculateSha1, monotonicTime } from '../../../utils'; import { calculateSha1, monotonicTime } from '../../utils';
import type { RegisteredListener } from '../../../utils/eventsHelper'; import type { RegisteredListener } from '../../utils/eventsHelper';
import { eventsHelper } from '../../../utils/eventsHelper'; import { eventsHelper } from '../../utils/eventsHelper';
import * as mime from 'mime'; import * as mime from 'mime';
import { ManualPromise } from '../../../utils/manualPromise'; import { ManualPromise } from '../../utils/manualPromise';
import { getPlaywrightVersion } from '../../common/userAgent';
const FALLBACK_HTTP_VERSION = 'HTTP/1.1'; const FALLBACK_HTTP_VERSION = 'HTTP/1.1';
@ -382,7 +383,7 @@ export class HarTracer {
version: '1.2', version: '1.2',
creator: { creator: {
name: 'Playwright', name: 'Playwright',
version: require('../../../../package.json')['version'], version: getPlaywrightVersion(),
}, },
browser: { browser: {
name: context?._browser.options.name || '', name: context?._browser.options.name || '',

View File

@ -1,3 +1,4 @@
# Files in this folder are used in browser environment, they can only depend on isomorphic files. # Files in this folder are used in browser environment, they can only depend on isomorphic files.
[*] [*]
../isomorphic/ ../isomorphic/
../../utils/isomorphic

View File

@ -14,9 +14,9 @@
* limitations under the License. * limitations under the License.
*/ */
import { escapeWithQuotes } from '../../../utils/isomorphic/stringUtils'; import { escapeWithQuotes } from '../../utils/isomorphic/stringUtils';
import { type InjectedScript } from '../../injected/injectedScript'; import { type InjectedScript } from './injectedScript';
import { generateSelector } from '../../injected/selectorGenerator'; import { generateSelector } from './selectorGenerator';
function createLocator(injectedScript: InjectedScript, initial: string, options?: { hasText?: string | RegExp }) { function createLocator(injectedScript: InjectedScript, initial: string, options?: { hasText?: string | RegExp }) {
class Locator { class Locator {

View File

@ -15,11 +15,11 @@
*/ */
import type * as actions from '../recorder/recorderActions'; import type * as actions from '../recorder/recorderActions';
import { type InjectedScript } from '../../injected/injectedScript'; import { type InjectedScript } from '../injected/injectedScript';
import { generateSelector, querySelector } from '../../injected/selectorGenerator'; import { generateSelector, querySelector } from '../injected/selectorGenerator';
import type { Point } from '../../../common/types'; import type { Point } from '../../common/types';
import type { UIState } from '../recorder/recorderTypes'; import type { UIState } from '../recorder/recorderTypes';
import { Highlight } from '../../injected/highlight'; import { Highlight } from '../injected/highlight';
declare module globalThis { declare module globalThis {

View File

@ -16,35 +16,35 @@
import * as fs from 'fs'; import * as fs from 'fs';
import type * as actions from './recorder/recorderActions'; import type * as actions from './recorder/recorderActions';
import type * as channels from '../../protocol/channels'; import type * as channels from '../protocol/channels';
import type { ActionInContext } from './recorder/codeGenerator'; import type { ActionInContext } from './recorder/codeGenerator';
import { CodeGenerator } from './recorder/codeGenerator'; import { CodeGenerator } from './recorder/codeGenerator';
import { toClickOptions, toModifiers } from './recorder/utils'; import { toClickOptions, toModifiers } from './recorder/utils';
import { Page } from '../page'; import { Page } from './page';
import { Frame } from '../frames'; import { Frame } from './frames';
import { BrowserContext } from '../browserContext'; import { BrowserContext } from './browserContext';
import { JavaLanguageGenerator } from './recorder/java'; import { JavaLanguageGenerator } from './recorder/java';
import { JavaScriptLanguageGenerator } from './recorder/javascript'; import { JavaScriptLanguageGenerator } from './recorder/javascript';
import { CSharpLanguageGenerator } from './recorder/csharp'; import { CSharpLanguageGenerator } from './recorder/csharp';
import { PythonLanguageGenerator } from './recorder/python'; import { PythonLanguageGenerator } from './recorder/python';
import * as recorderSource from '../../generated/recorderSource'; import * as recorderSource from '../generated/recorderSource';
import * as consoleApiSource from '../../generated/consoleApiSource'; import * as consoleApiSource from '../generated/consoleApiSource';
import type { IRecorderApp } from './recorder/recorderApp'; import type { IRecorderApp } from './recorder/recorderApp';
import { RecorderApp } from './recorder/recorderApp'; import { RecorderApp } from './recorder/recorderApp';
import type { CallMetadata, InstrumentationListener, SdkObject } from '../instrumentation'; import type { CallMetadata, InstrumentationListener, SdkObject } from './instrumentation';
import type { Point } from '../../common/types'; import type { Point } from '../common/types';
import type { CallLog, CallLogStatus, EventData, Mode, Source, UIState } from './recorder/recorderTypes'; import type { CallLog, CallLogStatus, EventData, Mode, Source, UIState } from './recorder/recorderTypes';
import { createGuid, monotonicTime } from '../../utils'; import { createGuid, monotonicTime } from '../utils';
import { metadataToCallLog } from './recorder/recorderUtils'; import { metadataToCallLog } from './recorder/recorderUtils';
import { Debugger } from './debugger'; import { Debugger } from './debugger';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { raceAgainstTimeout } from '../../utils/timeoutRunner'; import { raceAgainstTimeout } from '../utils/timeoutRunner';
type BindingSource = { frame: Frame, page: Page }; type BindingSource = { frame: Frame, page: Page };
const symbol = Symbol('RecorderSupplement'); const symbol = Symbol('RecorderSupplement');
export class RecorderSupplement implements InstrumentationListener { export class Recorder implements InstrumentationListener {
private _context: BrowserContext; private _context: BrowserContext;
private _mode: Mode; private _mode: Mode;
private _highlightedSelector = ''; private _highlightedSelector = '';
@ -57,13 +57,13 @@ export class RecorderSupplement implements InstrumentationListener {
private _contextRecorder: ContextRecorder; private _contextRecorder: ContextRecorder;
static showInspector(context: BrowserContext) { static showInspector(context: BrowserContext) {
RecorderSupplement.show(context, {}).catch(() => {}); Recorder.show(context, {}).catch(() => {});
} }
static show(context: BrowserContext, params: channels.BrowserContextRecorderSupplementEnableParams = {}): Promise<RecorderSupplement> { static show(context: BrowserContext, params: channels.BrowserContextRecorderSupplementEnableParams = {}): Promise<Recorder> {
let recorderPromise = (context as any)[symbol] as Promise<RecorderSupplement>; let recorderPromise = (context as any)[symbol] as Promise<Recorder>;
if (!recorderPromise) { if (!recorderPromise) {
const recorder = new RecorderSupplement(context, params); const recorder = new Recorder(context, params);
recorderPromise = recorder.install().then(() => recorder); recorderPromise = recorder.install().then(() => recorder);
(context as any)[symbol] = recorderPromise; (context as any)[symbol] = recorderPromise;
} }

View File

@ -0,0 +1,9 @@
[*]
../
../registry/**
../../common/
../../protocol/
../../utils/**
[recorderApp.ts]
../chromium/crApp.ts

View File

@ -15,8 +15,8 @@
*/ */
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import type { BrowserContextOptions, LaunchOptions } from '../../../..'; import type { BrowserContextOptions, LaunchOptions } from '../../..';
import type { Frame } from '../../frames'; import type { Frame } from '../frames';
import type { LanguageGenerator, LanguageGeneratorOptions } from './language'; import type { LanguageGenerator, LanguageGeneratorOptions } from './language';
import type { Action, Signal, FrameDescription } from './recorderActions'; import type { Action, Signal, FrameDescription } from './recorderActions';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { BrowserContextOptions } from '../../../..'; import type { BrowserContextOptions } from '../../..';
import type { LanguageGenerator, LanguageGeneratorOptions } from './language'; import type { LanguageGenerator, LanguageGeneratorOptions } from './language';
import { sanitizeDeviceOptions, toSignalMap } from './language'; import { sanitizeDeviceOptions, toSignalMap } from './language';
import type { ActionInContext } from './codeGenerator'; import type { ActionInContext } from './codeGenerator';
@ -22,8 +22,8 @@ import type { Action } from './recorderActions';
import { actionTitle } from './recorderActions'; import { actionTitle } from './recorderActions';
import type { MouseClickOptions } from './utils'; import type { MouseClickOptions } from './utils';
import { toModifiers } from './utils'; import { toModifiers } from './utils';
import { escapeWithQuotes } from '../../../utils/isomorphic/stringUtils'; import { escapeWithQuotes } from '../../utils/isomorphic/stringUtils';
import deviceDescriptors from '../../deviceDescriptors'; import deviceDescriptors from '../deviceDescriptors';
export class CSharpLanguageGenerator implements LanguageGenerator { export class CSharpLanguageGenerator implements LanguageGenerator {
id = 'csharp'; id = 'csharp';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { BrowserContextOptions } from '../../../..'; import type { BrowserContextOptions } from '../../..';
import type { LanguageGenerator, LanguageGeneratorOptions } from './language'; import type { LanguageGenerator, LanguageGeneratorOptions } from './language';
import { toSignalMap } from './language'; import { toSignalMap } from './language';
import type { ActionInContext } from './codeGenerator'; import type { ActionInContext } from './codeGenerator';
@ -22,9 +22,9 @@ import type { Action } from './recorderActions';
import { actionTitle } from './recorderActions'; import { actionTitle } from './recorderActions';
import type { MouseClickOptions } from './utils'; import type { MouseClickOptions } from './utils';
import { toModifiers } from './utils'; import { toModifiers } from './utils';
import deviceDescriptors from '../../deviceDescriptors'; import deviceDescriptors from '../deviceDescriptors';
import { JavaScriptFormatter } from './javascript'; import { JavaScriptFormatter } from './javascript';
import { escapeWithQuotes } from '../../../utils/isomorphic/stringUtils'; import { escapeWithQuotes } from '../../utils/isomorphic/stringUtils';
export class JavaLanguageGenerator implements LanguageGenerator { export class JavaLanguageGenerator implements LanguageGenerator {
id = 'java'; id = 'java';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { BrowserContextOptions } from '../../../..'; import type { BrowserContextOptions } from '../../..';
import type { LanguageGenerator, LanguageGeneratorOptions } from './language'; import type { LanguageGenerator, LanguageGeneratorOptions } from './language';
import { sanitizeDeviceOptions, toSignalMap } from './language'; import { sanitizeDeviceOptions, toSignalMap } from './language';
import type { ActionInContext } from './codeGenerator'; import type { ActionInContext } from './codeGenerator';
@ -22,8 +22,8 @@ import type { Action } from './recorderActions';
import { actionTitle } from './recorderActions'; import { actionTitle } from './recorderActions';
import type { MouseClickOptions } from './utils'; import type { MouseClickOptions } from './utils';
import { toModifiers } from './utils'; import { toModifiers } from './utils';
import deviceDescriptors from '../../deviceDescriptors'; import deviceDescriptors from '../deviceDescriptors';
import { escapeWithQuotes } from '../../../utils/isomorphic/stringUtils'; import { escapeWithQuotes } from '../../utils/isomorphic/stringUtils';
export class JavaScriptLanguageGenerator implements LanguageGenerator { export class JavaScriptLanguageGenerator implements LanguageGenerator {
id: string; id: string;

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { BrowserContextOptions, LaunchOptions } from '../../../..'; import type { BrowserContextOptions, LaunchOptions } from '../../..';
import type { ActionInContext } from './codeGenerator'; import type { ActionInContext } from './codeGenerator';
import type { Action, DialogSignal, DownloadSignal, NavigationSignal, PopupSignal } from './recorderActions'; import type { Action, DialogSignal, DownloadSignal, NavigationSignal, PopupSignal } from './recorderActions';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { BrowserContextOptions } from '../../../..'; import type { BrowserContextOptions } from '../../..';
import type { LanguageGenerator, LanguageGeneratorOptions } from './language'; import type { LanguageGenerator, LanguageGeneratorOptions } from './language';
import { sanitizeDeviceOptions, toSignalMap } from './language'; import { sanitizeDeviceOptions, toSignalMap } from './language';
import type { ActionInContext } from './codeGenerator'; import type { ActionInContext } from './codeGenerator';
@ -22,8 +22,8 @@ import type { Action } from './recorderActions';
import { actionTitle } from './recorderActions'; import { actionTitle } from './recorderActions';
import type { MouseClickOptions } from './utils'; import type { MouseClickOptions } from './utils';
import { toModifiers } from './utils'; import { toModifiers } from './utils';
import { escapeWithQuotes } from '../../../utils/isomorphic/stringUtils'; import { escapeWithQuotes } from '../../utils/isomorphic/stringUtils';
import deviceDescriptors from '../../deviceDescriptors'; import deviceDescriptors from '../deviceDescriptors';
export class PythonLanguageGenerator implements LanguageGenerator { export class PythonLanguageGenerator implements LanguageGenerator {
id = 'python'; id = 'python';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { Point } from '../../../common/types'; import type { Point } from '../../common/types';
export type ActionName = export type ActionName =
'check' | 'check' |

View File

@ -16,15 +16,15 @@
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import type { Page } from '../../page'; import type { Page } from '../page';
import { ProgressController } from '../../progress'; import { ProgressController } from '../progress';
import { EventEmitter } from 'events'; import { EventEmitter } from 'events';
import { serverSideCallMetadata } from '../../instrumentation'; import { serverSideCallMetadata } from '../instrumentation';
import type { CallLog, EventData, Mode, Source } from './recorderTypes'; import type { CallLog, EventData, Mode, Source } from './recorderTypes';
import { isUnderTest } from '../../../utils'; import { isUnderTest } from '../../utils';
import * as mime from 'mime'; import * as mime from 'mime';
import { installAppIcon } from '../../chromium/crApp'; import { installAppIcon } from '../chromium/crApp';
import { findChromiumChannel } from '../../registry'; import { findChromiumChannel } from '../registry';
declare global { declare global {
interface Window { interface Window {
@ -70,7 +70,7 @@ export class RecorderApp extends EventEmitter implements IRecorderApp {
await this._page._setServerRequestInterceptor(async route => { await this._page._setServerRequestInterceptor(async route => {
if (route.request().url().startsWith('https://playwright/')) { if (route.request().url().startsWith('https://playwright/')) {
const uri = route.request().url().substring('https://playwright/'.length); const uri = route.request().url().substring('https://playwright/'.length);
const file = require.resolve('../../../webpack/recorder/' + uri); const file = require.resolve('../../webpack/recorder/' + uri);
const buffer = await fs.promises.readFile(file); const buffer = await fs.promises.readFile(file);
await route.fulfill({ await route.fulfill({
status: 200, status: 200,
@ -99,7 +99,7 @@ export class RecorderApp extends EventEmitter implements IRecorderApp {
static async open(sdkLanguage: string, headed: boolean): Promise<IRecorderApp> { static async open(sdkLanguage: string, headed: boolean): Promise<IRecorderApp> {
if (process.env.PW_CODEGEN_NO_INSPECTOR) if (process.env.PW_CODEGEN_NO_INSPECTOR)
return new HeadlessRecorderApp(); return new HeadlessRecorderApp();
const recorderPlaywright = (require('../../playwright').createPlaywright as typeof import('../../playwright').createPlaywright)('javascript', true); const recorderPlaywright = (require('../playwright').createPlaywright as typeof import('../playwright').createPlaywright)('javascript', true);
const args = [ const args = [
'--app=data:text/html,', '--app=data:text/html,',
'--window-size=600,600', '--window-size=600,600',

View File

@ -14,8 +14,8 @@
* limitations under the License. * limitations under the License.
*/ */
import type { Point } from '../../../common/types'; import type { Point } from '../../common/types';
import type { SerializedError } from '../../../protocol/channels'; import type { SerializedError } from '../../protocol/channels';
export type Mode = 'inspecting' | 'recording' | 'none'; export type Mode = 'inspecting' | 'recording' | 'none';

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { CallMetadata } from '../../instrumentation'; import type { CallMetadata } from '../instrumentation';
import type { CallLog, CallLogStatus } from './recorderTypes'; import type { CallLog, CallLogStatus } from './recorderTypes';
export function metadataToCallLog(metadata: CallMetadata, status: CallLogStatus): CallLog { export function metadataToCallLog(metadata: CallMetadata, status: CallLogStatus): CallLog {

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { Frame } from '../../frames'; import type { Frame } from '../frames';
import type * as actions from './recorderActions'; import type * as actions from './recorderActions';
export type MouseClickOptions = Parameters<Frame['click']>[2]; export type MouseClickOptions = Parameters<Frame['click']>[2];

View File

@ -1,10 +0,0 @@
[*]
../
../../utils/
[debugger.ts]
../../protocol/
[recorderSupplement.ts]
../../generated/
./recorder/

View File

@ -1,4 +0,0 @@
# Files in this folder are used in browser environment, they can only depend on isomorphic files.
[*]
../../injected/
../../../utils/isomorphic/

View File

@ -1,9 +0,0 @@
[*]
../../
../../registry/**
../../../common/
../../../protocol/
../../../utils/**
[recorderApp.ts]
../../chromium/crApp.ts

View File

@ -1,3 +1,3 @@
[*] [*]
../../supplements/har/ ../../har/

View File

@ -14,7 +14,7 @@
* limitations under the License. * limitations under the License.
*/ */
import type { Entry as HAREntry } from '../../supplements/har/har'; import type { Entry as HAREntry } from '../../har/har';
export type ResourceSnapshot = HAREntry; export type ResourceSnapshot = HAREntry;

View File

@ -1,7 +1,7 @@
[*] [*]
../../ ../../
../../har/
../../../common/ ../../../common/
../../../protocol/ ../../../protocol/
../../../utils/ ../../../utils/
../../supplements/har/
../common/ ../common/

View File

@ -34,9 +34,9 @@ import type { APIRequestContext } from '../../fetch';
import type { CallMetadata, InstrumentationListener } from '../../instrumentation'; import type { CallMetadata, InstrumentationListener } from '../../instrumentation';
import { SdkObject } from '../../instrumentation'; import { SdkObject } from '../../instrumentation';
import { Page } from '../../page'; import { Page } from '../../page';
import type * as har from '../../supplements/har/har'; import type * as har from '../../har/har';
import type { HarTracerDelegate } from '../../supplements/har/harTracer'; import type { HarTracerDelegate } from '../../har/harTracer';
import { HarTracer } from '../../supplements/har/harTracer'; import { HarTracer } from '../../har/harTracer';
import type { FrameSnapshot } from '../common/snapshotTypes'; import type { FrameSnapshot } from '../common/snapshotTypes';
import type * as trace from '../common/traceEvents'; import type * as trace from '../common/traceEvents';
import { VERSION } from '../common/traceEvents'; import { VERSION } from '../common/traceEvents';

View File

@ -22,9 +22,9 @@ import { BaseSnapshotStorage } from '../../../../../trace-viewer/src/snapshotSto
import type { SnapshotterBlob, SnapshotterDelegate } from '../recorder/snapshotter'; import type { SnapshotterBlob, SnapshotterDelegate } from '../recorder/snapshotter';
import { Snapshotter } from '../recorder/snapshotter'; import { Snapshotter } from '../recorder/snapshotter';
import type { ElementHandle } from '../../dom'; import type { ElementHandle } from '../../dom';
import type { HarTracerDelegate } from '../../supplements/har/harTracer'; import type { HarTracerDelegate } from '../../har/harTracer';
import { HarTracer } from '../../supplements/har/harTracer'; import { HarTracer } from '../../har/harTracer';
import type * as har from '../../supplements/har/har'; import type * as har from '../../har/har';
export class InMemorySnapshotter extends BaseSnapshotStorage implements SnapshotterDelegate, HarTracerDelegate { export class InMemorySnapshotter extends BaseSnapshotStorage implements SnapshotterDelegate, HarTracerDelegate {
private _blobs = new Map<string, Buffer>(); private _blobs = new Map<string, Buffer>();

View File

@ -16,7 +16,7 @@
import './callLog.css'; import './callLog.css';
import * as React from 'react'; import * as React from 'react';
import type { CallLog } from '@playwright-core/server/supplements/recorder/recorderTypes'; import type { CallLog } from '@playwright-core/server/recorder/recorderTypes';
import { msToString } from '@web/uiUtils'; import { msToString } from '@web/uiUtils';
export interface CallLogProps { export interface CallLogProps {

View File

@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
*/ */
import type { CallLog, Mode, Source } from '@playwright-core/server/supplements/recorder/recorderTypes'; import type { CallLog, Mode, Source } from '@playwright-core/server/recorder/recorderTypes';
import * as React from 'react'; import * as React from 'react';
import { Recorder } from './recorder'; import { Recorder } from './recorder';
import './recorder.css'; import './recorder.css';

View File

@ -14,7 +14,7 @@
limitations under the License. limitations under the License.
*/ */
import type { CallLog, Mode, Source } from '@playwright-core/server/supplements/recorder/recorderTypes'; import type { CallLog, Mode, Source } from '@playwright-core/server/recorder/recorderTypes';
import { Source as SourceView } from '@web/components/source'; import { Source as SourceView } from '@web/components/source';
import { SplitView } from '@web/components/splitView'; import { SplitView } from '@web/components/splitView';
import { Toolbar } from '@web/components/toolbar'; import { Toolbar } from '@web/components/toolbar';

View File

@ -21,7 +21,7 @@ import fs from 'fs';
import http2 from 'http2'; import http2 from 'http2';
import type { BrowserContext, BrowserContextOptions } from 'playwright-core'; import type { BrowserContext, BrowserContextOptions } from 'playwright-core';
import type { AddressInfo } from 'net'; import type { AddressInfo } from 'net';
import type { Log } from '../../packages/playwright-core/src/server/supplements/har/har'; import type { Log } from '../../packages/playwright-core/src/server/har/har';
async function pageWithHar(contextFactory: (options?: BrowserContextOptions) => Promise<BrowserContext>, testInfo: any, outputPath: string = 'test.har') { async function pageWithHar(contextFactory: (options?: BrowserContextOptions) => Promise<BrowserContext>, testInfo: any, outputPath: string = 'test.har') {
const harPath = testInfo.outputPath(outputPath); const harPath = testInfo.outputPath(outputPath);

View File

@ -17,7 +17,7 @@
import { contextTest } from '../../config/browserTest'; import { contextTest } from '../../config/browserTest';
import type { Page } from 'playwright-core'; import type { Page } from 'playwright-core';
import * as path from 'path'; import * as path from 'path';
import type { Source } from '../../../packages/playwright-core/src/server/supplements/recorder/recorderTypes'; import type { Source } from '../../../packages/playwright-core/src/server/recorder/recorderTypes';
import type { CommonFixtures, TestChildProcess } from '../../config/commonFixtures'; import type { CommonFixtures, TestChildProcess } from '../../config/commonFixtures';
export { expect } from '@playwright/test'; export { expect } from '@playwright/test';

View File

@ -208,7 +208,6 @@ for (const pkg of workspace.packages()) {
'--extensions', '.ts', '--extensions', '.ts',
'--out-dir', quotePath(path.join(pkg.path, 'lib')), '--out-dir', quotePath(path.join(pkg.path, 'lib')),
'--ignore', '"packages/playwright-core/src/server/injected/**/*"', '--ignore', '"packages/playwright-core/src/server/injected/**/*"',
'--ignore', '"packages/playwright-core/src/server/supplements/injected/**/*"',
quotePath(path.join(pkg.path, 'src'))], quotePath(path.join(pkg.path, 'src'))],
shell: true, shell: true,
}); });
@ -219,7 +218,6 @@ onChanges.push({
committed: false, committed: false,
inputs: [ inputs: [
'packages/playwright-core/src/server/injected/**', 'packages/playwright-core/src/server/injected/**',
'packages/playwright-core/src/supplements/injected/**',
'utils/generate_injected.js', 'utils/generate_injected.js',
], ],
script: 'utils/generate_injected.js', script: 'utils/generate_injected.js',

View File

@ -25,8 +25,8 @@ const esbuild = require('esbuild');
const injectedScripts = [ const injectedScripts = [
path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'utilityScript.ts'), path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'utilityScript.ts'),
path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'injectedScript.ts'), path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'injectedScript.ts'),
path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'supplements', 'injected', 'consoleApi.ts'), path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'consoleApi.ts'),
path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'supplements', 'injected', 'recorder.ts'), path.join(ROOT, 'packages', 'playwright-core', 'src', 'server', 'injected', 'recorder.ts'),
]; ];
(async () => { (async () => {