File tree Expand file tree Collapse file tree 9 files changed +79
-5
lines changed Expand file tree Collapse file tree 9 files changed +79
-5
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @ast-grep/lang-toml" ,
3
- "version" : " 0.0.1 " ,
3
+ "version" : " 0.0.2 " ,
4
4
"description" : " " ,
5
5
"main" : " index.js" ,
6
6
"scripts" : {
Original file line number Diff line number Diff line change 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
} )
Original file line number Diff line number Diff line change
1
+ type LanguageRegistration = {
2
+ libraryPath : string
3
+ extensions : string [ ]
4
+ languageSymbol ?: string
5
+ metaVarChar ?: string
6
+ expandoChar ?: string
7
+ }
8
+
9
+ declare const registratoin : LanguageRegistration
10
+ export default registratoin
Original file line number Diff line number Diff line change
1
+ const path = require ( 'node:path' )
2
+ const libPath = path . join ( __dirname , 'parser.so' )
3
+
4
+ module . exports = {
5
+ libraryPath : libPath ,
6
+ extensions : $$EXTENSIONS$$ ,
7
+ languageSymbol : $$LANGUAGE_SYMBOL$$ ,
8
+ expandoChar : '_' ,
9
+ }
Original file line number Diff line number Diff line change
1
+ const { setup } = require ( '@ast-grep/nursery' )
2
+ const languageRegistration = require ( './index' )
3
+
4
+ setup ( {
5
+ dirname : __dirname ,
6
+ name : '$$NAME$$' ,
7
+ treeSitterPackage : '$$TREE_SITTER_PACKAGE$$' ,
8
+ languageRegistration,
9
+ testRunner : ( parse ) => {
10
+ // add test here
11
+ }
12
+ } )
Original file line number Diff line number Diff line change
1
+ {
2
+ "name" : " @ast-grep/lang-$$NAME$$" ,
3
+ "version" : " 0.0.1" ,
4
+ "description" : " " ,
5
+ "main" : " index.js" ,
6
+ "scripts" : {
7
+ "build" : " tree-sitter build -o parser.so" ,
8
+ "source" : " node nursery.js source" ,
9
+ "prepublishOnly" : " node nursery.js source" ,
10
+ "postinstall" : " node postinstall.js" ,
11
+ "test" : " node nursery.js test"
12
+ },
13
+ "files" : [
14
+ " index.js" ,
15
+ " index.d.ts" ,
16
+ " type.d.ts" ,
17
+ " postinstall.js" ,
18
+ " src" ,
19
+ " prebuilds"
20
+ ],
21
+ "keywords" : [],
22
+ "author" : " " ,
23
+ "license" : " ISC" ,
24
+ "dependencies" : {
25
+ "@ast-grep/setup-lang" : " 0.0.2"
26
+ },
27
+ "peerDependencies" : {
28
+ "tree-sitter-cli" : " 0.24.6"
29
+ },
30
+ "peerDependenciesMeta" : {
31
+ "tree-sitter-cli" : {
32
+ "optional" : true
33
+ }
34
+ },
35
+ "devDependencies" : {
36
+ "@ast-grep/nursery" : " 0.0.2"
37
+ },
38
+ "publishConfig" : {
39
+ "access" : " public" ,
40
+ "registry" : " https://registry.npmjs.org/"
41
+ }
42
+ }
Original file line number Diff line number Diff line change
1
+ const { postinstall } = require ( '@ast-grep/setup-lang' )
2
+ postinstall ( {
3
+ dirname : __dirname ,
4
+ } )
Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ function log(...args: unknown[]) {
12
12
interface SetupConfig {
13
13
/** Directory of the lang package. e.g. __dirname */
14
14
dirname : string
15
- /** Package name of tree-sitter package. e.g. tree-sitter-css */
16
- treeSitterPackage : string
17
15
}
18
16
19
17
/**
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @ast-grep/setup-lang" ,
3
- "version" : " 0.0.2 " ,
3
+ "version" : " 0.0.3 " ,
4
4
"private" : false ,
5
5
"description" : " " ,
6
6
"main" : " index.js" ,
You can’t perform that action at this time.
0 commit comments