Badget icon indicating copy to clipboard operation
Badget copied to clipboard

Improvments: Make it into a monorepo / Turborepo

Open Codehagen opened this issue 1 year ago • 8 comments

Convert Existing Repository into a TurboRepo Monorepo

Improvement Description

This issue proposes the transformation of our current repository into a TurboRepo, reorganizing it into a monorepo structure. This change aims to streamline our development workflow, enhance build performance, and improve the management of interdependent projects within our codebase.

Rationale

The primary motivation for this transition is to leverage TurboRepo's efficient task runner and smart caching mechanisms. These features will significantly speed up our build and test processes. Given our growing codebase and the increasing interconnectivity of our projects, adopting a monorepo structure will facilitate better project management and collaboration.

Proposed Solution

  • Initialize Turbo: Run npx create-turbo@latest at the root of the project to set up Turbo.
  • Configure Turbo: Edit the turbo.json file to define tasks and pipelines.
  • Reorganize Codebase: Structure the repository into separate folders for each project or package, ensuring a clean monorepo setup.
  • Update package.json: Ensure each project has a package.json with the necessary scripts.
  • Adopt Yarn/npm Workspaces: Use Yarn or npm Workspaces for managing dependencies across our projects.
  • Testing and Debugging: Extensively test the new setup to ensure compatibility and efficiency.

Additional Context

The transition to a TurboRepo will be a significant change in our development process, requiring thorough testing and potential adjustments in our CI/CD pipelines. Documentation will be updated to reflect these changes and guide the team through the new workflow.

Codehagen avatar Jan 02 '24 07:01 Codehagen

hi @meglerhagen I am interested in working on this - is it possible to get a description on this when you have a moment?

2wce avatar Jan 02 '24 14:01 2wce

Hi @2wce I made the description above. Thank you for the message. And do you have any issues please dont hesitate to contact me :)

Codehagen avatar Jan 02 '24 17:01 Codehagen

Hi @meglerhagen,

I am now familiar with Turborepo (to be honest, never heard of it before), but I have been using Nx.dev for some time now and can only recommend it.

I have also roughly looked at some benchmarks and Nx is usually a lot faster there too.

Reference: https://nx.dev/concepts/more-concepts/turbo-and-nx#tech-and-performance

tuffz avatar Jan 02 '24 18:01 tuffz

@meglerhagen Has anybody picked this up yet? Otherwise i'd like to take a crack at it.

Littletonconnor avatar Jan 04 '24 07:01 Littletonconnor

Hi @Littletonconnor ! Nobody has taken it up yet. Would be great if you could look at it 👏 I assigned you the task ✨

Codehagen avatar Jan 04 '24 08:01 Codehagen

@meglerhagen Hello 👋 . Just wanna give an update on this. I have started this and am making good progress, but it will likely take about 3 days to finish things up and raise a PR!

Littletonconnor avatar Jan 05 '24 08:01 Littletonconnor

Thanks for the update! Take your time 👏🏻 Lets gooooo

Codehagen avatar Jan 05 '24 08:01 Codehagen

#82 This PR will resolve the last conflicts

alexghirelli avatar Jan 25 '24 00:01 alexghirelli

Together with @matteobad, have improved all the project structure in this PR: #90

alexghirelli avatar Jan 26 '24 05:01 alexghirelli

Very good! Its up and running AND working ✨

Codehagen avatar Jan 26 '24 05:01 Codehagen