Skip to content

Use husky to manage deps #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 17, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
# runtime dependencies are checked in
# dev dependencies are *not* checked in
node_modules/.bin
node_modules/typescript
node_modules/@types
node_modules/prettier
__tests__/runner/*
17 changes: 11 additions & 6 deletions docs/contributors.md
Original file line number Diff line number Diff line change
@@ -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
### Husky

Remember to update .gitignore.
We run [Husky](https://github.com/typicode/husky) before each commit to ensure that formatting and checkin rules are followed. 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
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)
202 changes: 202 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,16 @@
"@types/jest": "^24.0.13",
"@types/node": "^12.0.4",
"@types/semver": "^6.0.0",
"husky": "^2.3.0",
"jest": "^24.8.0",
"jest-circus": "^24.7.1",
"prettier": "^1.17.1",
"ts-jest": "^24.0.2",
"typescript": "^3.5.1"
},
"husky": {
"hooks": {
"pre-commit": "npm run build && npm run format && npm prune --production && git add node_modules/*"
}
}
}