@ast-grep/lang-toml 0.0.1 → 0.0.3

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 ADDED
@@ -0,0 +1,24 @@
1
+ # ast-grep napi language for toml
2
+
3
+ ## Installation
4
+
5
+ In a pnpm project, run:
6
+
7
+ ```bash
8
+ pnpm install @ast-grep/lang-toml
9
+ pnpm install @ast-grep/napi
10
+ # install the tree-sitter-cli if no prebuild is available
11
+ pnpm install @tree-sitter/cli --save-dev
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ```js
17
+ import toml from '@ast-grep/lang-toml'
18
+ import { registerDynamicLanguage, parse } from '@ast-grep/napi'
19
+
20
+ registerDynamicLanguage({ toml })
21
+
22
+ const sg = parse('toml', `your code`)
23
+ sg.root().kind()
24
+ ```
package/index.d.ts CHANGED
@@ -6,5 +6,5 @@ type LanguageRegistration = {
6
6
  expandoChar?: string
7
7
  }
8
8
 
9
- declare const registratoin: LanguageRegistration
10
- export default registratoin
9
+ declare const registration: LanguageRegistration
10
+ export default registration
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- const path = require('path')
1
+ const path = require('node:path')
2
2
  const libPath = path.join(__dirname, 'parser.so')
3
3
 
4
4
  module.exports = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ast-grep/lang-toml",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -11,14 +11,17 @@
11
11
  "src",
12
12
  "prebuilds"
13
13
  ],
14
- "keywords": [],
14
+ "keywords": [
15
+ "ast-grep",
16
+ "ast-grep-lang"
17
+ ],
15
18
  "author": "",
16
19
  "license": "ISC",
17
20
  "dependencies": {
18
- "@ast-grep/setup-lang": "0.0.2"
21
+ "@ast-grep/setup-lang": "0.0.3"
19
22
  },
20
23
  "peerDependencies": {
21
- "tree-sitter-cli": "0.24.6"
24
+ "tree-sitter-cli": "0.25.6"
22
25
  },
23
26
  "peerDependenciesMeta": {
24
27
  "tree-sitter-cli": {
@@ -27,7 +30,8 @@
27
30
  },
28
31
  "devDependencies": {
29
32
  "@tree-sitter-grammars/tree-sitter-toml": "0.7.0",
30
- "@ast-grep/nursery": "0.0.2"
33
+ "tree-sitter-cli": "0.25.6",
34
+ "@ast-grep/nursery": "0.0.4"
31
35
  },
32
36
  "publishConfig": {
33
37
  "access": "public",
package/postinstall.js CHANGED
@@ -1,5 +1,4 @@
1
1
  const { postinstall } = require('@ast-grep/setup-lang')
2
2
  postinstall({
3
3
  dirname: __dirname,
4
- treeSitterPackage: '@tree-sitter-grammars/tree-sitter-toml',
5
4
  })