@grepai/cli 0.4.10 → 0.4.11
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grepai/cli",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "CLI for semantic code search. It uses vector embeddings to understand code meaning, enabling natural language queries that find relevant code—even when naming conventions vary.",
|
|
5
5
|
"homepage": "https://github.com/bismuth1991/grepai-ts#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
},
|
|
18
18
|
"files": [
|
|
19
19
|
"index.js",
|
|
20
|
-
"index.js.map"
|
|
20
|
+
"index.js.map",
|
|
21
|
+
"patches/"
|
|
21
22
|
],
|
|
22
23
|
"publishConfig": {
|
|
23
24
|
"access": "public"
|
|
@@ -37,5 +38,8 @@
|
|
|
37
38
|
"@libsql/linux-x64-gnu": "0.4.7",
|
|
38
39
|
"@libsql/linux-x64-musl": "0.4.7",
|
|
39
40
|
"@libsql/win32-x64-msvc": "0.4.7"
|
|
41
|
+
},
|
|
42
|
+
"patchedDependencies": {
|
|
43
|
+
"tree-sitter@0.25.0": "patches/tree-sitter@0.25.0.patch"
|
|
40
44
|
}
|
|
41
45
|
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
diff --git a/index.js b/index.js
|
|
2
|
+
index 9a57b3652ff41b8046c89c498802f6318ee78ff1..7087569e032b19712e86603a70c40d7b7c8c61d1 100644
|
|
3
|
+
--- a/index.js
|
|
4
|
+
+++ b/index.js
|
|
5
|
+
@@ -1,6 +1,6 @@
|
|
6
|
+
const binding = typeof process.versions.bun === "string" ?
|
|
7
|
+
// Statically analyzable enough for `bun build --compile` to embed the tree-sitter.node napi addon
|
|
8
|
+
- require(`./prebuilds/${process.platform}-${process.arch}/tree-sitter.node`) :
|
|
9
|
+
+ require('./build/Release/tree_sitter_runtime_binding.node') :
|
|
10
|
+
require('node-gyp-build')(__dirname);
|
|
11
|
+
const {Query, Parser, NodeMethods, Tree, TreeCursor, LookaheadIterator} = binding;
|
|
12
|
+
|
|
13
|
+
@@ -18,10 +18,10 @@ Object.defineProperty(Tree.prototype, 'rootNode', {
|
|
14
|
+
Due to a race condition arising from Jest's worker pool, "this"
|
|
15
|
+
has no knowledge of the native extension if the extension has not
|
|
16
|
+
yet loaded when multiple Jest tests are being run simultaneously.
|
|
17
|
+
- If the extension has correctly loaded, "this" should be an instance
|
|
18
|
+
+ If the extension has correctly loaded, "this" should be an instance
|
|
19
|
+
of the class whose prototype we are acting on (in this case, Tree).
|
|
20
|
+
- Furthermore, the race condition sometimes results in the function in
|
|
21
|
+
- question being undefined even when the context is correct, so we also
|
|
22
|
+
+ Furthermore, the race condition sometimes results in the function in
|
|
23
|
+
+ question being undefined even when the context is correct, so we also
|
|
24
|
+
perform a null function check.
|
|
25
|
+
*/
|
|
26
|
+
if (this instanceof Tree && rootNode) {
|