@ff-labs/fff-node 0.10.4-nightly.e2cad2f → 0.10.5-dev.774d6bc
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/README.md +2 -2
- package/dist/binary.d.ts.map +1 -0
- package/dist/fff-api.d.ts.map +1 -0
- package/dist/ffi.d.ts.map +1 -0
- package/dist/finder.d.ts.map +1 -0
- package/dist/index.cjs +1533 -0
- package/dist/index.cjs.map +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1504 -0
- package/dist/index.js.map +14 -0
- package/dist/platform.d.ts.map +1 -0
- package/package.json +25 -18
- package/dist/src/binary.d.ts.map +0 -1
- package/dist/src/binary.js +0 -135
- package/dist/src/binary.js.map +0 -1
- package/dist/src/fff-api.d.ts.map +0 -1
- package/dist/src/fff-api.js +0 -24
- package/dist/src/fff-api.js.map +0 -1
- package/dist/src/ffi.d.ts.map +0 -1
- package/dist/src/ffi.js +0 -1365
- package/dist/src/ffi.js.map +0 -1
- package/dist/src/finder.d.ts.map +0 -1
- package/dist/src/finder.js +0 -528
- package/dist/src/finder.js.map +0 -1
- package/dist/src/index.d.ts.map +0 -1
- package/dist/src/index.js +0 -47
- package/dist/src/index.js.map +0 -1
- package/dist/src/platform.d.ts.map +0 -1
- package/dist/src/platform.js +0 -124
- package/dist/src/platform.js.map +0 -1
- /package/dist/{src/binary.d.ts → binary.d.ts} +0 -0
- /package/dist/{src/fff-api.d.ts → fff-api.d.ts} +0 -0
- /package/dist/{src/ffi.d.ts → ffi.d.ts} +0 -0
- /package/dist/{src/finder.d.ts → finder.d.ts} +0 -0
- /package/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/dist/{src/platform.d.ts → platform.d.ts} +0 -0
package/dist/src/index.js
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* fff - Fast File Finder
|
|
3
|
-
*
|
|
4
|
-
* High-performance fuzzy file finder for Node.js, powered by Rust.
|
|
5
|
-
* Perfect for LLM agent tools that need to search through codebases.
|
|
6
|
-
*
|
|
7
|
-
* Each `FileFinder` instance is backed by an independent native file picker.
|
|
8
|
-
* Create as many as you need and destroy them when done.
|
|
9
|
-
*
|
|
10
|
-
* Uses ffi-rs to load the same native libfff_c binary used by @ff-labs/fff-bun.
|
|
11
|
-
*
|
|
12
|
-
* @example
|
|
13
|
-
* ```typescript
|
|
14
|
-
* import { FileFinder } from "@ff-labs/fff-node";
|
|
15
|
-
*
|
|
16
|
-
* // Create a file finder instance
|
|
17
|
-
* const result = FileFinder.create({ basePath: "/path/to/project" });
|
|
18
|
-
* if (!result.ok) {
|
|
19
|
-
* console.error(result.error);
|
|
20
|
-
* process.exit(1);
|
|
21
|
-
* }
|
|
22
|
-
* const finder = result.value;
|
|
23
|
-
*
|
|
24
|
-
* // Wait for initial scan
|
|
25
|
-
* await finder.waitForScan(5000);
|
|
26
|
-
*
|
|
27
|
-
* // Search for files
|
|
28
|
-
* const search = finder.fileSearch("main.ts");
|
|
29
|
-
* if (search.ok) {
|
|
30
|
-
* for (const item of search.value.items) {
|
|
31
|
-
* console.log(item.relativePath);
|
|
32
|
-
* }
|
|
33
|
-
* }
|
|
34
|
-
*
|
|
35
|
-
* // Cleanup when done
|
|
36
|
-
* finder.destroy();
|
|
37
|
-
* ```
|
|
38
|
-
*
|
|
39
|
-
* @packageDocumentation
|
|
40
|
-
*/
|
|
41
|
-
export { binaryExists, findBinary, } from "./binary.js";
|
|
42
|
-
export { closeLibrary } from "./ffi.js";
|
|
43
|
-
// Result helpers
|
|
44
|
-
export { err, ok } from "./fff-api.js";
|
|
45
|
-
export { FileFinder } from "./finder.js";
|
|
46
|
-
export { getLibExtension, getLibFilename, getNpmPackageName, getTriple, } from "./platform.js";
|
|
47
|
-
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH,OAAO,EACL,YAAY,EACZ,UAAU,GACX,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AA8BxC,iBAAiB;AACjB,OAAO,EAAE,GAAG,EAAE,EAAE,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EACL,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,SAAS,GACV,MAAM,eAAe,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH;;GAEG;AACH,wBAAgB,SAAS,IAAI,MAAM,CAmBlC;AAyCD;;GAEG;AACH,wBAAgB,eAAe,IAAI,OAAO,GAAG,IAAI,GAAG,KAAK,CASxD;AAED;;GAEG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAErC;AAED;;GAEG;AACH,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAmBD;;;;;GAKG;AACH,wBAAgB,iBAAiB,IAAI,MAAM,CAO1C"}
|
package/dist/src/platform.js
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Platform detection utilities for downloading the correct binary
|
|
3
|
-
*/
|
|
4
|
-
import { execSync } from "node:child_process";
|
|
5
|
-
/**
|
|
6
|
-
* Get the platform triple (e.g., "x86_64-unknown-linux-gnu")
|
|
7
|
-
*/
|
|
8
|
-
export function getTriple() {
|
|
9
|
-
const platform = process.platform;
|
|
10
|
-
const arch = process.arch;
|
|
11
|
-
let osName;
|
|
12
|
-
if (platform === "darwin") {
|
|
13
|
-
osName = "apple-darwin";
|
|
14
|
-
}
|
|
15
|
-
else if (platform === "android") {
|
|
16
|
-
osName = "linux-android";
|
|
17
|
-
}
|
|
18
|
-
else if (platform === "linux") {
|
|
19
|
-
osName = detectLinuxLibc();
|
|
20
|
-
}
|
|
21
|
-
else if (platform === "win32") {
|
|
22
|
-
osName = "pc-windows-msvc";
|
|
23
|
-
}
|
|
24
|
-
else {
|
|
25
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
26
|
-
}
|
|
27
|
-
const archName = normalizeArch(arch);
|
|
28
|
-
return `${archName}-${osName}`;
|
|
29
|
-
}
|
|
30
|
-
/**
|
|
31
|
-
* Detect whether we're on musl or glibc Linux
|
|
32
|
-
*/
|
|
33
|
-
function detectLinuxLibc() {
|
|
34
|
-
let output = "";
|
|
35
|
-
try {
|
|
36
|
-
output = execSync("ldd --version 2>&1", {
|
|
37
|
-
encoding: "utf-8",
|
|
38
|
-
timeout: 5000,
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
catch (e) {
|
|
42
|
-
const err = e;
|
|
43
|
-
output = String(err?.stdout ?? "") + String(err?.stderr ?? "");
|
|
44
|
-
}
|
|
45
|
-
// ldd on musl can produce stdout with musl either with exit code 1 or 0
|
|
46
|
-
if (output.toLowerCase().includes("musl")) {
|
|
47
|
-
return "unknown-linux-musl";
|
|
48
|
-
}
|
|
49
|
-
return "unknown-linux-gnu";
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Normalize architecture name to Rust target format
|
|
53
|
-
*/
|
|
54
|
-
function normalizeArch(arch) {
|
|
55
|
-
switch (arch) {
|
|
56
|
-
case "x64":
|
|
57
|
-
case "amd64":
|
|
58
|
-
return "x86_64";
|
|
59
|
-
case "arm64":
|
|
60
|
-
return "aarch64";
|
|
61
|
-
case "arm":
|
|
62
|
-
return "arm";
|
|
63
|
-
default:
|
|
64
|
-
throw new Error(`Unsupported architecture: ${arch}`);
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
/**
|
|
68
|
-
* Get the library file extension for the current platform
|
|
69
|
-
*/
|
|
70
|
-
export function getLibExtension() {
|
|
71
|
-
switch (process.platform) {
|
|
72
|
-
case "darwin":
|
|
73
|
-
return "dylib";
|
|
74
|
-
case "win32":
|
|
75
|
-
return "dll";
|
|
76
|
-
default:
|
|
77
|
-
return "so";
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* Get the library filename prefix (empty on Windows)
|
|
82
|
-
*/
|
|
83
|
-
export function getLibPrefix() {
|
|
84
|
-
return process.platform === "win32" ? "" : "lib";
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Get the full library filename for the current platform
|
|
88
|
-
*/
|
|
89
|
-
export function getLibFilename() {
|
|
90
|
-
const prefix = getLibPrefix();
|
|
91
|
-
const ext = getLibExtension();
|
|
92
|
-
return `${prefix}fff_c.${ext}`;
|
|
93
|
-
}
|
|
94
|
-
/**
|
|
95
|
-
* Map from Rust target triple to npm platform package name.
|
|
96
|
-
* The @ff-labs/fff-bin-* packages contain the pre-built libfff_c
|
|
97
|
-
* shared library and are runtime-agnostic (used by both Bun and Node).
|
|
98
|
-
*/
|
|
99
|
-
const TRIPLE_TO_NPM_PACKAGE = {
|
|
100
|
-
"aarch64-apple-darwin": "@ff-labs/fff-bin-darwin-arm64",
|
|
101
|
-
"x86_64-apple-darwin": "@ff-labs/fff-bin-darwin-x64",
|
|
102
|
-
"x86_64-unknown-linux-gnu": "@ff-labs/fff-bin-linux-x64-gnu",
|
|
103
|
-
"aarch64-unknown-linux-gnu": "@ff-labs/fff-bin-linux-arm64-gnu",
|
|
104
|
-
"x86_64-unknown-linux-musl": "@ff-labs/fff-bin-linux-x64-musl",
|
|
105
|
-
"aarch64-unknown-linux-musl": "@ff-labs/fff-bin-linux-arm64-musl",
|
|
106
|
-
"x86_64-pc-windows-msvc": "@ff-labs/fff-bin-win32-x64",
|
|
107
|
-
"aarch64-pc-windows-msvc": "@ff-labs/fff-bin-win32-arm64",
|
|
108
|
-
"aarch64-linux-android": "@ff-labs/fff-bin-android-arm64",
|
|
109
|
-
};
|
|
110
|
-
/**
|
|
111
|
-
* Get the npm package name for the current platform's native binary.
|
|
112
|
-
*
|
|
113
|
-
* @returns Package name like "@ff-labs/fff-bin-darwin-arm64"
|
|
114
|
-
* @throws If the current platform is not supported
|
|
115
|
-
*/
|
|
116
|
-
export function getNpmPackageName() {
|
|
117
|
-
const triple = getTriple();
|
|
118
|
-
const packageName = TRIPLE_TO_NPM_PACKAGE[triple];
|
|
119
|
-
if (!packageName) {
|
|
120
|
-
throw new Error(`No npm package available for platform: ${triple}`);
|
|
121
|
-
}
|
|
122
|
-
return packageName;
|
|
123
|
-
}
|
|
124
|
-
//# sourceMappingURL=platform.js.map
|
package/dist/src/platform.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"platform.js","sourceRoot":"","sources":["../../src/platform.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C;;GAEG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;IAClC,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAE1B,IAAI,MAAc,CAAC;IACnB,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QAC1B,MAAM,GAAG,cAAc,CAAC;IAC1B,CAAC;SAAM,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAClC,MAAM,GAAG,eAAe,CAAC;IAC3B,CAAC;SAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QAChC,MAAM,GAAG,eAAe,EAAE,CAAC;IAC7B,CAAC;SAAM,IAAI,QAAQ,KAAK,OAAO,EAAE,CAAC;QAChC,MAAM,GAAG,iBAAiB,CAAC;IAC7B,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,yBAAyB,QAAQ,EAAE,CAAC,CAAC;IACvD,CAAC;IAED,MAAM,QAAQ,GAAG,aAAa,CAAC,IAAI,CAAC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QAAQ,KAAK,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,CAAC;AACnD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,cAAc;IAC5B,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,GAAG,GAAG,eAAe,EAAE,CAAC;IAC9B,OAAO,GAAG,MAAM,SAAS,GAAG,EAAE,CAAC;AACjC,CAAC;AAED;;;;GAIG;AACH,MAAM,qBAAqB,GAA2B;IACpD,sBAAsB,EAAE,+BAA+B;IACvD,qBAAqB,EAAE,6BAA6B;IACpD,0BAA0B,EAAE,gCAAgC;IAC5D,2BAA2B,EAAE,kCAAkC;IAC/D,2BAA2B,EAAE,iCAAiC;IAC9D,4BAA4B,EAAE,mCAAmC;IACjE,wBAAwB,EAAE,4BAA4B;IACtD,yBAAyB,EAAE,8BAA8B;IACzD,uBAAuB,EAAE,gCAAgC;CAC1D,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB;IAC/B,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,WAAW,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAClD,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,0CAA0C,MAAM,EAAE,CAAC,CAAC;IACtE,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|