@willbooster/tree-sitter-bash 4.0.2 → 4.0.4

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
@@ -4,7 +4,7 @@
4
4
  [![license](https://img.shields.io/npm/l/@willbooster/tree-sitter-bash.svg)](https://www.npmjs.com/package/@willbooster/tree-sitter-bash)
5
5
  [![Test](https://github.com/WillBooster/tree-sitter-bash/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-bash/actions/workflows/test.yml)
6
6
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
7
- [![wbfy](https://img.shields.io/badge/wbfy-20.36.11-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
7
+ [![wbfy](https://img.shields.io/badge/wbfy-20.41.8-1e90ff.svg)](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,12 +17,12 @@ 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) 2.0.0 or later, a peer dependency.
20
+ [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter) 2.x, a peer dependency.
21
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:
22
+ original tree-sitter runtime and other major versions of `@willbooster/web-tree-sitter` reject it:
23
23
 
24
24
  ```sh
25
- npm install @willbooster/tree-sitter-bash @willbooster/web-tree-sitter
25
+ npm install @willbooster/tree-sitter-bash @willbooster/web-tree-sitter@^2.0.0
26
26
  ```
27
27
 
28
28
  In Node.js and Bun, load the grammar from its path:
@@ -66,19 +66,17 @@ parser.setLanguage(await Language.load(bash));
66
66
 
67
67
  The package also ships the queries in `queries/` and the node types in `src/node-types.json`.
68
68
 
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, except where backslashes inside backquotes precede `$` (or `"` when the backquotes are inside double quotes):
72
- like bash, the parser removes one level of those backslashes before it parses the text, so `` `echo \$x` `` holds an
73
- expansion and `` `echo \\$x` `` a literal `$x`. Recovery trees for malformed scripts can differ from every earlier
74
- major, so review consumers that depend on the exact shape of `ERROR` nodes.
69
+ Recovery trees for malformed scripts can differ between releases, so review consumers that depend on the exact
70
+ shape of `ERROR` nodes.
75
71
 
76
72
  Inside backquotes, the text of a node is the source text: consumers that read the value of a word or a string there
77
73
  remove a backslash before `$`, a backquote, or a backslash (and before `"` when the backquotes are inside double quotes)
78
- before they remove quotes and escapes as usual. The parser normalizes runs before `$`, and before `"` when the
79
- backquotes opened inside double quotes, only in ordinary word and double-quoted string scanning. Runs before other
80
- characters (including whitespace and metacharacters), heredoc bodies, parameter-expansion text, regexes, nested
81
- backquotes, and PID expansions split by a removed escape retain their existing parsing limitations.
74
+ before they remove quotes and escapes as usual. Ordinary word and double-quoted string scanning account for those
75
+ removals when recognizing expansions, quotes, blanks, and shell operators. Backquotes that delimit the substitution
76
+ retain their source escape parity. Source continuations inside ordinary words and double-quoted strings are removed
77
+ before the resulting command text is parsed. Continuations around deferred heredoc bodies, heredoc text, parameter
78
+ expansions, regexes, nested backquotes, and PID expansions split by a removed escape retain their existing parsing
79
+ limitations.
82
80
 
83
81
  ## Development
84
82
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-bash",
3
- "version": "4.0.2",
3
+ "version": "4.0.4",
4
4
  "description": "Bash grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -45,20 +45,19 @@
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.24.0",
49
- "@willbooster/web-tree-sitter": "2.0.1",
50
- "conventional-changelog-conventionalcommits": "10.4.0",
51
- "lefthook": "2.1.16",
52
- "oxfmt": "0.71.0",
53
- "oxlint": "1.86.0",
54
- "oxlint-tsgolint": "7.0.2003",
55
- "playwright": "1.63.0",
48
+ "@willbooster/wb": "22.26.1",
49
+ "@willbooster/web-tree-sitter": "2.0.26",
50
+ "conventional-changelog-conventionalcommits": "10.4.1",
51
+ "lefthook": "2.2.1",
52
+ "oxfmt": "0.72.0",
53
+ "oxlint": "1.87.0",
54
+ "oxlint-tsgolint": "7.0.2004",
55
+ "playwright": "1.64.0",
56
56
  "semantic-release": "25.0.9",
57
57
  "sort-package-json": "4.0.0",
58
- "typescript": "7.0.2",
59
- "vite": "8.3.2",
58
+ "vite": "8.3.4",
60
59
  "vitest": "5.0.3",
61
- "wrangler": "4.147.0"
60
+ "wrangler": "4.149.0"
62
61
  },
63
62
  "peerDependencies": {
64
63
  "@willbooster/web-tree-sitter": "^2.0.0"
Binary file
package/tree-sitter.json CHANGED
@@ -18,7 +18,7 @@
18
18
  }
19
19
  ],
20
20
  "metadata": {
21
- "version": "4.0.2",
21
+ "version": "4.0.4",
22
22
  "license": "MIT",
23
23
  "description": "Bash grammar for tree-sitter",
24
24
  "authors": [