Skip to content

Commit

Permalink
Add package.json for mozjs grammar (#539)
Browse files Browse the repository at this point in the history
* Do not remove package files from moz grammars

When a grammar is updated, package files need to be maintained in order
to pin up dependencies so that it is impossible to have indefinite
`tree-sitter-cli` versions

* mozjs: Add package.json
  • Loading branch information
Luni-4 authored Mar 10, 2021
1 parent d6eceac commit 5fa6788
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 6 deletions.
3 changes: 0 additions & 3 deletions generate-grammars/generate-mozcpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ npm install --save-dev tree-sitter-cli
# Delete node_modules
rm -rf node_modules

# Delete package files
rm -rf package-lock.json package.json

# Delete tree-sitter-cpp directory
rm -rf tree-sitter-cpp

Expand Down
3 changes: 0 additions & 3 deletions generate-grammars/generate-mozjs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ npm install --save-dev tree-sitter-cli
# Delete node_modules
rm -rf node_modules

# Delete package files
rm -rf package-lock.json package.json

# Delete tree-sitter-javascript directory
rm -rf tree-sitter-javascript

Expand Down
38 changes: 38 additions & 0 deletions tree-sitter-mozjs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"name": "tree-sitter-mozjs",
"version": "0.17.0",
"description": "Mozjs grammar for node-tree-sitter",
"main": "index.js",
"keywords": [
"parser",
"lexer"
],
"author": "Calixte Denizet",
"license": "MIT",
"dependencies": {
"nan": "^2.14.2"
},
"devDependencies": {
"tree-sitter-cli": "^0.17.3"
},
"scripts": {
"build": "tree-sitter generate && node-gyp build",
"test": "tree-sitter test && tree-sitter parse examples/* --quiet --time",
"test-windows": "tree-sitter test",
"install": "node-gyp rebuild"
},
"tree-sitter": [
{
"scope": "source.js",
"file-types": [
"js",
"js2",
"jsm"
]
}
],
"gypfile": true,
"directories": {
"example": "examples"
}
}

0 comments on commit 5fa6788

Please sign in to comment.