my goal is to create Monorepo. I am an Angular Developer, so I expect to start my first project as Angular. But in the future I expect other developer to may use React/Next.js. The point is: I do not want to constraint my developer to a specific framework.
My definition of a Monorepo is as follow:
Each project should have its own
package.json
with expectation:- a remote can be an Angular 15 / 16, React, Next.js.
- a host can share state between remote.
(optional) I hope I can put the backend in this repo as well. So we can avoid "version difference between Frontend and Backend" and other things such as "this model is outdated, and no one know about it"
host-project1 -> Angular 16 application.
- route to landingEditor.
- route to searchEngine.
- route to editor.
landingEditor -> Angular 16 application.
searchEngine -> Angular 16 application.
editor -> Angular 16 application.
What I've tried:
I can use Angular Workspace to create the Angular applications. Then, I can create
host-project1
Angular application with only 1 responsibility: to route to the Angular applications.The problem is
host-project
Angular application route to the source code of these Angular applications. This violates my definition of monorepo. "To make development faster, a developer can choose to run specific Angular application (i.e. just the landingPage) and still access it throughhost-project1
".Use NX
The problem is I do not see
package.json
in each of the remote folder. In the future, I expect that we run different version of Angular, and sometime maybe use React or Next.js. This is where Lerna shine, but I read that Lerna is taken over by NX.
What I am planning:
- Use Lerna.