![]() (and others), any guidance / opinion on this would be really appreciate. Given the amont of work on this, I will look deeper in Nx and see if this could lead to some PRs. ![]() As we use a specific node script to build and publish this specific libs, we also test that every dependency and peerDependency in this package.json files is coherent with the ones in the root package.json file before the build, and throw an exception if not. With all this stuff in mind, I ran into a much more simple solution : as we only use libs/*/package.json to manage the ng-packagr build process, and as we want coherent dependencies versions in our monorepo, we add dependencies and peerDependencies for our libs in this package.json files, and then add them to the root package.json file, wich is used by the build process (namely Nx and some node scripts). ![]() Using it with Nx is relevant if you also use ng-packagr and have different dependencies between your projects, but there is a big cons to this : Angular don't support having two different versions of angular definitions in the same compilation. On the other side, yarn workspaces is only a solution wich aim to manage different dependencies in a coherent way. I now think using it with Nx doesn't make sense, since Nx provide all the tools we need to have a consistent build system for every workspace. This is why it is logical with lerna to have diferent dependency versions : each project could be used in a entirely different way than the others. When deciding whether to use a monorepo build system, there are several factors to consider, including the size and complexity of the project, the number of interdependent packages, and the. Given such, it will create a node_modules for each workspace. Yarn Workspaces, on the other hand, is a feature of the Yarn package manager that provides a way to manage multiple packages in a single repository. Here is why : lerna is, in my opinion, thinked as a tools to manage different projects in a monorepository, namely with each project having is own build process and dependencies. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |