I am using yarn for my project. My project has a dependency which happened to be a subpackage of larger monorepo maintained by lerna. The subpackage was updated but not published yet and I need that unpublished code. Is there any way to install lerna's subpackage via git url?
Thanks.
lerna create is a command to add a new package to be managed in Monorepo. To install an npm package, we can use the yarn workspace command in the root directory or the yarn add package-name command in the package directory where you'd like to install the package. Yarn updates package. json for the package and yarn.
Lerna is a popular and widely used tool written in JavaScript for setting and managing multi-package repositories for Node. js projects with npm and Git.
2 We have a private git monorepo which hosts a number of Python packages. Poetry was the dependency management tool initially chosen for the project. Anyway, due to this Poetry issue, it would not be accepted solution that involves creating new setup.pyfiles.
By default, lerna points its packages to the packages folder. We’ll not be using the default lerna’ packages/ folder since Angular uses the projects directory for applications and libraries, therefore, we need to tell lerna about that. Open the lerna.json file and update it as follows:
Monorepos can be challenging to manage because sequential builds and publishing individual packages take a long time. Lerna provides features such as package bootstrapping, parallelized builds, and artifactory publication, which can aid you when managing monorepos.
If your questions is "How do I install a sub-package via git?" then that would be a duplicate of this question, which it sounds like you kind of can do, but it does not look fun. But npm on its own does not support installs of git subdirectories.
A better solution would be either to do a release of the package with a npm beta
tag and target it directly in your package.json. Or to set up the lerna project locally and run npm link
to use it directly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With