Building plugin apps
Building plugin apps
You can build a plugin app by using the following steps as a model. Alternatively, you can follow the Sample Angular App tutorial.
The basic requirement for a plugin app is that static web content must be in a /web directory, and server and other backend files must be in a /lib directory. You can place other plugin source code anywhere.
Before you can build a plugin app you must install all prerequisites.
Building web content#
On the computer where the virtual desktop is installed, use the the following command to specify a value for the
MVD_DESKTOP_DIRenvironment variable:export MVD_DESKTOP_DIR=/<path>/zowe/zlux-app-manager/virtual-desktopWhere
<path>is the install location of the virtual desktop.Navigate to
/<plugin_dir>/webClient. If there is no/webClientdirectory, proceed to the Building server content section below.Run the
npm installcommand to install any application dependencies. Check for successful return code.Run one of the following commands to build the application code:
- Run the
npm run buildcommand to generate static content in the/webdirectory. (You can ignore warnings as long as the build is successful.) - Run the
npm run startcommand to compile in real-time. Until you stop the script, it compiles code changes as you make them.
- Run the
Building server content#
Navigate to the plugin directory. If there is no
/nodeServerdirectory in the plugin directory, procede to the Building Javascript content (*.js files) section below.Run the
npm installcommand to install any application dependencies. Check for successful return code.Run one of the following commands to build the application code:
- Run the
npm run buildcommand to generate static content in the/libdirectory. - Run the
npm run startcommand to compile in real-time. Until you stop the script, it compiles code changes as you make them.
- Run the
Building Javascript content (*.js files)#
Unlike Typescript, Javascript is an interpreted language and does not need to be built. In most cases, reloading the page should build new code changes. For Iframes or other JS-based apps, close and open the app.
Installing#
Follow the steps described in Installing plugins to add your built plugin to the Zowe desktop.
Packaging#
For more information on how to package your Zowe app, developers can see Plugins definition and structure.