@willbooster/tree-sitter-bash 3.0.6 → 4.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 +9 -6
- package/package.json +4 -4
- package/tree-sitter-bash.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[](https://www.npmjs.com/package/@willbooster/tree-sitter-bash)
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-bash/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/semantic-release/semantic-release)
|
|
7
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
8
8
|
|
|
9
9
|
Bash grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
10
10
|
[tree-sitter/tree-sitter-bash](https://github.com/tree-sitter/tree-sitter-bash). We are grateful to its authors and
|
|
@@ -17,7 +17,9 @@ As a result, its syntax trees differ from the original grammar's; review your qu
|
|
|
17
17
|
## Usage
|
|
18
18
|
|
|
19
19
|
The npm package ships `tree-sitter-bash.wasm` for
|
|
20
|
-
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter)
|
|
20
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) 2.0.0 or later, a peer dependency.
|
|
21
|
+
The parser carries the ABI number of WillBooster/tree-sitter (`0x57420001`), so only that runtime loads it; the
|
|
22
|
+
original tree-sitter runtime rejects it, and so does `@willbooster/web-tree-sitter` 1.x:
|
|
21
23
|
|
|
22
24
|
```sh
|
|
23
25
|
npm install @willbooster/tree-sitter-bash @willbooster/web-tree-sitter
|
|
@@ -64,9 +66,10 @@ parser.setLanguage(await Language.load(bash));
|
|
|
64
66
|
|
|
65
67
|
The package also ships the queries in `queries/` and the node types in `src/node-types.json`.
|
|
66
68
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
69
|
+
When upgrading from 3.x, upgrade `@willbooster/web-tree-sitter` to 2.x in the same change: each major of this package
|
|
70
|
+
loads only with the runtime major it was generated for. Scripts that parse without errors get the same syntax trees as
|
|
71
|
+
with 3.x. Recovery trees for malformed scripts can differ from every earlier major, so review consumers that depend on
|
|
72
|
+
the exact shape of `ERROR` nodes.
|
|
70
73
|
|
|
71
74
|
## Development
|
|
72
75
|
|
|
@@ -85,7 +88,7 @@ and the runtime of upstream's CLI are not the ones this package ships with. Its
|
|
|
85
88
|
runtime's GitHub Release, or builds it with `cargo` (whose build runs the CMake that `mise.toml` pins) when the download fails or the release has no
|
|
86
89
|
binary that runs here. Run other CLI commands through it as well (e.g. `script/tree-sitter parse script.sh`).
|
|
87
90
|
|
|
88
|
-
`bun run generate` records a fresh
|
|
91
|
+
`bun run generate` records a fresh generation profile from the applicable `test/corpus` cases and Git-tracked
|
|
89
92
|
files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
|
|
90
93
|
`tree-sitter.json`, a corpus case, or a tracked example,
|
|
91
94
|
regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-bash",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "Bash grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
@@ -45,8 +45,8 @@
|
|
|
45
45
|
"@vitest/browser-playwright": "5.0.3",
|
|
46
46
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
47
47
|
"@willbooster/oxlint-config": "1.4.8",
|
|
48
|
-
"@willbooster/wb": "22.
|
|
49
|
-
"@willbooster/web-tree-sitter": "
|
|
48
|
+
"@willbooster/wb": "22.24.0",
|
|
49
|
+
"@willbooster/web-tree-sitter": "2.0.1",
|
|
50
50
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
51
51
|
"lefthook": "2.1.16",
|
|
52
52
|
"oxfmt": "0.71.0",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
"wrangler": "4.147.0"
|
|
63
63
|
},
|
|
64
64
|
"peerDependencies": {
|
|
65
|
-
"@willbooster/web-tree-sitter": "^
|
|
65
|
+
"@willbooster/web-tree-sitter": "^2.0.0"
|
|
66
66
|
},
|
|
67
67
|
"peerDependenciesMeta": {
|
|
68
68
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-bash.wasm
CHANGED
|
Binary file
|