@willbooster/tree-sitter-javascript 3.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 CHANGED
@@ -19,7 +19,7 @@ This fork fixes parsing bugs and raises conformance with [ECMAScript (ECMA-262)]
19
19
 
20
20
  The npm package ships `tree-sitter-javascript.wasm` for
21
21
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
22
- browsers, and Cloudflare Workers. Use runtime 1.2.2 or newer. In Node.js and Bun, load it from the package:
22
+ browsers, and Cloudflare Workers. Use runtime 1.3.0 or newer. In Node.js and Bun, load it from the package:
23
23
 
24
24
  ```js
25
25
  import { fileURLToPath } from 'node:url';
@@ -62,13 +62,12 @@ The package also ships the node types in `src/node-types.json`, the highlight, i
62
62
  `require('@willbooster/tree-sitter-javascript/grammar')`). The crate ships `tree-sitter.json` and `queries/` too.
63
63
 
64
64
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-javascript) and on
65
- [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter) 1.2.2 or newer. The canonical constructor
66
- supertype query requires this runtime version. This is the runtime this package is tested and fuzzed with:
65
+ [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter) 1.3.0 or newer for the compact ABI 16 parser:
67
66
 
68
67
  ```toml
69
68
  [dependencies]
70
- tree-sitter = { package = "willbooster-tree-sitter", version = "1.2.2" }
71
- tree-sitter-javascript = { package = "willbooster-tree-sitter-javascript", version = "3" }
69
+ tree-sitter = { package = "willbooster-tree-sitter", version = "1.3.0" }
70
+ tree-sitter-javascript = { package = "willbooster-tree-sitter-javascript", version = "4" }
72
71
  ```
73
72
 
74
73
  ```rust
@@ -92,6 +91,13 @@ locked in `Cargo.lock` (`script/tree-sitter`), whose generator and runtime have
92
91
  `script/fork-cli` downloads that CLI into `.tmp/` from its GitHub Release on first use, or builds it with `cargo` when
93
92
  the download fails or the release has no binary that runs here.
94
93
 
94
+ `bun run generate` records a fresh ABI 16 generation profile from the applicable `test/corpus` cases and Git-tracked
95
+ files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
96
+ `tree-sitter.json`, a corpus case, or a tracked example,
97
+ regenerate and commit `src/`. Stage added or removed examples with `git add -A examples` before generation so the profile uses the intended file list.
98
+ Profiles in `.tmp/generation-profiles/` are temporary and must not be committed. `bun run build-wasm`, `bun run build/ci`,
99
+ and the release build regenerate the parsers before compiling them.
100
+
95
101
  `bun run test` runs:
96
102
 
97
103
  - 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-javascript",
3
- "version": "3.0.0",
3
+ "version": "4.0.1",
4
4
  "description": "JavaScript 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.1",
49
- "@willbooster/web-tree-sitter": "1.2.2",
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.2.2"
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
@@ -24,7 +24,7 @@
24
24
  }
25
25
  ],
26
26
  "metadata": {
27
- "version": "3.0.0",
27
+ "version": "4.0.1",
28
28
  "license": "MIT",
29
29
  "description": "JavaScript grammar for tree-sitter",
30
30
  "authors": [