Skip to content

Commit

Permalink
missed refs to shrinkwrap
Browse files Browse the repository at this point in the history
  • Loading branch information
sndrs committed Oct 17, 2016
1 parent 7b0d158 commit ea65e81
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
6 changes: 2 additions & 4 deletions docs/02-architecture/03-libraries-we-use.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ Play - the application server
https://playframework.com/

### Node dependencies
We also have a set of Node dependencies, used mostly by our static asset pipeline. We use npm to manage these.
We also have a set of Node dependencies, used mostly by our static asset pipeline. We use `yarn` to manage these.

When you want to add or update a dependency:

```
npm install <package>@<version> --save
npm shrinkwrap
node dev/clean-shrinkwrap.js
yarn add <package>@<version>
```
6 changes: 3 additions & 3 deletions git-hooks/pre-commit
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/bash

# ensure npm-shrinkwrap is committed with package.json changes
# ensure yarn.lock is committed with package.json changes
readonly staged=$(git diff --name-only --cached)

if [[ $staged == package.json* && $staged != *"npm-shrinkwrap.json"* ]]; then
node tools/messages.js should-shrinkwrap;
if [[ $staged == package.json* && $staged != *"yarn.lock"* ]]; then
node tools/messages.js should-yarn;
exit 1;
fi

Expand Down
4 changes: 2 additions & 2 deletions tools/messages.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ switch (process.argv[2]) {
}, 'info');
break;

case 'should-shrinkwrap':
notify('Run `make shrinkwrap` and include the changes to `/npm-shrinkwrap.json` in your commit.', {
case 'should-yarn':
notify('Run `make install` and include any changes to `/yarn.locl` in your commit.', {
heading: 'Dependencies have changed'
}, 'error');
break;
Expand Down

0 comments on commit ea65e81

Please sign in to comment.