@kreuzberg/tree-sitter-language-pack 1.0.0-rc.9 → 1.1.0
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 +18 -14
- package/index.d.ts +234 -55
- package/index.js +70 -115
- package/package.json +48 -56
- package/ts-pack-node.darwin-arm64.node +0 -0
- package/ts-pack-node.linux-arm64-gnu.node +0 -0
- package/ts-pack-node.linux-x64-gnu.node +0 -0
- package/ts-pack-node.win32-x64-msvc.node +0 -0
package/README.md
CHANGED
|
@@ -9,33 +9,37 @@
|
|
|
9
9
|
<img src="https://img.shields.io/pypi/v/tree-sitter-language-pack?label=Python&color=007ec6" alt="Python">
|
|
10
10
|
</a> <a href="https://www.npmjs.com/package/@kreuzberg/tree-sitter-language-pack">
|
|
11
11
|
<img src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack?label=Node.js&color=007ec6" alt="Node">
|
|
12
|
-
</a> <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/go/v1">
|
|
13
|
-
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/tree-sitter-language-pack?label=Go&color=007ec6" alt="Go">
|
|
14
|
-
</a> <a href="https://central.sonatype.com/artifact/dev.kreuzberg/tree-sitter-language-pack">
|
|
15
|
-
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg/tree-sitter-language-pack?label=Java&color=007ec6" alt="Java">
|
|
16
|
-
</a> <a href="https://hex.pm/packages/tree_sitter_language_pack">
|
|
17
|
-
<img src="https://img.shields.io/hexpm/v/tree_sitter_language_pack?label=Elixir&color=007ec6" alt="Elixir">
|
|
18
|
-
</a> <a href="https://rubygems.org/gems/tree_sitter_language_pack">
|
|
19
|
-
<img src="https://img.shields.io/gem/v/tree_sitter_language_pack?label=Ruby&color=007ec6" alt="Ruby">
|
|
20
12
|
</a> <a href="https://www.npmjs.com/package/@kreuzberg/tree-sitter-language-pack-wasm">
|
|
21
13
|
<img src="https://img.shields.io/npm/v/@kreuzberg/tree-sitter-language-pack-wasm?label=WASM&color=007ec6" alt="Wasm">
|
|
22
|
-
</a> <a href="https://
|
|
23
|
-
<img src="https://img.shields.io/
|
|
14
|
+
</a> <a href="https://central.sonatype.com/artifact/dev.kreuzberg/tree-sitter-language-pack">
|
|
15
|
+
<img src="https://img.shields.io/maven-central/v/dev.kreuzberg/tree-sitter-language-pack?label=Java&color=007ec6" alt="Java">
|
|
16
|
+
</a> <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/packages/go/v1">
|
|
17
|
+
<img src="https://img.shields.io/github/v/tag/kreuzberg-dev/tree-sitter-language-pack?label=Go&color=007ec6" alt="Go">
|
|
24
18
|
</a> <a href="https://www.nuget.org/packages/TreeSitterLanguagePack">
|
|
25
19
|
<img src="https://img.shields.io/nuget/v/TreeSitterLanguagePack?label=C%23&color=007ec6" alt="Csharp">
|
|
20
|
+
</a> <a href="https://packagist.org/packages/kreuzberg/tree-sitter-language-pack">
|
|
21
|
+
<img src="https://img.shields.io/packagist/v/kreuzberg/tree-sitter-language-pack?label=PHP&color=007ec6" alt="Php">
|
|
22
|
+
</a> <a href="https://rubygems.org/gems/tree_sitter_language_pack">
|
|
23
|
+
<img src="https://img.shields.io/gem/v/tree_sitter_language_pack?label=Ruby&color=007ec6" alt="Ruby">
|
|
24
|
+
</a> <a href="https://hex.pm/packages/tree_sitter_language_pack">
|
|
25
|
+
<img src="https://img.shields.io/hexpm/v/tree_sitter_language_pack?label=Elixir&color=007ec6" alt="Elixir">
|
|
26
|
+
</a> <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/pkgs/container/tree-sitter-language-pack">
|
|
27
|
+
<img src="https://img.shields.io/badge/Docker-007ec6?logo=docker&logoColor=white" alt="Docker">
|
|
28
|
+
</a> <a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/tree/main/crates/ts-pack-ffi">
|
|
29
|
+
<img src="https://img.shields.io/badge/C-FFI-007ec6" alt="Ffi">
|
|
26
30
|
</a>
|
|
27
31
|
<!-- Project Info -->
|
|
28
32
|
<a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/actions">
|
|
29
33
|
<img src="https://img.shields.io/github/actions/workflow/status/kreuzberg-dev/tree-sitter-language-pack/ci-rust.yaml?branch=main&label=CI" alt="CI">
|
|
30
34
|
</a>
|
|
31
35
|
<a href="https://github.com/kreuzberg-dev/tree-sitter-language-pack/blob/main/LICENSE">
|
|
32
|
-
<img src="https://img.shields.io/badge/License-MIT%20%7C%20Apache--2.0-blue" alt="License">
|
|
36
|
+
<img src="https://img.shields.io/badge/License-MIT%20%7C%20Apache--2.0-blue.svg" alt="License">
|
|
33
37
|
</a>
|
|
34
38
|
<a href="https://github.com/kreuzberg-dev/homebrew-tap">
|
|
35
39
|
<img src="https://img.shields.io/badge/homebrew-ts--pack-FBB040?logo=homebrew" alt="Homebrew">
|
|
36
40
|
</a>
|
|
37
|
-
<a href="https://docs.
|
|
38
|
-
<img src="https://img.shields.io/badge/docs-
|
|
41
|
+
<a href="https://docs.tree-sitter-language-pack.kreuzberg.dev">
|
|
42
|
+
<img src="https://img.shields.io/badge/docs-kreuzberg.dev-blue" alt="Docs">
|
|
39
43
|
</a>
|
|
40
44
|
</div>
|
|
41
45
|
|
|
@@ -109,7 +113,7 @@ For detailed API documentation, see the [Node.js package](https://github.com/kre
|
|
|
109
113
|
|
|
110
114
|
## License
|
|
111
115
|
|
|
112
|
-
MIT
|
|
116
|
+
MIT -- see [LICENSE](https://github.com/kreuzberg-dev/tree-sitter-language-pack/blob/main/LICENSE) for details.
|
|
113
117
|
|
|
114
118
|
---
|
|
115
119
|
|
package/index.d.ts
CHANGED
|
@@ -7,9 +7,198 @@ export declare class ExternalObject<T> {
|
|
|
7
7
|
[K: symbol]: T;
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
/** Byte and line/column span within source code. */
|
|
12
|
+
export interface Span {
|
|
13
|
+
startByte: number;
|
|
14
|
+
endByte: number;
|
|
15
|
+
startRow: number;
|
|
16
|
+
startCol: number;
|
|
17
|
+
endRow: number;
|
|
18
|
+
endCol: number;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Information about a single syntax tree node. */
|
|
22
|
+
export interface NodeInfo {
|
|
23
|
+
kind: string;
|
|
24
|
+
isNamed: boolean;
|
|
25
|
+
startByte: number;
|
|
26
|
+
endByte: number;
|
|
27
|
+
startRow: number;
|
|
28
|
+
startCol: number;
|
|
29
|
+
endRow: number;
|
|
30
|
+
endCol: number;
|
|
31
|
+
namedChildCount: number;
|
|
32
|
+
isError: boolean;
|
|
33
|
+
isMissing: boolean;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Aggregate metrics for a source file. */
|
|
37
|
+
export interface FileMetrics {
|
|
38
|
+
totalLines: number;
|
|
39
|
+
totalBytes: number;
|
|
40
|
+
blankLines: number;
|
|
41
|
+
commentLines: number;
|
|
42
|
+
codeLines: number;
|
|
43
|
+
errorCount: number;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** A structural item (function, class, method, etc.) in source code. */
|
|
47
|
+
export interface StructureItem {
|
|
48
|
+
kind: string;
|
|
49
|
+
name: string;
|
|
50
|
+
span: Span;
|
|
51
|
+
parent: string | null;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** An import statement extracted from source code. */
|
|
55
|
+
export interface ImportInfo {
|
|
56
|
+
module: string;
|
|
57
|
+
names: string[];
|
|
58
|
+
span: Span;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/** An export statement extracted from source code. */
|
|
62
|
+
export interface ExportInfo {
|
|
63
|
+
name: string;
|
|
64
|
+
kind: string;
|
|
65
|
+
span: Span;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** A comment extracted from source code. */
|
|
69
|
+
export interface CommentInfo {
|
|
70
|
+
text: string;
|
|
71
|
+
kind: string;
|
|
72
|
+
span: Span;
|
|
73
|
+
associatedNode: string | null;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** A docstring extracted from source code. */
|
|
77
|
+
export interface DocstringInfo {
|
|
78
|
+
text: string;
|
|
79
|
+
format: string;
|
|
80
|
+
span: Span;
|
|
81
|
+
associatedItem: string | null;
|
|
82
|
+
sections: Array<Record<string, string>>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/** A symbol (variable, function, type, etc.) extracted from source code. */
|
|
86
|
+
export interface SymbolInfo {
|
|
87
|
+
name: string;
|
|
88
|
+
kind: string;
|
|
89
|
+
span: Span;
|
|
90
|
+
typeAnnotation: string | null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** A diagnostic (syntax error, missing node, etc.) from parsing. */
|
|
94
|
+
export interface Diagnostic {
|
|
95
|
+
message: string;
|
|
96
|
+
severity: string;
|
|
97
|
+
span: Span;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** Metadata for a single chunk of source code. */
|
|
101
|
+
export interface ChunkContext {
|
|
102
|
+
language: string;
|
|
103
|
+
chunkIndex: number;
|
|
104
|
+
totalChunks: number;
|
|
105
|
+
startLine: number;
|
|
106
|
+
endLine: number;
|
|
107
|
+
nodeTypes: string[];
|
|
108
|
+
symbolsDefined: string[];
|
|
109
|
+
comments: string[];
|
|
110
|
+
docstrings: string[];
|
|
111
|
+
hasErrorNodes: boolean;
|
|
112
|
+
contextPath: string[];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** A chunk of source code with rich metadata. */
|
|
116
|
+
export interface CodeChunk {
|
|
117
|
+
content: string;
|
|
118
|
+
startByte: number;
|
|
119
|
+
endByte: number;
|
|
120
|
+
metadata: ChunkContext;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
/** Complete analysis result from processing a source file. */
|
|
124
|
+
export interface ProcessResult {
|
|
125
|
+
language: string;
|
|
126
|
+
metrics: FileMetrics;
|
|
127
|
+
structure: StructureItem[];
|
|
128
|
+
imports: ImportInfo[];
|
|
129
|
+
exports: ExportInfo[];
|
|
130
|
+
comments: CommentInfo[];
|
|
131
|
+
docstrings: DocstringInfo[];
|
|
132
|
+
symbols: SymbolInfo[];
|
|
133
|
+
diagnostics: Diagnostic[];
|
|
134
|
+
chunks: CodeChunk[];
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** A single query capture pairing a capture name with a node. */
|
|
138
|
+
export interface QueryCapture {
|
|
139
|
+
captureName: string;
|
|
140
|
+
node: NodeInfo;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** A single pattern match from a tree-sitter query. */
|
|
144
|
+
export interface QueryMatch {
|
|
145
|
+
patternIndex: number;
|
|
146
|
+
captures: QueryCapture[];
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/** Result of resolving a file-extension ambiguity. */
|
|
150
|
+
export interface AmbiguityResult {
|
|
151
|
+
assigned: string;
|
|
152
|
+
alternatives: string[];
|
|
153
|
+
}
|
|
154
|
+
|
|
10
155
|
/** Returns an array of all available language names. */
|
|
11
156
|
export declare function availableLanguages(): Array<string>;
|
|
12
157
|
|
|
158
|
+
/**
|
|
159
|
+
* Get the effective cache directory being used.
|
|
160
|
+
*
|
|
161
|
+
* Returns the path as a string. Throws an error if cache directory cannot be determined.
|
|
162
|
+
*/
|
|
163
|
+
export declare function cacheDir(): string;
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Delete all cached parser files.
|
|
167
|
+
*
|
|
168
|
+
* Throws an error if cache deletion fails.
|
|
169
|
+
*/
|
|
170
|
+
export declare function cleanCache(): void;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Configure the cache directory without downloading.
|
|
174
|
+
*
|
|
175
|
+
* Throws an error if configuration fails.
|
|
176
|
+
*/
|
|
177
|
+
export declare function configure(config: JsPackConfig): void;
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Download specific languages by name.
|
|
181
|
+
*
|
|
182
|
+
* Returns the number of languages successfully downloaded.
|
|
183
|
+
* Throws an error if download fails.
|
|
184
|
+
*/
|
|
185
|
+
export declare function download(names: Array<string>): number;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Download all 170+ available languages from the remote manifest.
|
|
189
|
+
*
|
|
190
|
+
* Returns the number of languages successfully downloaded.
|
|
191
|
+
* Throws an error if download fails.
|
|
192
|
+
*/
|
|
193
|
+
export declare function downloadAll(): number;
|
|
194
|
+
|
|
195
|
+
/**
|
|
196
|
+
* Get all languages that have been downloaded and cached locally.
|
|
197
|
+
*
|
|
198
|
+
* Returns an array of language names currently in the cache.
|
|
199
|
+
*/
|
|
200
|
+
export declare function downloadedLanguages(): Array<string>;
|
|
201
|
+
|
|
13
202
|
/**
|
|
14
203
|
* Returns the raw TSLanguage pointer for interop with node-tree-sitter.
|
|
15
204
|
*
|
|
@@ -20,6 +209,20 @@ export declare function getLanguagePtr(name: string): number;
|
|
|
20
209
|
/** Checks whether a language with the given name is available. */
|
|
21
210
|
export declare function hasLanguage(name: string): boolean;
|
|
22
211
|
|
|
212
|
+
/**
|
|
213
|
+
* Initialize download system with configuration and pre-download all specified languages.
|
|
214
|
+
*
|
|
215
|
+
* Throws an error if configuration or download fails.
|
|
216
|
+
*/
|
|
217
|
+
export declare function init(config?: JsPackConfig | undefined | null): void;
|
|
218
|
+
|
|
219
|
+
/** Configuration for download and cache management. */
|
|
220
|
+
export interface JsPackConfig {
|
|
221
|
+
cacheDir?: string;
|
|
222
|
+
languages?: Array<string>;
|
|
223
|
+
groups?: Array<string>;
|
|
224
|
+
}
|
|
225
|
+
|
|
23
226
|
/** Configuration for the `process` function. */
|
|
24
227
|
export interface JsProcessConfig {
|
|
25
228
|
language: string;
|
|
@@ -36,24 +239,30 @@ export interface JsProcessConfig {
|
|
|
36
239
|
/** Returns the number of available languages. */
|
|
37
240
|
export declare function languageCount(): number;
|
|
38
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Get all available languages from the remote manifest.
|
|
244
|
+
*
|
|
245
|
+
* Returns an array of language names. Throws an error if manifest fetch fails.
|
|
246
|
+
*/
|
|
247
|
+
export declare function manifestLanguages(): Array<string>;
|
|
248
|
+
|
|
39
249
|
/**
|
|
40
250
|
* Parse a source string using the named language and return an opaque tree handle.
|
|
41
251
|
*
|
|
42
252
|
* Throws an error if the language is not found or parsing fails.
|
|
43
253
|
*/
|
|
44
|
-
export declare function parseString(
|
|
45
|
-
language: string,
|
|
46
|
-
source: string,
|
|
47
|
-
): ExternalObject<Tree>;
|
|
254
|
+
export declare function parseString(language: string, source: string): ExternalObject<Tree>;
|
|
48
255
|
|
|
49
|
-
/**
|
|
50
|
-
|
|
256
|
+
/**
|
|
257
|
+
* Process source code using a config and return a result object with metadata and chunks.
|
|
258
|
+
*
|
|
259
|
+
* Accepts both camelCase and snake_case config keys (auto-normalized to snake_case).
|
|
260
|
+
* Returns camelCase keys in the result for JavaScript convention.
|
|
261
|
+
*/
|
|
262
|
+
export declare function process(source: string, config: JsProcessConfig): ProcessResult;
|
|
51
263
|
|
|
52
264
|
/** Check whether any node in the tree has the given type name. */
|
|
53
|
-
export declare function treeContainsNodeType(
|
|
54
|
-
tree: ExternalObject<Tree>,
|
|
55
|
-
nodeType: string,
|
|
56
|
-
): boolean;
|
|
265
|
+
export declare function treeContainsNodeType(tree: ExternalObject<Tree>, nodeType: string): boolean;
|
|
57
266
|
|
|
58
267
|
/** Check whether the tree contains any ERROR or MISSING nodes. */
|
|
59
268
|
export declare function treeHasErrorNodes(tree: ExternalObject<Tree>): boolean;
|
|
@@ -64,67 +273,37 @@ export declare function treeRootChildCount(tree: ExternalObject<Tree>): number;
|
|
|
64
273
|
/** Get the type name of the root node. */
|
|
65
274
|
export declare function treeRootNodeType(tree: ExternalObject<Tree>): string;
|
|
66
275
|
|
|
67
|
-
/** Configuration for download and cache management. */
|
|
68
|
-
export interface JsPackConfig {
|
|
69
|
-
cacheDir?: string;
|
|
70
|
-
languages?: Array<string>;
|
|
71
|
-
groups?: Array<string>;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
276
|
/**
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* Throws an error if configuration or download fails.
|
|
78
|
-
*/
|
|
79
|
-
export declare function init(config?: JsPackConfig): void;
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Configure the cache directory without downloading.
|
|
83
|
-
*
|
|
84
|
-
* Throws an error if configuration fails.
|
|
85
|
-
*/
|
|
86
|
-
export declare function configure(config?: JsPackConfig): void;
|
|
87
|
-
|
|
88
|
-
/**
|
|
89
|
-
* Download specific languages by name.
|
|
90
|
-
*
|
|
91
|
-
* Returns the number of languages successfully downloaded.
|
|
92
|
-
* Throws an error if download fails.
|
|
93
|
-
*/
|
|
94
|
-
export declare function download(names: Array<string>): number;
|
|
95
|
-
|
|
96
|
-
/**
|
|
97
|
-
* Download all 170+ available languages from the remote manifest.
|
|
277
|
+
* Detect language from source content using heuristics.
|
|
98
278
|
*
|
|
99
|
-
* Returns the
|
|
100
|
-
* Throws an error if download fails.
|
|
279
|
+
* Returns the detected language name, or null if detection fails.
|
|
101
280
|
*/
|
|
102
|
-
export declare function
|
|
281
|
+
export declare function detectLanguageFromContent(content: string): string | null;
|
|
103
282
|
|
|
104
283
|
/**
|
|
105
|
-
*
|
|
284
|
+
* Resolve ambiguity for a file extension that maps to multiple languages.
|
|
106
285
|
*
|
|
107
|
-
* Returns
|
|
286
|
+
* Returns the assigned language and alternatives, or null if no ambiguity exists.
|
|
108
287
|
*/
|
|
109
|
-
export declare function
|
|
288
|
+
export declare function extensionAmbiguity(ext: string): AmbiguityResult | null;
|
|
110
289
|
|
|
111
290
|
/**
|
|
112
|
-
* Get
|
|
291
|
+
* Get the highlights query string for a language.
|
|
113
292
|
*
|
|
114
|
-
* Returns
|
|
293
|
+
* Returns the query source, or null if no highlights query is available.
|
|
115
294
|
*/
|
|
116
|
-
export declare function
|
|
295
|
+
export declare function getHighlightsQuery(language: string): string | null;
|
|
117
296
|
|
|
118
297
|
/**
|
|
119
|
-
*
|
|
298
|
+
* Get the injections query string for a language.
|
|
120
299
|
*
|
|
121
|
-
*
|
|
300
|
+
* Returns the query source, or null if no injections query is available.
|
|
122
301
|
*/
|
|
123
|
-
export declare function
|
|
302
|
+
export declare function getInjectionsQuery(language: string): string | null;
|
|
124
303
|
|
|
125
304
|
/**
|
|
126
|
-
* Get the
|
|
305
|
+
* Get the locals query string for a language.
|
|
127
306
|
*
|
|
128
|
-
* Returns the
|
|
307
|
+
* Returns the query source, or null if no locals query is available.
|
|
129
308
|
*/
|
|
130
|
-
export declare function
|
|
309
|
+
export declare function getLocalsQuery(language: string): string | null;
|
package/index.js
CHANGED
|
@@ -53,9 +53,7 @@ const isMuslFromReport = () => {
|
|
|
53
53
|
|
|
54
54
|
const isMuslFromChildProcess = () => {
|
|
55
55
|
try {
|
|
56
|
-
return require("child_process")
|
|
57
|
-
.execSync("ldd --version", { encoding: "utf8" })
|
|
58
|
-
.includes("musl");
|
|
56
|
+
return require("child_process").execSync("ldd --version", { encoding: "utf8" }).includes("musl");
|
|
59
57
|
} catch (e) {
|
|
60
58
|
// If we reach this case, we don't know if the system is musl or not, so is better to just fallback to false
|
|
61
59
|
return false;
|
|
@@ -81,12 +79,12 @@ function requireNative() {
|
|
|
81
79
|
const bindingPackageVersion =
|
|
82
80
|
require("@kreuzberg/tree-sitter-language-pack-android-arm64/package.json").version;
|
|
83
81
|
if (
|
|
84
|
-
bindingPackageVersion !== "1.
|
|
82
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
85
83
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
86
84
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
87
85
|
) {
|
|
88
86
|
throw new Error(
|
|
89
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
87
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
90
88
|
);
|
|
91
89
|
}
|
|
92
90
|
return binding;
|
|
@@ -104,12 +102,12 @@ function requireNative() {
|
|
|
104
102
|
const bindingPackageVersion =
|
|
105
103
|
require("@kreuzberg/tree-sitter-language-pack-android-arm-eabi/package.json").version;
|
|
106
104
|
if (
|
|
107
|
-
bindingPackageVersion !== "1.
|
|
105
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
108
106
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
109
107
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
110
108
|
) {
|
|
111
109
|
throw new Error(
|
|
112
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
110
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
113
111
|
);
|
|
114
112
|
}
|
|
115
113
|
return binding;
|
|
@@ -117,9 +115,7 @@ function requireNative() {
|
|
|
117
115
|
loadErrors.push(e);
|
|
118
116
|
}
|
|
119
117
|
} else {
|
|
120
|
-
loadErrors.push(
|
|
121
|
-
new Error(`Unsupported architecture on Android ${process.arch}`),
|
|
122
|
-
);
|
|
118
|
+
loadErrors.push(new Error(`Unsupported architecture on Android ${process.arch}`));
|
|
123
119
|
}
|
|
124
120
|
} else if (process.platform === "win32") {
|
|
125
121
|
if (process.arch === "x64") {
|
|
@@ -137,12 +133,12 @@ function requireNative() {
|
|
|
137
133
|
const bindingPackageVersion =
|
|
138
134
|
require("@kreuzberg/tree-sitter-language-pack-win32-x64-gnu/package.json").version;
|
|
139
135
|
if (
|
|
140
|
-
bindingPackageVersion !== "1.
|
|
136
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
141
137
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
142
138
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
143
139
|
) {
|
|
144
140
|
throw new Error(
|
|
145
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
141
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
146
142
|
);
|
|
147
143
|
}
|
|
148
144
|
return binding;
|
|
@@ -160,12 +156,12 @@ function requireNative() {
|
|
|
160
156
|
const bindingPackageVersion =
|
|
161
157
|
require("@kreuzberg/tree-sitter-language-pack-win32-x64-msvc/package.json").version;
|
|
162
158
|
if (
|
|
163
|
-
bindingPackageVersion !== "1.
|
|
159
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
164
160
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
165
161
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
166
162
|
) {
|
|
167
163
|
throw new Error(
|
|
168
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
164
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
169
165
|
);
|
|
170
166
|
}
|
|
171
167
|
return binding;
|
|
@@ -184,12 +180,12 @@ function requireNative() {
|
|
|
184
180
|
const bindingPackageVersion =
|
|
185
181
|
require("@kreuzberg/tree-sitter-language-pack-win32-ia32-msvc/package.json").version;
|
|
186
182
|
if (
|
|
187
|
-
bindingPackageVersion !== "1.
|
|
183
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
188
184
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
189
185
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
190
186
|
) {
|
|
191
187
|
throw new Error(
|
|
192
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
188
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
193
189
|
);
|
|
194
190
|
}
|
|
195
191
|
return binding;
|
|
@@ -207,12 +203,12 @@ function requireNative() {
|
|
|
207
203
|
const bindingPackageVersion =
|
|
208
204
|
require("@kreuzberg/tree-sitter-language-pack-win32-arm64-msvc/package.json").version;
|
|
209
205
|
if (
|
|
210
|
-
bindingPackageVersion !== "1.
|
|
206
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
211
207
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
212
208
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
213
209
|
) {
|
|
214
210
|
throw new Error(
|
|
215
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
211
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
216
212
|
);
|
|
217
213
|
}
|
|
218
214
|
return binding;
|
|
@@ -220,9 +216,7 @@ function requireNative() {
|
|
|
220
216
|
loadErrors.push(e);
|
|
221
217
|
}
|
|
222
218
|
} else {
|
|
223
|
-
loadErrors.push(
|
|
224
|
-
new Error(`Unsupported architecture on Windows: ${process.arch}`),
|
|
225
|
-
);
|
|
219
|
+
loadErrors.push(new Error(`Unsupported architecture on Windows: ${process.arch}`));
|
|
226
220
|
}
|
|
227
221
|
} else if (process.platform === "darwin") {
|
|
228
222
|
try {
|
|
@@ -235,42 +229,19 @@ function requireNative() {
|
|
|
235
229
|
const bindingPackageVersion =
|
|
236
230
|
require("@kreuzberg/tree-sitter-language-pack-darwin-universal/package.json").version;
|
|
237
231
|
if (
|
|
238
|
-
bindingPackageVersion !== "1.
|
|
232
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
239
233
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
240
234
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
241
235
|
) {
|
|
242
236
|
throw new Error(
|
|
243
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
237
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
244
238
|
);
|
|
245
239
|
}
|
|
246
240
|
return binding;
|
|
247
241
|
} catch (e) {
|
|
248
242
|
loadErrors.push(e);
|
|
249
243
|
}
|
|
250
|
-
if (process.arch === "
|
|
251
|
-
try {
|
|
252
|
-
return require("./ts-pack-node.darwin-x64.node");
|
|
253
|
-
} catch (e) {
|
|
254
|
-
loadErrors.push(e);
|
|
255
|
-
}
|
|
256
|
-
try {
|
|
257
|
-
const binding = require("@kreuzberg/tree-sitter-language-pack-darwin-x64");
|
|
258
|
-
const bindingPackageVersion =
|
|
259
|
-
require("@kreuzberg/tree-sitter-language-pack-darwin-x64/package.json").version;
|
|
260
|
-
if (
|
|
261
|
-
bindingPackageVersion !== "1.0.0-rc.9" &&
|
|
262
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
263
|
-
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
264
|
-
) {
|
|
265
|
-
throw new Error(
|
|
266
|
-
`Native binding package version mismatch, expected 1.0.0-rc.9 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
267
|
-
);
|
|
268
|
-
}
|
|
269
|
-
return binding;
|
|
270
|
-
} catch (e) {
|
|
271
|
-
loadErrors.push(e);
|
|
272
|
-
}
|
|
273
|
-
} else if (process.arch === "arm64") {
|
|
244
|
+
if (process.arch === "arm64") {
|
|
274
245
|
try {
|
|
275
246
|
return require("./ts-pack-node.darwin-arm64.node");
|
|
276
247
|
} catch (e) {
|
|
@@ -278,15 +249,14 @@ function requireNative() {
|
|
|
278
249
|
}
|
|
279
250
|
try {
|
|
280
251
|
const binding = require("@kreuzberg/tree-sitter-language-pack-darwin-arm64");
|
|
281
|
-
const bindingPackageVersion =
|
|
282
|
-
require("@kreuzberg/tree-sitter-language-pack-darwin-arm64/package.json").version;
|
|
252
|
+
const bindingPackageVersion = require("@kreuzberg/tree-sitter-language-pack-darwin-arm64/package.json").version;
|
|
283
253
|
if (
|
|
284
|
-
bindingPackageVersion !== "1.
|
|
254
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
285
255
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
286
256
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
287
257
|
) {
|
|
288
258
|
throw new Error(
|
|
289
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
259
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
290
260
|
);
|
|
291
261
|
}
|
|
292
262
|
return binding;
|
|
@@ -294,9 +264,7 @@ function requireNative() {
|
|
|
294
264
|
loadErrors.push(e);
|
|
295
265
|
}
|
|
296
266
|
} else {
|
|
297
|
-
loadErrors.push(
|
|
298
|
-
new Error(`Unsupported architecture on macOS: ${process.arch}`),
|
|
299
|
-
);
|
|
267
|
+
loadErrors.push(new Error(`Unsupported architecture on macOS: ${process.arch}`));
|
|
300
268
|
}
|
|
301
269
|
} else if (process.platform === "freebsd") {
|
|
302
270
|
if (process.arch === "x64") {
|
|
@@ -307,15 +275,14 @@ function requireNative() {
|
|
|
307
275
|
}
|
|
308
276
|
try {
|
|
309
277
|
const binding = require("@kreuzberg/tree-sitter-language-pack-freebsd-x64");
|
|
310
|
-
const bindingPackageVersion =
|
|
311
|
-
require("@kreuzberg/tree-sitter-language-pack-freebsd-x64/package.json").version;
|
|
278
|
+
const bindingPackageVersion = require("@kreuzberg/tree-sitter-language-pack-freebsd-x64/package.json").version;
|
|
312
279
|
if (
|
|
313
|
-
bindingPackageVersion !== "1.
|
|
280
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
314
281
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
315
282
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
316
283
|
) {
|
|
317
284
|
throw new Error(
|
|
318
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
285
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
319
286
|
);
|
|
320
287
|
}
|
|
321
288
|
return binding;
|
|
@@ -333,12 +300,12 @@ function requireNative() {
|
|
|
333
300
|
const bindingPackageVersion =
|
|
334
301
|
require("@kreuzberg/tree-sitter-language-pack-freebsd-arm64/package.json").version;
|
|
335
302
|
if (
|
|
336
|
-
bindingPackageVersion !== "1.
|
|
303
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
337
304
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
338
305
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
339
306
|
) {
|
|
340
307
|
throw new Error(
|
|
341
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
308
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
342
309
|
);
|
|
343
310
|
}
|
|
344
311
|
return binding;
|
|
@@ -346,9 +313,7 @@ function requireNative() {
|
|
|
346
313
|
loadErrors.push(e);
|
|
347
314
|
}
|
|
348
315
|
} else {
|
|
349
|
-
loadErrors.push(
|
|
350
|
-
new Error(`Unsupported architecture on FreeBSD: ${process.arch}`),
|
|
351
|
-
);
|
|
316
|
+
loadErrors.push(new Error(`Unsupported architecture on FreeBSD: ${process.arch}`));
|
|
352
317
|
}
|
|
353
318
|
} else if (process.platform === "linux") {
|
|
354
319
|
if (process.arch === "x64") {
|
|
@@ -363,12 +328,12 @@ function requireNative() {
|
|
|
363
328
|
const bindingPackageVersion =
|
|
364
329
|
require("@kreuzberg/tree-sitter-language-pack-linux-x64-musl/package.json").version;
|
|
365
330
|
if (
|
|
366
|
-
bindingPackageVersion !== "1.
|
|
331
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
367
332
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
368
333
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
369
334
|
) {
|
|
370
335
|
throw new Error(
|
|
371
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
336
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
372
337
|
);
|
|
373
338
|
}
|
|
374
339
|
return binding;
|
|
@@ -386,12 +351,12 @@ function requireNative() {
|
|
|
386
351
|
const bindingPackageVersion =
|
|
387
352
|
require("@kreuzberg/tree-sitter-language-pack-linux-x64-gnu/package.json").version;
|
|
388
353
|
if (
|
|
389
|
-
bindingPackageVersion !== "1.
|
|
354
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
390
355
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
391
356
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
392
357
|
) {
|
|
393
358
|
throw new Error(
|
|
394
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
359
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
395
360
|
);
|
|
396
361
|
}
|
|
397
362
|
return binding;
|
|
@@ -411,12 +376,12 @@ function requireNative() {
|
|
|
411
376
|
const bindingPackageVersion =
|
|
412
377
|
require("@kreuzberg/tree-sitter-language-pack-linux-arm64-musl/package.json").version;
|
|
413
378
|
if (
|
|
414
|
-
bindingPackageVersion !== "1.
|
|
379
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
415
380
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
416
381
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
417
382
|
) {
|
|
418
383
|
throw new Error(
|
|
419
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
384
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
420
385
|
);
|
|
421
386
|
}
|
|
422
387
|
return binding;
|
|
@@ -434,12 +399,12 @@ function requireNative() {
|
|
|
434
399
|
const bindingPackageVersion =
|
|
435
400
|
require("@kreuzberg/tree-sitter-language-pack-linux-arm64-gnu/package.json").version;
|
|
436
401
|
if (
|
|
437
|
-
bindingPackageVersion !== "1.
|
|
402
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
438
403
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
439
404
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
440
405
|
) {
|
|
441
406
|
throw new Error(
|
|
442
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
407
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
443
408
|
);
|
|
444
409
|
}
|
|
445
410
|
return binding;
|
|
@@ -459,12 +424,12 @@ function requireNative() {
|
|
|
459
424
|
const bindingPackageVersion =
|
|
460
425
|
require("@kreuzberg/tree-sitter-language-pack-linux-arm-musleabihf/package.json").version;
|
|
461
426
|
if (
|
|
462
|
-
bindingPackageVersion !== "1.
|
|
427
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
463
428
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
464
429
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
465
430
|
) {
|
|
466
431
|
throw new Error(
|
|
467
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
432
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
468
433
|
);
|
|
469
434
|
}
|
|
470
435
|
return binding;
|
|
@@ -482,12 +447,12 @@ function requireNative() {
|
|
|
482
447
|
const bindingPackageVersion =
|
|
483
448
|
require("@kreuzberg/tree-sitter-language-pack-linux-arm-gnueabihf/package.json").version;
|
|
484
449
|
if (
|
|
485
|
-
bindingPackageVersion !== "1.
|
|
450
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
486
451
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
487
452
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
488
453
|
) {
|
|
489
454
|
throw new Error(
|
|
490
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
455
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
491
456
|
);
|
|
492
457
|
}
|
|
493
458
|
return binding;
|
|
@@ -507,12 +472,12 @@ function requireNative() {
|
|
|
507
472
|
const bindingPackageVersion =
|
|
508
473
|
require("@kreuzberg/tree-sitter-language-pack-linux-loong64-musl/package.json").version;
|
|
509
474
|
if (
|
|
510
|
-
bindingPackageVersion !== "1.
|
|
475
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
511
476
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
512
477
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
513
478
|
) {
|
|
514
479
|
throw new Error(
|
|
515
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
480
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
516
481
|
);
|
|
517
482
|
}
|
|
518
483
|
return binding;
|
|
@@ -530,12 +495,12 @@ function requireNative() {
|
|
|
530
495
|
const bindingPackageVersion =
|
|
531
496
|
require("@kreuzberg/tree-sitter-language-pack-linux-loong64-gnu/package.json").version;
|
|
532
497
|
if (
|
|
533
|
-
bindingPackageVersion !== "1.
|
|
498
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
534
499
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
535
500
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
536
501
|
) {
|
|
537
502
|
throw new Error(
|
|
538
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
503
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
539
504
|
);
|
|
540
505
|
}
|
|
541
506
|
return binding;
|
|
@@ -555,12 +520,12 @@ function requireNative() {
|
|
|
555
520
|
const bindingPackageVersion =
|
|
556
521
|
require("@kreuzberg/tree-sitter-language-pack-linux-riscv64-musl/package.json").version;
|
|
557
522
|
if (
|
|
558
|
-
bindingPackageVersion !== "1.
|
|
523
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
559
524
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
560
525
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
561
526
|
) {
|
|
562
527
|
throw new Error(
|
|
563
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
528
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
564
529
|
);
|
|
565
530
|
}
|
|
566
531
|
return binding;
|
|
@@ -578,12 +543,12 @@ function requireNative() {
|
|
|
578
543
|
const bindingPackageVersion =
|
|
579
544
|
require("@kreuzberg/tree-sitter-language-pack-linux-riscv64-gnu/package.json").version;
|
|
580
545
|
if (
|
|
581
|
-
bindingPackageVersion !== "1.
|
|
546
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
582
547
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
583
548
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
584
549
|
) {
|
|
585
550
|
throw new Error(
|
|
586
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
551
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
587
552
|
);
|
|
588
553
|
}
|
|
589
554
|
return binding;
|
|
@@ -602,12 +567,12 @@ function requireNative() {
|
|
|
602
567
|
const bindingPackageVersion =
|
|
603
568
|
require("@kreuzberg/tree-sitter-language-pack-linux-ppc64-gnu/package.json").version;
|
|
604
569
|
if (
|
|
605
|
-
bindingPackageVersion !== "1.
|
|
570
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
606
571
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
607
572
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
608
573
|
) {
|
|
609
574
|
throw new Error(
|
|
610
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
575
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
611
576
|
);
|
|
612
577
|
}
|
|
613
578
|
return binding;
|
|
@@ -625,12 +590,12 @@ function requireNative() {
|
|
|
625
590
|
const bindingPackageVersion =
|
|
626
591
|
require("@kreuzberg/tree-sitter-language-pack-linux-s390x-gnu/package.json").version;
|
|
627
592
|
if (
|
|
628
|
-
bindingPackageVersion !== "1.
|
|
593
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
629
594
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
630
595
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
631
596
|
) {
|
|
632
597
|
throw new Error(
|
|
633
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
598
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
634
599
|
);
|
|
635
600
|
}
|
|
636
601
|
return binding;
|
|
@@ -638,9 +603,7 @@ function requireNative() {
|
|
|
638
603
|
loadErrors.push(e);
|
|
639
604
|
}
|
|
640
605
|
} else {
|
|
641
|
-
loadErrors.push(
|
|
642
|
-
new Error(`Unsupported architecture on Linux: ${process.arch}`),
|
|
643
|
-
);
|
|
606
|
+
loadErrors.push(new Error(`Unsupported architecture on Linux: ${process.arch}`));
|
|
644
607
|
}
|
|
645
608
|
} else if (process.platform === "openharmony") {
|
|
646
609
|
if (process.arch === "arm64") {
|
|
@@ -654,12 +617,12 @@ function requireNative() {
|
|
|
654
617
|
const bindingPackageVersion =
|
|
655
618
|
require("@kreuzberg/tree-sitter-language-pack-openharmony-arm64/package.json").version;
|
|
656
619
|
if (
|
|
657
|
-
bindingPackageVersion !== "1.
|
|
620
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
658
621
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
659
622
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
660
623
|
) {
|
|
661
624
|
throw new Error(
|
|
662
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
625
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
663
626
|
);
|
|
664
627
|
}
|
|
665
628
|
return binding;
|
|
@@ -677,12 +640,12 @@ function requireNative() {
|
|
|
677
640
|
const bindingPackageVersion =
|
|
678
641
|
require("@kreuzberg/tree-sitter-language-pack-openharmony-x64/package.json").version;
|
|
679
642
|
if (
|
|
680
|
-
bindingPackageVersion !== "1.
|
|
643
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
681
644
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
682
645
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
683
646
|
) {
|
|
684
647
|
throw new Error(
|
|
685
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
648
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
686
649
|
);
|
|
687
650
|
}
|
|
688
651
|
return binding;
|
|
@@ -700,12 +663,12 @@ function requireNative() {
|
|
|
700
663
|
const bindingPackageVersion =
|
|
701
664
|
require("@kreuzberg/tree-sitter-language-pack-openharmony-arm/package.json").version;
|
|
702
665
|
if (
|
|
703
|
-
bindingPackageVersion !== "1.
|
|
666
|
+
bindingPackageVersion !== "1.1.0" &&
|
|
704
667
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK &&
|
|
705
668
|
process.env.NAPI_RS_ENFORCE_VERSION_CHECK !== "0"
|
|
706
669
|
) {
|
|
707
670
|
throw new Error(
|
|
708
|
-
`Native binding package version mismatch, expected 1.0.0
|
|
671
|
+
`Native binding package version mismatch, expected 1.0.0 but got ${bindingPackageVersion}. You can reinstall dependencies to fix this issue.`,
|
|
709
672
|
);
|
|
710
673
|
}
|
|
711
674
|
return binding;
|
|
@@ -713,16 +676,10 @@ function requireNative() {
|
|
|
713
676
|
loadErrors.push(e);
|
|
714
677
|
}
|
|
715
678
|
} else {
|
|
716
|
-
loadErrors.push(
|
|
717
|
-
new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`),
|
|
718
|
-
);
|
|
679
|
+
loadErrors.push(new Error(`Unsupported architecture on OpenHarmony: ${process.arch}`));
|
|
719
680
|
}
|
|
720
681
|
} else {
|
|
721
|
-
loadErrors.push(
|
|
722
|
-
new Error(
|
|
723
|
-
`Unsupported OS: ${process.platform}, architecture: ${process.arch}`,
|
|
724
|
-
),
|
|
725
|
-
);
|
|
682
|
+
loadErrors.push(new Error(`Unsupported OS: ${process.platform}, architecture: ${process.arch}`));
|
|
726
683
|
}
|
|
727
684
|
}
|
|
728
685
|
|
|
@@ -755,9 +712,7 @@ if (!nativeBinding || process.env.NAPI_RS_FORCE_WASI) {
|
|
|
755
712
|
}
|
|
756
713
|
}
|
|
757
714
|
if (process.env.NAPI_RS_FORCE_WASI === "error" && !wasiBinding) {
|
|
758
|
-
const error = new Error(
|
|
759
|
-
"WASI binding not found and NAPI_RS_FORCE_WASI is set to error",
|
|
760
|
-
);
|
|
715
|
+
const error = new Error("WASI binding not found and NAPI_RS_FORCE_WASI is set to error");
|
|
761
716
|
error.cause = wasiBindingError;
|
|
762
717
|
throw error;
|
|
763
718
|
}
|
|
@@ -782,20 +737,20 @@ if (!nativeBinding) {
|
|
|
782
737
|
|
|
783
738
|
module.exports = nativeBinding;
|
|
784
739
|
module.exports.availableLanguages = nativeBinding.availableLanguages;
|
|
740
|
+
module.exports.cacheDir = nativeBinding.cacheDir;
|
|
741
|
+
module.exports.cleanCache = nativeBinding.cleanCache;
|
|
742
|
+
module.exports.configure = nativeBinding.configure;
|
|
743
|
+
module.exports.download = nativeBinding.download;
|
|
744
|
+
module.exports.downloadAll = nativeBinding.downloadAll;
|
|
745
|
+
module.exports.downloadedLanguages = nativeBinding.downloadedLanguages;
|
|
785
746
|
module.exports.getLanguagePtr = nativeBinding.getLanguagePtr;
|
|
786
747
|
module.exports.hasLanguage = nativeBinding.hasLanguage;
|
|
748
|
+
module.exports.init = nativeBinding.init;
|
|
787
749
|
module.exports.languageCount = nativeBinding.languageCount;
|
|
750
|
+
module.exports.manifestLanguages = nativeBinding.manifestLanguages;
|
|
788
751
|
module.exports.parseString = nativeBinding.parseString;
|
|
789
752
|
module.exports.process = nativeBinding.process;
|
|
790
753
|
module.exports.treeContainsNodeType = nativeBinding.treeContainsNodeType;
|
|
791
754
|
module.exports.treeHasErrorNodes = nativeBinding.treeHasErrorNodes;
|
|
792
755
|
module.exports.treeRootChildCount = nativeBinding.treeRootChildCount;
|
|
793
756
|
module.exports.treeRootNodeType = nativeBinding.treeRootNodeType;
|
|
794
|
-
module.exports.init = nativeBinding.init;
|
|
795
|
-
module.exports.download = nativeBinding.download;
|
|
796
|
-
module.exports.downloadAll = nativeBinding.downloadAll;
|
|
797
|
-
module.exports.configure = nativeBinding.configure;
|
|
798
|
-
module.exports.manifestLanguages = nativeBinding.manifestLanguages;
|
|
799
|
-
module.exports.downloadedLanguages = nativeBinding.downloadedLanguages;
|
|
800
|
-
module.exports.cleanCache = nativeBinding.cleanCache;
|
|
801
|
-
module.exports.cacheDir = nativeBinding.cacheDir;
|
package/package.json
CHANGED
|
@@ -1,57 +1,49 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
"optionalDependencies": {
|
|
51
|
-
"@kreuzberg/tree-sitter-language-pack-darwin-x64": "1.0.0-rc.9",
|
|
52
|
-
"@kreuzberg/tree-sitter-language-pack-darwin-arm64": "1.0.0-rc.9",
|
|
53
|
-
"@kreuzberg/tree-sitter-language-pack-linux-x64-gnu": "1.0.0-rc.9",
|
|
54
|
-
"@kreuzberg/tree-sitter-language-pack-linux-arm64-gnu": "1.0.0-rc.9",
|
|
55
|
-
"@kreuzberg/tree-sitter-language-pack-win32-x64-msvc": "1.0.0-rc.9"
|
|
56
|
-
}
|
|
57
|
-
}
|
|
2
|
+
"name": "@kreuzberg/tree-sitter-language-pack",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "Tree-sitter language pack - pre-compiled parsers for 197 languages (Node.js NAPI bindings)",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"index.js",
|
|
9
|
+
"index.d.ts",
|
|
10
|
+
"*.node"
|
|
11
|
+
],
|
|
12
|
+
"napi": {
|
|
13
|
+
"binaryName": "ts-pack-node",
|
|
14
|
+
"targets": [
|
|
15
|
+
"aarch64-apple-darwin",
|
|
16
|
+
"x86_64-unknown-linux-gnu",
|
|
17
|
+
"aarch64-unknown-linux-gnu",
|
|
18
|
+
"x86_64-pc-windows-msvc"
|
|
19
|
+
]
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">= 16"
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/kreuzberg-dev/tree-sitter-language-pack"
|
|
27
|
+
},
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"registry": "https://registry.npmjs.org/",
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"artifacts": "napi artifacts",
|
|
34
|
+
"build": "napi build --platform --release",
|
|
35
|
+
"prepublishOnly": "napi prepublish -t npm --skip-optional-publish"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"tree-sitter",
|
|
39
|
+
"parser",
|
|
40
|
+
"syntax",
|
|
41
|
+
"napi",
|
|
42
|
+
"language-pack",
|
|
43
|
+
"kreuzberg"
|
|
44
|
+
],
|
|
45
|
+
"license": "MIT",
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@napi-rs/cli": "^3.5.1"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|