Monorepos - alexanderteplov/computer-science GitHub Wiki

Monorepos

Imagine that instead of a small app, you need to maintain a huge platform consisting of a lot of functional areas. If you are thinking about architecture, you will want to do two main things: Separate concerns and avoid code dupes.

Monorepo Advantages

  • One place to store all configs and tests.
  • Easily refactor global features with atomic commits.
  • Simplified package publishing.
  • Easier dependency management.
  • Re-use code with shared packages while still keeping them isolated.

Monorepo Disadvantages

  • No way to restrict access only to some parts of the app.

  • Poor Git performance when working on large-scale projects

    Note: Nowadays, Facebook tries to resolve issues with VCS scalability by patching Mercurial and, probably soon, this won’t be such a big issue.

  • Higher build time.

Tools

  • Basel is Google’s monorepo-oriented build system.
  • Yarn is a JavaScript dependency management tool that supports monorepos through workspaces.
  • Lerna is a tool for managing JavaScript projects with multiple packages, built on Yarn. Lerna is focused on linking multiple packages from the same project and managing npm publishing.
  • Nx is an extensible dev tool for monorepos. It's focused on managing development workflow for multiple packages. Nx doesn't rebuild and retest everything on every commit - it only rebuilds what is necessary.

Links

-Guide to Monorepos for Front-end Code

⚠️ **GitHub.com Fallback** ⚠️