fix: omit Husky from published package installs - #206
Conversation
|
@Pybsama thank you for the response, is this meant to be implemented on the project using the library or its a patch to the library itself. I tried the fix on the Local project using the library but still got the error. however if its meant to be implementated on the library and patched, that might be a challange. how do i add the patch if its not installed in the first place. or probably i am get the whole fix wrong. more context on the implmentation will be much appreciated 🙏 |
3bc8b2b to
99aee6b
Compare
|
Thanks for asking, and sorry the scope was not clear. This is a patch to the library's publishing process, not code that should be copied into an app that consumes the library.
The currently published I have now rebased this library-side patch onto |
|
Revalidated and updated this PR against current
The previous run has no jobs or logs and changed to |
Issue #, if available:
Closes #205
Description of changes:
The published package currently runs
postinstall: husky, but Husky is adevelopment dependency and is not available in a clean consumer install.
This keeps the repository's Yarn 3 contributor hook setup intact while using
Husky's documented Yarn publishing pattern:
pinst --disableruns before packing, so the published manifest has noactive
postinstall;pinst --enablerestores the source manifest after packing; andoffline, development-dependency-free npm consumer.
The smoke test places a failing Husky guard ahead of the repository's own
node_modules/.bin, so the regression cannot pass by accidentally finding thecheckout's development dependency. It also restores the source manifest in a
finallyblock if packing fails.Validation:
corepack yarn install --immutablecorepack yarn test --runInBand(25/25)corepack yarn test:package-installcorepack yarn lintcorepack yarn typescriptcorepack yarn preparenpm packfollowed by offline npm and Yarn 3 consumer installscorepack yarn prettier --check package.json .github/workflows/pr.yaml scripts/test-package-install.jsgit diff --checkBy submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.