Skip to content

Commit

Permalink
feat(deps): bump husky from 4.3.8 to 5.1.1 (#869)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: husky v5 migration is performed
  • Loading branch information
dependabot[bot] authored Feb 26, 2021
1 parent 612e1e8 commit b7eb5bb
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 164 deletions.
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
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/post-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npm run release:dry-run
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"

npx --no-install lint-staged
3 changes: 1 addition & 2 deletions lib/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,14 @@ const initCommand = (baseDir, logger) => {
});

/**
* @param {"husky" | "lint-staged" | "standard-version" | "remarkConfig"} key
* @param {"lint-staged" | "standard-version" | "remarkConfig"} key
*/
const updateOtherKey = (key) => {
if (!(key in packageInfo)) {
packageInfo[key] = {};
}
Object.assign(packageInfo[key], originalPackage[key]);
};
updateOtherKey("husky");
updateOtherKey("lint-staged");
updateOtherKey("standard-version");
updateOtherKey("remarkConfig");
Expand Down
156 changes: 20 additions & 136 deletions package-lock.json

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

17 changes: 7 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@
"@commitlint/cli": "^11.0.0",
"@commitlint/config-conventional": "^11.0.0",
"eslint": "^7.11.0",
"husky": "^4.3.0",
"husky": "^5.1.1",
"lint-staged": "^10.4.0",
"npm-run-all": "^4.1.5",
"pinst": "^2.1.6",
"prettier": "^2.1.2",
"remark-cli": "^9.0.0",
"remark-lint-no-heading-punctuation": "^2.0.1",
Expand Down Expand Up @@ -71,18 +72,14 @@
"clean": "git clean -dx --force --exclude=node_modules",
"prerelease": "git switch main && git pull && npm ci && npm run clean && npm test && npm run lint && npm run clean",
"release": "standard-version",
"release:dry-run": "standard-version --dry-run"
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged",
"post-commit": "npm run release:dry-run"
}
"release:dry-run": "standard-version --dry-run",
"postinstall": "husky install",
"prepublishOnly": "pinst --disable",
"postpublish": "pinst --enable"
},
"lint-staged": {
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
"!(*.snap)": "prettier --write",
"!(*.snap|.husky/**)": "prettier --write",
"!(CHANGELOG).md": "remark --frail"
},
"standard-version": {
Expand Down
24 changes: 8 additions & 16 deletions test/__snapshots__/init.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,8 @@ Object {
],
"root": true,
},
"husky": Object {
"hooks": Object {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"post-commit": "npm run release:dry-run",
"pre-commit": "lint-staged",
},
},
"lint-staged": Object {
"!(*.snap)": "prettier --write",
"!(*.snap|.husky/**)": "prettier --write",
"!(CHANGELOG).md": "remark --frail",
"*.css": "xyz",
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
Expand Down Expand Up @@ -57,6 +50,9 @@ Object {
"lint:md": "remark . --frail",
"lint:md:fix": "remark . --output",
"lint:types": "tsc --noEmit",
"postinstall": "husky install",
"postpublish": "pinst --enable",
"prepublishOnly": "pinst --disable",
"prerelease": "git switch main && git pull && npm ci && npm run clean && npm test && npm run lint && npm run clean",
"prettier": "prettier --ignore-path .gitignore .",
"prettier:check": "npm run prettier -- --check",
Expand Down Expand Up @@ -96,15 +92,8 @@ Object {
],
"root": true,
},
"husky": Object {
"hooks": Object {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"post-commit": "npm run release:dry-run",
"pre-commit": "lint-staged",
},
},
"lint-staged": Object {
"!(*.snap)": "prettier --write",
"!(*.snap|.husky/**)": "prettier --write",
"!(CHANGELOG).md": "remark --frail",
"*.{js,jsx,mjs,ts,tsx}": "eslint --fix",
},
Expand Down Expand Up @@ -132,6 +121,9 @@ Object {
"lint:md": "remark . --frail",
"lint:md:fix": "remark . --output",
"lint:types": "tsc --noEmit",
"postinstall": "husky install",
"postpublish": "pinst --enable",
"prepublishOnly": "pinst --disable",
"prerelease": "git switch main && git pull && npm ci && npm run clean && npm test && npm run lint && npm run clean",
"prettier": "prettier --ignore-path .gitignore .",
"prettier:check": "npm run prettier -- --check",
Expand Down

0 comments on commit b7eb5bb

Please sign in to comment.