@typerighter/rpc-server 0.57.1 → 0.57.3
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/index.d.ts +4 -0
- package/index.js +4 -2
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export interface RpcServerOptions {
|
|
|
7
7
|
addr?: string;
|
|
8
8
|
/** Bind port (default: 0, OS picks a free port) */
|
|
9
9
|
port?: number;
|
|
10
|
+
/** Start fresh, ignore cache from previous session */
|
|
11
|
+
fresh?: boolean;
|
|
12
|
+
/** Enable debug logging from the RPC server process */
|
|
13
|
+
verbose?: boolean;
|
|
10
14
|
}
|
|
11
15
|
|
|
12
16
|
export class RpcServer extends EventEmitter {
|
package/index.js
CHANGED
|
@@ -26,12 +26,13 @@ function resolveBin() {
|
|
|
26
26
|
const bin = resolveBin();
|
|
27
27
|
|
|
28
28
|
export class RpcServer extends EventEmitter {
|
|
29
|
-
constructor({ root, addr, port, fresh } = {}) {
|
|
29
|
+
constructor({ root, addr, port, fresh, verbose } = {}) {
|
|
30
30
|
super();
|
|
31
31
|
this._root = root ?? process.cwd();
|
|
32
32
|
this._addr = addr ?? "127.0.0.1";
|
|
33
33
|
this._port = port ?? 0;
|
|
34
34
|
this._fresh = fresh ?? false;
|
|
35
|
+
this._verbose = verbose ?? false;
|
|
35
36
|
this._process = undefined;
|
|
36
37
|
this._listening = false;
|
|
37
38
|
this._resolvedAddress = undefined;
|
|
@@ -62,7 +63,8 @@ export class RpcServer extends EventEmitter {
|
|
|
62
63
|
throw new Error("Server is already running");
|
|
63
64
|
}
|
|
64
65
|
|
|
65
|
-
const
|
|
66
|
+
const args = this._verbose ? ["--verbose"] : [];
|
|
67
|
+
const child = spawn(bin, args, {
|
|
66
68
|
cwd: this._root,
|
|
67
69
|
env: {
|
|
68
70
|
...process.env,
|