@typerighter/rpc-server 0.1.2 → 0.1.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.
Files changed (3) hide show
  1. package/index.js +7 -5
  2. package/install.js +0 -4
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -4,16 +4,18 @@ import { EventEmitter } from "node:events";
4
4
  import { binPath } from "./platform.js";
5
5
 
6
6
  function resolveBin() {
7
- const local = binPath();
8
- if (existsSync(local)) return local;
9
-
10
- // Fall back to system PATH
7
+ // Prefer user's system binary
11
8
  try {
12
- return execFileSync("which", ["typedown-rpc"], { encoding: "utf-8" }).trim();
9
+ const system = execFileSync("which", ["typedown-rpc"], { encoding: "utf-8" }).trim();
10
+ if (system) return system;
13
11
  } catch {
14
12
  // ignore
15
13
  }
16
14
 
15
+ // Fall back to downloaded binary
16
+ const local = binPath();
17
+ if (existsSync(local)) return local;
18
+
17
19
  throw new Error(
18
20
  `typedown-rpc binary not found. Run "pnpm install" to download it, ` +
19
21
  `install via Nix, or build manually with "cargo build --release -p typedown-server".`,
package/install.js CHANGED
@@ -13,10 +13,6 @@ import {
13
13
 
14
14
  const bin = binPath();
15
15
 
16
- if (existsSync(bin)) {
17
- process.exit(0);
18
- }
19
-
20
16
  // In dev mode, we compile and `bin` will just automatically point to the artifact
21
17
  if (dev()) {
22
18
  console.log("[rpc-server] Development mode: building typedown-rpc with cargo");
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.1.2",
4
+ "version": "0.1.3",
5
5
  "description": "Typedown RPC server binary.",
6
6
  "repository": {
7
7
  "type": "git",