Skip to content

Commit dfaa4a8

Browse files
byzykmontogeek
authored andcommitted
infrastructure(site) feature: pre-commit hooks (#2249)
* add husky, pre-commit test hook * revert script to npm
1 parent 4bdd31b commit dfaa4a8

File tree

2 files changed

+65
-1
lines changed

2 files changed

+65
-1
lines changed

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@
3939
"test": "npm run lint",
4040
"sitemap": "cd build && sitemap-static --prefix=https://webpack.js.org/ > sitemap.xml"
4141
},
42+
"husky": {
43+
"hooks": {
44+
"pre-commit": "npm test"
45+
}
46+
},
4247
"devDependencies": {
4348
"alex": "^4.1.0",
4449
"antwar": "^0.28.3",
@@ -66,6 +71,7 @@
6671
"github": "^10.0.0",
6772
"html-webpack-plugin": "^3.1.0",
6873
"http-server": "^0.10.0",
74+
"husky": "^1.0.0-rc.8",
6975
"hyperlink": "^3.0.1",
7076
"loader-utils": "^1.1.0",
7177
"lodash": "^4.17.4",

yarn.lock

Lines changed: 59 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1761,6 +1761,14 @@ cosmiconfig@^2.1.0, cosmiconfig@^2.1.1:
17611761
parse-json "^2.2.0"
17621762
require-from-string "^1.1.0"
17631763

1764+
cosmiconfig@^5.0.2:
1765+
version "5.0.5"
1766+
resolved "https://registry.yarnpkg.com/cosmiconfig/-/cosmiconfig-5.0.5.tgz#a809e3c2306891ce17ab70359dc8bdf661fe2cd0"
1767+
dependencies:
1768+
is-directory "^0.3.1"
1769+
js-yaml "^3.9.0"
1770+
parse-json "^4.0.0"
1771+
17641772
create-ecdh@^4.0.0:
17651773
version "4.0.0"
17661774
resolved "https://registry.yarnpkg.com/create-ecdh/-/create-ecdh-4.0.0.tgz#888c723596cdf7612f6498233eebd7a35301737d"
@@ -2573,6 +2581,18 @@ execa@^0.7.0:
25732581
signal-exit "^3.0.0"
25742582
strip-eof "^1.0.0"
25752583

2584+
execa@^0.9.0:
2585+
version "0.9.0"
2586+
resolved "https://registry.yarnpkg.com/execa/-/execa-0.9.0.tgz#adb7ce62cf985071f60580deb4a88b9e34712d01"
2587+
dependencies:
2588+
cross-spawn "^5.0.1"
2589+
get-stream "^3.0.0"
2590+
is-stream "^1.1.0"
2591+
npm-run-path "^2.0.0"
2592+
p-finally "^1.0.0"
2593+
signal-exit "^3.0.0"
2594+
strip-eof "^1.0.0"
2595+
25762596
expand-brackets@^0.1.4:
25772597
version "0.1.5"
25782598
resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
@@ -3030,6 +3050,10 @@ get-stdin@^4.0.1:
30303050
version "4.0.1"
30313051
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-4.0.1.tgz#b968c6b0a04384324902e8bf1a5df32579a450fe"
30323052

3053+
get-stdin@^6.0.0:
3054+
version "6.0.0"
3055+
resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-6.0.0.tgz#9e09bf712b360ab9225e812048f71fde9c89657b"
3056+
30333057
get-stream@^3.0.0:
30343058
version "3.0.0"
30353059
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-3.0.0.tgz#8e943d1358dc37555054ecbe2edb05aa174ede14"
@@ -3568,6 +3592,21 @@ https-proxy-agent@^1.0.0:
35683592
debug "2"
35693593
extend "3"
35703594

3595+
husky@^1.0.0-rc.8:
3596+
version "1.0.0-rc.8"
3597+
resolved "https://registry.yarnpkg.com/husky/-/husky-1.0.0-rc.8.tgz#2fa25d0b89269f5b8bfa1ca001370fdb058e8792"
3598+
dependencies:
3599+
cosmiconfig "^5.0.2"
3600+
execa "^0.9.0"
3601+
find-up "^2.1.0"
3602+
get-stdin "^6.0.0"
3603+
is-ci "^1.1.0"
3604+
pkg-dir "^2.0.0"
3605+
pupa "^1.0.0"
3606+
read-pkg "^3.0.0"
3607+
run-node "^1.0.0"
3608+
slash "^2.0.0"
3609+
35713610
hyperlink@^3.0.1:
35723611
version "3.0.1"
35733612
resolved "https://registry.yarnpkg.com/hyperlink/-/hyperlink-3.0.1.tgz#f3d24d9c3fee35972aa5d4e85853878ac78caa49"
@@ -3761,7 +3800,7 @@ is-callable@^1.1.1, is-callable@^1.1.3:
37613800
version "1.1.3"
37623801
resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2"
37633802

3764-
is-ci@^1.0.10:
3803+
is-ci@^1.0.10, is-ci@^1.1.0:
37653804
version "1.1.0"
37663805
resolved "https://registry.yarnpkg.com/is-ci/-/is-ci-1.1.0.tgz#247e4162e7860cebbdaf30b774d6b0ac7dcfe7a5"
37673806
dependencies:
@@ -4082,6 +4121,13 @@ js-yaml@^3.10.0, js-yaml@^3.2.7, js-yaml@^3.4.3, js-yaml@^3.6.1, js-yaml@^3.9.1:
40824121
argparse "^1.0.7"
40834122
esprima "^4.0.0"
40844123

4124+
js-yaml@^3.9.0:
4125+
version "3.12.0"
4126+
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.12.0.tgz#eaed656ec8344f10f527c6bfa1b6e2244de167d1"
4127+
dependencies:
4128+
argparse "^1.0.7"
4129+
esprima "^4.0.0"
4130+
40854131
js-yaml@~3.7.0:
40864132
version "3.7.0"
40874133
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.7.0.tgz#5c967ddd837a9bfdca5f2de84253abe8a1c03b80"
@@ -5934,6 +5980,10 @@ punycode@^2.1.0:
59345980
version "2.1.0"
59355981
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"
59365982

5983+
pupa@^1.0.0:
5984+
version "1.0.0"
5985+
resolved "https://registry.yarnpkg.com/pupa/-/pupa-1.0.0.tgz#9a9568a5af7e657b8462a6e9d5328743560ceff6"
5986+
59375987
q@^1.1.2:
59385988
version "1.5.1"
59395989
resolved "https://registry.yarnpkg.com/q/-/q-1.5.1.tgz#7e32f75b41381291d04611f1bf14109ac00651d7"
@@ -6561,6 +6611,10 @@ run-async@^2.2.0:
65616611
dependencies:
65626612
is-promise "^2.1.0"
65636613

6614+
run-node@^1.0.0:
6615+
version "1.0.0"
6616+
resolved "https://registry.yarnpkg.com/run-node/-/run-node-1.0.0.tgz#46b50b946a2aa2d4947ae1d886e9856fd9cabe5e"
6617+
65646618
run-queue@^1.0.0, run-queue@^1.0.3:
65656619
version "1.0.3"
65666620
resolved "https://registry.yarnpkg.com/run-queue/-/run-queue-1.0.3.tgz#e848396f057d223f24386924618e25694161ec47"
@@ -6803,6 +6857,10 @@ slash@^1.0.0:
68036857
version "1.0.0"
68046858
resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
68056859

6860+
slash@^2.0.0:
6861+
version "2.0.0"
6862+
resolved "https://registry.yarnpkg.com/slash/-/slash-2.0.0.tgz#de552851a1759df3a8f206535442f5ec4ddeab44"
6863+
68066864
slice-ansi@1.0.0:
68076865
version "1.0.0"
68086866
resolved "https://registry.yarnpkg.com/slice-ansi/-/slice-ansi-1.0.0.tgz#044f1a49d8842ff307aad6b505ed178bd950134d"

0 commit comments

Comments
 (0)