firecamp icon indicating copy to clipboard operation
firecamp copied to clipboard

feat: common configuration #85

Open bathini79 opened this issue 2 years ago • 19 comments

This is an initial PR

#85

bathini79 avatar Oct 11 '23 06:10 bathini79

Deploy request for staging-firecamp-dev rejected.

Name Link
Latest commit d0f1f26114fa19578fc72e765d20bf16fc235d2f

netlify[bot] avatar Oct 11 '23 06:10 netlify[bot]

@bathini79 can you please explain this PR with some description? I need to understand your view on how to use this common code config in the rest of the app.

Nishchit14 avatar Oct 13 '23 13:10 Nishchit14

Gentle reminder here @bathini79

Nishchit14 avatar Oct 16 '23 10:10 Nishchit14

@Nishchit14 Working on it,now! I'll get you with a practical example

bathini79 avatar Oct 18 '23 04:10 bathini79

@Nishchit14 This is architecture i want to go with: packages: -> firecamp/eslint -> index.js (Contains lint configuration,This is a starting point we can rename it or add more files as needed) Example usage platform: ->firecamp-plaform -> package.json (devDependency) ->eslint (extend @firecamp/eslint)

https://github.com/firecamp-dev/firecamp/assets/116077457/0d5ed264-2bee-4553-967e-d32367556cf3

bathini79 avatar Oct 19 '23 02:10 bathini79

It looks good to me and I agree with it. thank you for the nice demonstration. @bathini79. what should be the next step? prettier?

Nishchit14 avatar Oct 19 '23 09:10 Nishchit14

@Nishchit14 yes prettier and tsconfig

bathini79 avatar Oct 19 '23 18:10 bathini79

@Nishchit14 I've included prettier in the same eslint config. Let me know if you want me to configure it differently

bathini79 avatar Oct 21 '23 14:10 bathini79

@Nishchit14 I renamed the file to common-config , So we can expand the configs. Also Added A Readme File On How to use it.

bathini79 avatar Oct 22 '23 20:10 bathini79

Great job @bathini79

I think keeping the prettier config separately is a good idea instead of combining it within eslint.

Also, I have doubts about husky. what would be the best way to implement husky for multiple packages in monorepo and use a common husky setup?

Nishchit14 avatar Oct 23 '23 09:10 Nishchit14

@Nishchit14 okay . I agree with you I'll separate out prettier config.i'll check about husky and I'll get back to you

bathini79 avatar Oct 23 '23 10:10 bathini79

i haved added prettier

bathini79 avatar Oct 25 '23 06:10 bathini79

I tried husky , Using the same way for prettier etc. But its not working i expected. I'll check once again though . Here's what i found , it is difficult for husky in a monorepo setup in itself, Let alone in a common configuration file is a bit tricky. https://dev.to/mimafogeus2/enforce-git-hooks-in-monorepos-with-husky-but-how-3fma

bathini79 avatar Oct 25 '23 06:10 bathini79

hmmm, thanks for sharing it. i'll try to find some help here @bathini79

Nishchit14 avatar Oct 25 '23 07:10 Nishchit14

@Nishchit14 let me know what you have found

bathini79 avatar Oct 30 '23 10:10 bathini79

@bathini79 looking into it, give me a day.

Nishchit14 avatar Oct 31 '23 12:10 Nishchit14

@bathini79 the husky common config is not possible, we need to add it at the whole repo level. that's the way it works, on any commit at the repo level the husky will get triggered to run the staged command.

you can give it a final try by adding Husky at the repo level. then after we would be good to go.

Nishchit14 avatar Nov 01 '23 09:11 Nishchit14

Okay thanks. I'll try by EOD

bathini79 avatar Nov 01 '23 10:11 bathini79

@Nishchit14 I Pushed the code . I have added pre commit configuration in the root folder and config file in husky . And Also husky config in mono repos .
The Way It Works Is , In Husky Configuration folder we need to add pre-commit hook . We Can Write the script to run we'll stick with pre-commit script . in this pre-commit script in root package.json we will run other repos pre commit script. In Husky File I Commented Out the command . So No Body Will Be Blocked to push the code . But After We're ready we can remove the comment

bathini79 avatar Nov 05 '23 21:11 bathini79