Comparing version 0.14.3 to 0.15.0-beta.0
# CHANGELOG | ||
## Unreleased | ||
* Support `sendemail-validate` hook [#173](https://github.com/typicode/husky/pull/173) | ||
* Support `HUSKY_SKIP_INSTALL` environment variable for skipping git hooks installation | ||
* Drop `nvm` installed with `brew` support as it's not supported by `nvm` itself (see [creationix/nvm#important-notes](https://github.com/creationix/nvm#important-notes)), `nvm` standard installation is still supported though | ||
## 0.14.3 | ||
* Fix PATH export [#150](https://github.com/typicode/husky/pull/114) | ||
* Fix handle space in `PATH` [#150](https://github.com/typicode/husky/pull/114) | ||
## 0.14.2 | ||
* Fix When a space was present in `$HOME`, hook script was failing | ||
* Fix handle space in `HOME` | ||
## 0.14.1 | ||
* Fix Husky wasn't installing Git hooks on Windows | ||
* Fix When nvm was installed with Brew, hook script was failing | ||
* Fix Git hooks install on Windows | ||
* Fix hook script when `nvm` was installed with Brew | ||
@@ -16,0 +22,0 @@ ## 0.14.0 |
{ | ||
"name": "husky", | ||
"version": "0.14.3", | ||
"version": "0.15.0-beta.0", | ||
"description": "Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)", | ||
"engines": { | ||
"node": ">=4" | ||
}, | ||
"scripts": { | ||
"test": "jest", | ||
"format": "prettier --single-quote --no-semi --write **/*.js", | ||
"install": "node ./bin/install.js", | ||
"uninstall": "node ./bin/uninstall.js" | ||
"test": "npm run lint && jest", | ||
"postinstall": "node husky install", | ||
"preuninstall": "node husky uninstall", | ||
"devInstall": "npm run build && node husky-dev install", | ||
"devUninstall": "npm run build && node husky-dev uninstall", | ||
"build": "del-cli lib && tsc", | ||
"prepublishOnly": "npm run test && npm run build && pkg-ok", | ||
"lint": "tslint 'src/**/*.ts'", | ||
"fix": "npm run lint -- --fix" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/typicode/husky.git" | ||
"url": "git+https://github.com/typicode/husky.git" | ||
}, | ||
@@ -30,3 +32,4 @@ "keywords": [ | ||
"postmerge", | ||
"test" | ||
"test", | ||
"lint" | ||
], | ||
@@ -38,20 +41,43 @@ "author": "Typicode <typicode@gmail.com>", | ||
}, | ||
"homepage": "https://github.com/typicode/husky", | ||
"homepage": "https://github.com/typicode/husky#readme", | ||
"dependencies": { | ||
"execa": "^0.8.0", | ||
"pkg-dir": "^2.0.0", | ||
"read-pkg": "^2.0.0", | ||
"run-node": "^0.1.1" | ||
}, | ||
"devDependencies": { | ||
"jest": "^20.0.4", | ||
"mkdirp": "^0.5.1", | ||
"prettier": "^1.4.4", | ||
"rimraf": "^2.6.1", | ||
"tempy": "^0.1.0" | ||
"@types/execa": "^0.7.0", | ||
"@types/jest": "^20", | ||
"@types/node": "^8.0.31", | ||
"del": "^3.0.0", | ||
"del-cli": "^1.1.0", | ||
"jest": "^20", | ||
"pkg-ok": "^1.1.0", | ||
"prettier": "^1.7.2", | ||
"tempy": "^0.2.1", | ||
"ts-jest": "^21.0.1", | ||
"tslint": "^5.7.0", | ||
"tslint-config-prettier": "^1.5.0", | ||
"tslint-plugin-prettier": "^1.3.0", | ||
"typescript": "^2.5.3" | ||
}, | ||
"dependencies": { | ||
"is-ci": "^1.0.10", | ||
"normalize-path": "^1.0.0", | ||
"strip-indent": "^2.0.0" | ||
"jest": { | ||
"transform": { | ||
"^.+\\.tsx?$": "<rootDir>/node_modules/ts-jest/preprocessor.js" | ||
}, | ||
"testRegex": "(/__tests__/.*|(\\.|/)(test|spec))\\.(jsx?|tsx?)$", | ||
"moduleFileExtensions": [ | ||
"ts", | ||
"tsx", | ||
"js", | ||
"jsx", | ||
"json" | ||
] | ||
}, | ||
"standard": { | ||
"env": { | ||
"jest": true | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm test" | ||
} | ||
} | ||
} | ||
} |
111
README.md
@@ -5,2 +5,4 @@ # husky [![](http://img.shields.io/npm/dm/husky.svg?style=flat)](https://www.npmjs.org/package/husky) [![npm version](https://badge.fury.io/js/husky.svg)](https://www.npmjs.com/package/husky) [![Mac/Linux Build Status](https://img.shields.io/travis/typicode/husky/master.svg?label=Mac%20OSX%20%26%20Linux)](https://travis-ci.org/typicode/husky) [![Windows Build status](https://img.shields.io/appveyor/ci/typicode/husky/master.svg?label=Windows)](https://ci.appveyor.com/project/typicode/husky/branch/master) | ||
_beta branch, see [master](https://github.com/typicode/husky) for stable release documentation_ | ||
Husky can prevent bad commit, push and more :dog: _woof!_ | ||
@@ -11,16 +13,14 @@ | ||
```sh | ||
npm install husky --save-dev | ||
npm install husky@beta --save-dev | ||
``` | ||
```sh | ||
yarn add husky --dev | ||
``` | ||
```javascript | ||
// Edit package.json | ||
```js | ||
// package.json | ||
{ | ||
"scripts": { | ||
"precommit": "npm test", | ||
"prepush": "npm test", | ||
"...": "..." | ||
"husky": { | ||
"hooks": { | ||
"pre-commit": "npm test", | ||
"pre-push": "npm test", | ||
"...": "..." | ||
} | ||
} | ||
@@ -30,21 +30,6 @@ } | ||
```bash | ||
git commit -m "Keep calm and commit" | ||
```sh | ||
git commit -m 'Keep calm and commit' | ||
``` | ||
_Existing hooks aren't replaced and you can use [any Git hook](HOOKS.md)._ | ||
_If you're migrating from `ghooks`, simply run `npm uninstall ghooks --save-dev && npm install husky --save-dev` and edit `package.json`. Husky will automatically migrate `ghooks` hooks._ | ||
## Used by | ||
* [jQuery](https://github.com/jquery/jquery) | ||
* [Next.js](https://github.com/zeit/next.js) | ||
* [Hyper](https://github.com/zeit/hyper) | ||
* [Paper.js](https://github.com/paperjs/paper.js) | ||
* [Kibana](https://github.com/elastic/kibana) | ||
* [JSON Server](https://github.com/typicode/json-server) | ||
* [Hotel](https://github.com/typicode/hotel) | ||
* ... and over 6000+ [other awesome projects](https://libraries.io/npm/husky/dependent-repositories). | ||
## Uninstall | ||
@@ -56,59 +41,33 @@ | ||
```sh | ||
yarn remove husky | ||
``` | ||
## Configure | ||
## Tricks | ||
By default, husky expects your project's `package.json` and your `.git` directory to be at the same level. It can be configured to support monorepos or sub-directories. | ||
<details> | ||
Check [documentation](DOCS.md) for more. | ||
### Debug hooks easily | ||
## Features | ||
If you need to debug hooks, simply use `npm run <script-name>`. For example: | ||
* Fast, minimalist and simple | ||
* Keeps existing user hooks | ||
* Supports GUI Git clients | ||
* Supports all Git hooks (`pre-commit`, `pre-push`, ...) | ||
* Supports monorepo/sub-directories layouts | ||
* If you were using `ghooks`, it will migrate your git hooks | ||
```bash | ||
npm run precommit | ||
``` | ||
## Used by | ||
### Git GUI clients support | ||
* [jQuery](https://github.com/jquery/jquery) | ||
* [babel](https://github.com/babel/babel) | ||
* [create-react-app](https://github.com/facebookincubator/create-react-app) | ||
* [Next.js](https://github.com/zeit/next.js) | ||
* [Hyper](https://github.com/zeit/hyper) | ||
* [Kibana](https://github.com/elastic/kibana) | ||
* [JSON Server](https://github.com/typicode/json-server) | ||
* [Hotel](https://github.com/typicode/hotel) | ||
* ... and over 10k+ [other awesome repos](https://libraries.io/npm/husky/dependent-repositories). | ||
If you've installed Node using the [standard installer](https://nodejs.org/en/), [nvm](https://github.com/creationix/nvm) or [homebrew](http://brew.sh/), Git hooks will be executed in GUI applications. | ||
### Working with multiple version of Node | ||
If [`nvm`](https://github.com/creationix/nvm) is installed, husky will try to use the `default`/`current` installed Node version or use the project `.nvmrc`. | ||
__Tip__ to use the system-installed version of node, `nvm` provides a [`system`](https://github.com/creationix/nvm#system-version-of-node) alias | ||
### Accessing Git params | ||
Git params can be found in `GIT_PARAMS` environment variable. | ||
### Setting a different log level | ||
By default, husky will run scripts using `--silent` to make the output more readable. If you want to override this, simply pass a different log level to your scripts: | ||
```json | ||
"precommit": "npm run some-script -q" | ||
``` | ||
_`-q/--quiet` is equivalent to `--loglevel warn` which is npm default log level._ | ||
### Git submodule and subtree support | ||
Yes | ||
### Cygwin support | ||
Yes | ||
### Yarn support | ||
Please use `yarn` `v0.24+` | ||
</details> | ||
## See also | ||
* [pkg-ok](https://github.com/typicode/pkg-ok) - prevents publishing modules with bad paths | ||
* [pkg-ok](https://github.com/typicode/pkg-ok) - Prevents publishing modules with bad paths | ||
* [please-upgrade-node](https://github.com/typicode/please-upgrade-node) - Show a message to upgrade Node instead of a stacktrace in your CLIs | ||
* [react-fake-props](https://github.com/typicode/react-fake-props) - Fake props for your React tests | ||
@@ -115,0 +74,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
41
547
2
53903
4
14
74
1
+ Addedexeca@^0.8.0
+ Addedpkg-dir@^2.0.0
+ Addedread-pkg@^2.0.0
+ Addedrun-node@^0.1.1
+ Addedcross-spawn@5.1.0(transitive)
+ Addederror-ex@1.3.2(transitive)
+ Addedexeca@0.8.0(transitive)
+ Addedfind-up@2.1.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-stream@3.0.0(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhosted-git-info@2.8.9(transitive)
+ Addedis-arrayish@0.2.1(transitive)
+ Addedis-core-module@2.15.1(transitive)
+ Addedis-stream@1.1.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedload-json-file@2.0.0(transitive)
+ Addedlocate-path@2.0.0(transitive)
+ Addedlru-cache@4.1.5(transitive)
+ Addednormalize-package-data@2.5.0(transitive)
+ Addednpm-run-path@2.0.2(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-limit@1.3.0(transitive)
+ Addedp-locate@2.0.0(transitive)
+ Addedp-try@1.0.0(transitive)
+ Addedparse-json@2.2.0(transitive)
+ Addedpath-exists@3.0.0(transitive)
+ Addedpath-key@2.0.1(transitive)
+ Addedpath-parse@1.0.7(transitive)
+ Addedpath-type@2.0.0(transitive)
+ Addedpify@2.3.0(transitive)
+ Addedpkg-dir@2.0.0(transitive)
+ Addedpseudomap@1.0.2(transitive)
+ Addedread-pkg@2.0.0(transitive)
+ Addedresolve@1.22.8(transitive)
+ Addedrun-node@0.1.1(transitive)
+ Addedsemver@5.7.2(transitive)
+ Addedshebang-command@1.2.0(transitive)
+ Addedshebang-regex@1.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedspdx-correct@3.2.0(transitive)
+ Addedspdx-exceptions@2.5.0(transitive)
+ Addedspdx-expression-parse@3.0.1(transitive)
+ Addedspdx-license-ids@3.0.20(transitive)
+ Addedstrip-bom@3.0.0(transitive)
+ Addedstrip-eof@1.0.0(transitive)
+ Addedsupports-preserve-symlinks-flag@1.0.0(transitive)
+ Addedvalidate-npm-package-license@3.0.4(transitive)
+ Addedwhich@1.3.1(transitive)
+ Addedyallist@2.1.2(transitive)
- Removedis-ci@^1.0.10
- Removednormalize-path@^1.0.0
- Removedstrip-indent@^2.0.0
- Removedci-info@1.6.0(transitive)
- Removedis-ci@1.2.1(transitive)
- Removednormalize-path@1.0.0(transitive)
- Removedstrip-indent@2.0.0(transitive)