@ast-grep/create-lang 0.0.0-prerelease-2 → 0.0.0-prerelease-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 +18 -0
- package/package.json +2 -2
- package/template/package.json +2 -1
package/README.md
CHANGED
|
@@ -8,3 +8,21 @@ pnpm create @ast-grep/lang
|
|
|
8
8
|
# create package in a specific directory
|
|
9
9
|
pnpm create @ast-grep/lang some-dir
|
|
10
10
|
```
|
|
11
|
+
|
|
12
|
+
You will be prompted to enter the language name, the language file extension, package name and tree-sitter grammar package.
|
|
13
|
+
|
|
14
|
+
Note the tree-sitter grammar package is different from the package name. package name is the repo you create, tree-sitter package should be a package already published on npm.
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## Commands
|
|
18
|
+
After the package is created, you can use these commands:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm source # copy tree-sitter grammar files to the src folder
|
|
22
|
+
pnpm build # build the tree-sitter grammar files to dynamic lib
|
|
23
|
+
pnpm test # test the tree-sitter grammar files
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Test file
|
|
27
|
+
|
|
28
|
+
You can edit `nursery.js` to add test case for your language.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ast-grep/create-lang",
|
|
3
|
-
"version": "0.0.0-prerelease-
|
|
3
|
+
"version": "0.0.0-prerelease-3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"registry": "https://registry.npmjs.org/"
|
|
27
27
|
},
|
|
28
28
|
"devDependencies": {
|
|
29
|
-
"@types/node": "22.10.
|
|
29
|
+
"@types/node": "22.10.7",
|
|
30
30
|
"@types/prompts": "^2.4.9",
|
|
31
31
|
"typescript": "^5.7.3"
|
|
32
32
|
},
|
package/template/package.json
CHANGED