@willbooster/tree-sitter-xml 4.0.0 → 4.0.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 +4 -3
- package/package.json +16 -19
- package/tree-sitter-dtd.wasm +0 -0
- package/tree-sitter-xml.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-xml/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-xml/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-xml)
|
|
10
10
|
|
|
11
11
|
XML and DTD grammars for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -43,6 +43,7 @@ In Node.js and Bun, load the grammar from its path:
|
|
|
43
43
|
|
|
44
44
|
```js
|
|
45
45
|
import { fileURLToPath } from 'node:url';
|
|
46
|
+
|
|
46
47
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
47
48
|
|
|
48
49
|
await Parser.init();
|
|
@@ -55,9 +56,9 @@ const tree = parser.parse('<?xml version="1.0"?>\n<note><to>Tove</to></note>\n')
|
|
|
55
56
|
In browsers, serve both `.wasm` files and load them by URL (the example uses Vite's `?url` imports):
|
|
56
57
|
|
|
57
58
|
```js
|
|
59
|
+
import xmlUrl from '@willbooster/tree-sitter-xml/tree-sitter-xml.wasm?url';
|
|
58
60
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
59
61
|
import runtimeUrl from '@willbooster/web-tree-sitter/web-tree-sitter.wasm?url';
|
|
60
|
-
import xmlUrl from '@willbooster/tree-sitter-xml/tree-sitter-xml.wasm?url';
|
|
61
62
|
|
|
62
63
|
await Parser.init({ locateFile: () => runtimeUrl });
|
|
63
64
|
const parser = new Parser();
|
|
@@ -68,9 +69,9 @@ Cloudflare Workers do not allow compiling Wasm at run time, so import both `.was
|
|
|
68
69
|
Node.js compatibility:
|
|
69
70
|
|
|
70
71
|
```js
|
|
72
|
+
import xml from '@willbooster/tree-sitter-xml/tree-sitter-xml.wasm';
|
|
71
73
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
72
74
|
import runtime from '@willbooster/web-tree-sitter/web-tree-sitter.wasm';
|
|
73
|
-
import xml from '@willbooster/tree-sitter-xml/tree-sitter-xml.wasm';
|
|
74
75
|
|
|
75
76
|
await Parser.init({ wasmModule: runtime });
|
|
76
77
|
const parser = new Parser();
|
package/package.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-xml",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.1",
|
|
4
4
|
"description": "XML & DTD grammars for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"dtd",
|
|
6
7
|
"incremental",
|
|
7
8
|
"parsing",
|
|
8
9
|
"tree-sitter",
|
|
9
|
-
"xml"
|
|
10
|
-
"dtd"
|
|
10
|
+
"xml"
|
|
11
11
|
],
|
|
12
|
+
"license": "MIT",
|
|
13
|
+
"author": "WillBooster Inc.",
|
|
12
14
|
"repository": {
|
|
13
15
|
"type": "git",
|
|
14
16
|
"url": "git+https://github.com/WillBooster/tree-sitter-xml.git"
|
|
15
17
|
},
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"author": "WillBooster Inc.",
|
|
18
18
|
"files": [
|
|
19
19
|
"common/common.mjs",
|
|
20
20
|
"xml/grammar.js",
|
|
@@ -27,6 +27,10 @@
|
|
|
27
27
|
"tree-sitter.json",
|
|
28
28
|
"*.wasm"
|
|
29
29
|
],
|
|
30
|
+
"publishConfig": {
|
|
31
|
+
"access": "public",
|
|
32
|
+
"registry": "https://registry.npmjs.org/"
|
|
33
|
+
},
|
|
30
34
|
"scripts": {
|
|
31
35
|
"build-wasm": "script/generate --build-wasm",
|
|
32
36
|
"build/ci": "bun run build-wasm",
|
|
@@ -49,21 +53,18 @@
|
|
|
49
53
|
"devDependencies": {
|
|
50
54
|
"@tsconfig/bun": "1.0.11",
|
|
51
55
|
"@types/bun": "1.4.3",
|
|
52
|
-
"@vitest/browser-playwright": "5.0.
|
|
53
|
-
"@willbooster/
|
|
54
|
-
"@willbooster/
|
|
55
|
-
"@willbooster/wb": "22.26.2",
|
|
56
|
+
"@vitest/browser-playwright": "5.0.5",
|
|
57
|
+
"@willbooster/oxlint-config": "1.4.9",
|
|
58
|
+
"@willbooster/wb": "22.29.3",
|
|
56
59
|
"@willbooster/web-tree-sitter": "13.0.0",
|
|
57
|
-
"conventional-changelog-conventionalcommits": "10.4.
|
|
60
|
+
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
58
61
|
"lefthook": "2.2.2",
|
|
59
|
-
"oxfmt": "0.73.0",
|
|
60
62
|
"oxlint": "1.88.0",
|
|
61
63
|
"oxlint-tsgolint": "7.0.2004",
|
|
62
|
-
"playwright": "1.
|
|
64
|
+
"playwright": "1.64.1",
|
|
63
65
|
"semantic-release": "25.0.9",
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"wrangler": "4.147.0"
|
|
66
|
+
"vitest": "5.0.5",
|
|
67
|
+
"wrangler": "4.151.1"
|
|
67
68
|
},
|
|
68
69
|
"peerDependencies": {
|
|
69
70
|
"@willbooster/web-tree-sitter": "^13.0.0"
|
|
@@ -72,9 +73,5 @@
|
|
|
72
73
|
"@willbooster/web-tree-sitter": {
|
|
73
74
|
"optional": true
|
|
74
75
|
}
|
|
75
|
-
},
|
|
76
|
-
"publishConfig": {
|
|
77
|
-
"access": "public",
|
|
78
|
-
"registry": "https://registry.npmjs.org/"
|
|
79
76
|
}
|
|
80
77
|
}
|
package/tree-sitter-dtd.wasm
CHANGED
|
Binary file
|
package/tree-sitter-xml.wasm
CHANGED
|
Binary file
|