Skip to content
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

Sibling packages in a repo conflict #134

Closed
jaydenseric opened this issue Jun 4, 2017 · 9 comments
Closed

Sibling packages in a repo conflict #134

jaydenseric opened this issue Jun 4, 2017 · 9 comments

Comments

@jaydenseric
Copy link

jaydenseric commented Jun 4, 2017

With a project repo structured like this:

project/.git
project/api/package.json
project/app/package.json

If you npm install each of the packages, the last to be installed destructively takes over. Installing or uninstalling husky in one of the sibling projects overwrites the git hooks.

Unless there is some clever config I am missing I won't be able to use husky :(

@jaydenseric
Copy link
Author

Potentially related? #36

@lifayt
Copy link

lifayt commented Jun 12, 2017

I find that I have similar issues - We store many front end widgets in a monorepo, and hooks being stored at a global level mean that a commit in a different subdirectory will trigger them.

@typicode
Copy link
Owner

I think it's going to be tricky to handle such layout. What about adding a package.json in:

project/package.json

with something like:

{
  "scripts": {
    "precommit": "cd A && npm test && cd ../B && npm test"
  },
  "devDependencies": {
    "husky": "^0.14.1"
  }
}

@yakhinvadim
Copy link

PR #13 is a bit old, but it might fix the issue.

@SuEric
Copy link

SuEric commented Aug 24, 2017

What's the status of this?

@mcwebb
Copy link

mcwebb commented Oct 10, 2017

We use @typicode's solution of simply having the githooks on the root repository which then makes calls in the subdirectories. As far as I can tell this solves the use case and provides the most flexibility.

@SuEric
Copy link

SuEric commented Oct 11, 2017

@mcwebb
So this mean I will have another node_modules in my root folder?

@mcwebb
Copy link

mcwebb commented Oct 11, 2017

Yes, containing only Husky and its dependencies.

@ollwenjones
Copy link

I kicked that root package idea around. Feel a little validated reading this. I really need to make the packages @scoped so maybe I can work this in as part of that refactor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants