OasisDigital / angular-enterprise-example

Scalable / Large Angular application structure example
MIT License
125 stars 47 forks source link

non-mono-repo, non-Lerna version, with private NPM repo #5

Open kylecordes opened 7 years ago

kylecordes commented 7 years ago

This example shows how to split a large Angular application into many pieces, managed in a monorepo. Although fairly popular in 2017, there are also many organizations looking to scale their enterprise Angular projects, who don't want a mono repo.

This idea therefore:

Write a script that processes the contents of this repo and automatically splits it into N separate repos. Then patches up the contents of each one to build locally and push to a private NPM repo.

There are serious developer productivity challenges with this approach. It requires that each separate module be developed separately, versioned, published to a private repo before it can be seen and used by other modules. This in turn, more strongly discourages developers from breaking out code in the most modular way.

Still, with the right tooling and advice such an approach should be workable and would be more valuable to some organizations then this monorepo approach.

kylecordes commented 7 years ago

In this variant, use the "Angular Package Format 4" described at ng-conf.

https://docs.google.com/document/d/1CZC2rcpxffTDfRDs6p1cfbmKNLA6x5O-NtkJglDaBVs/preview

kylecordes commented 7 years ago

... also consult the new lib quickstart:

https://github.com/filipesilva/angular-quickstart-lib

kylecordes commented 6 years ago

Update on what this item means: although the example uses Nx now, nonetheless it is possible to make each library be a valid NPM library, and be publishable. That could be done, in a way that yields a more tedious development experience, but which illustrates the same ideas without anything that resembles a monorepo; some organizations feel very strongly that a group of related applications and libraries should each have their own separate repository. It would be ideal to show an example that works with that constraint.