# spashiptest

> A command line interface for SPAship!

Latest version **1.2.1** (published 2022-01-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install spashiptest
pnpm add spashiptest
yarn add spashiptest
bun add spashiptest
```

Provides the command `spaship`.

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2022-01-20 |
| First published | 2022-01-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.0.0 |
| Dependencies | 21 |
| Unpacked size | 59.4 KB |
| Known vulnerabilities | 0 (+24 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | shrutianand |
| Maintainers | shrutianand |
| Keywords | oclif |

## Links

- npm: https://www.npmjs.com/package/spashiptest
- Repository: https://github.com/shruticode81/spaship
- Homepage: https://github.com/shruticode81/spaship/tree/master/packages/cli#readme
- Issues: https://github.com/spaship/spaship/issues
- npm.io page: https://npm.io/package/spashiptest

## Dependencies (21)

- [ajv](https://npm.io/package/ajv.md) ^8.6.3
- [ora](https://npm.io/package/ora.md) ^5.0.0
- [uuid](https://npm.io/package/uuid.md) ^8.3.2
- [axios](https://npm.io/package/axios.md) ^0.23.0
- [chalk](https://npm.io/package/chalk.md) ^4.1.1
- [nconf](https://npm.io/package/nconf.md) ^0.11.0
- [lodash](https://npm.io/package/lodash.md) ^4.17.15
- [js-yaml](https://npm.io/package/js-yaml.md) ^4.1.0
- [archiver](https://npm.io/package/archiver.md) ^5.0.0
- [inquirer](https://npm.io/package/inquirer.md) ^8.0.0
- [form-data](https://npm.io/package/form-data.md) ^4.0.0
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^7.0.0
- [read-pkg-up](https://npm.io/package/read-pkg-up.md) ^7.0.0
- [pretty-bytes](https://npm.io/package/pretty-bytes.md) ^5.3.0
- [@oclif/config](https://npm.io/package/@oclif/config.md) ^1.13.3
- [inquirer-loop](https://npm.io/package/inquirer-loop.md) ^0.3.0
- [@oclif/command](https://npm.io/package/@oclif/command.md) ^1.8.16
- [@spaship/common](https://npm.io/package/@spaship/common.md) ^0.14.0
- [read-package-json](https://npm.io/package/read-package-json.md) ^4.1.1
- [@oclif/plugin-help](https://npm.io/package/@oclif/plugin-help.md) ^3.3.1
- [jwt-check-expiration](https://npm.io/package/jwt-check-expiration.md) ^1.0.5

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 1.2.1 (latest) — 2022-01-20
- 1.2.0 — 2022-01-19
- 1.1.2 — 2022-01-19
- 1.1.1 — 2022-01-19
- 1.1.0 — 2022-01-10
- 1.0.0 — 2022-01-04

## README

# SPAship CLI

A command line interface for SPAship.

[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)
[![Version](https://img.shields.io/npm/v/@spaship/cli.svg)](https://npmjs.org/package/@spaship/cli)
[![Downloads/week](https://img.shields.io/npm/dw/@spaship/cli.svg)](https://npmjs.org/package/@spaship/cli)
[![License](https://img.shields.io/npm/l/@spaship/cli.svg)](https://github.com/spaship/cli/blob/master/package.json)

<!-- toc -->
* [SPAship CLI](#spaship-cli)
* [Usage](#usage)
* [Commands](#commands)
* [Writing tests](#writing-tests)
<!-- tocstop -->

# Usage

<!-- usage -->
```sh-session
$ npm install -g spashiptest
$ spaship COMMAND
running command...
$ spaship (-v|--version|version)
spashiptest/1.2.1 linux-x64 node-v14.18.3
$ spaship --help [COMMAND]
USAGE
  $ spaship COMMAND
...
```
<!-- usagestop -->

# Commands

<!-- commands -->
* [`spaship help [COMMAND]`](#spaship-help-command)
* [`spaship init`](#spaship-init)
* [`spaship login`](#spaship-login)
* [`spaship pack`](#spaship-pack)
* [`spaship upload [ZIP]`](#spaship-upload-zip)

## `spaship help [COMMAND]`

display help for spaship

```
USAGE
  $ spaship help [COMMAND]

ARGUMENTS
  COMMAND  command to show help for

OPTIONS
  --all  see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.3.1/src/commands/help.ts)_

## `spaship init`

Initialize a SPAship config file for your app.

```
USAGE
  $ spaship init

OPTIONS
  -b, --builddir=builddir  path of your SPAs artifact. Defaults to 'buildDir' if specified in the spaship.yaml.
  -d, --dist=dist          the URL path for dist folder
  -m, --file=file          the URL path for .spaship file

DESCRIPTION
  Without arguments, init will ask you a few questions and generate a .spaship config file.

EXAMPLES
  $ spaship init --file=/home/shranand/Documents/one-platform/packages/home-spa 
  --dist=/home/shranand/Documents/one-platform/packages/home-spa/dist
  $ spaship init --builddir=build
```

_See code: [src/commands/init.js](https://github.com/shruticode81/spaship/blob/v1.2.1/src/commands/init.js)_

## `spaship login`

Authenticate and Authorize users inorder to deploy SPA

```
USAGE
  $ spaship login

OPTIONS
  -s, --server=server  orchestrator-base-url it is responsible for loading file from cli
  -t, --token=token    jwt token for authentication

DESCRIPTION
  user access token && server url is saved inside config file(.spashipsessionrc.yaml) .
  spaship login command can be copied from web-ui.

EXAMPLES
  $ spaship login --token=eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiS 
  --server=http://dev.api.apps.int.spoke.preprod.us-west-2.aws.paas.redhat.com
  Here server refer to api Base-URL && token refer to jwt access token for authorization
```

_See code: [src/commands/login.js](https://github.com/shruticode81/spaship/blob/v1.2.1/src/commands/login.js)_

## `spaship pack`

pack the distribution folder

```
USAGE
  $ spaship pack

DESCRIPTION
  create and save the zip file of distribution folder which is consist of SPA content inside tmp.

EXAMPLE
  $ spaship pack
```

_See code: [src/commands/pack.js](https://github.com/shruticode81/spaship/blob/v1.2.1/src/commands/pack.js)_

## `spaship upload [ZIP]`

deploy to a SPAship host

```
USAGE
  $ spaship upload [ZIP]

ARGUMENTS
  ZIP  An archive (zip) file containing SPA static assets and a .spaship configfile.

DESCRIPTION
  Send zip file containing a SPA to a SPAship host for deployment.

EXAMPLES
  $ spaship upload your-app-1.0.0.zip #here your-app-1.0.0.zip refer to zip created by pack command
  $spaship upload # will prompt to enter your-app-1.0.0.zip
  If no your-app-1.0.0.zip is provided it will zip and upload it.
```

_See code: [src/commands/upload.js](https://github.com/shruticode81/spaship/blob/v1.2.1/src/commands/upload.js)_
<!-- commandsstop -->

<!-- # spashiprc & SPAship environments

_(As a rule of thumb, spaship.yaml files are consumed by the SPAship API, whereas spashiprc files are consumed by the CLI)_

spashiprc files provide an alternative to typing out `--apikey KEY` and `--env URL` every time you run `spaship` commands. You can use a spashiprc file to define an environment name (like `qa`) along with its URL and API key, after which you can run `spaship deploy --env qa`. The URL and API key will be read from your spashiprc file.

**Do not commit API keys to your project's version control**. If you do, _I'll know_. See [spashiprc layering](#spashiprc-layering) for how to avoid committing API keys.

spashiprc files are optional, but very convenient if you plan to do deployments from your dev environment. If your deployments are done by a CI/CD server, you probably don't need a spashiprc file and will be better off using `--env URL` and `--apikey KEY`.

## spashiprc layering

To separate environment URLs from API keys, you can "layer" two spashiprc files together. After the `spaship` command finds a spashiprc file, it continues searching parent directories for other spashiprc files. If any secondary spashiprc files are found, their values are merged together. If there are conflicting values, the values from the child directory (nearer to your project) will win.

This allows you to put a spashiprc file containing your SPAship URLs in your project's source control, and a secondary spashiprc file containing API keys in a parent directory, _not_ in your project's source control.

For an example, see [spashiprc-layering-example](#spashiprc-layering-example).

## spashiprc examples

### spashiprc with default environment

This spashiprc file defines a `default` environment which will be used whenever `--env` is not provided.

**.spashiprc.yml**

```yaml
envs:
  default:
    url: https://localhost:8008
    apikey: 57d5c061-9a02-40fc-a3e4-1eb3c9ae6a12
```

Now when you run `spaship` commands, the `--env` flag is optional. When it's omitted, the default environment will be used.

```sh
spaship deploy MyProject-1.0.0.tgz
```

### spashiprc layering example

**\$HOME/.spashiprc.yml**

```yaml
envs:
  qa:
    apikey: 57d5c061-9a02-40fc-a3e4-1eb3c9ae6a12
  prod:
    apikey: 70f19422-bf53-44b1-b664-f9b4636bea61
```

**\$HOME/projects/MyProject/.spashiprc.yml**

```yaml
envs:
  qa:
    url: https://qa.spaship.io
  prod:
    url: https://spaship.io
```

When you run `spaship` commands from within `$HOME/projects/MyProject`, _both_ of the above spashiprc files will be loaded and merged together, forming a complete definition of URL+API key for each environment.

Such as:

```sh
cd $HOME/projects/MyProject
spaship deploy --env prod MyProject-1.0.0.tgz
``` -->

# Writing tests

Tests are written using oclif's testing tools. See [oclif's testing documentation](https://oclif.io/docs/testing) for more.

---
_Source: https://npm.io/package/spashiptest · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
