chore: move trace to server (#5565)

This commit is contained in:
Pavel Feldman 2021-02-23 22:08:14 -08:00 committed by GitHub
parent 180446d20f
commit 48c237b3cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
12 changed files with 27 additions and 28 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{
"name": "playwright-internal",
"version": "1.9.0-next",
"version": "1.10.0-next",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@ -19,7 +19,7 @@ import fs from 'fs';
import path from 'path';
import type { TraceModel, trace, ContextEntry } from './traceModel';
import { TraceServer } from './traceServer';
import { NodeSnapshot } from '../../trace/traceTypes';
import { NodeSnapshot } from '../../server/trace/traceTypes';
export class SnapshotServer {
private _resourcesDir: string | undefined;

View File

@ -14,8 +14,8 @@
* limitations under the License.
*/
import * as trace from '../../trace/traceTypes';
export * as trace from '../../trace/traceTypes';
import * as trace from '../../server/trace/traceTypes';
export * as trace from '../../server/trace/traceTypes';
export type TraceModel = {
contexts: ContextEntry[];

View File

@ -20,7 +20,7 @@ import * as playwright from '../../..';
import * as util from 'util';
import { ScreenshotGenerator } from './screenshotGenerator';
import { readTraceFile, TraceModel } from './traceModel';
import type { TraceEvent } from '../../trace/traceTypes';
import type { TraceEvent } from '../../server/trace/traceTypes';
import { SnapshotServer } from './snapshotServer';
import { ServerRouteHandler, TraceServer } from './traceServer';

View File

@ -15,7 +15,7 @@
*/
import path from 'path';
import { Tracer } from '../trace/tracer';
import { Tracer } from './trace/tracer';
import { Android } from './android/android';
import { AdbBackend } from './android/backendAdb';
import { PlaywrightOptions } from './browser';

View File

@ -14,14 +14,14 @@
* limitations under the License.
*/
import { BrowserContext } from '../server/browserContext';
import { Page } from '../server/page';
import * as network from '../server/network';
import { helper, RegisteredListener } from '../server/helper';
import { debugLogger } from '../utils/debugLogger';
import { Frame } from '../server/frames';
import { BrowserContext } from '../browserContext';
import { Page } from '../page';
import * as network from '../network';
import { helper, RegisteredListener } from '../helper';
import { debugLogger } from '../../utils/debugLogger';
import { Frame } from '../frames';
import { SnapshotData, frameSnapshotStreamer, kSnapshotBinding, kSnapshotStreamer } from './snapshotterInjected';
import { calculateSha1 } from '../utils/utils';
import { calculateSha1 } from '../../utils/utils';
import { FrameSnapshot } from './traceTypes';
export type SnapshotterResource = {

View File

@ -14,7 +14,7 @@
* limitations under the License.
*/
import { StackFrame } from '../common/types';
import { StackFrame } from '../../common/types';
import { NodeSnapshot } from './snapshotterInjected';
export { NodeSnapshot } from './snapshotterInjected';

View File

@ -14,20 +14,20 @@
* limitations under the License.
*/
import { BrowserContext, Video } from '../server/browserContext';
import { BrowserContext, Video } from '../browserContext';
import type { SnapshotterResource as SnapshotterResource, SnapshotterBlob, SnapshotterDelegate } from './snapshotter';
import * as trace from './traceTypes';
import path from 'path';
import * as util from 'util';
import fs from 'fs';
import { createGuid, getFromENV, mkdirIfNeeded, monotonicTime } from '../utils/utils';
import { Page } from '../server/page';
import { createGuid, getFromENV, mkdirIfNeeded, monotonicTime } from '../../utils/utils';
import { Page } from '../page';
import { Snapshotter } from './snapshotter';
import { helper, RegisteredListener } from '../server/helper';
import { Dialog } from '../server/dialog';
import { Frame, NavigationEvent } from '../server/frames';
import { helper, RegisteredListener } from '../helper';
import { Dialog } from '../dialog';
import { Frame, NavigationEvent } from '../frames';
import { snapshotScript } from './snapshotterInjected';
import { CallMetadata, InstrumentationListener, SdkObject } from '../server/instrumentation';
import { CallMetadata, InstrumentationListener, SdkObject } from '../instrumentation';
const fsWriteFileAsync = util.promisify(fs.writeFile.bind(fs));
const fsAppendFileAsync = util.promisify(fs.appendFile.bind(fs));

View File

@ -17,7 +17,7 @@
import './networkResourceDetails.css';
import * as React from 'react';
import { Expandable } from './helpers';
import { NetworkResourceTraceEvent } from '../../../trace/traceTypes';
import { NetworkResourceTraceEvent } from '../../../server/trace/traceTypes';
const utf8Encoder = new TextDecoder('utf-8');

View File

@ -15,7 +15,7 @@
*/
import { it, expect } from './fixtures';
import type * as trace from '../src/trace/traceTypes';
import type * as trace from '../src/server/trace/traceTypes';
import path from 'path';
import fs from 'fs';

View File

@ -140,20 +140,19 @@ DEPS['src/server/injected/'] = ['src/server/common/'];
DEPS['src/server/android/'] = [...DEPS['src/server/'], 'src/server/chromium/', 'src/protocol/'];
DEPS['src/server/electron/'] = [...DEPS['src/server/'], 'src/server/chromium/'];
DEPS['src/server/playwright.ts'] = [...DEPS['src/server/'], 'src/trace/', 'src/server/chromium/', 'src/server/webkit/', 'src/server/firefox/', 'src/server/android/', 'src/server/electron/'];
DEPS['src/server/playwright.ts'] = [...DEPS['src/server/'], 'src/server/trace/', 'src/server/chromium/', 'src/server/webkit/', 'src/server/firefox/', 'src/server/android/', 'src/server/electron/'];
DEPS['src/cli/driver.ts'] = DEPS['src/inprocess.ts'] = DEPS['src/browserServerImpl.ts'] = ['src/**'];
// Tracing is a client/server plugin, nothing should depend on it.
DEPS['src/trace/'] = ['src/common/', 'src/utils/', 'src/client/**', 'src/server/**'];
DEPS['src/web/recorder/'] = ['src/common/', 'src/web/', 'src/web/components/', 'src/server/supplements/recorder/recorderTypes.ts'];
DEPS['src/web/traceViewer/'] = ['src/common/', 'src/web/', 'src/cli/traceViewer/'];
DEPS['src/web/traceViewer/ui/'] = ['src/common/', 'src/web/traceViewer/', 'src/web/', 'src/cli/traceViewer/', 'src/trace/'];
DEPS['src/web/traceViewer/ui/'] = ['src/common/', 'src/web/traceViewer/', 'src/web/', 'src/cli/traceViewer/', 'src/server/trace/'];
// The service is a cross-cutting feature, and so it depends on a bunch of things.
DEPS['src/remote/'] = ['src/client/', 'src/debug/', 'src/dispatchers/', 'src/server/', 'src/server/supplements/', 'src/server/electron/', 'src/trace/'];
DEPS['src/remote/'] = ['src/client/', 'src/debug/', 'src/dispatchers/', 'src/server/', 'src/server/supplements/', 'src/server/electron/', 'src/server/trace/'];
DEPS['src/service.ts'] = ['src/remote/'];
// CLI should only use client-side features.
DEPS['src/cli/'] = ['src/cli/**', 'src/client/**', 'src/install/**', 'src/generated/', 'src/server/injected/', 'src/debug/injected/', 'src/trace/**', 'src/utils/**'];
DEPS['src/cli/'] = ['src/cli/**', 'src/client/**', 'src/install/**', 'src/generated/', 'src/server/injected/', 'src/debug/injected/', 'src/server/trace/**', 'src/utils/**'];
DEPS['src/server/supplements/recorder/recorderApp.ts'] = ['src/common/', 'src/utils/', 'src/server/', 'src/server/chromium/'];
DEPS['src/utils/'] = ['src/common/'];