Building Plugins - 1000TurquoisePogs/zlux GitHub Wiki
Plugins can have any build process desired as long as it doesn't conflict with the packaging structure. That is to say, your source code can be anywhere as long as the /web folder contains static web content, and the /lib folder contains server files, etc.
However, many plugins do follow a similar build process, which is described here. NOTE: For the following steps to work, you must have the package manager installed, NPM. To use Zowe properly, you must have the rest of the prerequisites https://github.com/zowe/zlux-app-server#0-install-prerequisites
Building web content (webClient)
- Set the environment variable MVD_DESKTOP_DIR to point to the absolute path of
/zlux-app-manager/virtual-desktopi.e.
export MVD_DESKTOP_DIR=/{your_path}/zowe/zlux-app-manager/virtual-desktop
- Go to the plugin's directory. If the
/webClientfolder exists, go into it. If not, skip the following two steps and move onto the next section. - Run
npm installto install the app dependencies. Ifnpm installis not recognized, it is probably because you do not have npm installed in the terminal you are using. - Run
npm run buildto build the app code, which generates static content within the/webfolder. Check for success (Some warnings may appear. These are usually harmless and are only problematic if the build failed). (optional) 5. Instead of run build, you can runnpm run startto build the app code, except this will compile in real-time, and as long as you do not stop the script, it will compile your app code changes as you write to them.
Building server content (nodeServer)
- Go to the plugin's directory. If the
/nodeServerfolder exists, go into it. If not, skip the following two steps and move onto the next section. - Run
npm installto install dependencies. Check for successful return code. - Run
npm run buildto build, which generates content within the/libfolder. Check for success. (optional) 4. Instead of run build, you can runnpm run startto build the server code, except this will compile in real-time, and as long as you do not stop the script, it will compile your app code changes as you write to them.
Building Javascript content (*.js files)
- Javascript is an interpreted language, unlike Typescript, and thus does not need to be built. For most cases, reloading the page should build new code changes. For Iframes or other JS-based apps, simply closing and opening them in Zowe should have new changes take effect.
Installing
Follow the steps described here to add your built plugin to the Zowe desktop.
Packaging
(Developers) For more information on how to package your Zowe app, see the wiki here.