@armor/create-armor-ui
Version:
A CLI tool for generating Armor UI apps.
103 lines (70 loc) • 2.92 kB
Markdown
[![Build Status][build_badge_image]][build_badge_link]
[![@armor/api][npm_badge_image]][npm_badge_link]
[![Managed With][managed_badge_image]][managed_badge_link]
[build_badge_image]:https://jenkins.secure-shared.services:443/buildStatus/icon?job=github.com-armor/create-armor-ui/master
[build_badge_link]:https://jenkins.secure-shared.services/job/github.com-armor/job/create-armor-ui/job/master/
[npm_badge_image]:https://img.shields.io/npm/v/@armor/create-armor-ui.svg
[npm_badge_link]:https://www.npmjs.com/package/@armor/create-armor-ui
[managed_badge_image]:https://img.shields.io/badge/managed%20with-terragrunt-%235849a6.svg
[managed_badge_link]:https://github.com/armor/infrastructure-live/tree/master/github/armor/repositories/api/terraform.tfvars
# Create Armor UI
## Features
- [x] Installs core Armor dependencies
- [x] Connects to API out of the box, login redirect, and an example call to /me
- [x] Generates Example components that illustrate how routing and nav should be set up
- [x] Creates Passing Unit tests for generated components (100% coverage)
- [ ] Passes lint (angular cli generated e2e test do not pass)
- [ ] Runs e2e tests
## Prerequisites
* [NodeJS and NPM](https://github.com/armor/meta/tree/master/setup/node)
* PowerShell (on Windows)
## Install
We need to install Angular CLI & Armor Create UI
`npm i -g @angular/cli @armor/create-armor-ui`
## Create directory
If you have already set up a git repo, just `cd` into that now.
Otherwise create a new dir and cd in.
```bash
mkdir my-app
cd my-app
```
## Generate your new app
You just need to type `create-armor-ui` and supply a name for your app.
`create-armor-ui myApp`
## Run Your App
```bash
# run the app against TDE
npm run dev # prod | cert
```
## Testing / Linting
### Lint (scss & ts)
`npm run lint`
### Unit Tests
`npm run test`
### End-toEnd Tests
#### Credentials
We are running tests on TDE with the ``
1. [Install pass](https://www.passwordstore.org/#download) if you do not already have it.
2. Initialize a new password store
- `pass init <gpg-key-id>`
- `gpg --list-keys` to list gpg-keys
3. save tde/portal/test.dev to pass
- `pass insert tde/portal/test.dev`
#### Running Locally
1. export your password to your environment variables
- $`export tdePass="$(pass tde/portal/test.dev)"`
2. serve up & test the app
- `npm run e2e`
#### Writing tests
When writing tests it may be better to serve up the app with `npm start` and then in another terminal run `npm run e2e:no-serve`. This will save the time it takes to rebuild the app. You still need to export the password to **env** $`export tdePass="$(pass tde/portal/test.dev)"`
#### Error Messages and Solutions
##### Forgot to add tdePass to env
**Error Message**
```
Failed: each key must be a number of string; got undefined
```
**Solution**
Add tdePass to `env`
```
export tdePass="$(pass tde/portal/test.dev)"
```