DronaHQ-Cli to create MicroApp
npm install dronahq-cli
#### What is it good for?
The library allows you to:
* Create vanilla project of microapp.
* Package the project in a format which can be uploaded on DronaHQ Admin Console.
* Keep dronahq.js version upto date.
* Test created microapp in DronaHQ simulator.
##### Toolset
* npm 5 is required.
* Node 8 LTS is required.
##### Installing
Switch to dev CLI:
``bash`
$ dhq
Examples
Basic usage
##### Executing CLI
Create a new Project :
1. Run the script with the command
`bash`
$ dhq
2. Select 'create a new Project.' ( It will download the dronahq package which has the vanilla version of the project ).
3. Enter the path where the project needs to be created.
4. Modify as required inside the project.
!image
===========
##### If you already have created project you dont need to follow this step
Package the Project :
1. Run the script with the command
`bash`
$ dhq
2. Select Build a Zip of the Project.
3. It will request for path, enter the path till folder which has index.html present inside.
4. If all the files that are required are present then a zip file will be created by the name of the zippedProject.zip
5. This file then can be uploaded directly into the website.
!image
===========
Check if dronahq.js is upto date (outdated as now this is done during packaging the project):
1. Run the script with the command
`bash`
$ dhq
2. Select 'Check if DronaHQ.js is upto date'.
3. The CLI tool will request for the path where dronahq.js is present (Enter the path till the javascript folder which has dronahq.js).
4. The dronahq.js will be compared with the online dronahq.js and if it is a previous version it will ask if you want to update the js if answered with a Y then the dronahq.js will get updated or the same dronahq.js will be present inside the project.
!image
===========
Setting up user environment for DronaHQ simulator :
1. Run the script with the command
`bash`
$ dhq
2. Select 'Setup user environment for DronaHQ simulator'.
3. Fill the details as requested by the tool.
4. Your environment will be ready.
Run DronaHQ simulator for your micro app:
1. Run the script with the command
`bash`
$ dhq
2. Select 'Run DronaHQ simulator'.
3. It will request for path, enter the path till folder which has index.html present inside.
4. Happy debugging your App.
#### If the simulator does not run execute the following command in command prompt
`bash`
npm install -g electron
Publish package to DronaHQ console:
1. Run the script with the command
`bash`
$ dhq
2. Select 'Upload package to Dronahq console'.
3. Provide the details as requested.
4. Your app is successfully available on DronaHQ.
You can directly upload and publish a package to an existing app you've already created, using command-line options to provide details you'd have to provide through the interactive interface otherwise.
SYNOPSIS
`bash
dhq -a=[APIKEY] -e=[ENVIRONMENT] -u=[UPDATETYPE] -d=[DESCRIPTION] -p=[PATH]
dhq -a=[APIKEY] -e=[ENVIRONMENT] -u=[UPDATETYPE] -d=[DESCRIPTION] -p=[PATH] -o=[OUTPUTFILE]
dhq -f=[INPUTFILE] -o=[OUTPUTFILE]
dhq --apikey=[APIKEY] --environment=[ENVIRONMENT] --updateType=[UPDATETYPE] --description=[DESCRIPTION] --path=[PATH]
dhq --apikey=[APIKEY] --environment=[ENVIRONMENT] --updateType=[UPDATETYPE] --description=[DESCRIPTION] --path=[PATH] --outfile=[OUTPUTFILE]
dhq --file=[INPUTFILE] --outfile=[OUTPUTFILE]
`
EXAMPLE
`bash
dhq -a=xxxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -e=prod -u=patch -d=Description -p=path/to/file
dhq -a=xxxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx -e=prod -u=patch -d=Description -p=path/to/package.zip -o=path/to/output.csv
dhq -f=path/to/inputFile.zip -o=path/to/output.csv
dhq --apikey=xxxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --environment=prod --updateType=patch -d=Description -p=path/to/file
dhq --apikey=xxxxxxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx --environment=prod --updateType=patch --description==Description --path=path/to/package.zip --outfile=path/to/output.csv
dhq --file==path/to/inputFile.zip --outfile=path/to/output.csv
`
OPTIONS
`bash`
-a, --apikey
* -> [Required] The active license key for your created app.
`bash`
-e, --environment
* -> [Required] The app environment for your app's new version.
__Options__: dev, beta, prod
`bash`
-u, --updateType
* -> The update type of your new version as per semantic versioning syntax.
__Options__: major, minor, patch (_default: patch_)
`bash`
-d, --description
* -> [Required] The release notes for your app's new version.
`bash`
-p, --path
* -> [Required] The path for your package's zip file for your app's new version.
`bash`
-o, --outfile
* -> The path for an output file for publish statuses. The output will be provided in CSV format. If the file doesn't exist, one will be created with a CSV string in the first line to signify headers.
`bash`
-f, --file
* -> The path for a JSON file containing values for the above arguments - use the full names of the above arguments as keys and string values. Keys provided here do not need to be provided again as separate CLI arguments. Sample JSON input:-
`json``
{
"apikey": "
"environment": "
"updateType": "
"description": "
"path": "
"outfile": "
}
##### Dependencies
adm-zip, chalk,clui, co, co-prompt, commander, compare-versions, electron, figlet, folder-zip-sync, github, inquirer, lodash, minimist, node-storage, preferences, q, rimraf, simple-git, superagent,sync-request, touch, unzip, validator, zip-folder.