Closed johannesschobel closed 5 years ago
I am also thinking in this line. we already have package.json
for publishable lib modules e.g., ngx-utils
, led
etc. I wanted to have app
specific package.json
for apps/api
, apps/webapp
,apps/mobile
as they generally don't share dependencies and one workspace level package.json
with common dependencies.
For this I have to switch to Yarn Lerna. at this moment I wanted to keep it native to node and default npm
for package management.
on the pro side if we split package.json
at apps level, we could have faster CI/CD builds and docker multistage builds
Dear @xmlking ,
yeah, i think, switching to Lerna
may be a good idea, because this would
lib1
may use dep1.0
and lib2
may use dep2.0
). So it would be possible to "incrementally" update applications / dependencies more easily.. Do you consider switching? because this starter package is actually really (!) awesome.. And i would love to have such an awesome angular-nestjs-whatever-starter
package with Lerna
;)
I will just add some more thoughts on this - maybe you are willing to contribute and share your opinions?
I am thinking about using a Monorepository
approach to build my next project. However, i am currently stuck between Lerna
and nrwl/nx
- obviously, both are quite awesome.
package.json
file that contain all dependencies from all apps / libs in your project. This may become huge very fast. Furthermore, it does not allow to use different versions of the same library in different apps (because everything is managed within one single package.json
file)package.json
file to manage their own dependencies). package.json
files may dramatically increase the required disk spaceWhat is your opinion on this? Can you provide more pros / cons on both approaches / frameworks? All the best and thank you very much for your time and effort,
Lerna is splitting package.json , nrwl/nx is angularCli++ I think we could use both together. I have to research.
oh.. using Lerna
and nrwl/nx
together may be an awesome idea.. Don't know if this works.. But using the best from both worlds may be really cool..
Maybe these articles / issues / comments are helpful:
You can add lerna. Nothing in the nx workspace prevents you from using it.
In fact, after a lot of tests, both with lerna and workspaces, my conclusion is that we don't need such tools, even if we have package.json files for the libs we build with ng-packagr and publish on our npm repository.
As in some articles the use of git submodules
is mentioned. I would suggest to not follow this git submodules
approach because the use of submodules may get very dirty ;) But that's just my opinion...
To be honest, after reading so much about lerna
and nx
, i am not sure which approach is better.. For now, I am considering the following stack:
angular
for the web frontend, nestjs
as a backend and ionic
for smart mobile devicesMy main concern is, that ionic 4 (latest version) just switched to angular 7
, which may be "outdated" in a few months because angular 8
is just around the corner (beta already started).. So i think, having independent package.json
files may be benefitial, because you would not be able to upgrade the main web application
to angular 8
until ionic
supports it..
All the best
@johannesschobel we got experimental integration of Lerna with this commit. I also switched to Yarn from default npm
please test and let us know...
https://github.com/xmlking/ngx-starter-kit/commit/0b53f15b20289d80ed14c62e43eef816ffec1a6b
now we have dedicated package.json
files for workspace, webapp and API app.
Hey @xmlking ,
i was just wondering, if it would be benefitial to have dedicated
package.json
files in each\libs
and\apps
folder (i.e., each app handles their own dependencies). Is there a specific reason, why you don't follow this approach?All the best and thanks a lot for your time and effort