@grafema/rfdb 0.2.0-beta → 0.2.1-beta

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 (2) hide show
  1. package/bin/rfdb-server.js +27 -10
  2. package/package.json +1 -1
@@ -24,19 +24,36 @@ function getBinaryPath() {
24
24
  process.exit(1);
25
25
  }
26
26
 
27
- const binaryPath = path.join(__dirname, '..', 'prebuilt', platformDir, 'rfdb-server');
27
+ // Check prebuilt binary first
28
+ const prebuiltPath = path.join(__dirname, '..', 'prebuilt', platformDir, 'rfdb-server');
29
+ if (fs.existsSync(prebuiltPath)) {
30
+ return prebuiltPath;
31
+ }
28
32
 
29
- if (!fs.existsSync(binaryPath)) {
30
- console.error(`Binary not found for ${platform}-${arch}`);
31
- console.error(`Expected at: ${binaryPath}`);
32
- console.error('');
33
- console.error('Available options:');
34
- console.error('1. Build from source: cargo build --release');
35
- console.error('2. Download from GitHub releases');
36
- process.exit(1);
33
+ // Fallback: check for locally built binary in common locations
34
+ const localPaths = [
35
+ // Cargo release build (when building from source)
36
+ path.join(__dirname, '..', 'target', 'release', 'rfdb-server'),
37
+ // Monorepo development
38
+ path.join(__dirname, '..', '..', '..', 'packages', 'rfdb-server', 'target', 'release', 'rfdb-server'),
39
+ // Home directory fallback for manual builds
40
+ path.join(process.env.HOME || '', '.local', 'bin', 'rfdb-server'),
41
+ ];
42
+
43
+ for (const localPath of localPaths) {
44
+ if (fs.existsSync(localPath)) {
45
+ return localPath;
46
+ }
37
47
  }
38
48
 
39
- return binaryPath;
49
+ console.error(`Binary not found for ${platform}-${arch}`);
50
+ console.error(`Expected at: ${prebuiltPath}`);
51
+ console.error('');
52
+ console.error('Available options:');
53
+ console.error('1. Build from source: cargo build --release');
54
+ console.error('2. Copy binary to: ~/.local/bin/rfdb-server');
55
+ console.error('3. Download from GitHub releases');
56
+ process.exit(1);
40
57
  }
41
58
 
42
59
  const binaryPath = getBinaryPath();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@grafema/rfdb",
3
- "version": "0.2.0-beta",
3
+ "version": "0.2.1-beta",
4
4
  "description": "High-performance disk-backed graph database server for Grafema",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",