fix: disable postinstall script prior to publishing #925
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Note!!:
The alternative to this is to roll back husky to v4: #926. We should merge one and close the other + delete the branch.
Due to Husky v5 currently causing more headaches than it may be worth, I recommend rolling back to v4 (PR linked above)
Summary
Husky 5's implementation is a bit different and required adding a
postinstall
script to package.json. This script should only be ran while developing, not for users of the packaged artifact.Solution is to disable post install scripts before publishing. This is what
pinst
was added for in #867, however I missed adding the disable. (See pinst usage for more info)closes: #923
How To Test
Perform a clean install to verify dev still works (I deleted
node_modules
and ranyarn
to verify, plus the ability to commit this and see the git hooks still working with husky were good tests)Locally running
yarn prepublishOnly
should run the existing test and linting scripts as well as disablingpostInstall
:locally running
yarn postpublish
should result in postInstall being enabled once again:Finally, testing an install of this package after release of this code change will be the true test.