@willbooster/tree-sitter-python 1.0.1 → 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
@@ -1,23 +1,27 @@
1
1
  # @willbooster/tree-sitter-python
2
2
 
3
+ [![npm version](https://img.shields.io/npm/v/@willbooster/tree-sitter-python.svg)](https://www.npmjs.com/package/@willbooster/tree-sitter-python)
4
+ [![license](https://img.shields.io/npm/l/@willbooster/tree-sitter-python.svg)](https://www.npmjs.com/package/@willbooster/tree-sitter-python)
3
5
  [![Test](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test.yml)
4
6
  [![Test rust](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test-rust.yml/badge.svg)](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test-rust.yml)
5
7
  [![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)
6
- [![wbfy](https://img.shields.io/badge/wbfy-20.36.6-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
8
+ [![wbfy](https://img.shields.io/badge/wbfy-20.36.11-1e90ff.svg)](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
7
9
  [![crates.io](https://img.shields.io/crates/v/willbooster-tree-sitter-python.svg)](https://crates.io/crates/willbooster-tree-sitter-python)
8
10
 
9
11
  Python grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
10
12
  [tree-sitter/tree-sitter-python](https://github.com/tree-sitter/tree-sitter-python). We are grateful
11
13
  to its authors and contributors. This is not an official release of that project.
12
14
 
13
- This fork ships the unmodified grammar of upstream v0.25.0 as a compact ABI 16 parser, generated by the parser generator
14
- of [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter).
15
+ This fork ships the unmodified grammar of upstream v0.25.0 as a compact parser, generated by the parser generator of
16
+ [WillBooster/tree-sitter](https://github.com/WillBooster/tree-sitter). The parser carries that fork's own ABI number, so
17
+ it loads only with the WillBooster runtime (`willbooster-tree-sitter` or `@willbooster/web-tree-sitter`) 2.0.0 or later,
18
+ not with upstream's tree-sitter.
15
19
 
16
20
  ## Usage
17
21
 
18
22
  The npm package ships `tree-sitter-python.wasm` for
19
23
  [@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
20
- browsers, and Cloudflare Workers. The compact ABI 16 parser requires runtime 1.3.0 or later.
24
+ browsers, and Cloudflare Workers. The parser requires runtime 2.0.0 or later.
21
25
 
22
26
  In Node.js and Bun, load the grammar from its path:
23
27
 
@@ -60,12 +64,12 @@ The package also ships the queries in `queries/` and the node types in `src/node
60
64
 
61
65
  In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-python) and on
62
66
  [willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
63
- fuzzed with. The compact ABI 16 parser requires runtime 1.3.0 or later:
67
+ fuzzed with. The parser requires runtime 2.0.0 or later:
64
68
 
65
69
  ```toml
66
70
  [dependencies]
67
- tree-sitter = { package = "willbooster-tree-sitter", version = "1.3.0" }
68
- tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "1" }
71
+ tree-sitter = { package = "willbooster-tree-sitter", version = "2" }
72
+ tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "2" }
69
73
  ```
70
74
 
71
75
  ```rust
@@ -90,7 +94,7 @@ not the ones this package ships with. Its first run downloads that CLI from the
90
94
  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
91
95
  commands through it as well (e.g. `script/tree-sitter parse file.py`).
92
96
 
93
- `bun run generate` records a fresh ABI 16 generation profile from the applicable `test/corpus` cases and Git-tracked
97
+ `bun run generate` records a fresh generation profile from the applicable `test/corpus` cases and Git-tracked
94
98
  Python files in `examples/`, then generates compact parser tables. The parser also embeds metadata from `tree-sitter.json`. After changing a grammar,
95
99
  `tree-sitter.json`, a corpus case, or a tracked example,
96
100
  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-python",
3
- "version": "1.0.1",
3
+ "version": "2.0.0",
4
4
  "description": "Python grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -47,7 +47,7 @@
47
47
  "@willbooster/oxfmt-config": "1.2.2",
48
48
  "@willbooster/oxlint-config": "1.4.8",
49
49
  "@willbooster/wb": "22.24.0",
50
- "@willbooster/web-tree-sitter": "1.5.1",
50
+ "@willbooster/web-tree-sitter": "2.0.1",
51
51
  "conventional-changelog-conventionalcommits": "10.4.0",
52
52
  "lefthook": "2.1.16",
53
53
  "oxfmt": "0.71.0",
@@ -63,7 +63,7 @@
63
63
  "wrangler": "4.147.0"
64
64
  },
65
65
  "peerDependencies": {
66
- "@willbooster/web-tree-sitter": "^1.3.0"
66
+ "@willbooster/web-tree-sitter": "^2.0.0"
67
67
  },
68
68
  "peerDependenciesMeta": {
69
69
  "@willbooster/web-tree-sitter": {
Binary file
package/tree-sitter.json CHANGED
@@ -19,7 +19,7 @@
19
19
  }
20
20
  ],
21
21
  "metadata": {
22
- "version": "1.0.1",
22
+ "version": "2.0.0",
23
23
  "license": "MIT",
24
24
  "description": "Python grammar for tree-sitter",
25
25
  "authors": [