@domoinc/ryuu-angular
Version:
Angular Schematic to add @domoinc/ryuu-proxy support
76 lines (53 loc) • 2.23 kB
Markdown
# Ryuu Angular
### BYOA (Bring Your Own App)
Does `domo init` not give you enough of what you’re used to for starting new projects? If you have a generator or starter kit you’re partial to, you can still use it. All you have to do is update your local development server to handle requests for data from Domo. Here is an example of how you can leverage the ryuu-proxy module to turn any existing Angular application into a Domo App.
## Prerequisites
You'll need the [Angular CLI](http://cli.angular.io) installed in order to run the `ng add` command.
## Installation
### Create a new project
```shell
$ ng new domo-app
$ cd domo-app
```
### Add Ryuu Angular
```shell
$ ng add @domoinc/ryuu-angular
```
This will add the following:
* Domo `manifest.json` and `thumbnail.png` to a new `domo` directory at the root of the project
* `extra-webpack.config.js` at the root of the project that configures a local proxy.
* `domo:upload` helper script to `package.json` to upload to Domo.
## Local development
In order for the proxy to work in local development you need to have uploaded your app at least once.
```shell
$ npm run domo:upload
```
After this you should be able to run `ng serve` like normal and you'll be able to proxy domo requests in your local development.
### Publishing
To publish, simply do:
```bash
npm run build
npm publish
```
### Testing
To test locally, install `@angular-devkit/schematics-cli` globally and use the `schematics` command line tool. That tool acts the same as the `generate` command of the Angular CLI, but also has a debug mode.
Check the documentation with
```bash
schematics --help
```
Create new project and link the schematic to the project.
```bash
ng new test-project
ng add @domoinc/ryuu-angular || npm link @domoinc/ryuu-angular
# To Run the schematic
ng generate @domoinc/ryuu-angular:ng-add
```
### TODO List
- Add da_ng to the public repo in order to be able to apply manifest Overrides
- Add the `domo/manifestOverrides.json` to the Project src folder
- Make sure to add the required scripts to the package.json
```json
"prestart": "da_ng apply-manifest start",
"postbuild": "da_ng apply-manifest build",
"postbuild:prod": "da_ng apply-manifest build",
```