@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 +12 -8
- package/package.json +3 -3
- package/tree-sitter-python.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -1,23 +1,27 @@
|
|
|
1
1
|
# @willbooster/tree-sitter-python
|
|
2
2
|
|
|
3
|
+
[](https://www.npmjs.com/package/@willbooster/tree-sitter-python)
|
|
4
|
+
[](https://www.npmjs.com/package/@willbooster/tree-sitter-python)
|
|
3
5
|
[](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test.yml)
|
|
4
6
|
[](https://github.com/WillBooster/tree-sitter-python/actions/workflows/test-rust.yml)
|
|
5
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
6
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
7
9
|
[](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
|
|
14
|
-
|
|
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
|
|
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
|
|
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 = "
|
|
68
|
-
tree-sitter-python = { package = "willbooster-tree-sitter-python", version = "
|
|
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
|
|
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": "
|
|
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": "
|
|
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": "^
|
|
66
|
+
"@willbooster/web-tree-sitter": "^2.0.0"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
69
69
|
"@willbooster/web-tree-sitter": {
|
package/tree-sitter-python.wasm
CHANGED
|
Binary file
|