File tree Expand file tree Collapse file tree 6 files changed +120
-1
lines changed Expand file tree Collapse file tree 6 files changed +120
-1
lines changed Original file line number Diff line number Diff line change
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
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
+ ```
Original file line number Diff line number Diff line change @@ -40,4 +40,23 @@ function askConfiguration() {
40
40
] )
41
41
}
42
42
43
- askConfiguration ( ) . then ( console . log )
43
+ async function copyTemplate ( ) {
44
+ }
45
+
46
+ function removeDotFiles ( ) {
47
+ }
48
+ function renameFiles ( ) {
49
+ // Rename files
50
+ }
51
+
52
+ async function main ( ) {
53
+ const config = await askConfiguration ( )
54
+ await copyTemplate ( )
55
+ if ( process . argv . slice ( 2 ) . includes ( '--skip-dot-files' ) ) {
56
+ removeDotFiles ( )
57
+ }
58
+ renameFiles ( )
59
+ }
60
+
61
+ main ( )
62
+
Original file line number Diff line number Diff line change
1
+ name : Publish package
2
+
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ directory :
7
+ description : The working directory of the package, useful for monorepos
8
+ default : .
9
+ type : string
10
+ dry-run :
11
+ description : Dry run (no publish)
12
+ type : boolean
13
+ default : true
14
+
15
+ jobs :
16
+ npm-publish :
17
+ uses : ast-grep/langs/.github/workflows/release.yml@main
18
+ with :
19
+ directory : ${{ inputs.directory }}
20
+ dry-run : ${{ inputs.dry-run }}
21
+ secrets :
22
+ NODE_AUTH_TOKEN : ${{secrets.NODE_AUTH_TOKEN}}
Original file line number Diff line number Diff line change
1
+ # Logs
2
+ logs
3
+ * .log
4
+ npm-debug.log *
5
+ yarn-debug.log *
6
+ yarn-error.log *
7
+ pnpm-debug.log *
8
+ lerna-debug.log *
9
+
10
+ node_modules
11
+ dist
12
+ dist-ssr
13
+ * .local
14
+
15
+ # Editor directories and files
16
+ .vscode /*
17
+ ! .vscode /extensions.json
18
+ .idea
19
+ .DS_Store
20
+ * .suo
21
+ * .ntvs *
22
+ * .njsproj
23
+ * .sln
24
+ * .sw ?
25
+
26
+ # ignore generated parser files
27
+ parser.so
28
+ type.d.ts
29
+ # do not include copied directories
30
+ src
Original file line number Diff line number Diff line change
1
+ # ast-grep napi language for $NAME$
2
+
3
+ ## Installation
4
+
5
+ In a pnpm project, run:
6
+
7
+ ``` bash
8
+ pnpm install $PACKAGE_NAME $
9
+ pnpm install @ast-grep/napi
10
+ # install the tree-sitter-cli if no prebuild is available
11
+ pnpm install @tree-sitter/cli
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ ``` js
17
+ import $NAME $ from ' $PACKAGE_NAME$'
18
+ import { registerDynamicLanguage , parse } from ' @ast-grep/napi'
19
+
20
+ registerDynamicLanguage ({ $NAME$ })
21
+
22
+ const sg = parse (' $NAME$' , ` your code` )
23
+ sg .root ().kind ()
24
+ ```
You can’t perform that action at this time.
0 commit comments