-
Notifications
You must be signed in to change notification settings - Fork 671
Configurable project structure #2232
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
Comments
Some research: we're expecting some packages to be installed in For Node 8, This leaves us with 3 options:
|
With regards to the three options and my own use case, I'd be happy with any of them. I wouldn't mind having to go through a couple of extra steps to set up my environment, for instance having to install a local version of the CLI, if I get the benefits of a mono-repo. |
I suggest that we can provide this feature only for Node 8 or higher users. Anyone who wants this feature can upgrade their nodejs and get it automatically. :) |
@johneast Aside from what I've detailed, are there any additional issues with the Ionic CLI related to using a monorepo? As a side note, FYI: Ionic Pro appears to support custom directory structures with custom npm scripts: https://ionicframework.com/docs/pro/basics/concepts/customizing-builds.html |
@johneast In your original issue, you mention you lose the ability to organized code in a monorepo as soon as an ionic project is added. Can you elaborate? Are the issues with the build process? I found this commit, which makes me believe we likely won't be able to support monorepos for Ionic Angular v2/v3 projects with But... when I looked into importing a shared lib from a separate folder like @PoiScript wanted to do and building my app with the Angular CLI, I ran into this issue: angular/angular-cli#8783 I can fix what the Ionic CLI is doing wrong (and I have, see 9f1e202), but we're going to run into these issues everywhere. The ecosystem just doesn't seem to be ready for it... so let's compile a list of issues and tackle them one at a time. |
@dwieeb The biggest issue for me was the fact that I couldn't change the location of the node_modules folder. What I'd like to do, in the situation where I have multiple apps in my project repo is just have the one node_modules folder in the root and everything pulling in dependencies from there. After that, the next biggest issue was the process of configuring the build scripts to pull in my shared lib code. I was able to do it by modifying For instance, my
My
And my
At this point, I've had to specify the same path in three different locations and I don't feel I'm getting the benefit of the Ionic tooling as I'm having to do all the work myself. Also, this doesn't scale well. If I change my libs folder, or add others in, then I have to make many changes. A nice option might be to have some config options in the
A further enhancement, might be the ability in the ionic.config.json file to specify the root location of the app, relative to the location of the config file. That way, the ionic scripts can be in the root of the mono repo, but I could build and launch an app that is in a different location, and if I could specify the name of the app when I invoke the scripts, and the appropriate config is pulled in, that would greatly simplify things when I have multiple apps I want to test and build. From the root of the repo I'd like to be able to run the command
MyApp1, might live in a sub folder, such as
That way I could choose which app to run or build. The default operation could still be to have one app that doesn't have to be named to be built or served. Hope that all makes sense. |
@johneast Thank you for the detailed explanation. Yes, it makes sense. Our use case throughout the years has been for single-app repos, but I'm hearing more and more that people want monorepo support for their Ionic projects. I'll reiterate that support for monorepos in Ionic Angular 4 will be much better, simply because we've switched from our in-house Our position on tooling has been changing from trying to do all the optimizations ourselves to reworking Ionic itself such that it can be applied to any framework effectively and efficiently and then letting that framework handle tooling. 📝 The Ionic CLI still makes some assumptions about the project structure, such as prompting for |
@johneast As for that last point (multiple apps in one |
@dwieeb Thanks for the update. Sounds great. |
Just chiming in to mention Nrwl / Nx (and their workspaces) to make sure this is part of the research here. |
If I have understood correctly, Nx is nothing special but some handy schematics that help you build multiple apps in the same repo and you still serve and build everything using Angular CLI :). The primary problem is that we can not specify which project to use with ionic-cli, for example, if I run |
Closing in favor of this issue: #3281 as I think documentation for a multi-app setup and configurable structure is the last piece of the puzzle this 🎉 If I'm mistaken, please let me know. 😄 |
Some pathing is hard-coded in CLI v3. Support configurability and detect issues when something isn't where it's expected to be.
See:
The text was updated successfully, but these errors were encountered: