@php-wasm/xdebug-bridge 2.0.11 → 2.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @php-wasm/xdebug-bridge
2
2
 
3
- XDebug bridge server for PHP.wasm that enables debugging connections between XDebug and debugging clients.
3
+ A bridge server for XDebug and PHP.wasm that facilitates debugging connections between XDebug and Browser devtools.
4
4
 
5
5
  ## Installation
6
6
 
@@ -18,6 +18,10 @@ import { startBridge } from './xdebug-bridge/src/start-bridge';
18
18
  // Start with default settings
19
19
  const server = startBridge();
20
20
  await server.start();
21
+ ```
22
+
23
+ ```typescript
24
+ import { startBridge } from './xdebug-bridge/src/start-bridge';
21
25
 
22
26
  // Start with custom configuration
23
27
  const server = startBridge({
@@ -37,20 +41,29 @@ await server.start();
37
41
  npx xdebug-bridge
38
42
 
39
43
  # Custom port and verbose logging
40
- npx xdebug-bridge --port 9000 --verbose
44
+ npx xdebug-bridge --port 9000 --verbosity debug
41
45
 
42
46
  # Show help
43
47
  npx xdebug-bridge --help
44
48
  ```
45
49
 
46
- ## Configuration Options
50
+ ## Configuration Options (CLI)
51
+
52
+ - `port`: Xdebug port to listen on (default: 9003)
53
+ - `host`: Xdebug host to bind to (default: 'localhost')
54
+ - `php-root`: Path to PHP root directory (default: './')
55
+ - `verbosity`: Output logs and progress messages (choices: "quiet", "normal", "debug") (default: "normal")
56
+ - `help`: Display help
57
+
58
+ ## Configuration Options (API)
47
59
 
48
60
  - `cdpPort`: Port to listen for CDP connections (default: 9229)
49
61
  - `cdpHost`: Host to bind to (default: 'localhost')
50
62
  - `dbgpPort`: Port to listen for XDebug connections (default: 9003)
51
- - `phpRoot`: Root path for php files;
52
- - `remoteRoot`: Remote root path for php files;
53
- - `localRoot`: Local root path for php files;
63
+ - `phpRoot`: Root path for php files
64
+ - `verbosity`: Output logs and progress messages (choices: "quiet", "normal", "debug") (default: "normal")
65
+ - `remoteRoot`: Remote root path for php files
66
+ - `localRoot`: Local root path for php files
54
67
  - `phpInstance`: PHP instance
55
68
  - `getPHPFile`: Custom file listing function
56
69
 
@@ -58,11 +71,15 @@ npx xdebug-bridge --help
58
71
 
59
72
  The bridge listens to events for monitoring connection activity:
60
73
 
74
+ #### From Xdebug
75
+
61
76
  - `connected`: Xdebug Server has started
62
77
  - `close`: Xdebug Server has stopped
63
78
  - `message`: Raw XDebug data received
64
79
  - `error`: Xdebug Server error occurred
65
80
 
81
+ #### To Devtools
82
+
66
83
  - `clientConnected`: Devtools client connected
67
84
  - `clientDisconnected`: Devtools client disconnected
68
85
  - `message`: Raw Devtools data received
package/cli.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";const i=require("./run-cli-BKbM-eYC.cjs");i.main();
1
+ "use strict";const i=require("./run-cli-CioU2BLc.cjs");i.main();
package/cli.js CHANGED
@@ -1,2 +1,2 @@
1
- import { m } from "./run-cli-Cs104r6H.js";
1
+ import { m } from "./run-cli-BmBrNemj.js";
2
2
  m();
package/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./run-cli-BKbM-eYC.cjs");exports.CDPServer=e.CDPServer;exports.DbgpSession=e.DbgpSession;exports.XdebugCDPBridge=e.XdebugCDPBridge;exports.main=e.main;exports.startBridge=e.startBridge;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./run-cli-CioU2BLc.cjs");exports.CDPServer=e.CDPServer;exports.DbgpSession=e.DbgpSession;exports.XdebugCDPBridge=e.XdebugCDPBridge;exports.main=e.main;exports.startBridge=e.startBridge;
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { C as e, D as r, X as g, m as i, s as D } from "./run-cli-Cs104r6H.js";
1
+ import { C as e, D as r, X as g, m as i, s as D } from "./run-cli-BmBrNemj.js";
2
2
  export {
3
3
  e as CDPServer,
4
4
  r as DbgpSession,
@@ -5,4 +5,5 @@ export declare class CDPServer extends EventEmitter {
5
5
  private ws;
6
6
  constructor(port?: number);
7
7
  sendMessage(message: any): void;
8
+ close(): void;
8
9
  }
@@ -8,4 +8,5 @@ export declare class DbgpSession extends EventEmitter {
8
8
  constructor(port?: number);
9
9
  private onData;
10
10
  sendCommand(command: string): void;
11
+ close(): void;
11
12
  }
@@ -25,6 +25,7 @@ export declare class XdebugCDPBridge {
25
25
  private localRoot;
26
26
  constructor(dbgp: DbgpSession, cdp: CDPServer, config: XdebugCDPBridgeConfig);
27
27
  start(): void;
28
+ stop(): void;
28
29
  private sendInitialScripts;
29
30
  private getOrCreateScriptId;
30
31
  private formatPropertyFullName;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@php-wasm/xdebug-bridge",
3
- "version": "2.0.11",
3
+ "version": "2.0.13",
4
4
  "description": "XDebug bridge server for PHP.wasm",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,17 +39,22 @@
39
39
  },
40
40
  "license": "GPL-2.0-or-later",
41
41
  "types": "index.d.ts",
42
- "gitHead": "537de170ea60139b84225bbf932ddf3afaf7e19a",
42
+ "gitHead": "c9d2979597806e5f14985a0607c9c61e48d54c9b",
43
43
  "engines": {
44
44
  "node": ">=20.18.3",
45
45
  "npm": ">=10.1.0"
46
46
  },
47
47
  "dependencies": {
48
+ "express": "4.21.2",
48
49
  "ini": "4.1.2",
50
+ "wasm-feature-detect": "1.8.0",
49
51
  "ws": "8.18.1",
50
52
  "xml2js": "0.6.2",
51
53
  "yargs": "17.7.2",
52
- "@php-wasm/universal": "2.0.11"
54
+ "@php-wasm/logger": "2.0.13",
55
+ "@php-wasm/universal": "2.0.13",
56
+ "@wp-playground/common": "2.0.13",
57
+ "@php-wasm/node": "2.0.13"
53
58
  },
54
59
  "overrides": {
55
60
  "rollup": "^4.34.6",