Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding monorepo as a possible repository option? #499

Open
1 of 3 tasks
duydnguyen07 opened this issue Aug 30, 2019 · 6 comments
Open
1 of 3 tasks

Adding monorepo as a possible repository option? #499

duydnguyen07 opened this issue Aug 30, 2019 · 6 comments

Comments

@duydnguyen07
Copy link

Would it be possible to add a monorepo option when generating a web app?

Something that looks like this https://github.com/kievsash/Core-App-monorepo ?

I'm submitting a...

  • Bug report
  • Feature request
  • Documentation issue or request

Current behavior

There isn't really a way to create a monorepo setup

Expected behavior

A new option called "Web app (monorepo)" or something like that will generate a monorepo setup.

Minimal reproduction of the problem with instructions

Environment





Others:

@sinedied
Copy link
Member

sinedied commented Sep 3, 2019

Basically, what you want is this: https://angular.io/guide/file-structure#multiple-projects ?

Because the repo you linked contains both an app at the root and a workspace, which is something you can already do with the current generator and the ng cli: just call ng generate application my-app to add an additional app after the initial ngx project is generated.

I'm not sure I understand what you really wants here?

@sinedied sinedied moved this from Waiting for triage/review to Awaiting feedback in ngX-Rocket backlog for all repos Sep 4, 2019
@davidecampello
Copy link

Hi, I'm looking for the same thing because I would like to have a monorepo for a project that have multiple angular (web/desktop) webapp and multiple ionic app with some shared modules like services and components.
If I create the new application with ng generate application I later have errors running ng serve with --project option.
Furthermore I'm not sure that with Ionic this solution will work because config.xml is in the root directory.
Have you found a solution?

@duydnguyen07
Copy link
Author

@sinedied true. I guess what I was wishing for was that the shell code can exist in the src folder and then the features can be grouped in applications in the project folder. The use case for me is that I have a dashboard that has some shared features and some distinct features for 2 different app and currently, I have to use 2 separate installations or risk bundling things I don't need using the monolithic application approach. It would be helpful to give me the choice from the beginning to set up the app in such a way that I can easily add a new project without undoing a lot of the boilerplate code. Maybe this is just a nice to have.

@dopsonbr
Copy link

Personally I would love to see something that is a cross between this and setup that yarn create nx-workspace $workspace-name --preset=angular-nest gives you. Has there been any thought to collaborating with the nrwl folks?

@sinedied sinedied moved this from Awaiting feedback to Backlog in ngX-Rocket backlog for all repos Oct 4, 2019
@sinedied
Copy link
Member

sinedied commented Oct 4, 2019

@dopsonbr nrwl includes the monorepo approach in its core, but is based entirely on angular schematics while this project use Yeoman, so the integration would be difficult.

I don't have much experience in Angular monorepos, but if anyone has some thoughts on what needs to be done to make this project "monorepo friendly", feel free to suggests changes to be made and/or propose a PR.
I could see a --monorepo or --workspace option flag being added to support that.

AFAIK, it's mainly a matter of where to put the files/folder and configs, + tweaks to angular.json?

@duydnguyen07
Copy link
Author

Well in a simplistic sense, it is just that. However, the topic is a lot more complex than that. I'm still investigating which approach is the best for monorepo. A few approaches that are worth looking into are lerna, nx from nrwl, and simply just using ng-packagr for libs and the app is a combination of those libs. I will give more detailed findings soon after a few experiments and more research on pros and cons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants