@xberg-io/tree-sitter-language-pack 1.22.0 → 1.23.1
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 +14 -1
- package/binding.cjs +138 -0
- package/index.d.ts +7 -1
- package/index.js +1 -1
- package/index.mjs +60 -0
- package/package.json +18 -16
- package/ts-pack-core-node.darwin-arm64.node +0 -0
- package/ts-pack-core-node.darwin-x64.node +0 -0
- package/ts-pack-core-node.linux-arm64-gnu.node +0 -0
- package/ts-pack-core-node.linux-arm64-musl.node +0 -0
- package/ts-pack-core-node.linux-x64-gnu.node +0 -0
- package/ts-pack-core-node.linux-x64-musl.node +0 -0
- package/ts-pack-core-node.win32-arm64-msvc.node +0 -0
- package/ts-pack-core-node.win32-x64-msvc.node +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- This file is auto-generated by alef — DO NOT EDIT. -->
|
|
2
|
-
<!-- alef:hash:
|
|
2
|
+
<!-- alef:hash:472efed54a83eedfce2d008fe63ea7808fca8966c95230f4d3a1ea8b25edb0f9 -->
|
|
3
3
|
<!-- To regenerate: alef readme -->
|
|
4
4
|
<!-- To verify freshness: alef verify -->
|
|
5
5
|
|
|
@@ -116,6 +116,19 @@ Pre-compiled tree-sitter grammars for 372 programming languages with TypeScript
|
|
|
116
116
|
npm install @xberg-io/tree-sitter-language-pack
|
|
117
117
|
```
|
|
118
118
|
|
|
119
|
+
## Coding-agent plugin
|
|
120
|
+
|
|
121
|
+
Install the [tree-sitter-language-pack plugin](https://github.com/xberg-io/tree-sitter-language-pack/blob/main/plugin/README.md)
|
|
122
|
+
for product skills and runtime integrations, or install [public skills](https://github.com/xberg-io/tree-sitter-language-pack/tree/main/skills)
|
|
123
|
+
independently:
|
|
124
|
+
|
|
125
|
+
```sh
|
|
126
|
+
npx skills add xberg-io/tree-sitter-language-pack
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Select the skills and target agents interactively. Install the product CLI separately for
|
|
130
|
+
executable operations; the skill installer adds instructions only.
|
|
131
|
+
|
|
119
132
|
## Quick Start
|
|
120
133
|
|
|
121
134
|
```typescript title="TypeScript"
|
package/binding.cjs
ADDED
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
// DO NOT EDIT - auto-generated by alef
|
|
2
|
+
// alef:hash:b5a84836004f3b1787dc4ddf756b1f8dd85684282f90c6b508552bd1861b3f61
|
|
3
|
+
"use strict";
|
|
4
|
+
|
|
5
|
+
// The native binding attaches the structured properties of a failed call to the thrown error as
|
|
6
|
+
// the JSON message of its `cause`: the napi runtime cannot set own properties on an error that an
|
|
7
|
+
// async Rust function returns. This module moves those properties onto the error itself, so a
|
|
8
|
+
// caller reads `error.kind`, `error.statusCode`, `error.retryAfter` and the rest as declared in
|
|
9
|
+
// `index.d.ts`. It wraps every exported function, every static and prototype method of an
|
|
10
|
+
// exported class, and the async iterator a streaming call returns.
|
|
11
|
+
// Constructors are not wrapped: a constructor that throws keeps the plain native error.
|
|
12
|
+
|
|
13
|
+
const MARKER = "alef:error-info:";
|
|
14
|
+
const SKIP = new Set(["constructor", "length", "name", "prototype", "caller", "arguments"]);
|
|
15
|
+
const patched = new WeakSet();
|
|
16
|
+
const iterables = new WeakSet();
|
|
17
|
+
|
|
18
|
+
function decorate(error) {
|
|
19
|
+
if (error === null || typeof error !== "object") return error;
|
|
20
|
+
const cause = error.cause;
|
|
21
|
+
if (cause === null || typeof cause !== "object" || typeof cause.message !== "string") return error;
|
|
22
|
+
if (!cause.message.startsWith(MARKER)) return error;
|
|
23
|
+
let info;
|
|
24
|
+
try {
|
|
25
|
+
info = JSON.parse(cause.message.slice(MARKER.length));
|
|
26
|
+
} catch {
|
|
27
|
+
return error;
|
|
28
|
+
}
|
|
29
|
+
for (const [name, value] of Object.entries(info)) {
|
|
30
|
+
Object.defineProperty(error, name, { value, enumerable: true, writable: true, configurable: true });
|
|
31
|
+
}
|
|
32
|
+
try {
|
|
33
|
+
delete error.cause;
|
|
34
|
+
} catch {
|
|
35
|
+
// The payload stays on the cause when the runtime refuses the delete.
|
|
36
|
+
}
|
|
37
|
+
return error;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function rethrow(error) {
|
|
41
|
+
throw decorate(error);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function wrapIterator(iterator) {
|
|
45
|
+
if (iterator === null || typeof iterator !== "object") return iterator;
|
|
46
|
+
for (const name of ["next", "return", "throw"]) {
|
|
47
|
+
const original = iterator[name];
|
|
48
|
+
if (typeof original !== "function") continue;
|
|
49
|
+
try {
|
|
50
|
+
Object.defineProperty(iterator, name, {
|
|
51
|
+
configurable: true,
|
|
52
|
+
writable: true,
|
|
53
|
+
value: function (...args) {
|
|
54
|
+
return Promise.resolve(original.apply(this, args)).then(undefined, rethrow);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
57
|
+
} catch {
|
|
58
|
+
// A frozen iterator keeps its plain errors.
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return iterator;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
function wrapIterable(value) {
|
|
65
|
+
if (value === null || typeof value !== "object") return value;
|
|
66
|
+
const open = value[Symbol.asyncIterator];
|
|
67
|
+
if (typeof open !== "function" || iterables.has(value)) return value;
|
|
68
|
+
iterables.add(value);
|
|
69
|
+
try {
|
|
70
|
+
Object.defineProperty(value, Symbol.asyncIterator, {
|
|
71
|
+
configurable: true,
|
|
72
|
+
writable: true,
|
|
73
|
+
value: function () {
|
|
74
|
+
return wrapIterator(open.call(this));
|
|
75
|
+
},
|
|
76
|
+
});
|
|
77
|
+
} catch {
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
wrapIterator(value);
|
|
81
|
+
return value;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function settle(result) {
|
|
85
|
+
if (result !== null && typeof result === "object" && typeof result.then === "function") {
|
|
86
|
+
return result.then(wrapIterable, rethrow);
|
|
87
|
+
}
|
|
88
|
+
return wrapIterable(result);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
function wrapFunction(fn) {
|
|
92
|
+
return function (...args) {
|
|
93
|
+
let result;
|
|
94
|
+
try {
|
|
95
|
+
result = fn.apply(this, args);
|
|
96
|
+
} catch (error) {
|
|
97
|
+
throw decorate(error);
|
|
98
|
+
}
|
|
99
|
+
return settle(result);
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
function patchMethods(target) {
|
|
104
|
+
if (target === null || (typeof target !== "object" && typeof target !== "function")) return;
|
|
105
|
+
if (patched.has(target)) return;
|
|
106
|
+
patched.add(target);
|
|
107
|
+
for (const key of Reflect.ownKeys(target)) {
|
|
108
|
+
if (typeof key === "string" && SKIP.has(key)) continue;
|
|
109
|
+
const descriptor = Object.getOwnPropertyDescriptor(target, key);
|
|
110
|
+
if (!descriptor || typeof descriptor.value !== "function" || !descriptor.configurable) continue;
|
|
111
|
+
try {
|
|
112
|
+
Object.defineProperty(target, key, { ...descriptor, value: wrapFunction(descriptor.value) });
|
|
113
|
+
} catch {
|
|
114
|
+
// A method the runtime refuses to redefine keeps its plain errors.
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function wrapExport(value) {
|
|
120
|
+
if (typeof value !== "function") return value;
|
|
121
|
+
patchMethods(value);
|
|
122
|
+
patchMethods(value.prototype);
|
|
123
|
+
// Only `apply` is trapped, so `new`, `instanceof` and static access reach the native class.
|
|
124
|
+
return new Proxy(value, {
|
|
125
|
+
apply(target, thisArg, args) {
|
|
126
|
+
return wrapFunction(target).apply(thisArg, args);
|
|
127
|
+
},
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
module.exports = function decorateBinding(native) {
|
|
132
|
+
const decorated = {};
|
|
133
|
+
for (const key of Object.keys(native)) {
|
|
134
|
+
decorated[key] = wrapExport(native[key]);
|
|
135
|
+
}
|
|
136
|
+
return decorated;
|
|
137
|
+
};
|
|
138
|
+
module.exports.decorate = decorate;
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef — DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:ba15f1094d615258a6ced362ab9e469f4a9f457cebea80a1f8741ad0b9bacfa9
|
|
3
3
|
// To regenerate: alef generate
|
|
4
4
|
// To verify freshness: alef verify
|
|
5
5
|
/* eslint-disable */
|
|
@@ -1276,3 +1276,9 @@ export declare function prefetch(languages: Array<string>): void;
|
|
|
1276
1276
|
* language is unknown, or `Error.ParseFailed` if parsing yields no tree.
|
|
1277
1277
|
*/
|
|
1278
1278
|
export declare function process(source: string, config?: ProcessConfig | undefined | null): ProcessResult;
|
|
1279
|
+
|
|
1280
|
+
/** The error a binding call throws for `Error`. */
|
|
1281
|
+
export interface ThrownError extends Error {
|
|
1282
|
+
kind: "LanguageNotFound" | "DynamicLoad" | "NullLanguagePointer" | "ParserSetup" | "LockPoisoned" | "Config" | "ParseFailed" | "ParseTimeout" | "QueryError" | "InvalidRange" | "Download" | "ChecksumMismatch" | "CacheLock" | "Unknown"
|
|
1283
|
+
errorCode: number
|
|
1284
|
+
}
|
package/index.js
CHANGED
package/index.mjs
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// DO NOT EDIT - auto-generated by alef
|
|
2
|
+
// alef:hash:3c195c58900cbcbebad357df3c3152b5c6da421696e61d0dfc14d2b06d4e06b7
|
|
3
|
+
import binding from "./index.js";
|
|
4
|
+
|
|
5
|
+
export const CommentKind = binding.CommentKind;
|
|
6
|
+
export const DataNodeKind = binding.DataNodeKind;
|
|
7
|
+
export const DiagnosticSeverity = binding.DiagnosticSeverity;
|
|
8
|
+
export const DownloadManager = binding.DownloadManager;
|
|
9
|
+
export const ExportKind = binding.ExportKind;
|
|
10
|
+
export const JsCommentKind = binding.JsCommentKind;
|
|
11
|
+
export const JsDataNodeKind = binding.JsDataNodeKind;
|
|
12
|
+
export const JsDiagnosticSeverity = binding.JsDiagnosticSeverity;
|
|
13
|
+
export const JsDownloadManager = binding.JsDownloadManager;
|
|
14
|
+
export const JsExportKind = binding.JsExportKind;
|
|
15
|
+
export const JsLanguageRegistry = binding.JsLanguageRegistry;
|
|
16
|
+
export const JsNode = binding.JsNode;
|
|
17
|
+
export const JsParser = binding.JsParser;
|
|
18
|
+
export const JsTree = binding.JsTree;
|
|
19
|
+
export const JsTreeCursor = binding.JsTreeCursor;
|
|
20
|
+
export const LanguageRegistry = binding.LanguageRegistry;
|
|
21
|
+
export const Node = binding.Node;
|
|
22
|
+
export const Parser = binding.Parser;
|
|
23
|
+
export const Tree = binding.Tree;
|
|
24
|
+
export const TreeCursor = binding.TreeCursor;
|
|
25
|
+
export const availableLanguages = binding.availableLanguages;
|
|
26
|
+
export const cacheDir = binding.cacheDir;
|
|
27
|
+
export const cleanCache = binding.cleanCache;
|
|
28
|
+
export const configure = binding.configure;
|
|
29
|
+
export const detectLanguage = binding.detectLanguage;
|
|
30
|
+
export const detectLanguageFromContent = binding.detectLanguageFromContent;
|
|
31
|
+
export const detectLanguageFromExtension = binding.detectLanguageFromExtension;
|
|
32
|
+
export const detectLanguageFromPath = binding.detectLanguageFromPath;
|
|
33
|
+
export const download = binding.download;
|
|
34
|
+
export const downloadAll = binding.downloadAll;
|
|
35
|
+
export const downloadGroup = binding.downloadGroup;
|
|
36
|
+
export const downloadedLanguages = binding.downloadedLanguages;
|
|
37
|
+
export const getFoldsQuery = binding.getFoldsQuery;
|
|
38
|
+
export const getHighlightsQuery = binding.getHighlightsQuery;
|
|
39
|
+
export const getIndentsQuery = binding.getIndentsQuery;
|
|
40
|
+
export const getInjectionsQuery = binding.getInjectionsQuery;
|
|
41
|
+
export const getLanguage = binding.getLanguage;
|
|
42
|
+
export const getLocalsQuery = binding.getLocalsQuery;
|
|
43
|
+
export const getParser = binding.getParser;
|
|
44
|
+
export const getTagsQuery = binding.getTagsQuery;
|
|
45
|
+
export const hasLanguage = binding.hasLanguage;
|
|
46
|
+
export const init = binding.init;
|
|
47
|
+
export const languageCount = binding.languageCount;
|
|
48
|
+
export const manifestGroups = binding.manifestGroups;
|
|
49
|
+
export const manifestLanguages = binding.manifestLanguages;
|
|
50
|
+
export const prefetch = binding.prefetch;
|
|
51
|
+
export const process = binding.process;
|
|
52
|
+
export const processConfigAll = binding.processConfigAll;
|
|
53
|
+
export const processConfigDefault = binding.processConfigDefault;
|
|
54
|
+
export const processConfigMinimal = binding.processConfigMinimal;
|
|
55
|
+
export const processConfigWithChunking = binding.processConfigWithChunking;
|
|
56
|
+
export const processConfigWithDataExtraction = binding.processConfigWithDataExtraction;
|
|
57
|
+
export const processConfigWithMaxSourceBytes = binding.processConfigWithMaxSourceBytes;
|
|
58
|
+
export const processConfigWithParseTimeoutMs = binding.processConfigWithParseTimeoutMs;
|
|
59
|
+
|
|
60
|
+
export default binding;
|
package/package.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
}
|
|
11
11
|
],
|
|
12
12
|
"name": "@xberg-io/tree-sitter-language-pack",
|
|
13
|
-
"version": "1.
|
|
13
|
+
"version": "1.23.1",
|
|
14
14
|
"description": "Pre-compiled tree-sitter grammars for 372 programming languages",
|
|
15
15
|
"license": "MIT",
|
|
16
16
|
"repository": {
|
|
@@ -22,24 +22,27 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./index.d.ts",
|
|
25
|
+
"import": "./index.mjs",
|
|
25
26
|
"require": "./index.js",
|
|
26
27
|
"default": "./index.js"
|
|
27
28
|
}
|
|
28
29
|
},
|
|
29
30
|
"files": [
|
|
30
31
|
"index.js",
|
|
32
|
+
"binding.cjs",
|
|
33
|
+
"index.mjs",
|
|
31
34
|
"index.d.ts",
|
|
32
35
|
"*.node"
|
|
33
36
|
],
|
|
34
37
|
"optionalDependencies": {
|
|
35
|
-
"@xberg-io/tree-sitter-language-pack-darwin-arm64": "1.
|
|
36
|
-
"@xberg-io/tree-sitter-language-pack-darwin-x64": "1.
|
|
37
|
-
"@xberg-io/tree-sitter-language-pack-linux-arm64-gnu": "1.
|
|
38
|
-
"@xberg-io/tree-sitter-language-pack-linux-arm64-musl": "1.
|
|
39
|
-
"@xberg-io/tree-sitter-language-pack-linux-x64-gnu": "1.
|
|
40
|
-
"@xberg-io/tree-sitter-language-pack-linux-x64-musl": "1.
|
|
41
|
-
"@xberg-io/tree-sitter-language-pack-win32-arm64-msvc": "1.
|
|
42
|
-
"@xberg-io/tree-sitter-language-pack-win32-x64-msvc": "1.
|
|
38
|
+
"@xberg-io/tree-sitter-language-pack-darwin-arm64": "1.23.1",
|
|
39
|
+
"@xberg-io/tree-sitter-language-pack-darwin-x64": "1.23.1",
|
|
40
|
+
"@xberg-io/tree-sitter-language-pack-linux-arm64-gnu": "1.23.1",
|
|
41
|
+
"@xberg-io/tree-sitter-language-pack-linux-arm64-musl": "1.23.1",
|
|
42
|
+
"@xberg-io/tree-sitter-language-pack-linux-x64-gnu": "1.23.1",
|
|
43
|
+
"@xberg-io/tree-sitter-language-pack-linux-x64-musl": "1.23.1",
|
|
44
|
+
"@xberg-io/tree-sitter-language-pack-win32-arm64-msvc": "1.23.1",
|
|
45
|
+
"@xberg-io/tree-sitter-language-pack-win32-x64-msvc": "1.23.1"
|
|
43
46
|
},
|
|
44
47
|
"napi": {
|
|
45
48
|
"packageName": "@xberg-io/tree-sitter-language-pack",
|
|
@@ -55,11 +58,6 @@
|
|
|
55
58
|
"aarch64-pc-windows-msvc"
|
|
56
59
|
]
|
|
57
60
|
},
|
|
58
|
-
"scripts": {
|
|
59
|
-
"build": "npx --yes -p @napi-rs/cli@^3.7.3 napi build --platform --release",
|
|
60
|
-
"artifacts": "npx --yes -p @napi-rs/cli@^3.7.3 napi artifacts",
|
|
61
|
-
"prepublishOnly": "npx --yes -p @napi-rs/cli@^3.7.3 napi prepublish -t npm --skip-optional-publish"
|
|
62
|
-
},
|
|
63
61
|
"engines": {
|
|
64
62
|
"node": ">= 22"
|
|
65
63
|
},
|
|
@@ -67,6 +65,10 @@
|
|
|
67
65
|
"access": "public"
|
|
68
66
|
},
|
|
69
67
|
"devDependencies": {
|
|
70
|
-
"@napi-rs/cli": "^3.10.
|
|
68
|
+
"@napi-rs/cli": "^3.10.9"
|
|
69
|
+
},
|
|
70
|
+
"scripts": {
|
|
71
|
+
"build": "npx --yes -p @napi-rs/cli@^3.7.3 napi build --no-js --platform --release",
|
|
72
|
+
"artifacts": "npx --yes -p @napi-rs/cli@^3.7.3 napi artifacts"
|
|
71
73
|
}
|
|
72
|
-
}
|
|
74
|
+
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|