Skip to content

Commit

Permalink
chore(deps): update to husky 8
Browse files Browse the repository at this point in the history
Changes to be committed:
new file:   .husky/_/husky.sh
new file:   .husky/commit-msg
new file:   .husky/pre-commit
modified:   package-lock.json
modified:   package.json
  • Loading branch information
blackfalcon committed Mar 9, 2023
1 parent b60fc6f commit 18471bd
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 148 deletions.
36 changes: 36 additions & 0 deletions .husky/_/husky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#!/usr/bin/env sh
if [ -z "$husky_skip_init" ]; then
debug () {
if [ "$HUSKY_DEBUG" = "1" ]; then
echo "husky (debug) - $1"
fi
}

readonly hook_name="$(basename -- "$0")"
debug "starting $hook_name..."

if [ "$HUSKY" = "0" ]; then
debug "HUSKY env variable is set to 0, skipping hook"
exit 0
fi

if [ -f ~/.huskyrc ]; then
debug "sourcing ~/.huskyrc"
. ~/.huskyrc
fi

readonly husky_skip_init=1
export husky_skip_init
sh -e "$0" "$@"
exitCode="$?"

if [ $exitCode != 0 ]; then
echo "husky - $hook_name hook exited with code $exitCode (error)"
fi

if [ $exitCode = 127 ]; then
echo "husky - command not found in PATH=$PATH"
fi

exit $exitCode
fi
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

./node_modules/.bin/npm-run-all test
151 changes: 11 additions & 140 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 3 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"@semantic-release/git": "^10.0.1",
"@semantic-release/npm": "^9.0.0",
"copyfiles": "^2.4.1",
"husky": "^4.3.8",
"husky": "^8.0.3",
"npm-run-all": "^4.1.5",
"postcss-custom-properties": "^12.1.3",
"semantic-release": "^19.0.2",
Expand All @@ -32,13 +32,8 @@
"build:ci": "npm-run-all sweep test copy:json build:tokens postinstall",
"copy:json": "copyfiles -u 1 -V './src/**/*.json' ./dist",
"test": "node scripts/jsonTest.js",
"sweep": "rm -rf dist/"
},
"husky": {
"hooks": {
"pre-commit": "npm test",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
"sweep": "rm -rf dist/",
"prepare": "husky install"
},
"commitlint": {
"extends": [
Expand Down

0 comments on commit 18471bd

Please sign in to comment.