@willbooster/tree-sitter-rust 1.10.3 → 2.0.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 CHANGED
@@ -18,7 +18,7 @@ This fork fixes parsing bugs and raises conformance with [The Rust Reference](ht
18
18
 
19
19
  The npm package ships `tree-sitter-rust.wasm` for
20
20
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
21
- browsers, and Cloudflare Workers.
21
+ browsers, and Cloudflare Workers. The compact ABI 16 parser requires runtime 1.3.0 or later.
22
22
 
23
23
  In Node.js and Bun, load the grammar from its path:
24
24
 
@@ -61,13 +61,12 @@ The package also ships the queries in `queries/` and the node types in `src/node
61
61
 
62
62
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-rust) and on
63
63
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
64
- fuzzed with (the grammar also loads in the upstream `tree-sitter` crate 0.27, whose error recovery never ends on some
65
- malformed input):
64
+ fuzzed with. The compact ABI 16 parser requires runtime 1.3.0 or later:
66
65
 
67
66
  ```toml
68
67
  [dependencies]
69
- tree-sitter = { package = "willbooster-tree-sitter", version = "1" }
70
- tree-sitter-rust = { package = "willbooster-tree-sitter-rust", version = "1" }
68
+ tree-sitter = { package = "willbooster-tree-sitter", version = "1.3.0" }
69
+ tree-sitter-rust = { package = "willbooster-tree-sitter-rust", version = "2" }
71
70
  ```
72
71
 
73
72
  ```rust
@@ -103,6 +102,13 @@ not the ones this package ships with. Its first run downloads that CLI from the
103
102
  with `cargo` (whose build runs the CMake that `mise.toml` pins) when the download fails or the release has no binary that runs here. Run other CLI
104
103
  commands through it as well (e.g. `script/tree-sitter parse file.rs`).
105
104
 
105
+ `bun run generate` records a fresh ABI 16 generation profile from the applicable `test/corpus` cases and Git-tracked
106
+ files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
107
+ `tree-sitter.json`, a corpus case, or a tracked example,
108
+ regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
109
+ Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,
110
+ and the release build regenerate the parsers before compiling them.
111
+
106
112
  `bun run test` runs:
107
113
 
108
114
  - the corpus in `test/corpus`, with the native build and with the Wasm build (the first run downloads the WASI SDK);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-rust",
3
- "version": "1.10.3",
3
+ "version": "2.0.0",
4
4
  "description": "Rust grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -22,10 +22,11 @@
22
22
  "*.wasm"
23
23
  ],
24
24
  "scripts": {
25
- "build-wasm": "script/tree-sitter build --wasm",
26
- "build/ci": "script/tree-sitter generate && script/tree-sitter build --wasm",
25
+ "build-wasm": "script/generate --build-wasm",
26
+ "build/ci": "bun run build-wasm",
27
27
  "cleanup": "bun wb lint --fix --format",
28
28
  "format": "bun wb lint --format",
29
+ "generate": "script/generate",
29
30
  "lint": "bun wb lint",
30
31
  "lint-fix": "bun wb lint --fix",
31
32
  "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
@@ -46,7 +47,7 @@
46
47
  "@willbooster/oxfmt-config": "1.2.2",
47
48
  "@willbooster/oxlint-config": "1.4.8",
48
49
  "@willbooster/wb": "22.13.2",
49
- "@willbooster/web-tree-sitter": "1.0.17",
50
+ "@willbooster/web-tree-sitter": "1.4.0",
50
51
  "conventional-changelog-conventionalcommits": "10.4.0",
51
52
  "lefthook": "2.1.14",
52
53
  "oxfmt": "0.70.0",
@@ -62,7 +63,7 @@
62
63
  "wrangler": "4.136.2"
63
64
  },
64
65
  "peerDependencies": {
65
- "@willbooster/web-tree-sitter": "^1.0.0"
66
+ "@willbooster/web-tree-sitter": "^1.3.0"
66
67
  },
67
68
  "peerDependenciesMeta": {
68
69
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -22,7 +22,7 @@
22
22
  }
23
23
  ],
24
24
  "metadata": {
25
- "version": "1.10.3",
25
+ "version": "2.0.0",
26
26
  "license": "MIT",
27
27
  "description": "Rust grammar for tree-sitter",
28
28
  "authors": [