-
-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add flag to fix relativeUserPkgDir #728
Conversation
README.md
Outdated
@@ -328,6 +328,10 @@ npm install husky --save-dev | |||
|
|||
Verify that your version of Git is `>=2.13.0`. | |||
|
|||
#### Lerna Workspaces and Monorepos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like this fix would also address this happening in a Yarn Workspaces monorepo. Maybe we should call that out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed to Lerna, Monorepos, and Yarn Worksapces
to cover everything. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks :) Already updated the PR, what is your merge process?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First lets recreate the issue on master:
- close this example of a basic Lerna monorepo https://github.com/reggi/lerna-tutorial
- Setup Husky
- Run
yarn
insidepackages/usage
- Open
.git/hooks/huskey.local.sh
, expect to seecd "packages/usage"
// <-- this is the problem
Test the fix
- Checkout this PR in the example project
- Set the env variable
HUSKY_RUN_FROM_ROOT="true"
orHUSKY_RUN_FROM_ROOT="1"
- Remove
.git/hooks
- Run
yarn
insidepackages/usage
- Open
.git/hooks/huskey.local.sh
, expect to seecd "."
// <-- this is the fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Piniging @lessen-inc and @typicode for their attention :)
hey just bumping this, any reason why it hasn't been merged? @typicode @lessen-inc |
What
Per #677, and @eduard-malakhov great explanation #677 (comment)
Fix a bug when running
yarn|npm install
from a subnode_modules
in a monorepo/yarn workspaces project.Current: the relative path to the project's root is set no
packages/someOther
when running from a package likepackages/someOther
.Expected: To be able to force the relative path to the be the root of the project even when the
yarn|npm install
is running not from the root.