Comments (8)
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.
nrwl/nx
Pros
- Very easy-to-use console commands to create apps & libs. Everything is automatically wired up by the framework - no manual tasks
- powerful schematics
- very tightly coupled with angular (well, you can also list this as a con 😆 )
- provides a clear structure for the repository (and apps and libs)
Cons
- only one "big"
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 singlepackage.json
file) - you cannot have different "build scripts" (or rather - the overhead to do so is very high!)
Lerna
Pros
- seems very battle tested and follows a more "each package is a separate buildable / deployable entity" approach (e.g., each package has its own
package.json
file to manage their own dependencies). - libs are more reusable (e.g., all dependencies are directly managed by the lib itself)
Cons
- more "manual" work (e.g., wiring it all together)
- no explicit project / package structure given
- using different
package.json
files may dramatically increase the required disk space
What 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,
from ngx-starter-kit.
now we have dedicated package.json
files for workspace, webapp and API app.
from ngx-starter-kit.
this is an other motivational blog...
https://medium.com/naresh-bhatia/sharing-ui-components-with-lerna-and-yarn-workspaces-be1ebca06efe
https://medium.com/@zachary.n.feldman/harmony-with-angular-lerna-and-yarn-workspaces-6a7394f08da
from ngx-starter-kit.
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
from ngx-starter-kit.
Dear @xmlking ,
yeah, i think, switching to Lerna
may be a good idea, because this would
- reduce the build-time and -resources
- make it possible to "update" specific dependencies per project / app / library (e.g.,
lib1
may usedep1.0
andlib2
may usedep2.0
). So it would be possible to "incrementally" update applications / dependencies more easily.. - you could build, test, ... each library / application 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
;)
from ngx-starter-kit.
Lerna is splitting package.json , nrwl/nx is angularCli++
I think we could use both together. I have to research.
from ngx-starter-kit.
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 andionic
for smart mobile devices
My 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
from ngx-starter-kit.
@johannesschobel we got experimental integration of Lerna with this commit. I also switched to Yarn from default npm
please test and let us know...
from ngx-starter-kit.
Related Issues (20)
- An in-range update of fortawesome is breaking the build 🚨
- An in-range update of @types/jest is breaking the build 🚨 HOT 2
- An in-range update of @angular-devkit/build-angular is breaking the build 🚨 HOT 1
- Action Required: Fix Renovate Configuration
- what is "var" ?
- Error with image-comparison HOT 2
- Need more documentation HOT 2
- Ivy fails with NGXS
- @ngx-starter-kit/ngx-utils removed from npm HOT 4
- Please re-publish also 0.0.3 version. HOT 4
- support for nestjs compiler plugins (e.g. for swagger)
- iPhone not ringing with incoming calls HOT 1
- Keycloak Default Config file not accessible
- An in-range update of filepond-plugin-image-preview is breaking the build 🚨 HOT 2
- Dependency Dashboard
- [Question] Testing & (Mock) Classes HOT 4
- An in-range update of @nrwl/workspace is breaking the build 🚨 HOT 1
- Error: original.line and original.column are not numbers
- An in-range update of @semantic-release/github is breaking the build 🚨 HOT 1
- How long does it take you to save a recompile boot
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ngx-starter-kit.