Skip to content

Commit

Permalink
Add install.js to README.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
kruplm committed Mar 31, 2023
1 parent c399ce7 commit 9ce2939
Showing 1 changed file with 49 additions and 1 deletion.
50 changes: 49 additions & 1 deletion src/shell/js/composeui-node-launcher/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,61 @@ The CLI enables you to execute your app with compose by executing the following
```
composeui myapp.js
```
### Install.js

This script is downloading and extracting the necessary binaries from CDN during `npm install`.
By default it's downloading the binaries from the github taged releases but the following variables can be overriden by setting an environment variable or including an .npmrc file:

CDN URL: `COMPOSEUI_CDN_URL` (or `npm_config_composeui_cdn_url`)

```
COMPOSEUI_CDN_URL='http://127.0.0.1:8080'
```

version: `COMPOSEUI_VERSION` (or `npm_config_composeui_version`)

```
COMPOSEUI_VERSION='0.1.0'
```

skip download: `COMPOSEUI_SKIP_DOWNLOAD` (or `npm_config_composeui_skip_download`)

```
COMPOSEUI_SKIP_DOWNLOAD='true'
```

location of the binary: `COMPOSEUI_BINARY_FILE_PATH` (or `npm_config_composeui_binary_file_path`)

```
COMPOSEUI_BINARY_FILE_PATH='path\to\binary\ComposeUI-Shell.exe'
```

### Local Development

#### Developing the CLI

If you're developing the CLI itself you need to execute the following command

```
npm link
```

in the `.\Tryouts\Prototypes\Shell\Node-launcher\Lib` folder
in the `.\Tryouts\Prototypes\Shell\Node-launcher\Lib` folder

#### Developing the install.js script

If you're developing the install.js script and would like to test if the binaries downloading and extracting as expected you can serve a folder with a name of the version containing a zip with the binaries locally (e.g with http-server), and set that link for the `COMPOSEUI_CDN_URL` environment variable.

For example:

```
COMPOSEUI_CDN_URL='http://127.0.0.1:8080'
```

#### Working with the locally compiled shell binary:

To achieve this you can set the `COMPOSEUI_BINARY_FILE_PATH` variable to point to the exe compiled by Visual Studio:

```
COMPOSEUI_BINARY_FILE_PATH='path\to\your\project\folder\ComposeUI\src\shell\dotnet\Shell\bin\Debug\net6.0-windows\ComposeUI-Shell.exe'
```

0 comments on commit 9ce2939

Please sign in to comment.