@domoinc/ryuu-angular
v3.0.0
Published
Angular Schematic to add @domoinc/ryuu-proxy support
Downloads
73
Readme
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 installed in order to run the ng add
command.
Installation
Create a new project
$ ng new domo-app
$ cd domo-app
Add Ryuu Angular
$ ng add @domoinc/ryuu-angular
This will add the following:
- Domo
manifest.json
andthumbnail.png
to a newdomo
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 topackage.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.
$ 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:
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
schematics --help
Create new project and link the schematic to the project.
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
"prestart": "da_ng apply-manifest start",
"postbuild": "da_ng apply-manifest build",
"postbuild:prod": "da_ng apply-manifest build",