From ad00bdacd2c02c773a13c584674a6d2eab33db85 Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Fri, 19 Mar 2021 12:27:00 -0700 Subject: [PATCH 1/4] fix(deps): move TypeScript to `devDependencies` --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index ac655236..e351aec2 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,6 @@ "prettier": "^2.2.1", "read-pkg-up": "^7.0.1", "rimraf": "^3.0.2", - "typescript": "^4.2.2", "which": "^2.0.2", "yargs-parser": "^20.2.4" }, @@ -122,6 +121,7 @@ "eslint-config-kentcdodds": "^17.5.0", "jest-in-case": "^1.0.2", "npm-run-all": "^4.1.5", - "slash": "^3.0.0" + "slash": "^3.0.0", + "typescript": "^4.2.2" } } From 9804bb55c978631c7edc6777bd3bbfe107686b2e Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Fri, 19 Mar 2021 12:27:38 -0700 Subject: [PATCH 2/4] fix(deps): move Husky to `devDependencies` --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e351aec2..f8233a9e 100644 --- a/package.json +++ b/package.json @@ -73,7 +73,6 @@ "eslint-plugin-react": "^7.22.0", "eslint-plugin-react-hooks": "^4.2.0", "glob": "^7.1.6", - "husky": "^4.3.8", "is-ci": "^3.0.0", "jest": "^26.6.3", "jest-watch-typeahead": "^0.6.1", @@ -119,6 +118,7 @@ "@babel/preset-env": "^7.13.9", "babel-jest": "^26.6.3", "eslint-config-kentcdodds": "^17.5.0", + "husky": "^4.3.8", "jest-in-case": "^1.0.2", "npm-run-all": "^4.1.5", "slash": "^3.0.0", From d9130e2661b038e6aea4e6210f96d4ea3054dd10 Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Fri, 19 Mar 2021 13:55:55 -0700 Subject: [PATCH 3/4] docs(readme): document source control hook scripts --- README.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/README.md b/README.md index acce844e..5e4b2ab4 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,8 @@ - [Jest](#jest) - [Semantic Release](#semantic-release) - [Lint Staged](#lint-staged) + - [Source Control Hooks](#source-control-hooks) + - [Husky Example](#husky-example) - [License](#license) - [Maintenance](#maintenance) @@ -194,6 +196,36 @@ used with your custom command. } ``` +### Source Control Hooks + +This package includes a couple scripts designed to be run as part of your +project's source control workflow. The most common workflow is using +[Husky](https://github.com/typicode/husky) to manage +[Git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks), but they +should work with other solutions as well. + +#### Husky Example + +1. Install Husky + +```sh +yarn add -D husky +``` + +2. Configure hooks in `package.json` + +```json +{ + "name": "my-package", + "husky": { + "hooks": { + "pre-commit": "hover-scripts pre-commit", + "commit-msg": "hover-scripts commit-msg" + } + } +} +``` + ## License MIT From f5be67f94b3a8a285474701856e8138a065916fa Mon Sep 17 00:00:00 2001 From: Jamie Rolfs Date: Fri, 19 Mar 2021 14:07:35 -0700 Subject: [PATCH 4/4] build(deps-dev): upgrade TypeScript to 4.2.3 --- package.json | 2 +- yarn.lock | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index f8233a9e..eb0ceace 100644 --- a/package.json +++ b/package.json @@ -122,6 +122,6 @@ "jest-in-case": "^1.0.2", "npm-run-all": "^4.1.5", "slash": "^3.0.0", - "typescript": "^4.2.2" + "typescript": "^4.2.3" } } diff --git a/yarn.lock b/yarn.lock index 06d8ca9d..1aa307db 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8305,10 +8305,10 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.2.2: - version "4.2.2" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.2.tgz#1450f020618f872db0ea17317d16d8da8ddb8c4c" - integrity sha512-tbb+NVrLfnsJy3M59lsDgrzWIflR4d4TIUjz+heUnHZwdF7YsrMTKoRERiIvI2lvBG95dfpLxB21WZhys1bgaQ== +typescript@^4.2.3: + version "4.2.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.3.tgz#39062d8019912d43726298f09493d598048c1ce3" + integrity sha512-qOcYwxaByStAWrBf4x0fibwZvMRG+r4cQoTjbPtUlrWjBHbmCAww1i448U0GJ+3cNNEtebDteo/cHOR3xJ4wEw== underscore@~1.10.2: version "1.10.2"