@typerighter/rpc-server 0.25.0 → 0.26.0
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.js +4 -3
- package/install.js +1 -1
- package/package.json +1 -1
- package/platform.js +1 -1
package/index.js
CHANGED
|
@@ -70,6 +70,8 @@ export class RpcServer extends EventEmitter {
|
|
|
70
70
|
TYPEDOWN_RPC_PORT: String(this._port),
|
|
71
71
|
},
|
|
72
72
|
stdio: ["ignore", "pipe", "inherit"],
|
|
73
|
+
// Detach so the server can save its cache after Node exits
|
|
74
|
+
detached: true,
|
|
73
75
|
});
|
|
74
76
|
|
|
75
77
|
this._process = child;
|
|
@@ -116,10 +118,9 @@ export class RpcServer extends EventEmitter {
|
|
|
116
118
|
return this;
|
|
117
119
|
}
|
|
118
120
|
|
|
121
|
+
// Let the server detect the socket close and save cache in the background
|
|
122
|
+
// The process is already unref'd so it won't block Node from exiting
|
|
119
123
|
close() {
|
|
120
|
-
if (this._process) {
|
|
121
|
-
this._process.kill();
|
|
122
|
-
}
|
|
123
124
|
return this;
|
|
124
125
|
}
|
|
125
126
|
}
|
package/install.js
CHANGED
|
@@ -18,7 +18,7 @@ const bin = binPath();
|
|
|
18
18
|
if (dev()) {
|
|
19
19
|
console.log("[rpc-server] Development mode: building typedown-rpc with cargo");
|
|
20
20
|
try {
|
|
21
|
-
execFileSync("cargo", ["build", "-p", "typedown-server"], {
|
|
21
|
+
execFileSync("cargo", ["build", "--release", "-p", "typedown-server"], {
|
|
22
22
|
cwd: repoRoot(),
|
|
23
23
|
stdio: "inherit",
|
|
24
24
|
});
|
package/package.json
CHANGED
package/platform.js
CHANGED
|
@@ -74,7 +74,7 @@ export function repoRoot() {
|
|
|
74
74
|
export function binPath() {
|
|
75
75
|
const ext = process.platform === "win32" ? ".exe" : "";
|
|
76
76
|
if (isDev) {
|
|
77
|
-
return path.join(repoRoot(), "target", "
|
|
77
|
+
return path.join(repoRoot(), "target", "release", `typedown-rpc${ext}`);
|
|
78
78
|
}
|
|
79
79
|
return path.join(path.dirname(import.meta.filename), "bin", `typedown-rpc${ext}`);
|
|
80
80
|
}
|