bcgov / cas-reporting

This is for the Clean Growth Digital Services team for work related to reporting.
Apache License 2.0
0 stars 0 forks source link

Explore monorepo tooling options #158

Closed mikevespi closed 3 months ago

mikevespi commented 4 months ago

Describe the task

Moving to a single repository does not have to mean a slow unmanageable monolith. There are tools that make monorepos an extremely efficient way to manage and coordinate multiple projects. While there are plenty of options, the two that standout (to me at least) are Nx and Turborepo. Turbo because it is made by Vercel, the creators of NextJS. Nx because it drastically outperforms the alternatives in many ways (particularly fast build and CI processes), and has native support for NextJS as well.

Consider while exploring these tools the effort of handling these processes by ourselves, in comparison to the learning curve experienced while demoing monorepos.

Acceptance Criteria

Additional context

The creators of the top monorepo tools came together and wrote up documentation on the approach itself, as well has offer feature comparisons across their products. This can be found here https://monorepo.tools/ and is a great introduction to the concepts and features that can be offered.

mikevespi commented 4 months ago

I have begun looking at Nx, but am off tomorrow so will leave this in the Sprint Backlog for now. Other devs feel free to jump in on this as well, let's just make sure we're synchronizing our work if you do!

mikevespi commented 3 months ago

Broke card #173 out of this card, will discuss closing this with team. cc @joshgamache

mikevespi commented 3 months ago

After discussions today we have opted to try Nx. Research done independantly by the Giraffe devs all lead back to Nx being the best fit for our needs. It has the highest performance in build optimization, allows for shared packages, and side-by-side apps. One of the main deciding factors was also the volume and quality of their documentation, which should allow the team to more effectively and efficiently adapt the new tool.

173 will be reworded to reflect the next steps.

joshgamache commented 3 months ago

Adding my notes from Turborepo exploration here, so there in a shared location in case we ever need them. Not spending time to distill them, since we won't be going this way for now.

Jot notes

Random links

Nx remote caching

While I was messing around with Turborepo, I read about how you can set up remote caching seperate from Vercel. Not sure if it had been discussed yet, but it looks like there's similar support in Nx without needing to use Nx Cloud (one example here, but I'm sure there might be others). With the Terraform+GCS chart we have, makes for a seemingly straightforward bonus.

pbastia commented 3 months ago

@mikevespi and @joshgamache I'm thinking we might be able to call this done?