@rejot-dev/tree-sitter-thalo 0.2.1 → 0.2.3
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 +37 -4
- package/binding.gyp +11 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ using fenced code blocks with the `thalo` language identifier:
|
|
|
17
17
|
|
|
18
18
|
Some markdown content here.
|
|
19
19
|
|
|
20
|
-
```
|
|
20
|
+
```
|
|
21
21
|
2026-01-05T18:00Z create lore "An insight" #example
|
|
22
22
|
type: "insight"
|
|
23
23
|
subject: ^self
|
|
@@ -47,7 +47,7 @@ Create or update instances of entities (lore, opinion, reference, journal):
|
|
|
47
47
|
|
|
48
48
|
### Example
|
|
49
49
|
|
|
50
|
-
```
|
|
50
|
+
```
|
|
51
51
|
2026-01-05T18:11Z create lore "Custom event streaming system" ^event-streaming #architecture #distributed
|
|
52
52
|
type: "fact"
|
|
53
53
|
subject: ^acme-corp
|
|
@@ -117,7 +117,7 @@ Define or alter entity schemas using `define-entity` and `alter-entity` directiv
|
|
|
117
117
|
|
|
118
118
|
### Example
|
|
119
119
|
|
|
120
|
-
```
|
|
120
|
+
```
|
|
121
121
|
2026-01-05T18:12Z define-entity reference "Collected resources"
|
|
122
122
|
# Metadata
|
|
123
123
|
url?: string ; "the url to the resource"
|
|
@@ -135,7 +135,7 @@ Define or alter entity schemas using `define-entity` and `alter-entity` directiv
|
|
|
135
135
|
|
|
136
136
|
Modify existing entity schemas by adding or removing fields/sections:
|
|
137
137
|
|
|
138
|
-
```
|
|
138
|
+
```
|
|
139
139
|
2026-01-10T14:00Z alter-entity reference "Add published field, remove legacy"
|
|
140
140
|
# Metadata
|
|
141
141
|
published: datetime ; "publication date"
|
|
@@ -321,6 +321,39 @@ pnpm exec tree-sitter test
|
|
|
321
321
|
pnpm exec tree-sitter parse path/to/file.thalo
|
|
322
322
|
```
|
|
323
323
|
|
|
324
|
+
## Building Native Bindings
|
|
325
|
+
|
|
326
|
+
The package includes native Node.js bindings that require compilation. The `binding.gyp` uses C++20
|
|
327
|
+
to support Node.js 24+ (which requires C++20 for V8 headers).
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
# Build native bindings
|
|
331
|
+
pnpm run build:native
|
|
332
|
+
|
|
333
|
+
# Validate binding.gyp syntax (without building)
|
|
334
|
+
pnpm run check:gyp
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
### Requirements
|
|
338
|
+
|
|
339
|
+
- **C++20 compiler**: GCC 10+, Clang 10+, or MSVC 2019+
|
|
340
|
+
- **Python 3.6+**: Required by node-gyp
|
|
341
|
+
- **Node.js 18+**: For running the bindings
|
|
342
|
+
|
|
343
|
+
### WASM Alternative
|
|
344
|
+
|
|
345
|
+
If native compilation fails or isn't available, consumers can use the WASM build instead:
|
|
346
|
+
|
|
347
|
+
```javascript
|
|
348
|
+
import { Parser, Language } from "web-tree-sitter";
|
|
349
|
+
import thaloWasm from "@rejot-dev/tree-sitter-thalo/tree-sitter-thalo.wasm";
|
|
350
|
+
|
|
351
|
+
await Parser.init();
|
|
352
|
+
const parser = new Parser();
|
|
353
|
+
const language = await Language.load(thaloWasm);
|
|
354
|
+
parser.setLanguage(language);
|
|
355
|
+
```
|
|
356
|
+
|
|
324
357
|
## Limitations
|
|
325
358
|
|
|
326
359
|
### General
|
package/binding.gyp
CHANGED
|
@@ -23,11 +23,22 @@
|
|
|
23
23
|
"cflags_c": [
|
|
24
24
|
"-std=c11",
|
|
25
25
|
],
|
|
26
|
+
"cflags_cc": [
|
|
27
|
+
"-std=c++20",
|
|
28
|
+
],
|
|
29
|
+
"xcode_settings": {
|
|
30
|
+
"CLANG_CXX_LANGUAGE_STANDARD": "c++20",
|
|
31
|
+
"OTHER_CPLUSPLUSFLAGS": ["-std=c++20"],
|
|
32
|
+
},
|
|
26
33
|
}, { # OS == "win"
|
|
27
34
|
"cflags_c": [
|
|
28
35
|
"/std:c11",
|
|
29
36
|
"/utf-8",
|
|
30
37
|
],
|
|
38
|
+
"cflags_cc": [
|
|
39
|
+
"/std:c++20",
|
|
40
|
+
"/utf-8",
|
|
41
|
+
],
|
|
31
42
|
}],
|
|
32
43
|
],
|
|
33
44
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rejot-dev/tree-sitter-thalo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"build:wasm": "tree-sitter build --wasm --output tree-sitter-thalo.wasm",
|
|
40
40
|
"build:native": "pnpm exec node-gyp rebuild",
|
|
41
41
|
"check:native": "node scripts/check-rebuild.mjs",
|
|
42
|
+
"check:gyp": "node-gyp configure --loglevel=warn",
|
|
42
43
|
"test": "tree-sitter test",
|
|
43
44
|
"types:check": "tsc --noEmit"
|
|
44
45
|
}
|