Comparing version 0.15.0-beta.7 to 0.15.0-beta.8
43
docs.md
# Documentation | ||
## Available hooks | ||
## Supported hooks | ||
`husky` supports all Git hooks (https://git-scm.com/docs/githooks). | ||
`husky` supports all Git hooks (https://git-scm.com/docs/githooks) and Git params can be accessed using `GIT_PARAMS` environment variable. | ||
## Sub-directory package | ||
## How to | ||
### Sub-directory package | ||
If your project is in a sub-directory: | ||
``` | ||
@@ -15,5 +19,6 @@ project | ||
Create a root `package.json` and run `npm install husky --save-dev`, then edit `package.json` to configure `husky`: | ||
Create a root `package.json`, run `npm install husky --save-dev` and edit `package.json` to configure `husky`: | ||
``` | ||
```js | ||
// project/package.json | ||
{ | ||
@@ -34,3 +39,4 @@ "private": true, | ||
``` | ||
```js | ||
// project/subproject/package.json | ||
{ | ||
@@ -42,8 +48,9 @@ "private": true, | ||
} | ||
``` | ||
## Multi-package repository | ||
### Multi-package repository (monorepo) | ||
If you have a multi-package repository (or monorepo), like that: | ||
If you have a multi-package repository: | ||
``` | ||
```sh | ||
project | ||
@@ -54,5 +61,7 @@ packages | ||
C/package.json | ||
``` | ||
it's recommended to use tools like [lerna](https://github.com/lerna/lerna) and have `husky` installed in the root `package.json`: | ||
It's recommended to use tools like [lerna](https://github.com/lerna/lerna) and have `husky` installed in the root `package.json`: | ||
```json | ||
{ | ||
@@ -72,12 +81,6 @@ "private": true, | ||
### skipInstall | ||
Default: false | ||
By default, `husky` will automatically install hooks in `.git/hooks`. You can disable it by setting `skipInstall` to `true` or `HUSKY_SKIP_INSTALL` environment variable. | ||
``` | ||
```json | ||
{ | ||
"husky": { | ||
"skipInstall": true | ||
"skipCI": false | ||
} | ||
@@ -87,6 +90,2 @@ } | ||
To manually install hooks, you can run `node ./node_modules/husky/husky install` and to uninstall `node ./node_modules/husky/husky uninstall`. | ||
Though, if you run `npm uninstall husky`, it will still automatically revert `.git/hooks` to its previous state. | ||
### skipCI | ||
@@ -93,0 +92,0 @@ |
{ | ||
"name": "husky", | ||
"version": "0.15.0-beta.7", | ||
"version": "0.15.0-beta.8", | ||
"description": "Prevents bad commit or push (git hooks, pre-commit/precommit, pre-push/prepush, post-merge/postmerge and all that stuff...)", | ||
"scripts": { | ||
"test": "npm run lint && jest", | ||
"postinstall": "node husky install", | ||
"preuninstall": "node husky uninstall", | ||
"devInstall": "npm run build && cross-env HUSKY_ENV=dev node husky install && node husky-dev", | ||
"devUninstall": "npm run build && node husky uninstall", | ||
"postinstall": "node lib/installer/bin install", | ||
"preuninstall": "node lib/installer/bin uninstall", | ||
"devinstall": "npm run build && npm run postinstall -- node_modules/husky && node scripts/dev", | ||
"devuninstall": "npm run build && npm run preuninstall -- node_modules/husky", | ||
"build": "del-cli lib && tsc", | ||
"normalizeNewline": "node scripts/normalizeNewline", | ||
"prepublishOnly": "npm run test && npm run build && npm run normalizeNewline && pkg-ok", | ||
"lf": "crlf --set=LF templates/hook.sh", | ||
"prepublishOnly": "npm run test && npm run build && npm run lf && pkg-ok", | ||
"lint": "tslint 'src/**/*.ts'", | ||
@@ -50,5 +50,5 @@ "fix": "npm run lint -- --fix" | ||
"devDependencies": { | ||
"@types/execa": "^0.7.0", | ||
"@types/jest": "^21.1.2", | ||
"@types/node": "^8.0.32", | ||
"@types/node": "^8.0.34", | ||
"crlf": "^1.1.1", | ||
"cross-env": "^5.0.5", | ||
@@ -58,7 +58,6 @@ "del": "^3.0.0", | ||
"jest": "^21.2.1", | ||
"normalize-newline": "^3.0.0", | ||
"pkg-ok": "^1.1.0", | ||
"prettier": "^1.7.4", | ||
"tempy": "^0.2.1", | ||
"ts-jest": "^21.1.0", | ||
"ts-jest": "^21.1.2", | ||
"tslint": "^5.7.0", | ||
@@ -65,0 +64,0 @@ "tslint-config-prettier": "^1.5.0", |
@@ -7,3 +7,3 @@ # 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) | ||
Husky can prevent bad commit, push and more :dog: _woof!_ | ||
Husky can prevent bad `git commit`, `git push` and more :dog: _woof!_ | ||
@@ -52,3 +52,3 @@ ## Install | ||
* Supports monorepo/sub-directories layouts | ||
* If you were using `ghooks`, it will migrate your git hooks | ||
* If you were using `ghooks`, it will migrate your Git hooks | ||
@@ -55,0 +55,0 @@ ## Used by |
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 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
15
2
16669
13
201
1