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

feat: common configuration #85 #108

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

bathini79
Copy link
Contributor

@bathini79 bathini79 commented Oct 11, 2023

This is an initial PR

#85

@netlify
Copy link

netlify bot commented Oct 11, 2023

‼️ Deploy request for staging-firecamp-dev rejected.

Name Link
🔨 Latest commit d0f1f26

@Nishchit14
Copy link
Contributor

@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
Copy link
Contributor

Gentle reminder here @bathini79

@bathini79
Copy link
Contributor Author

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

@Nishchit14 Nishchit14 changed the title Feat/common configuration #85 feat: common configuration #85 Oct 18, 2023
@bathini79
Copy link
Contributor Author

bathini79 commented Oct 19, 2023

@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)

2023-10-19.08-06-27-94.1.mp4

@Nishchit14
Copy link
Contributor

Nishchit14 commented Oct 19, 2023

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

@bathini79
Copy link
Contributor Author

@Nishchit14 yes prettier and tsconfig

@bathini79
Copy link
Contributor Author

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

@bathini79
Copy link
Contributor Author

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

@Nishchit14
Copy link
Contributor

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?

@bathini79
Copy link
Contributor Author

@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
Copy link
Contributor Author

i haved added prettier

@bathini79
Copy link
Contributor Author

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

@Nishchit14
Copy link
Contributor

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

@bathini79
Copy link
Contributor Author

@Nishchit14 let me know what you have found

@Nishchit14
Copy link
Contributor

@bathini79 looking into it, give me a day.

@Nishchit14
Copy link
Contributor

Nishchit14 commented Nov 1, 2023

@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.

@bathini79
Copy link
Contributor Author

Okay thanks. I'll try by EOD

@bathini79 bathini79 force-pushed the feat/common-configuration-#85 branch from c549518 to d0f1f26 Compare November 5, 2023 18:02
@bathini79
Copy link
Contributor Author

@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

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

Successfully merging this pull request may close these issues.

2 participants