# fe-toolbelt
KASKO Frontend developer scripts

# Installation

To install toolbelt globally, run:

```
yarn global add @kasko/fe-toolbelt
```

Now the `kasko-fe` command is available globally.

# Running scripts
When package not installed globaly run

```
yarn start <command>
```

Otherwise run `kasko-fe` or alias `kk`

```
kasko-fe <command> [options]
```

### `help`
To get help about usage of toolbelt run

```
kasko-fe help
```

To get detailed info about how some commands run

```
kasko-fe help <command>
```

# All CLI Options

```
  Usage
    $ kasko-fe <command> [options]

  General Options
    -v, --version           Displays current version

  Available Commands
    help                    List all commands and options

    deploy [options]        Deploy a plugin/app to the KASKO platform
      --plugin              Define the name of the plugin that should be deployed (default: all plugins)
      --host                Define deployment target - host environment (default: "eu1.kaskocloud.com")
      --version             Define the version that should be published
      --fail-on-existing-version
                            Should program fail and exit when plugin version already exists (default: false)

    translations [options]  Lists missing translation keys
      --host                Define host of environment to get keys from (default: "feapi.kasko.io")
      --tp                  Define touchpoint id to get translations from (required)
      --key                 Define public key for the touchpoint distributor (required)
      --language            Language of content keys (default: "de")
      --silent              Disables console output (default: false)
      --batch               Size of request batches (default: 4)
      --delay               Time in ms for delay between batched requests (default: 1000)
      --output              Output of console (options: "verbose" \| "json", default: "verbose")

    graph [url] [options]   Generates webapp flow graph
      --fontSize            Font size in px (default: "12px")
      --format              Format of generated file (options: "png" \| "pdf" \| "svg", default: "png")
      --silent              Disables console output (default: false)
      --output              Output of console (options: "verbose" \| "json", default: "verbose")
      --file                Output a file in current directory (options: boolean, default: false)

    mock-api download [options]
      --host                Define target host environment (default: "eu1.kaskocloud.com")

  For more info, run `help` command with name of the command as second argument
    $ kasko-fe help something
```

# Development
To add new command you must create new `/<command>/<command>.js` file in `/src/commands` and import in in `/src/commands/index.js` root file with command name you want to link it.

To add docs for newly created command, create `readme.md` new file in commands folder.

Finally add info about new command in `/src/help/readme.md` file.

### Installation of dependencies

```
yarn install
```

### Running tests

```
yarn test
```

or with watch mode

```
yarn test:watch
```
