@willbooster/tree-sitter-bash 1.1.4 → 2.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@willbooster/tree-sitter-bash",
3
- "version": "1.1.4",
3
+ "version": "2.0.1",
4
4
  "description": "Bash grammar for tree-sitter",
5
5
  "keywords": [
6
6
  "incremental",
@@ -14,58 +14,53 @@
14
14
  },
15
15
  "license": "MIT",
16
16
  "author": "WillBooster Inc.",
17
- "main": "bindings/node",
18
- "types": "bindings/node",
19
17
  "files": [
20
18
  "grammar.js",
21
19
  "tree-sitter.json",
22
- "binding.gyp",
23
- "prebuilds/**",
24
- "bindings/node/*",
25
20
  "queries/*",
26
- "src/**",
21
+ "src/node-types.json",
27
22
  "*.wasm"
28
23
  ],
29
24
  "scripts": {
30
- "build-prebuilds": "prebuildify --napi --strip --name tree-sitter-bash",
31
25
  "build-wasm": "tree-sitter build --wasm",
32
- "build/ci": "tree-sitter generate && node-gyp rebuild",
26
+ "build/ci": "tree-sitter generate && tree-sitter build --wasm",
33
27
  "cleanup": "bun wb lint --fix --format",
34
28
  "format": "bun wb lint --format",
35
- "install": "node-gyp-build",
36
29
  "lint": "bun wb lint",
37
30
  "lint-fix": "bun wb lint --fix",
38
31
  "prepare": "(bun lefthook install || true) && (test ! -f .lefthook/normalize-bun-lockfile.sh || bash .lefthook/normalize-bun-lockfile.sh)",
39
32
  "release": "wb release",
40
- "release-test": "node node_modules/semantic-release/bin/semantic-release.js --dry-run --plugins @semantic-release/commit-analyzer @semantic-release/release-notes-generator",
41
33
  "prestart": "bun run build-wasm",
42
34
  "start": "tree-sitter playground",
43
35
  "test": "bun wb test",
44
36
  "test/ci": "bun wb test-on-ci",
37
+ "typecheck": "bun wb typecheck",
45
38
  "verify": "bun wb verify",
46
39
  "verify-full": "bun wb verify --full"
47
40
  },
48
- "dependencies": {
49
- "node-addon-api": "^8.2.1",
50
- "node-gyp-build": "^4.8.2"
51
- },
52
41
  "devDependencies": {
53
42
  "@semantic-release/exec": "7.1.0",
43
+ "@tsconfig/bun": "1.0.11",
44
+ "@types/bun": "1.4.2",
45
+ "@willbooster/oxfmt-config": "1.2.2",
46
+ "@willbooster/oxlint-config": "1.4.8",
54
47
  "@willbooster/wb": "22.8.0",
55
48
  "conventional-changelog-conventionalcommits": "10.4.0",
56
49
  "lefthook": "2.1.14",
57
- "node-gyp": "13.0.2",
58
- "prebuildify": "^6.0.1",
50
+ "oxfmt": "0.68.0",
51
+ "oxlint": "1.83.0",
52
+ "oxlint-tsgolint": "7.0.2002",
59
53
  "semantic-release": "25.0.9",
60
54
  "sort-package-json": "4.0.0",
61
- "tree-sitter": "^0.25.0",
62
- "tree-sitter-cli": "^0.27.0"
55
+ "tree-sitter-cli": "0.27.0",
56
+ "typescript": "7.0.2",
57
+ "web-tree-sitter": "0.27.0"
63
58
  },
64
59
  "peerDependencies": {
65
- "tree-sitter": "^0.25.0"
60
+ "web-tree-sitter": "^0.27.0"
66
61
  },
67
62
  "peerDependenciesMeta": {
68
- "tree-sitter": {
63
+ "web-tree-sitter": {
69
64
  "optional": true
70
65
  }
71
66
  },
Binary file
package/tree-sitter.json CHANGED
@@ -18,7 +18,7 @@
18
18
  }
19
19
  ],
20
20
  "metadata": {
21
- "version": "1.1.4",
21
+ "version": "2.0.1",
22
22
  "license": "MIT",
23
23
  "description": "Bash grammar for tree-sitter",
24
24
  "authors": [
@@ -29,13 +29,5 @@
29
29
  "links": {
30
30
  "repository": "https://github.com/WillBooster/tree-sitter-bash"
31
31
  }
32
- },
33
- "bindings": {
34
- "c": true,
35
- "go": true,
36
- "node": true,
37
- "python": true,
38
- "rust": false,
39
- "swift": true
40
32
  }
41
33
  }
package/binding.gyp DELETED
@@ -1,30 +0,0 @@
1
- {
2
- "targets": [
3
- {
4
- "target_name": "tree_sitter_bash_binding",
5
- "dependencies": [
6
- "<!(node -p \"require('node-addon-api').targets\"):node_addon_api_except",
7
- ],
8
- "include_dirs": [
9
- "src",
10
- ],
11
- "sources": [
12
- "bindings/node/binding.cc",
13
- "src/parser.c",
14
- "src/scanner.c",
15
- ],
16
- "conditions": [
17
- ["OS!='win'", {
18
- "cflags_c": [
19
- "-std=c11",
20
- ],
21
- }, { # OS == "win"
22
- "cflags_c": [
23
- "/std:c11",
24
- "/utf-8",
25
- ],
26
- }],
27
- ],
28
- }
29
- ]
30
- }
@@ -1,20 +0,0 @@
1
- #include <napi.h>
2
-
3
- typedef struct TSLanguage TSLanguage;
4
-
5
- extern "C" TSLanguage *tree_sitter_bash();
6
-
7
- // "tree-sitter", "language" hashed with BLAKE2
8
- const napi_type_tag LANGUAGE_TYPE_TAG = {
9
- 0x8AF2E5212AD58ABF, 0xD5006CAD83ABBA16
10
- };
11
-
12
- Napi::Object Init(Napi::Env env, Napi::Object exports) {
13
- exports["name"] = Napi::String::New(env, "bash");
14
- auto language = Napi::External<TSLanguage>::New(env, tree_sitter_bash());
15
- language.TypeTag(&LANGUAGE_TYPE_TAG);
16
- exports["language"] = language;
17
- return exports;
18
- }
19
-
20
- NODE_API_MODULE(tree_sitter_bash_binding, Init)
@@ -1,9 +0,0 @@
1
- const assert = require("node:assert");
2
- const { test } = require("node:test");
3
-
4
- const Parser = require("tree-sitter");
5
-
6
- test("can load grammar", () => {
7
- const parser = new Parser();
8
- assert.doesNotThrow(() => parser.setLanguage(require(".")));
9
- });
@@ -1,28 +0,0 @@
1
- type BaseNode = {
2
- type: string;
3
- named: boolean;
4
- };
5
-
6
- type ChildNode = {
7
- multiple: boolean;
8
- required: boolean;
9
- types: BaseNode[];
10
- };
11
-
12
- type NodeInfo =
13
- | (BaseNode & {
14
- subtypes: BaseNode[];
15
- })
16
- | (BaseNode & {
17
- fields: { [name: string]: ChildNode };
18
- children: ChildNode[];
19
- });
20
-
21
- type Language = {
22
- name: string;
23
- language: unknown;
24
- nodeTypeInfo: NodeInfo[];
25
- };
26
-
27
- declare const language: Language;
28
- export = language;
@@ -1,11 +0,0 @@
1
- const root = require("path").join(__dirname, "..", "..");
2
-
3
- module.exports =
4
- typeof process.versions.bun === "string"
5
- // Support `bun build --compile` by being statically analyzable enough to find the .node file at build-time
6
- ? require(`../../prebuilds/${process.platform}-${process.arch}/tree-sitter-bash.node`)
7
- : require("node-gyp-build")(root);
8
-
9
- try {
10
- module.exports.nodeTypeInfo = require("../../src/node-types.json");
11
- } catch (_) {}