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

Feature request: Migrate to NX for multiple applications structure #54

Closed
xgenvn opened this issue Nov 20, 2017 · 10 comments
Closed

Feature request: Migrate to NX for multiple applications structure #54

xgenvn opened this issue Nov 20, 2017 · 10 comments

Comments

@xgenvn
Copy link

xgenvn commented Nov 20, 2017

Hi,

Thank you for the excellent work.

I found out that NX has been open-sourced recently, and we can manage multiple apps within one place.
Do you think it's a good idea to migrate the current structure to a shared convenience way?
I've done some works and try to migrate some from your code base, but I really want to know your opinion.

For example, currently many shared codes are from app core, utils and shared.
We can try move this to a core app in nx, or even global lib, so we can reuse it later in many apps.

Thanks.

@cipchk
Copy link
Member

cipchk commented Nov 20, 2017

thank you very much! NX is very good.

I don't know how many changes will happen, if time permits, i will try to.

@xgenvn
Copy link
Author

xgenvn commented Nov 20, 2017

Yes, it'll be a breaking change for sure. If you intend to integrate NX, can you create another branch so that I can also contribute to?
However, we can write an inject script to have current repository to work with NX.
Please let me know if you have any better idea ;).

@cipchk
Copy link
Member

cipchk commented Nov 20, 2017

it is unlikely that if need releases a breaking change. I have a lot of work to do future, so i can't maintenance extra branches.

can supported NX on the bases, maybe your write an inject script is also a pretty good choice. other ways is so hard to implement, i don't have too much energy.

@cipchk
Copy link
Member

cipchk commented Nov 23, 2017

@xgenvn hi, i pondered this problem over and over again that manage multiple apps within one place.

so, i plan to create a new repository service for business components (like alain), please tell me how to do compatible NX?

@xgenvn
Copy link
Author

xgenvn commented Nov 23, 2017

I'll start experiment with creating a lib called alain, and moving things from the core and shared into alain. Or two different lib (alain_shared, alain_core). Well, I don't think you'll have problem moving things around like that. However, the structures should be well-defined. Then the current dashboard implementation can be defined as a playground app for references.

Perhaps we can create another repository called nx.alain?

@cipchk
Copy link
Member

cipchk commented Nov 23, 2017

Sure, it's the best if you can create a basic project service for NX.

and i have a few questions to ask.

  • What is the difference between NX and npm?
  • What should a NX directory structure?

@xgenvn
Copy link
Author

xgenvn commented Nov 27, 2017

I'm not sure how to answer the first question correctly.
I think it's very similar if we manage the app as npm packages.
There's one point that NX is superior though.
Scenario: We have Front app for user, Admin app for management, maybe Mobile app as well.
With NX, we have these apps under app folder. You can choose to build which app, and anything can be shared, put in lib folder, or separate npm package is also good.

With npm, I suppose we still have multiple app folders, right? And it makes maintenance a little bit harder.
So for me, NX solution is like a Visual Studio solution, where every app is a different project.

@dreamdevil00
Copy link

dreamdevil00 commented Nov 27, 2017

Why not using lerna to manage packages that you want to share among many other apps ?
And the code structure could be like colmena which is more scalable

@xgenvn
Copy link
Author

xgenvn commented Nov 27, 2017

Hi,

I haven't heard about lerna before. Thank you for mentioning it. Just have been checking it out, it serves similar to NX. However, lerna is very general compare to NX, which serves only Angular based development. And it requires a lot of configuration (correct me if I'm wrong). It's not like NX, one command and we have it working nicely.
And NX will extend Angular CLI, so it'll be better if we're using Angular CLI.

Colmena directory structure is similar to NX, and under active development. NX has reach the stable release at 1.5.x.

@dreamdevil00
Copy link

@xgenvn In fact, there's little configuration you have to do with lerna, just try it.
Yes, Colmena directory structure is similar to NX.

Using lerna to manage projects, you can control the package version and quickly publish it to npm, thus you can update your packages in semver. and use packages in other apps, not only current project. It's flexible whereas you have to manage the directory structure by yourself like Colmena. You can use ng serve as usual and do not have to build libs at first.

AFAIK, using Nx do save our time to manage directory structure and the time to create some basic files, but you can not control the package version.

They are complementary。 I think it may be better if using both of them.

@cipchk cipchk closed this as completed May 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants