diff --git a/.cirrus.yml b/.cirrus.yml index dcac4249..08fd96ad 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -1,8 +1,8 @@ freebsd_instance: - image: freebsd-12-1-release-amd64 + image: freebsd-12-2-release-amd64 task: - name: FreeBSD 12.1 + name: FreeBSD 12.2 env: DEBUG: 'napi:*' setup_script: diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 00000000..c9cdc63b --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 00000000..f5c8eadb --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn lint-staged && cargo fmt --all \ No newline at end of file diff --git a/package.json b/package.json index f803c88d..5088fb77 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,10 @@ "format:source": "prettier --config ./package.json --write './**/*.{js,ts}'", "format:yaml": "prettier --parser yaml --write './**/*.{yml,yaml}'", "lint": "eslint -c .eslintrc.yml './cli/**/*.ts' './test_module/**/*.{ts,js}'", - "prepublishOnly": "npm run build", - "test": "ava" + "prepublishOnly": "npm run build && pinst --disable", + "test": "ava", + "postinstall": "husky install", + "postpublish": "pinst --enable" }, "bugs": { "url": "https://github.com/napi-rs/napi-rs/issues"