Badget
Badget copied to clipboard
feat: Migrate to monorepo
Overview
This pull request aims to fix: #15 by introducing Turborepo to this repository and ultimately migrating this repo over to a monorepo.
Features
Configure Turbo ✅
- Turbo is now configured in this repo. The monorepo is setup to have
apps
andpackages
directories.- Apps - Used to hold, well, apps like the Next.js app that powers the site.
- Packages - We don't currently have any, but this is where we can put reusable libraries and configs.
Reorganize Codebase ✅
- Mentioned above, but the codebase has been organized to fit common monorepo conventions.
Update package.json ✅
- Both the root package.json and
www
package.json are updated and I have ensured the scripts work.
Adopt Yarn/npm Workspaces ✅
- We have adopted yarn workspaces since yarn is the package manager this project uses.
Testing and Debugging ✅
- I have tested all scripts and ensured they still work the same as they did before, but now we have first class caching ✨
Documentation ✅
- I have updated the README to include the fact that this repo is now a monorepo.
Additional Notes
There's a ton more we can do in terms of setting up a monorepo, but I left those out to keep the scope of the PR relatively small. I was already a bit concerned with the amount of files changes just due to the sheer number of files I had to move over. So while this pull request does not set up the perfect monorepo structure it does set the project on the right path, and I figure we can break down future tasks like setting up testing so we can add those to our Turbo.json file, setting up utility packages of sorts, etc.
Someone is attempting to deploy a commit to a Personal Account owned by @meglerhagen on Vercel.
@meglerhagen first needs to authorize it.
Totally open to suggestions if there are missing items folks think should be included here 😄
What would the advantages of a monorepo? If reusable packages are needed they can be uploaded to npm and used within their free plan because they would be open source.
What would the advantages of a monorepo? If reusable packages are needed they can be uploaded to npm and used within their free plan because they would be open source.
So, going ahead, the plan is to have a react-native app, a Node.js server, etc. Having a monorepo will help us having everything related to ProjectX at single place.
I would avoid a monorepo setup until strictly necessary, but the final call should be done by @meglerhagen
What would the advantages of a monorepo? If reusable packages are needed they can be uploaded to npm and used within their free plan because they would be open source. Sure, I can help you with that. Here's a reworded version of the text you provided:
In addition to what @akkikumar72 mentioned, there are a few more benefits to using a monorepo like Turborepo:
- Turborepo's ability to cache tasks can save money and time in the long run, especially as more features like Github actions are likely to be added to the repo in the future.
- Uploading multiple packages to npm and ensuring that all changes are reflected in a single PR can be a daunting task. A monorepo ensures that all the changes can be made in one go.
- With a monorepo, all Git history is organized in one place, making it easier to track changes over time.
- Adopting a monorepo early on, before the repository grows too large, can save time and effort in the long run. At my current workplace, we switched to a monorepo quite late and it took us almost a year to complete the transition and we're still nowhere close to where we want to be 😅 .
@meglerhagen What do we think about this? I can fix the merge conflicts if we plan on merging this soon.
Hi @Littletonconnor - Yes i would probebly need some help with the merge. But looks like its only the package.json that is the problem right now.
@meglerhagen Conflicts are now resolved!
Ok! Just did a commit @Littletonconnor , Just saw some new conflicts. Going to wait for new if you could help with the merge ✨
@meglerhagen Okay merge conflicts are cleaned up again! 🤞
Well @Littletonconnor i see that the conflicts are back, becouse i havent merged this yet (haha) - Do you mind for the last time to fix the merge conflicts that i made so that we can push it? Community wants this ✨
@meglerhagen Yep, I should be able to get around to fixing these either today or tomorrow!
Cant wait! Need to merge it asap when its ready. Also remember to yarn format so we get trough the github actions
It's failing the github workflow. Make sure to adapt the github action workflow so that it runs for all packages in the monorepo (format, lint, test and build)
It's failing the github workflow. Make sure to adapt the github action workflow so that it runs for all packages in the monorepo (format, lint, test and build)
Yes, I'm on it. There are a lot of broken paths due to the migration to turborepo that isn't completed at 100%
@meglerhagen sorry I wasn't able to get to this in time. Glad this was picked up by someone else though!
No worries and thanks @Littletonconnor ✨