@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 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
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package",
3
3
  "name": "@typerighter/rpc-server",
4
- "version": "0.25.0",
4
+ "version": "0.26.0",
5
5
  "description": "Typedown RPC server binary.",
6
6
  "repository": {
7
7
  "type": "git",
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", "debug", `typedown-rpc${ext}`);
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
  }