Skip to content

Commit 98afff8

Browse files
committed
Removes husky install from prepare script.
Running this on `prepare` is the best practice from Husky to avoid installing into consumer packages. That makes sense, but has two problems: 1. `prepare` runs on `npm publish`, meaning that `bazel run //:pkg.publish` also executes `husky install`, which then fails because `.git` isn't present in the sandbox (see this [release failure](https://github.com/dgp1130/rules_prerender/runs/3530314979?check_suite_focus=true)). 2. `prepare` runs on `npm install rules_prerender-*.tgz`. I can't confirm that this is actually intended behavior, but it effectively installs Husky into a consumer package, which is most annoying in the [`ref/external` branch](https://github.com/dgp1130/rules_prerender/tree/ref/external/) and needs to be worked around. I'll try to figure out if there is a cleaner way to install Husky, otherwise maybe I'll just document that you have to do it manually?
1 parent 0cfe3b5 commit 98afff8

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@
2525
"lint-fix": "npm run -s lint -- --fix",
2626
"lint-commit": "git diff \"${COMMIT}~1..${COMMIT}\" --name-only | npm run -s -- filter-lintable | xargs -P 8 -L 1 -I {} bash -c \"git show \\\"${COMMIT}:{}\\\" --diff-filter=d | npm run -s -- eslint --stdin --stdin-filename \\\"{}\\\"\" --max-warnings 0 --report-unused-disable-directives",
2727
"filter-lintable": "grep '\\.js$\\|\\.cjs$\\|\\.mjs$\\|\\.ts$'",
28-
"eslint": "eslint",
29-
"prepare": "husky install"
28+
"eslint": "eslint"
3029
},
3130
"repository": {
3231
"type": "git",

0 commit comments

Comments
 (0)