Use husky to manage deps (#7)

* Add husky

* Update docs

* Don't ignore node_modules
This commit is contained in:
Danny McCormick 2019-06-17 09:32:08 -04:00 committed by GitHub
parent 68c1f30223
commit 075e678472
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 222 additions and 14 deletions

View file

@ -1,17 +1,22 @@
# Contributors
# Checkin
### Checkin
- Do checkin source (src)
- Do checkin build output (lib)
- Do checkin runtime node_modules
- Do not checkin
- Do not checkin devDependency node_modules (husky can help see below)
# Adding a dev dependency
### devDependencies
Remember to update .gitignore.
In order to handle correctly checking in node_modules without devDependencies, we run [Husky](https://github.com/typicode/husky) before each commit.
This step ensures that formatting and checkin rules are followed and that devDependencies are excluded. To make sure Husky runs correctly, please use the following workflow:
# Updating toolkit dependency
```
npm install # installs all devDependencies including Husky
git add abc.ext # Add the files you've changed. This should include files in src, lib, and node_modules (see above)
git commit -m "Informative commit message" # Commit. This will run Husky
```
Until released publically, update tgz packages in toolkit
During the commit step, Husky will take care of formatting all files with [Prettier](https://github.com/prettier/prettier) as well as pruning out devDependencies using `npm prune --production`.
It will also make sure these changes are appropriately included in your commit (no further work is needed)