We have decided to use NX in our startup to build a large scale enterprise software with Angular and NestJS, and our main idea was to construct multiple libraries that we can very easily re-use and extend in new projects due to their generic nature (ex. Grids, Scheduling, Map, Data Table etc.)
So we have our MainProject NX mono-repo which will be our main software that we are trying to release in the future. This project is built of many libraries as mentioned, LibraryA, LibraryB, LibraryC etc. All of the libraries that we will build over time will reside here and will be used at some capacity for MainProject.
Now after a while we get a possible ClientA which requests ProjectA with some set of functionality, which we know we can deliver by using the existing LibraryA and building a new LibraryD, which would most likely also be integrated and reside in the mono-repo to be re-used later.
The eventual goal for us, to be able to spin up quickly projects for potential clients (they all will still be in the same or similar domain as the main project), that would re-use these libraries and tweak/extend them for their own needs.
I am looking into the option of using a private package repository, maybe GitLab's one or Sonatype Nexus. These libraries that we build and keep in our MainProject mono-repo will be set as publishable and hosted on the package repository with versioning and functioning CI/CD, then re-used in these different projects and extended for their use-case. It's worth noting, that we will have a bigger tree hierarchy of shared dependencies, for example LibraryA depends on LibraryShared depends on LibraryCore, so the upper tree libraries should also be publishable and referenced by other libraries. We are well aware that small changes in the upper libraries will result in broken dependencies, and broken code further down the dependency tree, but we hope to keep the tree as shallow as possible, with lots of smaller libraries, careful version management, will make this bearable and allow for slow code transition to latest versions (minor, major, breaking changes etc).
Does all of this make sense? Is there a better way of doing this? Perhaps NX/mono-repo doesn't even make sense and we have to go with something entirely different. Any type of ideas or discussions would be appreciated. Thanks!