From 1652d176d19d1603058418fe0d326ad79007e6ef Mon Sep 17 00:00:00 2001 From: dhananjaypai08 Date: Sat, 14 Jun 2025 00:42:47 +0530 Subject: [PATCH 1/2] feat(husky-setup): husky pre-commit hook --- .husky/pre-commit | 5 +++++ package-lock.json | 17 +++++++++++++++++ package.json | 2 ++ yarn.lock | 5 +++++ 4 files changed, 29 insertions(+) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..988a083 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,5 @@ +#!/bin/bash + +npm run lint:fix +npm run lint:check +npm run test \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index 7cd3349..1156f97 100644 --- a/package-lock.json +++ b/package-lock.json @@ -35,6 +35,7 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", + "husky": "^9.1.7", "jest": "^29.5.0", "nock": "^13.3.1", "prettier": "^3.0.3", @@ -8219,6 +8220,22 @@ "node": ">=10.17.0" } }, + "node_modules/husky": { + "version": "9.1.7", + "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", + "integrity": "sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==", + "dev": true, + "license": "MIT", + "bin": { + "husky": "bin.js" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/typicode" + } + }, "node_modules/iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", diff --git a/package.json b/package.json index c555da0..3dcb561 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "description": "An NPM package with collection of functions that can be used for working with Chainlink Functions.", "main": "./dist/index.js", "scripts": { + "prepare": "husky", "build": "rimraf dist && tsc -P tsconfig.build.json && cpy src/simulateScript/deno-sandbox/**/* dist/simulateScript/deno-sandbox && yarn build:browser", "build:browser": "webpack && browserify dist/frontendSimulateScript.bundle.js -o dist/simulateScript.browser.js -t [ babelify --presets [ @babel/preset-env ] ] --standalone simulateScript && rm dist/frontendSimulateScript.bundle.js", "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest", @@ -51,6 +52,7 @@ "eslint": "^8.51.0", "eslint-config-prettier": "^9.0.0", "eslint-plugin-prettier": "^5.0.1", + "husky": "^9.1.7", "jest": "^29.5.0", "nock": "^13.3.1", "prettier": "^3.0.3", diff --git a/yarn.lock b/yarn.lock index 547330c..bb58706 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4355,6 +4355,11 @@ human-signals@^4.3.0: resolved "https://registry.npmjs.org/human-signals/-/human-signals-4.3.1.tgz" integrity sha512-nZXjEF2nbo7lIw3mgYjItAfgQXog3OjJogSbKa2CQIIvSGWcKgeJnQlNXip6NglNzYH45nSRiEVimMvYL8DDqQ== +husky@^9.1.7: + version "9.1.7" + resolved "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz" + integrity sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA== + iconv-lite@^0.4.24: version "0.4.24" resolved "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz" From 2c8dcf3a1da5a996ec22e11b2934f281a25db3f8 Mon Sep 17 00:00:00 2001 From: dhananjaypai08 Date: Sat, 14 Jun 2025 00:48:22 +0530 Subject: [PATCH 2/2] chore(husky): pause test pre-commit hook --- .husky/pre-commit | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index 988a083..b6b42c8 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1,5 +1,4 @@ #!/bin/bash npm run lint:fix -npm run lint:check -npm run test \ No newline at end of file +npm run lint:check \ No newline at end of file