Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/just-paja/lerna-isolate
Extract your app from lerna repository with local package dependencies
https://github.com/just-paja/lerna-isolate
Last synced: 13 days ago
JSON representation
Extract your app from lerna repository with local package dependencies
- Host: GitHub
- URL: https://github.com/just-paja/lerna-isolate
- Owner: just-paja
- License: mit
- Created: 2020-04-13T16:05:49.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-01-06T03:21:56.000Z (almost 2 years ago)
- Last Synced: 2024-10-23T10:38:15.472Z (24 days ago)
- Language: JavaScript
- Size: 989 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 15
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# 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)
└── app
```**Also**, let's say that app depends on lib1 and lib2.
### Problems
1. You can't deploy the app before lib1 is published to registry
2. You can't deploy the app without lib2, which is a private package### Solution
Bundle it together.
```shell
lerna-isolate bundle app
```The 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
```shell
npm -g install lerna-isolate
```Or just use npx
```shell
npx lerna-isolate
```## Usage
Leverage the CLI text help for your convenience.
### List available packages
List packages that can be bundled
```shell
lerna-isolate list
```### Bundle one package
Bundle one package. A package name or a path can be given.
```shell
lerna-isolate bundle app
```### Bundle multiple packages
Bundle multiple packages. A package name or a path can be given.
```shell
lerna-isolate bundle app1 app2
```### Bundle all packages
Bundle all packages.
```shell
lerna-isolate bundle
```### Produce extracted outputs
This is useful when you want to examine contents of the isolated build.
```shell
lerna-isolate bundle -e
```### Produce 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.
```shell
lerna-isolate bundle -e
```