@willbooster/tree-sitter-kotlin 8.0.0 → 9.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 +8 -7
- package/package.json +17 -20
- package/tree-sitter-kotlin.wasm +0 -0
- package/tree-sitter.json +1 -1
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
[](https://github.com/WillBooster/tree-sitter-kotlin/actions/workflows/test.yml)
|
|
6
6
|
[](https://github.com/WillBooster/tree-sitter-kotlin/actions/workflows/test-rust.yml)
|
|
7
7
|
[](https://github.com/semantic-release/semantic-release)
|
|
8
|
-
[](https://github.com/WillBooster/shared/tree/main/packages/wbfy)
|
|
9
9
|
[](https://crates.io/crates/willbooster-tree-sitter-kotlin)
|
|
10
10
|
|
|
11
11
|
Kotlin grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter), forked from
|
|
@@ -18,13 +18,14 @@ This fork fixes parsing bugs and raises conformance with the Kotlin grammar.
|
|
|
18
18
|
|
|
19
19
|
The npm package ships `tree-sitter-kotlin.wasm` for
|
|
20
20
|
[@willbooster/web-tree-sitter](https://www.npmjs.com/package/@willbooster/web-tree-sitter), which runs in Node.js, Bun,
|
|
21
|
-
browsers, and Cloudflare Workers. The parser loads only with this runtime, version
|
|
21
|
+
browsers, and Cloudflare Workers. The parser loads only with this runtime, version 15.0.0 or later in the 15.x series: the upstream
|
|
22
22
|
Tree-sitter runtime rejects it.
|
|
23
23
|
|
|
24
24
|
In Node.js and Bun:
|
|
25
25
|
|
|
26
26
|
```js
|
|
27
27
|
import { fileURLToPath } from 'node:url';
|
|
28
|
+
|
|
28
29
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
29
30
|
|
|
30
31
|
await Parser.init();
|
|
@@ -37,9 +38,9 @@ const tree = parser.parse('fun main() = println("Hello")\n');
|
|
|
37
38
|
In browsers, load both `.wasm` files by URL. With Vite:
|
|
38
39
|
|
|
39
40
|
```js
|
|
41
|
+
import kotlinUrl from '@willbooster/tree-sitter-kotlin/tree-sitter-kotlin.wasm?url';
|
|
40
42
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
41
43
|
import runtimeUrl from '@willbooster/web-tree-sitter/web-tree-sitter.wasm?url';
|
|
42
|
-
import kotlinUrl from '@willbooster/tree-sitter-kotlin/tree-sitter-kotlin.wasm?url';
|
|
43
44
|
|
|
44
45
|
await Parser.init({ locateFile: () => runtimeUrl });
|
|
45
46
|
const parser = new Parser();
|
|
@@ -50,9 +51,9 @@ In Cloudflare Workers, which do not allow compiling Wasm at run time, import bot
|
|
|
50
51
|
without Node.js compatibility):
|
|
51
52
|
|
|
52
53
|
```js
|
|
54
|
+
import kotlin from '@willbooster/tree-sitter-kotlin/tree-sitter-kotlin.wasm';
|
|
53
55
|
import { Language, Parser } from '@willbooster/web-tree-sitter';
|
|
54
56
|
import runtime from '@willbooster/web-tree-sitter/web-tree-sitter.wasm';
|
|
55
|
-
import kotlin from '@willbooster/tree-sitter-kotlin/tree-sitter-kotlin.wasm';
|
|
56
57
|
|
|
57
58
|
await Parser.init({ wasmModule: runtime });
|
|
58
59
|
const parser = new Parser();
|
|
@@ -63,12 +64,12 @@ The package also ships the node types in `src/node-types.json`.
|
|
|
63
64
|
|
|
64
65
|
In Rust, depend on the [crate](https://crates.io/crates/willbooster-tree-sitter-kotlin) and on
|
|
65
66
|
[willbooster-tree-sitter](https://crates.io/crates/willbooster-tree-sitter), the runtime this package is tested and
|
|
66
|
-
fuzzed with. The parser loads only with this runtime, version
|
|
67
|
+
fuzzed with. The parser loads only with this runtime, version 15.0.0 or later in the 15.x series:
|
|
67
68
|
|
|
68
69
|
```toml
|
|
69
70
|
[dependencies]
|
|
70
|
-
tree-sitter = { package = "willbooster-tree-sitter", version = "
|
|
71
|
-
tree-sitter-kotlin = { package = "willbooster-tree-sitter-kotlin", version = "
|
|
71
|
+
tree-sitter = { package = "willbooster-tree-sitter", version = "15.0.0" }
|
|
72
|
+
tree-sitter-kotlin = { package = "willbooster-tree-sitter-kotlin", version = "9" }
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
```rust
|
package/package.json
CHANGED
|
@@ -1,25 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@willbooster/tree-sitter-kotlin",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
4
|
"description": "Kotlin grammar for tree-sitter",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"incremental",
|
|
7
|
+
"kotlin",
|
|
7
8
|
"parsing",
|
|
8
|
-
"tree-sitter"
|
|
9
|
-
"kotlin"
|
|
9
|
+
"tree-sitter"
|
|
10
10
|
],
|
|
11
|
+
"license": "MIT",
|
|
12
|
+
"author": "WillBooster Inc.",
|
|
11
13
|
"repository": {
|
|
12
14
|
"type": "git",
|
|
13
15
|
"url": "git+https://github.com/WillBooster/tree-sitter-kotlin.git"
|
|
14
16
|
},
|
|
15
|
-
"license": "MIT",
|
|
16
|
-
"author": "WillBooster Inc.",
|
|
17
17
|
"files": [
|
|
18
18
|
"grammar.js",
|
|
19
19
|
"tree-sitter.json",
|
|
20
20
|
"src/node-types.json",
|
|
21
21
|
"*.wasm"
|
|
22
22
|
],
|
|
23
|
+
"publishConfig": {
|
|
24
|
+
"access": "public",
|
|
25
|
+
"registry": "https://registry.npmjs.org/"
|
|
26
|
+
},
|
|
23
27
|
"scripts": {
|
|
24
28
|
"build-wasm": "script/generate --build-wasm",
|
|
25
29
|
"build/ci": "bun run build-wasm",
|
|
@@ -42,33 +46,26 @@
|
|
|
42
46
|
"devDependencies": {
|
|
43
47
|
"@tsconfig/bun": "1.0.11",
|
|
44
48
|
"@types/bun": "1.4.3",
|
|
45
|
-
"@vitest/browser-playwright": "5.0.
|
|
46
|
-
"@willbooster/
|
|
47
|
-
"@willbooster/
|
|
48
|
-
"@willbooster/
|
|
49
|
-
"@willbooster/web-tree-sitter": "13.0.0",
|
|
49
|
+
"@vitest/browser-playwright": "5.0.5",
|
|
50
|
+
"@willbooster/oxlint-config": "1.4.9",
|
|
51
|
+
"@willbooster/wb": "22.29.3",
|
|
52
|
+
"@willbooster/web-tree-sitter": "15.0.0",
|
|
50
53
|
"conventional-changelog-conventionalcommits": "10.4.1",
|
|
51
54
|
"lefthook": "2.2.2",
|
|
52
|
-
"oxfmt": "0.73.0",
|
|
53
55
|
"oxlint": "1.88.0",
|
|
54
56
|
"oxlint-tsgolint": "7.0.2004",
|
|
55
|
-
"playwright": "1.64.
|
|
57
|
+
"playwright": "1.64.1",
|
|
56
58
|
"semantic-release": "25.0.9",
|
|
57
|
-
"sort-package-json": "4.1.0",
|
|
58
59
|
"vite": "8.3.4",
|
|
59
|
-
"vitest": "5.0.
|
|
60
|
-
"wrangler": "4.
|
|
60
|
+
"vitest": "5.0.5",
|
|
61
|
+
"wrangler": "4.151.1"
|
|
61
62
|
},
|
|
62
63
|
"peerDependencies": {
|
|
63
|
-
"@willbooster/web-tree-sitter": "^
|
|
64
|
+
"@willbooster/web-tree-sitter": "^15.0.0"
|
|
64
65
|
},
|
|
65
66
|
"peerDependenciesMeta": {
|
|
66
67
|
"@willbooster/web-tree-sitter": {
|
|
67
68
|
"optional": true
|
|
68
69
|
}
|
|
69
|
-
},
|
|
70
|
-
"publishConfig": {
|
|
71
|
-
"access": "public",
|
|
72
|
-
"registry": "https://registry.npmjs.org/"
|
|
73
70
|
}
|
|
74
71
|
}
|
package/tree-sitter-kotlin.wasm
CHANGED
|
Binary file
|