HIRO SDK CLI
CLI utils for HIRO applications.
This tool is slightly modified version of
create-react-app package.
Prerequisites
During development you must link two packages to deal with local installations.
Ensure that you have the latest develop branch inside these directories.
cd hiro-sdk/packages/hiro-sdk
npm link
cd hiro-sdk-cli/packages/hiro-sdk-cli
npm link
By doing this, you'll emulate registry for linked packages.
Further information can be found at npm-link docs.
Commands
hiro-sdk init
Initializes new HIRO Application.
react-scripts
is used for development server / build scripts.
Usage:
hiro-sdk init appname - initialize blank appname application.
hiro-sdk init appname -l - initialize blank appname application and link local hiro-sdk package.
hiro-sdk init appname -t react - initialize React appname applicaiton.
hiro-sdk init appname -t react -l - initialize React appname applicaiton and link local hiro-sdk package.
hiro-sdk bundle
Bundles production-ready application.
Example usage:
npm run build
hiro-sdk bundle
As result, bundle.zip will be created.
hiro-sdk publish
Publish bundled application (bundle.zip) to the GraphIT server.
You will be needed to specify either host -h and token -t or -e option via command line options.
Note: manifest.yaml must contain reader that specifies a role already defined in WSO2. Users having that role would only be able to access the application within Hiro Desktop.
Example usage:
# Publish using host/token pair
hiro-sdk publish -P -h https://acme.graphit.co -t vm8127v89126cn8712616c12c12
# Publish using .env files
hiro-sdk publish -P -e
Example dotenv files:
$ cat .env.local
REACT_APP_GRAPHIT_HOST=https://acme.graphit.co
REACT_APP_GRAPHIT_TOKEN=vm8127v89126cn8712616c12c12
Those are prefixed with REACT_APP_ because we use it for initial application structure.
We believe in the future versions there will be no need to prefix these variables.
As result, your application will be either created or updated, depending on name field in the manifest.yaml.
NOTE, that you can only update applications uploaded by you.