build: 添加 git hook,提交前格式化代码并执行单元测试。

This commit is contained in:
Ivan Li 2021-09-19 19:43:09 +08:00
parent 8467a42b3b
commit 38dd05c4be
4 changed files with 633 additions and 13 deletions

1
.husky/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
_

5
.husky/pre-commit Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
npx lint-staged
npm test

632
package-lock.json generated
View File

@ -62,7 +62,9 @@
"eslint": "^7.12.1", "eslint": "^7.12.1",
"eslint-config-prettier": "7.2.0", "eslint-config-prettier": "7.2.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"husky": "^7.0.2",
"jest": "^26.6.3", "jest": "^26.6.3",
"lint-staged": "^11.1.2",
"prettier": "^2.1.2", "prettier": "^2.1.2",
"supertest": "^6.0.0", "supertest": "^6.0.0",
"ts-jest": "^26.4.3", "ts-jest": "^26.4.3",
@ -4281,8 +4283,8 @@
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://npm.ivanli.cc/aggregate-error/-/aggregate-error-3.1.0.tgz", "resolved": "https://npm.ivanli.cc/aggregate-error/-/aggregate-error-3.1.0.tgz",
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
"devOptional": true,
"license": "MIT", "license": "MIT",
"optional": true,
"dependencies": { "dependencies": {
"clean-stack": "^2.0.0", "clean-stack": "^2.0.0",
"indent-string": "^4.0.0" "indent-string": "^4.0.0"
@ -6071,8 +6073,8 @@
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://npm.ivanli.cc/clean-stack/-/clean-stack-2.2.0.tgz", "resolved": "https://npm.ivanli.cc/clean-stack/-/clean-stack-2.2.0.tgz",
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
"devOptional": true,
"license": "MIT", "license": "MIT",
"optional": true,
"engines": { "engines": {
"node": ">=6" "node": ">=6"
} }
@ -6252,6 +6254,63 @@
"node": ">=8.10.0" "node": ">=8.10.0"
} }
}, },
"node_modules/cli-truncate": {
"version": "2.1.0",
"resolved": "https://npm.ivanli.cc/cli-truncate/-/cli-truncate-2.1.0.tgz",
"integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==",
"dev": true,
"license": "MIT",
"dependencies": {
"slice-ansi": "^3.0.0",
"string-width": "^4.2.0"
},
"engines": {
"node": ">=8"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/cli-truncate/node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://npm.ivanli.cc/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/cli-truncate/node_modules/slice-ansi": {
"version": "3.0.0",
"resolved": "https://npm.ivanli.cc/slice-ansi/-/slice-ansi-3.0.0.tgz",
"integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"astral-regex": "^2.0.0",
"is-fullwidth-code-point": "^3.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/cli-truncate/node_modules/string-width": {
"version": "4.2.2",
"resolved": "https://npm.ivanli.cc/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/cli-width": { "node_modules/cli-width": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://npm.ivanli.cc/cli-width/-/cli-width-3.0.0.tgz", "resolved": "https://npm.ivanli.cc/cli-width/-/cli-width-3.0.0.tgz",
@ -6417,9 +6476,9 @@
"license": "MIT" "license": "MIT"
}, },
"node_modules/colorette": { "node_modules/colorette": {
"version": "1.2.2", "version": "1.4.0",
"resolved": "https://npm.ivanli.cc/colorette/-/colorette-1.2.2.tgz", "resolved": "https://npm.ivanli.cc/colorette/-/colorette-1.4.0.tgz",
"integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==",
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
@ -8794,6 +8853,13 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/get-own-enumerable-property-symbols": {
"version": "3.0.2",
"resolved": "https://npm.ivanli.cc/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
"dev": true,
"license": "ISC"
},
"node_modules/get-package-type": { "node_modules/get-package-type": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://npm.ivanli.cc/get-package-type/-/get-package-type-0.1.0.tgz", "resolved": "https://npm.ivanli.cc/get-package-type/-/get-package-type-0.1.0.tgz",
@ -9375,6 +9441,22 @@
"ms": "^2.0.0" "ms": "^2.0.0"
} }
}, },
"node_modules/husky": {
"version": "7.0.2",
"resolved": "https://npm.ivanli.cc/husky/-/husky-7.0.2.tgz",
"integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==",
"dev": true,
"license": "MIT",
"bin": {
"husky": "lib/bin.js"
},
"engines": {
"node": ">=12"
},
"funding": {
"url": "https://github.com/sponsors/typicode"
}
},
"node_modules/iconv-lite": { "node_modules/iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://npm.ivanli.cc/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://npm.ivanli.cc/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -9475,8 +9557,8 @@
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://npm.ivanli.cc/indent-string/-/indent-string-4.0.0.tgz", "resolved": "https://npm.ivanli.cc/indent-string/-/indent-string-4.0.0.tgz",
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
"devOptional": true,
"license": "MIT", "license": "MIT",
"optional": true,
"engines": { "engines": {
"node": ">=8" "node": ">=8"
} }
@ -9914,6 +9996,16 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/is-obj": {
"version": "1.0.1",
"resolved": "https://npm.ivanli.cc/is-obj/-/is-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-plain-object": { "node_modules/is-plain-object": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://npm.ivanli.cc/is-plain-object/-/is-plain-object-2.0.4.tgz", "resolved": "https://npm.ivanli.cc/is-plain-object/-/is-plain-object-2.0.4.tgz",
@ -9950,6 +10042,16 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/is-regexp": {
"version": "1.0.0",
"resolved": "https://npm.ivanli.cc/is-regexp/-/is-regexp-1.0.0.tgz",
"integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.10.0"
}
},
"node_modules/is-set": { "node_modules/is-set": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://npm.ivanli.cc/is-set/-/is-set-2.0.2.tgz", "resolved": "https://npm.ivanli.cc/is-set/-/is-set-2.0.2.tgz",
@ -11362,6 +11464,207 @@
"dev": true, "dev": true,
"license": "MIT" "license": "MIT"
}, },
"node_modules/lint-staged": {
"version": "11.1.2",
"resolved": "https://npm.ivanli.cc/lint-staged/-/lint-staged-11.1.2.tgz",
"integrity": "sha512-6lYpNoA9wGqkL6Hew/4n1H6lRqF3qCsujVT0Oq5Z4hiSAM7S6NksPJ3gnr7A7R52xCtiZMcEUNNQ6d6X5Bvh9w==",
"dev": true,
"license": "MIT",
"dependencies": {
"chalk": "^4.1.1",
"cli-truncate": "^2.1.0",
"commander": "^7.2.0",
"cosmiconfig": "^7.0.0",
"debug": "^4.3.1",
"enquirer": "^2.3.6",
"execa": "^5.0.0",
"listr2": "^3.8.2",
"log-symbols": "^4.1.0",
"micromatch": "^4.0.4",
"normalize-path": "^3.0.0",
"please-upgrade-node": "^3.2.0",
"string-argv": "0.3.1",
"stringify-object": "^3.3.0"
},
"bin": {
"lint-staged": "bin/lint-staged.js"
},
"funding": {
"url": "https://opencollective.com/lint-staged"
}
},
"node_modules/lint-staged/node_modules/chalk": {
"version": "4.1.2",
"resolved": "https://npm.ivanli.cc/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/chalk?sponsor=1"
}
},
"node_modules/lint-staged/node_modules/commander": {
"version": "7.2.0",
"resolved": "https://npm.ivanli.cc/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">= 10"
}
},
"node_modules/lint-staged/node_modules/cosmiconfig": {
"version": "7.0.1",
"resolved": "https://npm.ivanli.cc/cosmiconfig/-/cosmiconfig-7.0.1.tgz",
"integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
},
"engines": {
"node": ">=10"
}
},
"node_modules/lint-staged/node_modules/execa": {
"version": "5.1.1",
"resolved": "https://npm.ivanli.cc/execa/-/execa-5.1.1.tgz",
"integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
"dev": true,
"license": "MIT",
"dependencies": {
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sindresorhus/execa?sponsor=1"
}
},
"node_modules/lint-staged/node_modules/get-stream": {
"version": "6.0.1",
"resolved": "https://npm.ivanli.cc/get-stream/-/get-stream-6.0.1.tgz",
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/lint-staged/node_modules/human-signals": {
"version": "2.1.0",
"resolved": "https://npm.ivanli.cc/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true,
"license": "Apache-2.0",
"engines": {
"node": ">=10.17.0"
}
},
"node_modules/listr2": {
"version": "3.12.1",
"resolved": "https://npm.ivanli.cc/listr2/-/listr2-3.12.1.tgz",
"integrity": "sha512-oB1DlXlCzGPbvWhqYBZUQEPJKqsmebQWofXG6Mpbe3uIvoNl8mctBEojyF13ZyqwQ91clCWXpwsWp+t98K4FOQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"cli-truncate": "^2.1.0",
"colorette": "^1.4.0",
"log-update": "^4.0.0",
"p-map": "^4.0.0",
"rxjs": "^6.6.7",
"through": "^2.3.8",
"wrap-ansi": "^7.0.0"
},
"engines": {
"node": ">=10.0.0"
},
"peerDependencies": {
"enquirer": ">= 2.3.0 < 3"
}
},
"node_modules/listr2/node_modules/is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://npm.ivanli.cc/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=8"
}
},
"node_modules/listr2/node_modules/p-map": {
"version": "4.0.0",
"resolved": "https://npm.ivanli.cc/p-map/-/p-map-4.0.0.tgz",
"integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
"dev": true,
"license": "MIT",
"dependencies": {
"aggregate-error": "^3.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/listr2/node_modules/string-width": {
"version": "4.2.2",
"resolved": "https://npm.ivanli.cc/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dev": true,
"license": "MIT",
"dependencies": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=8"
}
},
"node_modules/listr2/node_modules/wrap-ansi": {
"version": "7.0.0",
"resolved": "https://npm.ivanli.cc/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/chalk/wrap-ansi?sponsor=1"
}
},
"node_modules/loader-runner": { "node_modules/loader-runner": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://npm.ivanli.cc/loader-runner/-/loader-runner-4.2.0.tgz", "resolved": "https://npm.ivanli.cc/loader-runner/-/loader-runner-4.2.0.tgz",
@ -11532,6 +11835,25 @@
"url": "https://github.com/chalk/chalk?sponsor=1" "url": "https://github.com/chalk/chalk?sponsor=1"
} }
}, },
"node_modules/log-update": {
"version": "4.0.0",
"resolved": "https://npm.ivanli.cc/log-update/-/log-update-4.0.0.tgz",
"integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==",
"dev": true,
"license": "MIT",
"dependencies": {
"ansi-escapes": "^4.3.0",
"cli-cursor": "^3.1.0",
"slice-ansi": "^4.0.0",
"wrap-ansi": "^6.2.0"
},
"engines": {
"node": ">=10"
},
"funding": {
"url": "https://github.com/sponsors/sindresorhus"
}
},
"node_modules/loglevel": { "node_modules/loglevel": {
"version": "1.7.1", "version": "1.7.1",
"resolved": "https://npm.ivanli.cc/loglevel/-/loglevel-1.7.1.tgz", "resolved": "https://npm.ivanli.cc/loglevel/-/loglevel-1.7.1.tgz",
@ -13329,6 +13651,16 @@
"node": ">=8" "node": ">=8"
} }
}, },
"node_modules/please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://npm.ivanli.cc/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
"integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
"dev": true,
"license": "MIT",
"dependencies": {
"semver-compare": "^1.0.0"
}
},
"node_modules/pluralize": { "node_modules/pluralize": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://npm.ivanli.cc/pluralize/-/pluralize-8.0.0.tgz", "resolved": "https://npm.ivanli.cc/pluralize/-/pluralize-8.0.0.tgz",
@ -14723,6 +15055,13 @@
"node": ">=10" "node": ">=10"
} }
}, },
"node_modules/semver-compare": {
"version": "1.0.0",
"resolved": "https://npm.ivanli.cc/semver-compare/-/semver-compare-1.0.0.tgz",
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
"dev": true,
"license": "MIT"
},
"node_modules/send": { "node_modules/send": {
"version": "0.17.1", "version": "0.17.1",
"resolved": "https://npm.ivanli.cc/send/-/send-0.17.1.tgz", "resolved": "https://npm.ivanli.cc/send/-/send-0.17.1.tgz",
@ -15602,6 +15941,16 @@
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=",
"license": "MIT" "license": "MIT"
}, },
"node_modules/string-argv": {
"version": "0.3.1",
"resolved": "https://npm.ivanli.cc/string-argv/-/string-argv-0.3.1.tgz",
"integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==",
"dev": true,
"license": "MIT",
"engines": {
"node": ">=0.6.19"
}
},
"node_modules/string-length": { "node_modules/string-length": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://npm.ivanli.cc/string-length/-/string-length-4.0.2.tgz", "resolved": "https://npm.ivanli.cc/string-length/-/string-length-4.0.2.tgz",
@ -15676,6 +16025,21 @@
"url": "https://github.com/sponsors/ljharb" "url": "https://github.com/sponsors/ljharb"
} }
}, },
"node_modules/stringify-object": {
"version": "3.3.0",
"resolved": "https://npm.ivanli.cc/stringify-object/-/stringify-object-3.3.0.tgz",
"integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
"get-own-enumerable-property-symbols": "^3.0.0",
"is-obj": "^1.0.1",
"is-regexp": "^1.0.0"
},
"engines": {
"node": ">=4"
}
},
"node_modules/strip-ansi": { "node_modules/strip-ansi": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://npm.ivanli.cc/strip-ansi/-/strip-ansi-6.0.0.tgz", "resolved": "https://npm.ivanli.cc/strip-ansi/-/strip-ansi-6.0.0.tgz",
@ -21149,7 +21513,7 @@
"version": "3.1.0", "version": "3.1.0",
"resolved": "https://npm.ivanli.cc/aggregate-error/-/aggregate-error-3.1.0.tgz", "resolved": "https://npm.ivanli.cc/aggregate-error/-/aggregate-error-3.1.0.tgz",
"integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==",
"optional": true, "devOptional": true,
"requires": { "requires": {
"clean-stack": "^2.0.0", "clean-stack": "^2.0.0",
"indent-string": "^4.0.0" "indent-string": "^4.0.0"
@ -22430,7 +22794,7 @@
"version": "2.2.0", "version": "2.2.0",
"resolved": "https://npm.ivanli.cc/clean-stack/-/clean-stack-2.2.0.tgz", "resolved": "https://npm.ivanli.cc/clean-stack/-/clean-stack-2.2.0.tgz",
"integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==",
"optional": true "devOptional": true
}, },
"cli-cursor": { "cli-cursor": {
"version": "3.1.0", "version": "3.1.0",
@ -22549,6 +22913,46 @@
"chalk": "3.0.0" "chalk": "3.0.0"
} }
}, },
"cli-truncate": {
"version": "2.1.0",
"resolved": "https://npm.ivanli.cc/cli-truncate/-/cli-truncate-2.1.0.tgz",
"integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==",
"dev": true,
"requires": {
"slice-ansi": "^3.0.0",
"string-width": "^4.2.0"
},
"dependencies": {
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://npm.ivanli.cc/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"slice-ansi": {
"version": "3.0.0",
"resolved": "https://npm.ivanli.cc/slice-ansi/-/slice-ansi-3.0.0.tgz",
"integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"astral-regex": "^2.0.0",
"is-fullwidth-code-point": "^3.0.0"
}
},
"string-width": {
"version": "4.2.2",
"resolved": "https://npm.ivanli.cc/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
}
}
}
},
"cli-width": { "cli-width": {
"version": "3.0.0", "version": "3.0.0",
"resolved": "https://npm.ivanli.cc/cli-width/-/cli-width-3.0.0.tgz", "resolved": "https://npm.ivanli.cc/cli-width/-/cli-width-3.0.0.tgz",
@ -22665,9 +23069,9 @@
"integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA=="
}, },
"colorette": { "colorette": {
"version": "1.2.2", "version": "1.4.0",
"resolved": "https://npm.ivanli.cc/colorette/-/colorette-1.2.2.tgz", "resolved": "https://npm.ivanli.cc/colorette/-/colorette-1.4.0.tgz",
"integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==",
"dev": true "dev": true
}, },
"colors": { "colors": {
@ -24384,6 +24788,12 @@
"has-symbols": "^1.0.1" "has-symbols": "^1.0.1"
} }
}, },
"get-own-enumerable-property-symbols": {
"version": "3.0.2",
"resolved": "https://npm.ivanli.cc/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz",
"integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==",
"dev": true
},
"get-package-type": { "get-package-type": {
"version": "0.1.0", "version": "0.1.0",
"resolved": "https://npm.ivanli.cc/get-package-type/-/get-package-type-0.1.0.tgz", "resolved": "https://npm.ivanli.cc/get-package-type/-/get-package-type-0.1.0.tgz",
@ -24793,6 +25203,12 @@
"ms": "^2.0.0" "ms": "^2.0.0"
} }
}, },
"husky": {
"version": "7.0.2",
"resolved": "https://npm.ivanli.cc/husky/-/husky-7.0.2.tgz",
"integrity": "sha512-8yKEWNX4z2YsofXAMT7KvA1g8p+GxtB1ffV8XtpAEGuXNAbCV5wdNKH+qTpw8SM9fh4aMPDR+yQuKfgnreyZlg==",
"dev": true
},
"iconv-lite": { "iconv-lite": {
"version": "0.4.24", "version": "0.4.24",
"resolved": "https://npm.ivanli.cc/iconv-lite/-/iconv-lite-0.4.24.tgz", "resolved": "https://npm.ivanli.cc/iconv-lite/-/iconv-lite-0.4.24.tgz",
@ -24850,7 +25266,7 @@
"version": "4.0.0", "version": "4.0.0",
"resolved": "https://npm.ivanli.cc/indent-string/-/indent-string-4.0.0.tgz", "resolved": "https://npm.ivanli.cc/indent-string/-/indent-string-4.0.0.tgz",
"integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==",
"optional": true "devOptional": true
}, },
"infer-owner": { "infer-owner": {
"version": "1.0.4", "version": "1.0.4",
@ -25132,6 +25548,12 @@
"resolved": "https://npm.ivanli.cc/is-number-object/-/is-number-object-1.0.5.tgz", "resolved": "https://npm.ivanli.cc/is-number-object/-/is-number-object-1.0.5.tgz",
"integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==" "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw=="
}, },
"is-obj": {
"version": "1.0.1",
"resolved": "https://npm.ivanli.cc/is-obj/-/is-obj-1.0.1.tgz",
"integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=",
"dev": true
},
"is-plain-object": { "is-plain-object": {
"version": "2.0.4", "version": "2.0.4",
"resolved": "https://npm.ivanli.cc/is-plain-object/-/is-plain-object-2.0.4.tgz", "resolved": "https://npm.ivanli.cc/is-plain-object/-/is-plain-object-2.0.4.tgz",
@ -25156,6 +25578,12 @@
"has-symbols": "^1.0.2" "has-symbols": "^1.0.2"
} }
}, },
"is-regexp": {
"version": "1.0.0",
"resolved": "https://npm.ivanli.cc/is-regexp/-/is-regexp-1.0.0.tgz",
"integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=",
"dev": true
},
"is-set": { "is-set": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://npm.ivanli.cc/is-set/-/is-set-2.0.2.tgz", "resolved": "https://npm.ivanli.cc/is-set/-/is-set-2.0.2.tgz",
@ -26188,6 +26616,142 @@
"integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=",
"dev": true "dev": true
}, },
"lint-staged": {
"version": "11.1.2",
"resolved": "https://npm.ivanli.cc/lint-staged/-/lint-staged-11.1.2.tgz",
"integrity": "sha512-6lYpNoA9wGqkL6Hew/4n1H6lRqF3qCsujVT0Oq5Z4hiSAM7S6NksPJ3gnr7A7R52xCtiZMcEUNNQ6d6X5Bvh9w==",
"dev": true,
"requires": {
"chalk": "^4.1.1",
"cli-truncate": "^2.1.0",
"commander": "^7.2.0",
"cosmiconfig": "^7.0.0",
"debug": "^4.3.1",
"enquirer": "^2.3.6",
"execa": "^5.0.0",
"listr2": "^3.8.2",
"log-symbols": "^4.1.0",
"micromatch": "^4.0.4",
"normalize-path": "^3.0.0",
"please-upgrade-node": "^3.2.0",
"string-argv": "0.3.1",
"stringify-object": "^3.3.0"
},
"dependencies": {
"chalk": {
"version": "4.1.2",
"resolved": "https://npm.ivanli.cc/chalk/-/chalk-4.1.2.tgz",
"integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==",
"dev": true,
"requires": {
"ansi-styles": "^4.1.0",
"supports-color": "^7.1.0"
}
},
"commander": {
"version": "7.2.0",
"resolved": "https://npm.ivanli.cc/commander/-/commander-7.2.0.tgz",
"integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==",
"dev": true
},
"cosmiconfig": {
"version": "7.0.1",
"resolved": "https://npm.ivanli.cc/cosmiconfig/-/cosmiconfig-7.0.1.tgz",
"integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==",
"dev": true,
"requires": {
"@types/parse-json": "^4.0.0",
"import-fresh": "^3.2.1",
"parse-json": "^5.0.0",
"path-type": "^4.0.0",
"yaml": "^1.10.0"
}
},
"execa": {
"version": "5.1.1",
"resolved": "https://npm.ivanli.cc/execa/-/execa-5.1.1.tgz",
"integrity": "sha512-8uSpZZocAZRBAPIEINJj3Lo9HyGitllczc27Eh5YYojjMFMn8yHMDMaUHE2Jqfq05D/wucwI4JGURyXt1vchyg==",
"dev": true,
"requires": {
"cross-spawn": "^7.0.3",
"get-stream": "^6.0.0",
"human-signals": "^2.1.0",
"is-stream": "^2.0.0",
"merge-stream": "^2.0.0",
"npm-run-path": "^4.0.1",
"onetime": "^5.1.2",
"signal-exit": "^3.0.3",
"strip-final-newline": "^2.0.0"
}
},
"get-stream": {
"version": "6.0.1",
"resolved": "https://npm.ivanli.cc/get-stream/-/get-stream-6.0.1.tgz",
"integrity": "sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==",
"dev": true
},
"human-signals": {
"version": "2.1.0",
"resolved": "https://npm.ivanli.cc/human-signals/-/human-signals-2.1.0.tgz",
"integrity": "sha512-B4FFZ6q/T2jhhksgkbEW3HBvWIfDW85snkQgawt07S7J5QXTk6BkNV+0yAeZrM5QpMAdYlocGoljn0sJ/WQkFw==",
"dev": true
}
}
},
"listr2": {
"version": "3.12.1",
"resolved": "https://npm.ivanli.cc/listr2/-/listr2-3.12.1.tgz",
"integrity": "sha512-oB1DlXlCzGPbvWhqYBZUQEPJKqsmebQWofXG6Mpbe3uIvoNl8mctBEojyF13ZyqwQ91clCWXpwsWp+t98K4FOQ==",
"dev": true,
"requires": {
"cli-truncate": "^2.1.0",
"colorette": "^1.4.0",
"log-update": "^4.0.0",
"p-map": "^4.0.0",
"rxjs": "^6.6.7",
"through": "^2.3.8",
"wrap-ansi": "^7.0.0"
},
"dependencies": {
"is-fullwidth-code-point": {
"version": "3.0.0",
"resolved": "https://npm.ivanli.cc/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
"integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
"dev": true
},
"p-map": {
"version": "4.0.0",
"resolved": "https://npm.ivanli.cc/p-map/-/p-map-4.0.0.tgz",
"integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==",
"dev": true,
"requires": {
"aggregate-error": "^3.0.0"
}
},
"string-width": {
"version": "4.2.2",
"resolved": "https://npm.ivanli.cc/string-width/-/string-width-4.2.2.tgz",
"integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==",
"dev": true,
"requires": {
"emoji-regex": "^8.0.0",
"is-fullwidth-code-point": "^3.0.0",
"strip-ansi": "^6.0.0"
}
},
"wrap-ansi": {
"version": "7.0.0",
"resolved": "https://npm.ivanli.cc/wrap-ansi/-/wrap-ansi-7.0.0.tgz",
"integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==",
"dev": true,
"requires": {
"ansi-styles": "^4.0.0",
"string-width": "^4.1.0",
"strip-ansi": "^6.0.0"
}
}
}
},
"loader-runner": { "loader-runner": {
"version": "4.2.0", "version": "4.2.0",
"resolved": "https://npm.ivanli.cc/loader-runner/-/loader-runner-4.2.0.tgz", "resolved": "https://npm.ivanli.cc/loader-runner/-/loader-runner-4.2.0.tgz",
@ -26316,6 +26880,18 @@
} }
} }
}, },
"log-update": {
"version": "4.0.0",
"resolved": "https://npm.ivanli.cc/log-update/-/log-update-4.0.0.tgz",
"integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==",
"dev": true,
"requires": {
"ansi-escapes": "^4.3.0",
"cli-cursor": "^3.1.0",
"slice-ansi": "^4.0.0",
"wrap-ansi": "^6.2.0"
}
},
"loglevel": { "loglevel": {
"version": "1.7.1", "version": "1.7.1",
"resolved": "https://npm.ivanli.cc/loglevel/-/loglevel-1.7.1.tgz", "resolved": "https://npm.ivanli.cc/loglevel/-/loglevel-1.7.1.tgz",
@ -27594,6 +28170,15 @@
"find-up": "^4.0.0" "find-up": "^4.0.0"
} }
}, },
"please-upgrade-node": {
"version": "3.2.0",
"resolved": "https://npm.ivanli.cc/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz",
"integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==",
"dev": true,
"requires": {
"semver-compare": "^1.0.0"
}
},
"pluralize": { "pluralize": {
"version": "8.0.0", "version": "8.0.0",
"resolved": "https://npm.ivanli.cc/pluralize/-/pluralize-8.0.0.tgz", "resolved": "https://npm.ivanli.cc/pluralize/-/pluralize-8.0.0.tgz",
@ -28578,6 +29163,12 @@
"lru-cache": "^6.0.0" "lru-cache": "^6.0.0"
} }
}, },
"semver-compare": {
"version": "1.0.0",
"resolved": "https://npm.ivanli.cc/semver-compare/-/semver-compare-1.0.0.tgz",
"integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=",
"dev": true
},
"send": { "send": {
"version": "0.17.1", "version": "0.17.1",
"resolved": "https://npm.ivanli.cc/send/-/send-0.17.1.tgz", "resolved": "https://npm.ivanli.cc/send/-/send-0.17.1.tgz",
@ -29254,6 +29845,12 @@
"resolved": "https://npm.ivanli.cc/string_decoder/-/string_decoder-0.10.31.tgz", "resolved": "https://npm.ivanli.cc/string_decoder/-/string_decoder-0.10.31.tgz",
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
}, },
"string-argv": {
"version": "0.3.1",
"resolved": "https://npm.ivanli.cc/string-argv/-/string-argv-0.3.1.tgz",
"integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==",
"dev": true
},
"string-length": { "string-length": {
"version": "4.0.2", "version": "4.0.2",
"resolved": "https://npm.ivanli.cc/string-length/-/string-length-4.0.2.tgz", "resolved": "https://npm.ivanli.cc/string-length/-/string-length-4.0.2.tgz",
@ -29306,6 +29903,17 @@
"define-properties": "^1.1.3" "define-properties": "^1.1.3"
} }
}, },
"stringify-object": {
"version": "3.3.0",
"resolved": "https://npm.ivanli.cc/stringify-object/-/stringify-object-3.3.0.tgz",
"integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==",
"dev": true,
"requires": {
"get-own-enumerable-property-symbols": "^3.0.0",
"is-obj": "^1.0.1",
"is-regexp": "^1.0.0"
}
},
"strip-ansi": { "strip-ansi": {
"version": "6.0.0", "version": "6.0.0",
"resolved": "https://npm.ivanli.cc/strip-ansi/-/strip-ansi-6.0.0.tgz", "resolved": "https://npm.ivanli.cc/strip-ansi/-/strip-ansi-6.0.0.tgz",

View File

@ -18,7 +18,8 @@
"test:watch": "jest --watch", "test:watch": "jest --watch",
"test:cov": "jest --coverage", "test:cov": "jest --coverage",
"test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand", "test:debug": "node --inspect-brk -r tsconfig-paths/register -r ts-node/register node_modules/.bin/jest --runInBand",
"test:e2e": "jest --config ./test/jest-e2e.json" "test:e2e": "jest --config ./test/jest-e2e.json",
"prepare": "husky install"
}, },
"dependencies": { "dependencies": {
"@golevelup/nestjs-rabbitmq": "^1.16.1", "@golevelup/nestjs-rabbitmq": "^1.16.1",
@ -74,7 +75,9 @@
"eslint": "^7.12.1", "eslint": "^7.12.1",
"eslint-config-prettier": "7.2.0", "eslint-config-prettier": "7.2.0",
"eslint-plugin-prettier": "^3.1.4", "eslint-plugin-prettier": "^3.1.4",
"husky": "^7.0.2",
"jest": "^26.6.3", "jest": "^26.6.3",
"lint-staged": "^11.1.2",
"prettier": "^2.1.2", "prettier": "^2.1.2",
"supertest": "^6.0.0", "supertest": "^6.0.0",
"ts-jest": "^26.4.3", "ts-jest": "^26.4.3",
@ -102,5 +105,8 @@
}, },
"coverageDirectory": "../coverage", "coverageDirectory": "../coverage",
"testEnvironment": "node" "testEnvironment": "node"
},
"lint-staged": {
"{src,apps,libs,test}/**/*.ts": "eslint --cache --fix"
} }
} }