@grafema/core 0.2.1-beta → 0.2.4-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.
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/storage/backends/RFDBServerBackend.d.ts +11 -6
- package/dist/storage/backends/RFDBServerBackend.d.ts.map +1 -1
- package/dist/storage/backends/RFDBServerBackend.js +19 -61
- package/dist/utils/findRfdbBinary.d.ts +39 -0
- package/dist/utils/findRfdbBinary.d.ts.map +1 -0
- package/dist/utils/findRfdbBinary.js +140 -0
- package/package.json +3 -3
- package/src/index.ts +2 -0
- package/src/storage/backends/RFDBServerBackend.ts +27 -67
- package/src/utils/findRfdbBinary.ts +160 -0
package/dist/index.d.ts
CHANGED
|
@@ -17,6 +17,8 @@ export { GraphBackend, typeToKind, edgeTypeToNumber } from './core/GraphBackend.
|
|
|
17
17
|
export type { Node, Edge, EdgeType, AttrQuery, GraphStats, GraphExport } from './core/GraphBackend.js';
|
|
18
18
|
export { RFDBClient } from '@grafema/rfdb-client';
|
|
19
19
|
export { RFDBServerBackend } from './storage/backends/RFDBServerBackend.js';
|
|
20
|
+
export { findRfdbBinary, getPlatformDir, getBinaryNotFoundMessage } from './utils/findRfdbBinary.js';
|
|
21
|
+
export type { FindBinaryOptions } from './utils/findRfdbBinary.js';
|
|
20
22
|
export { NodeFactory } from './core/NodeFactory.js';
|
|
21
23
|
export { Profiler } from './core/Profiler.js';
|
|
22
24
|
export { computeSemanticId, parseSemanticId, computeDiscriminator } from './core/SemanticId.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EACL,YAAY,EACZ,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,WAAW,EACX,aAAa,EACb,eAAe,E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,wBAAwB,EACxB,eAAe,EACf,gBAAgB,EACjB,MAAM,yCAAyC,CAAC;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACrF,YAAY,EACV,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,QAAQ,EACR,QAAQ,GACT,MAAM,4BAA4B,CAAC;AACpC,YAAY,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAG7D,OAAO,EAAE,wBAAwB,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AACnF,YAAY,EACV,eAAe,EACf,cAAc,EACd,cAAc,EACd,WAAW,EACX,cAAc,EACd,cAAc,EACd,mBAAmB,GACpB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,WAAW,EAAE,eAAe,EAAE,yBAAyB,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACpK,YAAY,EACV,QAAQ,EACR,UAAU,EACV,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,aAAa,EACb,kBAAkB,EAClB,cAAc,EACd,uBAAuB,EACvB,uBAAuB,GACxB,MAAM,oBAAoB,CAAC;AAG5B,mBAAmB,gBAAgB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -18,6 +18,7 @@ export { GraphBackend, typeToKind, edgeTypeToNumber } from './core/GraphBackend.
|
|
|
18
18
|
// RFDB
|
|
19
19
|
export { RFDBClient } from '@grafema/rfdb-client';
|
|
20
20
|
export { RFDBServerBackend } from './storage/backends/RFDBServerBackend.js';
|
|
21
|
+
export { findRfdbBinary, getPlatformDir, getBinaryNotFoundMessage } from './utils/findRfdbBinary.js';
|
|
21
22
|
// Core utilities
|
|
22
23
|
export { NodeFactory } from './core/NodeFactory.js';
|
|
23
24
|
export { Profiler } from './core/Profiler.js';
|
|
@@ -26,6 +26,12 @@ import type { AttrQuery, GraphStats, GraphExport } from '../../core/GraphBackend
|
|
|
26
26
|
export interface RFDBServerBackendOptions {
|
|
27
27
|
socketPath?: string;
|
|
28
28
|
dbPath?: string;
|
|
29
|
+
/**
|
|
30
|
+
* If true, automatically start the server if not running.
|
|
31
|
+
* If false, require explicit `grafema server start`.
|
|
32
|
+
* Default: true (for backwards compatibility)
|
|
33
|
+
*/
|
|
34
|
+
autoStart?: boolean;
|
|
29
35
|
}
|
|
30
36
|
/**
|
|
31
37
|
* Input node format (flexible)
|
|
@@ -70,6 +76,7 @@ export interface BackendStats extends GraphStats {
|
|
|
70
76
|
export declare class RFDBServerBackend {
|
|
71
77
|
readonly socketPath: string;
|
|
72
78
|
readonly dbPath: string | undefined;
|
|
79
|
+
private readonly autoStart;
|
|
73
80
|
private client;
|
|
74
81
|
private serverProcess;
|
|
75
82
|
connected: boolean;
|
|
@@ -78,7 +85,9 @@ export declare class RFDBServerBackend {
|
|
|
78
85
|
private _cachedEdgeCounts;
|
|
79
86
|
constructor(options?: RFDBServerBackendOptions);
|
|
80
87
|
/**
|
|
81
|
-
* Connect to RFDB server
|
|
88
|
+
* Connect to RFDB server.
|
|
89
|
+
* If autoStart is true (default), starts the server if not running.
|
|
90
|
+
* If autoStart is false, requires explicit `grafema server start`.
|
|
82
91
|
*/
|
|
83
92
|
connect(): Promise<void>;
|
|
84
93
|
/**
|
|
@@ -86,11 +95,7 @@ export declare class RFDBServerBackend {
|
|
|
86
95
|
*/
|
|
87
96
|
initialize(): Promise<void>;
|
|
88
97
|
/**
|
|
89
|
-
* Find RFDB server binary
|
|
90
|
-
* 1. packages/rfdb-server/target/release (monorepo development - prioritized for dev)
|
|
91
|
-
* 2. packages/rfdb-server/target/debug
|
|
92
|
-
* 3. @grafema/rfdb npm package
|
|
93
|
-
* 4. ~/.local/bin/rfdb-server (user-installed binary)
|
|
98
|
+
* Find RFDB server binary using shared utility
|
|
94
99
|
*/
|
|
95
100
|
private _findServerBinary;
|
|
96
101
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RFDBServerBackend.d.ts","sourceRoot":"","sources":["../../../src/storage/backends/RFDBServerBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;
|
|
1
|
+
{"version":3,"file":"RFDBServerBackend.d.ts","sourceRoot":"","sources":["../../../src/storage/backends/RFDBServerBackend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AASH,OAAO,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAGrF;;GAEG;AACH,MAAM,WAAW,wBAAwB;IACvC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,CAAC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M,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;IAS9G;;OAEG;IACG,gBAAgB,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAKvD;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC;IAKxC;;OAEG;IACG,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC;QAAE,QAAQ,EAAE,KAAK,CAAC;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAAE,CAAC,CAAC;IAavG;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC;IASpC;;OAEG;IACG,SAAS,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,OAAO,GAAG,OAAO,CAAC,cAAc,EAAE,CAAC;IASxF,IAAI,KAAK,IAAI,IAAI,CAEhB;CACF;AAED,eAAe,iBAAiB,CAAC"}
|
|
@@ -21,14 +21,12 @@ import { RFDBClient } from '@grafema/rfdb-client';
|
|
|
21
21
|
import { existsSync, unlinkSync } from 'fs';
|
|
22
22
|
import { spawn } from 'child_process';
|
|
23
23
|
import { join, dirname } from 'path';
|
|
24
|
-
import { fileURLToPath } from 'url';
|
|
25
|
-
import { createRequire } from 'module';
|
|
26
24
|
import { setTimeout as sleep } from 'timers/promises';
|
|
27
|
-
|
|
28
|
-
const __dirname = dirname(__filename);
|
|
25
|
+
import { findRfdbBinary, getBinaryNotFoundMessage } from '../../utils/findRfdbBinary.js';
|
|
29
26
|
export class RFDBServerBackend {
|
|
30
27
|
socketPath;
|
|
31
28
|
dbPath;
|
|
29
|
+
autoStart;
|
|
32
30
|
client;
|
|
33
31
|
serverProcess;
|
|
34
32
|
connected; // Public for compatibility
|
|
@@ -37,6 +35,7 @@ export class RFDBServerBackend {
|
|
|
37
35
|
_cachedEdgeCounts;
|
|
38
36
|
constructor(options = {}) {
|
|
39
37
|
this.dbPath = options.dbPath;
|
|
38
|
+
this.autoStart = options.autoStart ?? true; // Default true for backwards compat
|
|
40
39
|
// Default socket path: next to the database in .grafema folder
|
|
41
40
|
// This ensures each project has its own socket, avoiding conflicts
|
|
42
41
|
if (options.socketPath) {
|
|
@@ -54,7 +53,9 @@ export class RFDBServerBackend {
|
|
|
54
53
|
this.edgeTypes = new Set();
|
|
55
54
|
}
|
|
56
55
|
/**
|
|
57
|
-
* Connect to RFDB server
|
|
56
|
+
* Connect to RFDB server.
|
|
57
|
+
* If autoStart is true (default), starts the server if not running.
|
|
58
|
+
* If autoStart is false, requires explicit `grafema server start`.
|
|
58
59
|
*/
|
|
59
60
|
async connect() {
|
|
60
61
|
if (this.connected)
|
|
@@ -66,14 +67,18 @@ export class RFDBServerBackend {
|
|
|
66
67
|
// Verify server is responsive
|
|
67
68
|
await this.client.ping();
|
|
68
69
|
this.connected = true;
|
|
69
|
-
console.log(`[RFDBServerBackend] Connected to
|
|
70
|
+
console.log(`[RFDBServerBackend] Connected to RFDB server at ${this.socketPath}`);
|
|
70
71
|
return;
|
|
71
72
|
}
|
|
72
73
|
catch {
|
|
73
|
-
// Server not running
|
|
74
|
+
// Server not running
|
|
75
|
+
if (!this.autoStart) {
|
|
76
|
+
throw new Error(`RFDB server not running at ${this.socketPath}\n` +
|
|
77
|
+
`Start the server first: grafema server start`);
|
|
78
|
+
}
|
|
74
79
|
console.log(`[RFDBServerBackend] RFDB server not running, starting...`);
|
|
75
80
|
}
|
|
76
|
-
// Start the server
|
|
81
|
+
// Start the server (only if autoStart is true)
|
|
77
82
|
await this._startServer();
|
|
78
83
|
// Connect again
|
|
79
84
|
this.client = new RFDBClient(this.socketPath);
|
|
@@ -89,59 +94,14 @@ export class RFDBServerBackend {
|
|
|
89
94
|
return this.connect();
|
|
90
95
|
}
|
|
91
96
|
/**
|
|
92
|
-
* Find RFDB server binary
|
|
93
|
-
* 1. packages/rfdb-server/target/release (monorepo development - prioritized for dev)
|
|
94
|
-
* 2. packages/rfdb-server/target/debug
|
|
95
|
-
* 3. @grafema/rfdb npm package
|
|
96
|
-
* 4. ~/.local/bin/rfdb-server (user-installed binary)
|
|
97
|
+
* Find RFDB server binary using shared utility
|
|
97
98
|
*/
|
|
98
99
|
_findServerBinary() {
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
if (existsSync(releaseBinary)) {
|
|
103
|
-
console.log(`[RFDBServerBackend] Found release binary: ${releaseBinary}`);
|
|
104
|
-
return releaseBinary;
|
|
105
|
-
}
|
|
106
|
-
// 2. Check debug build
|
|
107
|
-
const debugBinary = join(projectRoot, 'packages/rfdb-server/target/debug/rfdb-server');
|
|
108
|
-
if (existsSync(debugBinary)) {
|
|
109
|
-
console.log(`[RFDBServerBackend] Found debug binary: ${debugBinary}`);
|
|
110
|
-
return debugBinary;
|
|
111
|
-
}
|
|
112
|
-
// 3. Check @grafema/rfdb npm package
|
|
113
|
-
try {
|
|
114
|
-
const require = createRequire(import.meta.url);
|
|
115
|
-
const rfdbPkg = require.resolve('@grafema/rfdb');
|
|
116
|
-
const rfdbDir = dirname(rfdbPkg);
|
|
117
|
-
const platform = process.platform;
|
|
118
|
-
const arch = process.arch;
|
|
119
|
-
let platformDir;
|
|
120
|
-
if (platform === 'darwin') {
|
|
121
|
-
platformDir = arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
122
|
-
}
|
|
123
|
-
else if (platform === 'linux') {
|
|
124
|
-
platformDir = arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
platformDir = `${platform}-${arch}`;
|
|
128
|
-
}
|
|
129
|
-
const npmBinary = join(rfdbDir, 'prebuilt', platformDir, 'rfdb-server');
|
|
130
|
-
if (existsSync(npmBinary)) {
|
|
131
|
-
console.log(`[RFDBServerBackend] Found binary in @grafema/rfdb: ${npmBinary}`);
|
|
132
|
-
return npmBinary;
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
catch {
|
|
136
|
-
// @grafema/rfdb not installed
|
|
137
|
-
}
|
|
138
|
-
// 4. Check ~/.local/bin (user-installed binary for unsupported platforms)
|
|
139
|
-
const homeBinary = join(process.env.HOME || '', '.local', 'bin', 'rfdb-server');
|
|
140
|
-
if (existsSync(homeBinary)) {
|
|
141
|
-
console.log(`[RFDBServerBackend] Found user binary: ${homeBinary}`);
|
|
142
|
-
return homeBinary;
|
|
100
|
+
const binaryPath = findRfdbBinary();
|
|
101
|
+
if (binaryPath) {
|
|
102
|
+
console.log(`[RFDBServerBackend] Found binary: ${binaryPath}`);
|
|
143
103
|
}
|
|
144
|
-
return
|
|
104
|
+
return binaryPath;
|
|
145
105
|
}
|
|
146
106
|
/**
|
|
147
107
|
* Start RFDB server process
|
|
@@ -153,9 +113,7 @@ export class RFDBServerBackend {
|
|
|
153
113
|
// Find server binary - check multiple locations
|
|
154
114
|
const binaryPath = this._findServerBinary();
|
|
155
115
|
if (!binaryPath) {
|
|
156
|
-
throw new Error(
|
|
157
|
-
'Install @grafema/rfdb: npm install @grafema/rfdb\n' +
|
|
158
|
-
'Or build from source: cargo build --release --bin rfdb-server');
|
|
116
|
+
throw new Error(getBinaryNotFoundMessage());
|
|
159
117
|
}
|
|
160
118
|
// Remove stale socket
|
|
161
119
|
if (existsSync(this.socketPath)) {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for finding rfdb-server binary
|
|
3
|
+
*
|
|
4
|
+
* Used by:
|
|
5
|
+
* - RFDBServerBackend (core)
|
|
6
|
+
* - CLI server command
|
|
7
|
+
* - VS Code extension
|
|
8
|
+
* - rfdb-server bin wrapper
|
|
9
|
+
*
|
|
10
|
+
* Search order:
|
|
11
|
+
* 1. Explicit path (from config or flag)
|
|
12
|
+
* 2. GRAFEMA_RFDB_SERVER environment variable
|
|
13
|
+
* 3. Monorepo target/release (development)
|
|
14
|
+
* 4. Monorepo target/debug (development)
|
|
15
|
+
* 5. @grafema/rfdb npm package (prebuilt)
|
|
16
|
+
* 6. ~/.local/bin/rfdb-server (user-installed)
|
|
17
|
+
*/
|
|
18
|
+
export interface FindBinaryOptions {
|
|
19
|
+
/** Explicit path to binary (highest priority) */
|
|
20
|
+
explicitPath?: string;
|
|
21
|
+
/** Base directory for monorepo search (defaults to auto-detect) */
|
|
22
|
+
monorepoRoot?: string;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Get platform directory name for prebuilt binaries
|
|
26
|
+
*/
|
|
27
|
+
export declare function getPlatformDir(): string;
|
|
28
|
+
/**
|
|
29
|
+
* Find rfdb-server binary using standard search order
|
|
30
|
+
*
|
|
31
|
+
* @param options - Search options
|
|
32
|
+
* @returns Path to binary or null if not found
|
|
33
|
+
*/
|
|
34
|
+
export declare function findRfdbBinary(options?: FindBinaryOptions): string | null;
|
|
35
|
+
/**
|
|
36
|
+
* Get human-readable error message when binary not found
|
|
37
|
+
*/
|
|
38
|
+
export declare function getBinaryNotFoundMessage(): string;
|
|
39
|
+
//# sourceMappingURL=findRfdbBinary.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"findRfdbBinary.d.ts","sourceRoot":"","sources":["../../src/utils/findRfdbBinary.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH,MAAM,WAAW,iBAAiB;IAChC,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAUvC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,OAAO,GAAE,iBAAsB,GAAG,MAAM,GAAG,IAAI,CAoD7E;AA0BD;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,MAAM,CAwBjD"}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for finding rfdb-server binary
|
|
3
|
+
*
|
|
4
|
+
* Used by:
|
|
5
|
+
* - RFDBServerBackend (core)
|
|
6
|
+
* - CLI server command
|
|
7
|
+
* - VS Code extension
|
|
8
|
+
* - rfdb-server bin wrapper
|
|
9
|
+
*
|
|
10
|
+
* Search order:
|
|
11
|
+
* 1. Explicit path (from config or flag)
|
|
12
|
+
* 2. GRAFEMA_RFDB_SERVER environment variable
|
|
13
|
+
* 3. Monorepo target/release (development)
|
|
14
|
+
* 4. Monorepo target/debug (development)
|
|
15
|
+
* 5. @grafema/rfdb npm package (prebuilt)
|
|
16
|
+
* 6. ~/.local/bin/rfdb-server (user-installed)
|
|
17
|
+
*/
|
|
18
|
+
import { existsSync } from 'fs';
|
|
19
|
+
import { join, dirname, resolve } from 'path';
|
|
20
|
+
import { createRequire } from 'module';
|
|
21
|
+
import { fileURLToPath } from 'url';
|
|
22
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
23
|
+
const __dirname = dirname(__filename);
|
|
24
|
+
/**
|
|
25
|
+
* Get platform directory name for prebuilt binaries
|
|
26
|
+
*/
|
|
27
|
+
export function getPlatformDir() {
|
|
28
|
+
const platform = process.platform;
|
|
29
|
+
const arch = process.arch;
|
|
30
|
+
if (platform === 'darwin') {
|
|
31
|
+
return arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
32
|
+
}
|
|
33
|
+
else if (platform === 'linux') {
|
|
34
|
+
return arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
35
|
+
}
|
|
36
|
+
return `${platform}-${arch}`;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Find rfdb-server binary using standard search order
|
|
40
|
+
*
|
|
41
|
+
* @param options - Search options
|
|
42
|
+
* @returns Path to binary or null if not found
|
|
43
|
+
*/
|
|
44
|
+
export function findRfdbBinary(options = {}) {
|
|
45
|
+
// 1. Explicit path (from config or --binary flag)
|
|
46
|
+
if (options.explicitPath) {
|
|
47
|
+
const resolved = resolve(options.explicitPath);
|
|
48
|
+
if (existsSync(resolved)) {
|
|
49
|
+
return resolved;
|
|
50
|
+
}
|
|
51
|
+
// Explicit path was given but not found - don't fallback
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
// 2. Environment variable
|
|
55
|
+
const envBinary = process.env.GRAFEMA_RFDB_SERVER;
|
|
56
|
+
if (envBinary && existsSync(envBinary)) {
|
|
57
|
+
return envBinary;
|
|
58
|
+
}
|
|
59
|
+
// 3-4. Monorepo development builds
|
|
60
|
+
const monorepoRoot = options.monorepoRoot || findMonorepoRoot();
|
|
61
|
+
if (monorepoRoot) {
|
|
62
|
+
const releaseBinary = join(monorepoRoot, 'packages', 'rfdb-server', 'target', 'release', 'rfdb-server');
|
|
63
|
+
if (existsSync(releaseBinary)) {
|
|
64
|
+
return releaseBinary;
|
|
65
|
+
}
|
|
66
|
+
const debugBinary = join(monorepoRoot, 'packages', 'rfdb-server', 'target', 'debug', 'rfdb-server');
|
|
67
|
+
if (existsSync(debugBinary)) {
|
|
68
|
+
return debugBinary;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
// 5. @grafema/rfdb npm package
|
|
72
|
+
try {
|
|
73
|
+
const require = createRequire(import.meta.url);
|
|
74
|
+
const rfdbPkg = require.resolve('@grafema/rfdb');
|
|
75
|
+
const rfdbDir = dirname(rfdbPkg);
|
|
76
|
+
const platformDir = getPlatformDir();
|
|
77
|
+
const npmBinary = join(rfdbDir, 'prebuilt', platformDir, 'rfdb-server');
|
|
78
|
+
if (existsSync(npmBinary)) {
|
|
79
|
+
return npmBinary;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
catch {
|
|
83
|
+
// @grafema/rfdb not installed
|
|
84
|
+
}
|
|
85
|
+
// 6. User-installed binary in ~/.local/bin
|
|
86
|
+
const homeBinary = join(process.env.HOME || '', '.local', 'bin', 'rfdb-server');
|
|
87
|
+
if (existsSync(homeBinary)) {
|
|
88
|
+
return homeBinary;
|
|
89
|
+
}
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Find monorepo root by looking for characteristic files
|
|
94
|
+
*/
|
|
95
|
+
function findMonorepoRoot() {
|
|
96
|
+
// Start from this file's location and walk up
|
|
97
|
+
const searchPaths = [
|
|
98
|
+
// From packages/core/src/utils -> packages/core -> packages -> root
|
|
99
|
+
join(__dirname, '..', '..', '..', '..'),
|
|
100
|
+
// Common development locations
|
|
101
|
+
process.env.GRAFEMA_ROOT,
|
|
102
|
+
].filter(Boolean);
|
|
103
|
+
for (const candidate of searchPaths) {
|
|
104
|
+
// Check for grafema monorepo markers
|
|
105
|
+
const hasPackagesDir = existsSync(join(candidate, 'packages', 'core'));
|
|
106
|
+
const hasRfdbServer = existsSync(join(candidate, 'packages', 'rfdb-server', 'Cargo.toml'));
|
|
107
|
+
if (hasPackagesDir && hasRfdbServer) {
|
|
108
|
+
return candidate;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Get human-readable error message when binary not found
|
|
115
|
+
*/
|
|
116
|
+
export function getBinaryNotFoundMessage() {
|
|
117
|
+
const platformDir = getPlatformDir();
|
|
118
|
+
return `RFDB server binary not found for ${platformDir}
|
|
119
|
+
|
|
120
|
+
Options:
|
|
121
|
+
1. Specify path: grafema server start --binary /path/to/rfdb-server
|
|
122
|
+
|
|
123
|
+
2. Add to config.yaml:
|
|
124
|
+
server:
|
|
125
|
+
binaryPath: /path/to/rfdb-server
|
|
126
|
+
|
|
127
|
+
3. Set environment variable:
|
|
128
|
+
export GRAFEMA_RFDB_SERVER=/path/to/rfdb-server
|
|
129
|
+
|
|
130
|
+
4. Build from source and install:
|
|
131
|
+
git clone https://github.com/Disentinel/grafema.git
|
|
132
|
+
cd grafema/packages/rfdb-server
|
|
133
|
+
cargo build --release
|
|
134
|
+
mkdir -p ~/.local/bin
|
|
135
|
+
cp target/release/rfdb-server ~/.local/bin/
|
|
136
|
+
|
|
137
|
+
5. Install prebuilt (if available for your platform):
|
|
138
|
+
npm install @grafema/rfdb
|
|
139
|
+
`;
|
|
140
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grafema/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4-beta",
|
|
4
4
|
"description": "Core analysis engine for Grafema code analysis toolkit",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"node-source-walk": "^7.0.1",
|
|
43
43
|
"oxc-parser": "^0.96.0",
|
|
44
44
|
"yaml": "^2.8.2",
|
|
45
|
-
"@grafema/
|
|
46
|
-
"@grafema/
|
|
45
|
+
"@grafema/rfdb-client": "0.2.1-beta",
|
|
46
|
+
"@grafema/types": "0.2.4-beta"
|
|
47
47
|
},
|
|
48
48
|
"optionalDependencies": {
|
|
49
49
|
"@grafema/rfdb": "^0.1.0-alpha.2"
|
package/src/index.ts
CHANGED
|
@@ -52,6 +52,8 @@ export type { Node, Edge, EdgeType, AttrQuery, GraphStats, GraphExport } from '.
|
|
|
52
52
|
// RFDB
|
|
53
53
|
export { RFDBClient } from '@grafema/rfdb-client';
|
|
54
54
|
export { RFDBServerBackend } from './storage/backends/RFDBServerBackend.js';
|
|
55
|
+
export { findRfdbBinary, getPlatformDir, getBinaryNotFoundMessage } from './utils/findRfdbBinary.js';
|
|
56
|
+
export type { FindBinaryOptions } from './utils/findRfdbBinary.js';
|
|
55
57
|
|
|
56
58
|
// Core utilities
|
|
57
59
|
export { NodeFactory } from './core/NodeFactory.js';
|
|
@@ -22,17 +22,13 @@ import { RFDBClient } from '@grafema/rfdb-client';
|
|
|
22
22
|
import { existsSync, unlinkSync } from 'fs';
|
|
23
23
|
import { spawn, type ChildProcess } from 'child_process';
|
|
24
24
|
import { join, dirname } from 'path';
|
|
25
|
-
import { fileURLToPath } from 'url';
|
|
26
|
-
import { createRequire } from 'module';
|
|
27
25
|
import { setTimeout as sleep } from 'timers/promises';
|
|
28
26
|
|
|
29
27
|
import type { WireNode, WireEdge } from '@grafema/types';
|
|
30
28
|
import type { NodeType, EdgeType } from '@grafema/types';
|
|
31
29
|
import type { BaseNodeRecord, EdgeRecord } from '@grafema/types';
|
|
32
30
|
import type { AttrQuery, GraphStats, GraphExport } from '../../core/GraphBackend.js';
|
|
33
|
-
|
|
34
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
35
|
-
const __dirname = dirname(__filename);
|
|
31
|
+
import { findRfdbBinary, getBinaryNotFoundMessage } from '../../utils/findRfdbBinary.js';
|
|
36
32
|
|
|
37
33
|
/**
|
|
38
34
|
* Options for RFDBServerBackend
|
|
@@ -40,6 +36,12 @@ const __dirname = dirname(__filename);
|
|
|
40
36
|
export interface RFDBServerBackendOptions {
|
|
41
37
|
socketPath?: string;
|
|
42
38
|
dbPath?: string;
|
|
39
|
+
/**
|
|
40
|
+
* If true, automatically start the server if not running.
|
|
41
|
+
* If false, require explicit `grafema server start`.
|
|
42
|
+
* Default: true (for backwards compatibility)
|
|
43
|
+
*/
|
|
44
|
+
autoStart?: boolean;
|
|
43
45
|
}
|
|
44
46
|
|
|
45
47
|
/**
|
|
@@ -89,6 +91,7 @@ export interface BackendStats extends GraphStats {
|
|
|
89
91
|
export class RFDBServerBackend {
|
|
90
92
|
readonly socketPath: string;
|
|
91
93
|
readonly dbPath: string | undefined;
|
|
94
|
+
private readonly autoStart: boolean;
|
|
92
95
|
private client: RFDBClient | null;
|
|
93
96
|
private serverProcess: ChildProcess | null;
|
|
94
97
|
connected: boolean; // Public for compatibility
|
|
@@ -98,6 +101,7 @@ export class RFDBServerBackend {
|
|
|
98
101
|
|
|
99
102
|
constructor(options: RFDBServerBackendOptions = {}) {
|
|
100
103
|
this.dbPath = options.dbPath;
|
|
104
|
+
this.autoStart = options.autoStart ?? true; // Default true for backwards compat
|
|
101
105
|
// Default socket path: next to the database in .grafema folder
|
|
102
106
|
// This ensures each project has its own socket, avoiding conflicts
|
|
103
107
|
if (options.socketPath) {
|
|
@@ -114,7 +118,9 @@ export class RFDBServerBackend {
|
|
|
114
118
|
}
|
|
115
119
|
|
|
116
120
|
/**
|
|
117
|
-
* Connect to RFDB server
|
|
121
|
+
* Connect to RFDB server.
|
|
122
|
+
* If autoStart is true (default), starts the server if not running.
|
|
123
|
+
* If autoStart is false, requires explicit `grafema server start`.
|
|
118
124
|
*/
|
|
119
125
|
async connect(): Promise<void> {
|
|
120
126
|
if (this.connected) return;
|
|
@@ -127,14 +133,20 @@ export class RFDBServerBackend {
|
|
|
127
133
|
// Verify server is responsive
|
|
128
134
|
await this.client.ping();
|
|
129
135
|
this.connected = true;
|
|
130
|
-
console.log(`[RFDBServerBackend] Connected to
|
|
136
|
+
console.log(`[RFDBServerBackend] Connected to RFDB server at ${this.socketPath}`);
|
|
131
137
|
return;
|
|
132
138
|
} catch {
|
|
133
|
-
// Server not running
|
|
139
|
+
// Server not running
|
|
140
|
+
if (!this.autoStart) {
|
|
141
|
+
throw new Error(
|
|
142
|
+
`RFDB server not running at ${this.socketPath}\n` +
|
|
143
|
+
`Start the server first: grafema server start`
|
|
144
|
+
);
|
|
145
|
+
}
|
|
134
146
|
console.log(`[RFDBServerBackend] RFDB server not running, starting...`);
|
|
135
147
|
}
|
|
136
148
|
|
|
137
|
-
// Start the server
|
|
149
|
+
// Start the server (only if autoStart is true)
|
|
138
150
|
await this._startServer();
|
|
139
151
|
|
|
140
152
|
// Connect again
|
|
@@ -153,62 +165,14 @@ export class RFDBServerBackend {
|
|
|
153
165
|
}
|
|
154
166
|
|
|
155
167
|
/**
|
|
156
|
-
* Find RFDB server binary
|
|
157
|
-
* 1. packages/rfdb-server/target/release (monorepo development - prioritized for dev)
|
|
158
|
-
* 2. packages/rfdb-server/target/debug
|
|
159
|
-
* 3. @grafema/rfdb npm package
|
|
160
|
-
* 4. ~/.local/bin/rfdb-server (user-installed binary)
|
|
168
|
+
* Find RFDB server binary using shared utility
|
|
161
169
|
*/
|
|
162
170
|
private _findServerBinary(): string | null {
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
if (existsSync(releaseBinary)) {
|
|
167
|
-
console.log(`[RFDBServerBackend] Found release binary: ${releaseBinary}`);
|
|
168
|
-
return releaseBinary;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
// 2. Check debug build
|
|
172
|
-
const debugBinary = join(projectRoot, 'packages/rfdb-server/target/debug/rfdb-server');
|
|
173
|
-
if (existsSync(debugBinary)) {
|
|
174
|
-
console.log(`[RFDBServerBackend] Found debug binary: ${debugBinary}`);
|
|
175
|
-
return debugBinary;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
// 3. Check @grafema/rfdb npm package
|
|
179
|
-
try {
|
|
180
|
-
const require = createRequire(import.meta.url);
|
|
181
|
-
const rfdbPkg = require.resolve('@grafema/rfdb');
|
|
182
|
-
const rfdbDir = dirname(rfdbPkg);
|
|
183
|
-
const platform = process.platform;
|
|
184
|
-
const arch = process.arch;
|
|
185
|
-
|
|
186
|
-
let platformDir: string;
|
|
187
|
-
if (platform === 'darwin') {
|
|
188
|
-
platformDir = arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
189
|
-
} else if (platform === 'linux') {
|
|
190
|
-
platformDir = arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
191
|
-
} else {
|
|
192
|
-
platformDir = `${platform}-${arch}`;
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
const npmBinary = join(rfdbDir, 'prebuilt', platformDir, 'rfdb-server');
|
|
196
|
-
if (existsSync(npmBinary)) {
|
|
197
|
-
console.log(`[RFDBServerBackend] Found binary in @grafema/rfdb: ${npmBinary}`);
|
|
198
|
-
return npmBinary;
|
|
199
|
-
}
|
|
200
|
-
} catch {
|
|
201
|
-
// @grafema/rfdb not installed
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
// 4. Check ~/.local/bin (user-installed binary for unsupported platforms)
|
|
205
|
-
const homeBinary = join(process.env.HOME || '', '.local', 'bin', 'rfdb-server');
|
|
206
|
-
if (existsSync(homeBinary)) {
|
|
207
|
-
console.log(`[RFDBServerBackend] Found user binary: ${homeBinary}`);
|
|
208
|
-
return homeBinary;
|
|
171
|
+
const binaryPath = findRfdbBinary();
|
|
172
|
+
if (binaryPath) {
|
|
173
|
+
console.log(`[RFDBServerBackend] Found binary: ${binaryPath}`);
|
|
209
174
|
}
|
|
210
|
-
|
|
211
|
-
return null;
|
|
175
|
+
return binaryPath;
|
|
212
176
|
}
|
|
213
177
|
|
|
214
178
|
/**
|
|
@@ -222,11 +186,7 @@ export class RFDBServerBackend {
|
|
|
222
186
|
// Find server binary - check multiple locations
|
|
223
187
|
const binaryPath = this._findServerBinary();
|
|
224
188
|
if (!binaryPath) {
|
|
225
|
-
throw new Error(
|
|
226
|
-
'RFDB server binary not found.\n' +
|
|
227
|
-
'Install @grafema/rfdb: npm install @grafema/rfdb\n' +
|
|
228
|
-
'Or build from source: cargo build --release --bin rfdb-server'
|
|
229
|
-
);
|
|
189
|
+
throw new Error(getBinaryNotFoundMessage());
|
|
230
190
|
}
|
|
231
191
|
|
|
232
192
|
// Remove stale socket
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility for finding rfdb-server binary
|
|
3
|
+
*
|
|
4
|
+
* Used by:
|
|
5
|
+
* - RFDBServerBackend (core)
|
|
6
|
+
* - CLI server command
|
|
7
|
+
* - VS Code extension
|
|
8
|
+
* - rfdb-server bin wrapper
|
|
9
|
+
*
|
|
10
|
+
* Search order:
|
|
11
|
+
* 1. Explicit path (from config or flag)
|
|
12
|
+
* 2. GRAFEMA_RFDB_SERVER environment variable
|
|
13
|
+
* 3. Monorepo target/release (development)
|
|
14
|
+
* 4. Monorepo target/debug (development)
|
|
15
|
+
* 5. @grafema/rfdb npm package (prebuilt)
|
|
16
|
+
* 6. ~/.local/bin/rfdb-server (user-installed)
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { existsSync } from 'fs';
|
|
20
|
+
import { join, dirname, resolve } from 'path';
|
|
21
|
+
import { createRequire } from 'module';
|
|
22
|
+
import { fileURLToPath } from 'url';
|
|
23
|
+
|
|
24
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
25
|
+
const __dirname = dirname(__filename);
|
|
26
|
+
|
|
27
|
+
export interface FindBinaryOptions {
|
|
28
|
+
/** Explicit path to binary (highest priority) */
|
|
29
|
+
explicitPath?: string;
|
|
30
|
+
/** Base directory for monorepo search (defaults to auto-detect) */
|
|
31
|
+
monorepoRoot?: string;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Get platform directory name for prebuilt binaries
|
|
36
|
+
*/
|
|
37
|
+
export function getPlatformDir(): string {
|
|
38
|
+
const platform = process.platform;
|
|
39
|
+
const arch = process.arch;
|
|
40
|
+
|
|
41
|
+
if (platform === 'darwin') {
|
|
42
|
+
return arch === 'arm64' ? 'darwin-arm64' : 'darwin-x64';
|
|
43
|
+
} else if (platform === 'linux') {
|
|
44
|
+
return arch === 'arm64' ? 'linux-arm64' : 'linux-x64';
|
|
45
|
+
}
|
|
46
|
+
return `${platform}-${arch}`;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Find rfdb-server binary using standard search order
|
|
51
|
+
*
|
|
52
|
+
* @param options - Search options
|
|
53
|
+
* @returns Path to binary or null if not found
|
|
54
|
+
*/
|
|
55
|
+
export function findRfdbBinary(options: FindBinaryOptions = {}): string | null {
|
|
56
|
+
// 1. Explicit path (from config or --binary flag)
|
|
57
|
+
if (options.explicitPath) {
|
|
58
|
+
const resolved = resolve(options.explicitPath);
|
|
59
|
+
if (existsSync(resolved)) {
|
|
60
|
+
return resolved;
|
|
61
|
+
}
|
|
62
|
+
// Explicit path was given but not found - don't fallback
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// 2. Environment variable
|
|
67
|
+
const envBinary = process.env.GRAFEMA_RFDB_SERVER;
|
|
68
|
+
if (envBinary && existsSync(envBinary)) {
|
|
69
|
+
return envBinary;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// 3-4. Monorepo development builds
|
|
73
|
+
const monorepoRoot = options.monorepoRoot || findMonorepoRoot();
|
|
74
|
+
if (monorepoRoot) {
|
|
75
|
+
const releaseBinary = join(monorepoRoot, 'packages', 'rfdb-server', 'target', 'release', 'rfdb-server');
|
|
76
|
+
if (existsSync(releaseBinary)) {
|
|
77
|
+
return releaseBinary;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const debugBinary = join(monorepoRoot, 'packages', 'rfdb-server', 'target', 'debug', 'rfdb-server');
|
|
81
|
+
if (existsSync(debugBinary)) {
|
|
82
|
+
return debugBinary;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// 5. @grafema/rfdb npm package
|
|
87
|
+
try {
|
|
88
|
+
const require = createRequire(import.meta.url);
|
|
89
|
+
const rfdbPkg = require.resolve('@grafema/rfdb');
|
|
90
|
+
const rfdbDir = dirname(rfdbPkg);
|
|
91
|
+
const platformDir = getPlatformDir();
|
|
92
|
+
const npmBinary = join(rfdbDir, 'prebuilt', platformDir, 'rfdb-server');
|
|
93
|
+
if (existsSync(npmBinary)) {
|
|
94
|
+
return npmBinary;
|
|
95
|
+
}
|
|
96
|
+
} catch {
|
|
97
|
+
// @grafema/rfdb not installed
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 6. User-installed binary in ~/.local/bin
|
|
101
|
+
const homeBinary = join(process.env.HOME || '', '.local', 'bin', 'rfdb-server');
|
|
102
|
+
if (existsSync(homeBinary)) {
|
|
103
|
+
return homeBinary;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
return null;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Find monorepo root by looking for characteristic files
|
|
111
|
+
*/
|
|
112
|
+
function findMonorepoRoot(): string | null {
|
|
113
|
+
// Start from this file's location and walk up
|
|
114
|
+
const searchPaths = [
|
|
115
|
+
// From packages/core/src/utils -> packages/core -> packages -> root
|
|
116
|
+
join(__dirname, '..', '..', '..', '..'),
|
|
117
|
+
// Common development locations
|
|
118
|
+
process.env.GRAFEMA_ROOT,
|
|
119
|
+
].filter(Boolean) as string[];
|
|
120
|
+
|
|
121
|
+
for (const candidate of searchPaths) {
|
|
122
|
+
// Check for grafema monorepo markers
|
|
123
|
+
const hasPackagesDir = existsSync(join(candidate, 'packages', 'core'));
|
|
124
|
+
const hasRfdbServer = existsSync(join(candidate, 'packages', 'rfdb-server', 'Cargo.toml'));
|
|
125
|
+
if (hasPackagesDir && hasRfdbServer) {
|
|
126
|
+
return candidate;
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
/**
|
|
134
|
+
* Get human-readable error message when binary not found
|
|
135
|
+
*/
|
|
136
|
+
export function getBinaryNotFoundMessage(): string {
|
|
137
|
+
const platformDir = getPlatformDir();
|
|
138
|
+
return `RFDB server binary not found for ${platformDir}
|
|
139
|
+
|
|
140
|
+
Options:
|
|
141
|
+
1. Specify path: grafema server start --binary /path/to/rfdb-server
|
|
142
|
+
|
|
143
|
+
2. Add to config.yaml:
|
|
144
|
+
server:
|
|
145
|
+
binaryPath: /path/to/rfdb-server
|
|
146
|
+
|
|
147
|
+
3. Set environment variable:
|
|
148
|
+
export GRAFEMA_RFDB_SERVER=/path/to/rfdb-server
|
|
149
|
+
|
|
150
|
+
4. Build from source and install:
|
|
151
|
+
git clone https://github.com/Disentinel/grafema.git
|
|
152
|
+
cd grafema/packages/rfdb-server
|
|
153
|
+
cargo build --release
|
|
154
|
+
mkdir -p ~/.local/bin
|
|
155
|
+
cp target/release/rfdb-server ~/.local/bin/
|
|
156
|
+
|
|
157
|
+
5. Install prebuilt (if available for your platform):
|
|
158
|
+
npm install @grafema/rfdb
|
|
159
|
+
`;
|
|
160
|
+
}
|