@@ -22,8 +22,8 @@ It is intended to be used within a project as a series of npm scripts.
2222``` json
2323{
2424 "devDependencies" : {
25- "@spotify/web-scripts" : " ^11 .0.0" ,
26- "husky" : " ^4.3.8 "
25+ "@spotify/web-scripts" : " ^12 .0.0" ,
26+ "husky" : " ^7.0.0 "
2727 },
2828 "scripts" : {
2929 "build" : " web-scripts build" ,
@@ -32,17 +32,24 @@ It is intended to be used within a project as a series of npm scripts.
3232 "lint" : " web-scripts lint" ,
3333 "commit" : " web-scripts commit" ,
3434 "release" : " web-scripts release" ,
35- "prepare" : " web-scripts audit"
36- },
37- "husky" : {
38- "hooks" : {
39- "pre-commit" : " web-scripts precommit" ,
40- "commit-msg" : " web-scripts commitmsg"
41- }
35+ "prepare" : " husky install && web-scripts audit"
4236 }
4337}
4438```
4539
40+ Additionally, you'll need to run the following two commands to create the commit and pre-commit hooks:
41+
42+ ``` shell
43+ npx husky set .husky/pre-commit ' yarn web-scripts precommit --no-tests --no-typecheck'
44+
45+ npx husky set .husky/commit-msg ' yarn web-scripts commitmsg --edit="$1"' && \
46+ sed ' s/edit=""/edit="$1"/g' .husky/commit-msg | tee .husky/commit-msg
47+ ```
48+
49+ NOTE: the second command uses sed to hack around [ this bug in husky] ( https://github.com/typicode/husky/issues/1019 ) that removes ` $1 ` .
50+
51+ You'll want to add and commit the ` .husky ` directory.
52+
4653View the [ full CLI documentation] ( ./packages/web-scripts ) for more details on how to get started.
4754
4855### Create a new library
0 commit comments