From 70d94eb826fec0fb14d58343aafefc1ab8778221 Mon Sep 17 00:00:00 2001 From: Kenneth Skovhus Date: Mon, 6 Aug 2018 19:03:34 +0200 Subject: [PATCH] Development experience (#25) * Rename prebuild target clashing with build target * Add test:watch target and documentation --- .travis.yml | 2 +- README.md | 15 +++++++++++++++ appveyor.yml | 2 +- package.json | 12 ++++++++++-- 4 files changed, 27 insertions(+), 4 deletions(-) diff --git a/.travis.yml b/.travis.yml index f6f7461..c20a925 100644 --- a/.travis.yml +++ b/.travis.yml @@ -33,7 +33,7 @@ branches: deploy: provider: script - script: npm run prebuild && npm run prebuild:upload -u ${PREBUILD_UPLOAD} + script: npm run pre-build && npm run pre-build:upload -u ${PREBUILD_UPLOAD} skip_cleanup: true on: all_branches: true diff --git a/README.md b/README.md index b7207b8..4e2cecb 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,21 @@ tree-sitter-bash Bash grammar for [tree-sitter](https://github.com/tree-sitter/tree-sitter). +### Development + +Install the dependencies: + + npm install + +Build and run the tests: + + npm run build + npm run test + +Run the build and tests in watch mode: + + npm run test:watch + #### References * [Bash man page](http://man7.org/linux/man-pages/man1/bash.1.html#SHELL_GRAMMAR) diff --git a/appveyor.yml b/appveyor.yml index 9095843..708a476 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -25,4 +25,4 @@ branches: - master - /^v.*$/ -deploy_script: IF "%APPVEYOR_REPO_TAG%" == "true" (npm run prebuild && npm run prebuild:upload -u %PREBUILD_UPLOAD%) +deploy_script: IF "%APPVEYOR_REPO_TAG%" == "true" (npm run pre-build && npm run pre-build:upload -u %PREBUILD_UPLOAD%) diff --git a/package.json b/package.json index 8ce24ba..688c483 100644 --- a/package.json +++ b/package.json @@ -14,16 +14,24 @@ "prebuild-install": "^5.0.0" }, "devDependencies": { + "nodemon": "^1.18.3", "prebuild": "^7.6.1", "tree-sitter-cli": "^0.13.1" }, "scripts": { "build": "tree-sitter generate && node-gyp build", "install": "prebuild-install || node-gyp rebuild", - "prebuild": "prebuild --all --strip --verbose", - "prebuild:upload": "prebuild --upload-all", + "pre-build": "prebuild --all --strip --verbose", + "pre-build:upload": "prebuild --upload-all", "test": "tree-sitter test && script/parse-examples.sh", + "test:watch": "nodemon --exec 'npm run build && npm run test' --ext js,txt,sh", "test-windows": "tree-sitter test" }, + "nodemonConfig": { + "ignore": [ + "build/", + "src/" + ] + }, "repository": "https://github.com/tree-sitter/tree-sitter-bash" }