@willbooster/tree-sitter-bash 2.1.8 → 3.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 +12 -1
- package/package.json +6 -5
- package/tree-sitter-bash.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -17,7 +17,7 @@ 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) 1.
|
|
20
|
+
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) 1.4.2 or later, a peer dependency:
|
|
21
21
|
|
|
22
22
|
```sh
|
|
23
23
|
npm install @willbooster/tree-sitter-bash @willbooster/web-tree-sitter
|
|
@@ -64,6 +64,10 @@ parser.setLanguage(await Language.load(bash));
|
|
|
64
64
|
|
|
65
65
|
The package also ships the queries in `queries/` and the node types in `src/node-types.json`.
|
|
66
66
|
|
|
67
|
+
The ABI 16 major release can change recovery trees for malformed scripts. Valid syntax and completed constructs
|
|
68
|
+
remain supported, and incremental parses must match fresh parses. Review consumers that depend on the exact shape
|
|
69
|
+
of `ERROR` nodes when upgrading.
|
|
70
|
+
|
|
67
71
|
## Development
|
|
68
72
|
|
|
69
73
|
```sh
|
|
@@ -81,6 +85,13 @@ and the runtime of upstream's CLI are not the ones this package ships with. Its
|
|
|
81
85
|
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
|
|
82
86
|
binary that runs here. Run other CLI commands through it as well (e.g. `script/tree-sitter parse script.sh`).
|
|
83
87
|
|
|
88
|
+
`bun run generate` records a fresh ABI 16 generation profile from the applicable `test/corpus` cases and Git-tracked
|
|
89
|
+
files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
|
|
90
|
+
`tree-sitter.json`, a corpus case, or a tracked example,
|
|
91
|
+
regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
|
|
92
|
+
Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,
|
|
93
|
+
and the release build regenerate the parsers before compiling them.
|
|
94
|
+
|
|
84
95
|
`bun run test` runs:
|
|
85
96
|
|
|
86
97
|
- 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-bash",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
4
|
"description": "Bash 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/
|
|
26
|
-
"build/ci": "
|
|
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)",
|
|
@@ -45,7 +46,7 @@
|
|
|
45
46
|
"@willbooster/oxfmt-config": "1.2.2",
|
|
46
47
|
"@willbooster/oxlint-config": "1.4.8",
|
|
47
48
|
"@willbooster/wb": "22.18.0",
|
|
48
|
-
"@willbooster/web-tree-sitter": "1.
|
|
49
|
+
"@willbooster/web-tree-sitter": "1.4.2",
|
|
49
50
|
"conventional-changelog-conventionalcommits": "10.4.0",
|
|
50
51
|
"lefthook": "2.1.14",
|
|
51
52
|
"oxfmt": "0.70.0",
|
|
@@ -61,7 +62,7 @@
|
|
|
61
62
|
"wrangler": "4.141.0"
|
|
62
63
|
},
|
|
63
64
|
"peerDependencies": {
|
|
64
|
-
"@willbooster/web-tree-sitter": "^1.
|
|
65
|
+
"@willbooster/web-tree-sitter": "^1.4.2"
|
|
65
66
|
},
|
|
66
67
|
"peerDependenciesMeta": {
|
|
67
68
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-bash.wasm
CHANGED
|
Binary file
|