million-views / praas

Proxy as a service.
MIT License
4 stars 2 forks source link

Fixing husky per app and not globally #37

Open vakareeralil opened 4 years ago

vakareeralil commented 4 years ago

As a developer, one should have the husky configured per application. ie, husky configured for praas-app should not be interfering with one in praas-ionic-app.

Acceptance criteria

kavithaii commented 4 years ago

Shared two approaches Husky setup to configure Husky in multi package.

  1. Standard setup
  2. Lerna setup

Later in discussion decided to take standard setup, as the Lerna package requires more learning.

Then @vakareeralil Varghese, showed a demo by implementing the standard setup. Do a root package.json solves the purpose, praas-app-ionic git commit triggers Husky - lint-staged pre-commit hook, without triggering praas-app Husky pre-commit hook.

Waiting for the fully functional Husky pre-commit hook based on standard setup by @vakareeralil.

m5nv commented 4 years ago

Since we are reactivating this task after a long time, these were the thoughts that I captured before the issue got parked:

The issue we are trying to resolve is how to run code quality checks prior to committing but only on affected files and folders. A combination of husky and lint-staged is one solution. But it requires that we need to npm init a the root of a pseudo-mono-repo structure.

What is unresolved is if we can avoid introducing npm dependency at the root level.

Counter argument is nodejs is a tool like any other (instead of being seen as a service/product tech stack), and so it's not productive to make that distinction.

/fin

Btw, Git Hooks is a great reference to explore all one needs to know on topic.

m5nv commented 4 years ago

@vakareeralil I have been going through the list of tools (from the Git Hooks link mentioned earlier) because I am not at ease with the husky+lint-staged solution because (a) we have not tested in how it behaves in a multiple language environment, and (b) the speed. So I shifted my search to look for pre-commit tools that were explicitly designed for multiple language environment.

I will update this after I finish my search. So far LeftHook is resonating.