move cdp-relay and protocol out of extension subfolder
This commit is contained in:
@@ -3,7 +3,7 @@ declare const process: { env: { PLAYWRITER_PORT: string } }
|
||||
import { createStore } from 'zustand/vanilla'
|
||||
import type { ExtensionState, ConnectionState, TabState, TabInfo } from './types'
|
||||
import type { CDPEvent, Protocol } from 'playwriter/src/cdp-types'
|
||||
import type { ExtensionCommandMessage, ExtensionResponseMessage } from 'playwriter/src/extension/protocol'
|
||||
import type { ExtensionCommandMessage, ExtensionResponseMessage } from 'playwriter/src/protocol'
|
||||
|
||||
const RELAY_PORT = process.env.PLAYWRITER_PORT
|
||||
const RELAY_URL = `ws://localhost:${RELAY_PORT}/extension`
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { startPlayWriterCDPRelayServer } from '../src/extension/cdp-relay.js'
|
||||
import { startPlayWriterCDPRelayServer } from '../src/cdp-relay.js'
|
||||
|
||||
async function main() {
|
||||
const server = await startPlayWriterCDPRelayServer({ port: 19988 })
|
||||
|
||||
@@ -2,12 +2,12 @@ import { Hono } from 'hono'
|
||||
import { serve } from '@hono/node-server'
|
||||
import { createNodeWebSocket } from '@hono/node-ws'
|
||||
import type { WSContext } from 'hono/ws'
|
||||
import type { Protocol } from '../cdp-types.js'
|
||||
import type { CDPCommand, CDPResponseBase, CDPEventBase, CDPEventFor, RelayServerEvents } from '../cdp-types.js'
|
||||
import type { Protocol } from './cdp-types.js'
|
||||
import type { CDPCommand, CDPResponseBase, CDPEventBase, CDPEventFor, RelayServerEvents } from './cdp-types.js'
|
||||
import type { ExtensionMessage, ExtensionEventMessage } from './protocol.js'
|
||||
import chalk from 'chalk'
|
||||
import { EventEmitter } from 'node:events'
|
||||
import { VERSION } from '../utils.js'
|
||||
import { VERSION } from './utils.js'
|
||||
|
||||
type ConnectedTarget = {
|
||||
sessionId: string
|
||||
@@ -124,5 +124,5 @@ The `Runtime.enable` fix addresses reason #1 at the CDP level, but test waits ar
|
||||
|
||||
## Files Changed
|
||||
|
||||
- `playwriter/src/extension/cdp-relay.ts` - Added event-based wait in `Runtime.enable` handler
|
||||
- `playwriter/src/cdp-relay.ts` - Added event-based wait in `Runtime.enable` handler
|
||||
- `extension/src/background.ts` - Removed arbitrary `sleep(200)` from `Runtime.enable` handler
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
import { cac } from 'cac'
|
||||
import { startPlayWriterCDPRelayServer } from './extension/cdp-relay.js'
|
||||
import { startPlayWriterCDPRelayServer } from './cdp-relay.js'
|
||||
import { createFileLogger } from './create-logger.js'
|
||||
import { VERSION } from './utils.js'
|
||||
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export * from './extension/cdp-relay.js'
|
||||
export * from './cdp-relay.js'
|
||||
export * from './utils.js'
|
||||
|
||||
@@ -13,7 +13,7 @@ import { imageSize } from 'image-size'
|
||||
import { getCDPSessionForPage } from './cdp-session.js'
|
||||
import { Debugger } from './debugger.js'
|
||||
import { Editor } from './editor.js'
|
||||
import { startPlayWriterCDPRelayServer, type RelayServer } from './extension/cdp-relay.js'
|
||||
import { startPlayWriterCDPRelayServer, type RelayServer } from './cdp-relay.js'
|
||||
import { createFileLogger } from './create-logger.js'
|
||||
import type { CDPCommand } from './cdp-types.js'
|
||||
import { killPortProcess } from 'kill-port-process'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { CDPEventFor, ProtocolMapping } from '../cdp-types.js'
|
||||
import { CDPEventFor, ProtocolMapping } from './cdp-types.js'
|
||||
|
||||
export const VERSION = 1
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { startPlayWriterCDPRelayServer } from './extension/cdp-relay.js'
|
||||
import { startPlayWriterCDPRelayServer } from './cdp-relay.js'
|
||||
import { createFileLogger } from './create-logger.js'
|
||||
|
||||
process.title = 'playwriter-ws-server'
|
||||
|
||||
Reference in New Issue
Block a user