Skip to content

Commit

Permalink
feat: migrate husky to v6
Browse files Browse the repository at this point in the history
  • Loading branch information
Jozwiaczek committed Apr 11, 2021
1 parent aa09790 commit 3e5ca85
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 71 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
node_modules/
dist/
build/
.docusaurus/
1 change: 1 addition & 0 deletions .husky/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
_
6 changes: 6 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"
[ -n "$CI" ] && exit 0

yarn commitlint --edit
8 changes: 8 additions & 0 deletions .husky/common.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
command_exists () {
command -v "$1" >/dev/null 2>&1
}

# Workaround for Windows 10, Git Bash and Yarn
if command_exists winpty && test -t 1; then
exec < /dev/tty
fi
6 changes: 6 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
. "$(dirname "$0")/common.sh"

yarn type-check
yarn lint-staged
6 changes: 0 additions & 6 deletions .huskyrc.js

This file was deleted.

2 changes: 2 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ dist
.docusaurus
build
storybook-static
coverage
CHANGELOG.md
3 changes: 2 additions & 1 deletion lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module.exports = {
'{src,test}/**/*.{js,jsx,ts,tsx}': ['eslint --cache', 'prettier --write'],
'**/*.{js,jsx,ts,tsx}': ['eslint --cache --fix'],
'**/*.{js,jsx,ts,tsx,md,json}': ['prettier --write --ignore-path .prettierignore'],
};
45 changes: 23 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
{
"name": "@dotintent/intentbase-ui-auth",
"description": "UI React components for Log in, Register and Forgot password, to use with auth providers like Cognito",
"version": "0.1.6",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"private": false,
"repository": {
"type": "git",
"url": "https://github.com/dotintent/intentbase-ui-auth"
},
"homepage": "https://intentbase-ui-auth.netlify.app",
"description": "UI React components for Log in, Register and Forgot password, to use with auth providers like Cognito",
"keywords": [
"Template",
"Boilerplate",
"Intent",
"intentbase"
],
"homepage": "https://intentbase-ui-auth.netlify.app",
"repository": {
"type": "git",
"url": "https://github.com/dotintent/intentbase-ui-auth"
},
"license": "UNLICENSED",
"author": {
"name": "Jakub Jóźwiak",
"email": "kubencki@gmail.com"
},
"engines": {
"node": ">=12",
"yarn": ">=1.22"
},
"contributors": [
"Bernard Kasprzak <bernard.kasprzak@withintent.com>",
"Tomasz Fabisiak <tomasz.fabisiak@withintent.com>"
],
"license": "UNLICENSED",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"scripts": {
"prepublish": "yarn build",
"preinstall": "node -e \"if (process.env.npm_execpath.indexOf('yarn') === -1) throw new Error('Use yarn for installing')\"",
Expand All @@ -39,10 +35,11 @@
"check": "yarn type-check && yarn format:check && yarn lint:check",
"clean": "rimraf dist",
"type-check": "tsc --noEmit",
"format": "prettier --write --config .prettierrc .",
"format:check": "prettier --check --config .prettierrc .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"lint": "yarn lint:check --fix",
"lint:check": "eslint 'src/**/*.{js,ts,tsx}' --cache"
"lint:check": "eslint 'src/**/*.{js,ts,tsx}' --cache",
"prepare": "husky install"
},
"dependencies": {
"@aws-amplify/auth": "^3.4.29",
Expand All @@ -55,11 +52,6 @@
"final-form": "^4.20.2",
"react-final-form": "^6.5.3"
},
"peerDependencies": {
"react": "17.x",
"react-dom": "17.x",
"styled-components": "5.2.1"
},
"devDependencies": {
"@babel/core": "^7.12.3",
"@commitlint/cli": "^12.1.1",
Expand All @@ -86,13 +78,22 @@
"eslint-plugin-prettier": "^3.3.1",
"eslint-plugin-react": "^7.23.2",
"eslint-plugin-react-hooks": "^4.2.0",
"husky": "^4.3.0",
"husky": "^6.0.0",
"lint-staged": "^10.5.4",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-is": "^17.0.2",
"rimraf": "^3.0.2",
"styled-components": "^5.2.3",
"typescript": "^4.2.4"
},
"peerDependencies": {
"react": "17.x",
"react-dom": "17.x",
"styled-components": "5.2.1"
},
"engines": {
"node": ">=12",
"yarn": ">=1.22"
}
}
46 changes: 4 additions & 42 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4506,11 +4506,6 @@ compare-func@^2.0.0:
array-ify "^1.0.0"
dot-prop "^5.1.0"

compare-versions@^3.6.0:
version "3.6.0"
resolved "https://registry.yarnpkg.com/compare-versions/-/compare-versions-3.6.0.tgz#1a5689913685e5a87637b8d3ffca75514ec41d62"
integrity sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==

component-emitter@^1.2.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
Expand Down Expand Up @@ -6015,13 +6010,6 @@ find-up@^5.0.0:
locate-path "^6.0.0"
path-exists "^4.0.0"

find-versions@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/find-versions/-/find-versions-4.0.0.tgz#3c57e573bf97769b8cb8df16934b627915da4965"
integrity sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==
dependencies:
semver-regex "^3.1.2"

flat-cache@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11"
Expand Down Expand Up @@ -6762,21 +6750,10 @@ human-signals@^1.1.1:
resolved "https://registry.yarnpkg.com/human-signals/-/human-signals-1.1.1.tgz#c5b1cd14f50aeae09ab6c59fe63ba3395fe4dfa3"
integrity sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==

husky@^4.3.0:
version "4.3.8"
resolved "https://registry.yarnpkg.com/husky/-/husky-4.3.8.tgz#31144060be963fd6850e5cc8f019a1dfe194296d"
integrity sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==
dependencies:
chalk "^4.0.0"
ci-info "^2.0.0"
compare-versions "^3.6.0"
cosmiconfig "^7.0.0"
find-versions "^4.0.0"
opencollective-postinstall "^2.0.2"
pkg-dir "^5.0.0"
please-upgrade-node "^3.2.0"
slash "^3.0.0"
which-pm-runs "^1.0.0"
husky@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/husky/-/husky-6.0.0.tgz#810f11869adf51604c32ea577edbc377d7f9319e"
integrity sha512-SQS2gDTB7tBN486QSoKPKQItZw97BMOd+Kdb6ghfpBc0yXyzrddI0oDV5MkDAbuB4X2mO3/nj60TRMcYxwzZeQ==

hyphenate-style-name@^1.0.3:
version "1.0.4"
Expand Down Expand Up @@ -8605,11 +8582,6 @@ open@^7.0.2, open@^7.0.3:
is-docker "^2.0.0"
is-wsl "^2.1.1"

opencollective-postinstall@^2.0.2:
version "2.0.3"
resolved "https://registry.yarnpkg.com/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz#7a0fff978f6dbfa4d006238fbac98ed4198c3259"
integrity sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==

optionator@^0.8.1:
version "0.8.3"
resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.8.3.tgz#84fa1d036fe9d3c7e21d99884b601167ec8fb495"
Expand Down Expand Up @@ -10050,11 +10022,6 @@ semver-compare@^1.0.0:
resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=

semver-regex@^3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/semver-regex/-/semver-regex-3.1.2.tgz#34b4c0d361eef262e07199dbef316d0f2ab11807"
integrity sha512-bXWyL6EAKOJa81XG1OZ/Yyuq+oT0b2YLlxx7c+mrdYPaPbnj6WgVULXhinMIeZGufuUBu/eVRqXEhiv4imfwxA==

"semver@2 || 3 || 4 || 5", semver@^5.4.1, semver@^5.5.0, semver@^5.6.0:
version "5.7.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.7.1.tgz#a954f931aeba508d307bbf069eff0c01c96116f7"
Expand Down Expand Up @@ -11475,11 +11442,6 @@ which-boxed-primitive@^1.0.2:
is-string "^1.0.5"
is-symbol "^1.0.3"

which-pm-runs@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/which-pm-runs/-/which-pm-runs-1.0.0.tgz#670b3afbc552e0b55df6b7780ca74615f23ad1cb"
integrity sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=

which@^1.2.9, which@^1.3.1:
version "1.3.1"
resolved "https://registry.yarnpkg.com/which/-/which-1.3.1.tgz#a45043d54f5805316da8d62f9f50918d3da70b0a"
Expand Down

0 comments on commit 3e5ca85

Please sign in to comment.