lerna-isolate v0.11.2
lerna-isolate
Extract your app or lib as npm package from lerna repository with local/private package dependencies ready to be shipped to your server. Very helpful when using Continuous deployment with lerna and Docker bundling.
What does this do
Let's say you have multiple packages in your monorepo and they depend on some local packages. There is an example of the minimal monorepo. Lerna isolate will put outputs into your lerna root dist directory, so make sure you've got it in .gitignore.
├── lerna.json
├── node_modules
├── package.json
├── package-lock.json
└── packages
├── lib1 (published to npm repo)
├── lib2 (private)
└── appAlso, let's say that app depends on lib1 and lib2.
Problems
- You can't deploy the app before lib1 is published to registry
- You can't deploy the app without lib2, which is a private package
Solution
Bundle it together.
lerna-isolate bundle appThe isolation script will bundle only packages that are not available in the configured npm registry. It also changes package.json and package-lock.json inside the package.
The output will be npm packed package compressed as tgz.
Installation
Either install this globally
npm -g install lerna-isolateOr just use npx
npx lerna-isolateUsage
Leverage the CLI text help for your convenience.
List available packages
List packages that can be bundled
lerna-isolate listBundle one package
Bundle one package. A package name or a path can be given.
lerna-isolate bundle appBundle multiple packages
Bundle multiple packages. A package name or a path can be given.
lerna-isolate bundle app1 app2Bundle all packages
Bundle all packages.
lerna-isolate bundleProduce extracted outputs
This is useful when you want to examine contents of the isolated build.
lerna-isolate bundle -eProduce zip
Sometimes, it is more useful to produce zip file instead of npm package. One example could be that you're uploading Google Cloud Platform Function archive. Private dependencies are still bundled in.
lerna-isolate bundle -eClean build artifacts
To clean all built artifacts, simply rin
lerna-isolate clean2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
3 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago