MultiRepo

pankajparkar

Blogpost

E-commerce

Book Store

MultiRepo

pankajparkar

Pros

  • Ownership is clear
  • Each separate repository can have separate CI rules
  • Rollback can be easier since it is a separate repo
  • Small build times

Cons

  • CI and CD may become challenging if multiple dependencies 
  • Hard to maintain dependencies version
  • e2e test can be challenging to verify
  • Code sharing may require extra effort and maintenance 

MonoRepo

pankajparkar

Pros

  • Code sharing and maintenance are easy
  • One source of truth
  • Better e2e tests
  • System versioning can be simpler
  • Easy to refactor and check dependency graph is easy
  • Better visibility across projects

Cons

  • Limitations Around Access Control
  • Long build times

Monorepo Users

pankajparkar

Google, Microsoft, Facebook, Twitter, Airbnb, Uber  etc.

Monorepo Tools

pankajparkar

  • Lerna
  • Bazel
  • Yarn
  • Nx
  • RushJS

Monorepo with Angular CLI

pankajparkar

ng new my-workspace --create-application false
cd my-workspace
ng generate application my-first-app
ng generate application my-lib

Reference: https://angular.io/guide/file-structure

What is Nx?

pankajparkar

  • Help to build app in scalable way
  • It provides out of the box support for tools like cypress, jest, etc. 

Nx Devtools

pankajparkar

npx create-nx-workspace --preset=angular

Reference: https://blog.ng-book.com/getting-started-with-nx-the-nrwl-extensions-for-angular/

Demo - https://github.com/pankajparkar/monorepo-angular

Q & A

pankajparkar

pankajparkar

pankajparkar

References

  • https://connect.nrwl.io/app/books/enterprise-angular-monorepo-patterns

  • https://blog.nrwl.io/12-things-to-help-large-organizations-do-angular-right-f261a798ad6b

  • https://www.youtube.com/watch?v=LEqJ1xKf_1w

  • https://nx.dev/latest/angular/getting-started/nx-setup

  •  

MonoRepo Angular

By Pankaj Parkar

MonoRepo Angular

Monorepo Angular

  • 662