From 59e2fbeebb149830211db2de4e29427318467905 Mon Sep 17 00:00:00 2001 From: Pacharapol Withayasakpunt Date: Tue, 5 Oct 2021 23:39:49 +0700 Subject: [PATCH] add build hooks --- .gitattributes | 1 + .husky/pre-commit | 4 ++++ package.json | 4 +++- yarn.lock | 5 +++++ 4 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .gitattributes create mode 100755 .husky/pre-commit diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..51cb6ab --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +lib/* linguist-vendored diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..a135470 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +yarn build diff --git a/package.json b/package.json index ff7d858..32a05f8 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "license": "MIT", "scripts": { "ts": "ts-node -O '{\"noImplicitAny\":false}'", - "build": "tsc -p src/tsconfig.json" + "build": "tsc -p src/tsconfig.json", + "prepare": "husky install" }, "dependencies": { "axios": "^0.22.0", @@ -16,6 +17,7 @@ }, "devDependencies": { "@types/node": "^16.9.6", + "husky": "^7.0.2", "import-sort-parser-typescript": "^6.0.0", "ts-node": "^10.2.1", "typescript": "^4.4.3" diff --git a/yarn.lock b/yarn.lock index 4df434a..a51d5dc 100644 --- a/yarn.lock +++ b/yarn.lock @@ -81,6 +81,11 @@ follow-redirects@^1.14.4: resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.4.tgz#838fdf48a8bbdd79e52ee51fb1c94e3ed98b9379" integrity sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g== +husky@^7.0.2: + version "7.0.2" + resolved "https://registry.yarnpkg.com/husky/-/husky-7.0.2.tgz#21900da0f30199acca43a46c043c4ad84ae88dff" + integrity sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg== + import-sort-parser-typescript@^6.0.0: version "6.0.0" resolved "https://registry.yarnpkg.com/import-sort-parser-typescript/-/import-sort-parser-typescript-6.0.0.tgz#98e73cef9e077d073e798722ed59e215b51c17e2"