Skip to content

Commit

Permalink
docs(serve-command): complete the descriptions of options in the serv…
Browse files Browse the repository at this point in the history
…e command
  • Loading branch information
LiKang6688 committed Jan 6, 2023
1 parent bb7f5b7 commit 6785ff2
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 28 deletions.
63 changes: 37 additions & 26 deletions commands/serve/README.md
Expand Up @@ -18,28 +18,35 @@ nebula serve -h
Start a development server

Options:
--version Show version number [boolean]
--config, -c Path to a JavaScript config file
--version Show version number [boolean]
-c, --config Path to JSON config file
[string] [default: "nebula.config.js"]
--entry File entrypoint [string]
--type Generic object type [string]
--keyboardNavigation [boolean] [default: false]
--build [boolean] [default: true]
--host [string] [default: "localhost"]
--port [number]
--disableHostCheck [boolean] [default: false]
--resources Path to a folder that will be served as static files under
/resources [string]
--scripts Array of scripts to inject [array]
--stylesheets Array of stylesheets to inject [array]
--enigma.host [string] [default: "localhost"]
--enigma.port [number] [default: 9076]
--clientId Your tenant's clientId for OAuth connection [string]
--webIntegrationId Your tenant's webIntegrationId for connection [string]
--fixturePath Path to a folder that will be used as basis when locating
fixtures [string] [default: "test/component"]
--mfe Serves bundle to use in micro frontend [boolean]
-h, --help Show help [boolean]
--entry File entrypoint [string]
--type Generic object type [string]
--build Build the nebula visualization into /dist dictionary
[boolean] [default: true]
--host Specify a host to use[string] [default: "localhost"]
--port Specify a port number to listen for requests on
[number]
--disableHostCheck Bypasses host checking [boolean] [default: false]
--keyboardNavigation Whether or not Nebula handles keyboard navigation
[boolean] [default: false]
--resources Path to a folder that will be served as static files
under /resources [string]
--scripts Array of scripts to inject [array]
--stylesheets Array of stylesheets to inject [array]
--enigma.host Set host to communicate with Qlik Associative Engine
[string] [default: "localhost"]
--enigma.port Set port to communicate with Qlik Associative Engine
[number] [default: 9076]
--clientId Tenant's clientId for OAuth connection [string]
--webIntegrationId Tenant's webIntegrationId for connection [string]
--fixturePath Path to a folder that will be used as basis when
locating fixtures
[string] [default: "test/component"]
--mfe Serves bundle to use in micro frontend
[boolean] [default: false]
-h, --help Show help [boolean]
```

#### Example
Expand Down Expand Up @@ -93,14 +100,14 @@ serve({

### Micro Frontend (MFE) Mode

The MFE mode, activated with the `--mfe` option, builds a visualisation which is
used in a micro frontend environemnt. The visualisation is served at:
The MFE mode activated with the `--mfe` option, builds a visualisation which is
used in a micro frontend environment. The visualisation is served at:

```
https://<host>:<port>/pkg/<module name>
```

The module name is by default the name in `package.json` but may be overriden using the
The module name is by default the name in `package.json` but may be overridden using the
`--type` option.

The MFE mode runs in HTTPS which requires certificates to be installed in the
Expand All @@ -110,7 +117,7 @@ The regular dev environment in nebula serve is disabled when running in this mod

#### How to install trusted certificates locally

There are a few ways to install local trusted certificates on your machine, The important
There are a few ways to install locally trusted certificates on your machine, The important
end result is that there are two files `~/.certs/cert.pem` (the certificate) and
`~/.certs/key.pem` (the public key). Read about how certificates work
[here](http://www.steves-internet-guide.com/ssl-certificates-explained/). If you already
Expand All @@ -124,7 +131,7 @@ Install mkcert - [documentation](https://github.com/FiloSottile/mkcert)
brew install mkcert
```

Make sure the active directory is user folder and run the following:
Make sure the active directory is the user folder and run the following:

```sh
$ mkdir ~/.certs
Expand All @@ -136,3 +143,7 @@ $ mkcert -key-file ~/.certs/key.pem -cert-file ~/.certs/cert.pem localhost 127.0
```

Verify that two new files have appeared in the certs/ - folder

### More info

webpack and webpack-dev-server are used behind the web development server for nebula.js visualizations. You can find more info from [webpack configuration](https://webpack.js.org/configuration/) and [webpack-dev-server configuration](https://webpack.js.org/configuration/dev-server/#devserverport).
11 changes: 9 additions & 2 deletions commands/serve/lib/init-config.js
Expand Up @@ -22,21 +22,26 @@ const options = {
},
build: {
type: 'boolean',
description: 'Build the nebula visualization into /dist dictionary',
default: true,
},
host: {
type: 'string',
description: 'Specify a host to use',
default: 'localhost',
},
port: {
type: 'number',
description: 'Specify a port number to listen for requests on',
},
disableHostCheck: {
type: 'boolean',
description: 'Bypasses host checking',
default: false,
},
keyboardNavigation: {
type: 'boolean',
description: 'Whether or not Nebula handles keyboard navigation',
default: false,
},
resources: {
Expand All @@ -53,10 +58,12 @@ const options = {
},
'enigma.host': {
type: 'string',
description: 'Set host to communicate with Qlik QIX Engine',
default: 'localhost',
},
'enigma.port': {
type: 'number',
description: 'Set port to communicate with Qlik QIX Engine',
default: 9076,
},
clientId: {
Expand All @@ -69,13 +76,13 @@ const options = {
},
fixturePath: {
type: 'string',
default: 'test/component',
description: 'Path to a folder that will be used as basis when locating fixtures',
default: 'test/component',
},
mfe: {
type: 'boolean',
description: 'Serves bundle to use in micro frontend',
default: false,
describe: 'Serves bundle to use in micro frontend',
},
};

Expand Down

0 comments on commit 6785ff2

Please sign in to comment.