Aside from the SDK, Reekoh also provides a project scaffolding generator tool to quickly bootstrap new plugin projects using Yeoman. This tool automatically creates the files and folders which are typically needed to create certain types of plugins using the Node.js Plugin SDK.
Installation
In your terminal or command line, execute the following command/s:
npm install yo generator-reekoh-node -g
How to Use
1. In your terminal or command line, execute the following command/s:
cd /path/to/your/project-folder
yo reekoh-node
2. You will then be asked which type or category of plugin you would like to create. The options are the following:
The plugin categories and their specific use-cases are discussed on other sections of the documentation. For more information, you may either click the links on the categories above or search them in the Help Center.
Note: You can also run yo reekoh-node:<seed-name> to bypass the selection process e.g., yo reekoh-node:inventory-sync.
3. Once you choose one from the options, a project with all the necessary files, folders, and dependencies are created for you similar to the screenshot below:
Files & Folders
- assets
- The assets folder is where you can put the icon for your plugin. Plugin icons are 300px x 300px in size/dimension. Other files, images which the plugin needs to use can also be put in this folder.
- release-notes
- The release-notes folder is where you can put your change log for each version/iteration of the plugin.
- Release notes should be written in markdown syntax.
- test
- The test folder is where you should put all your unit tests. All plugins should have unit test/s. This will be used when the plugin is submitted for approval.
- The seed project already has mocha, should and gulp as dependencies for writing and running unit tests. Use
gulp test
to run all tests under the test folder.
- app.js
- This is the main script file which acts as entry point for executing the plugin. Most of plugin's code goes in here.
- app.yml
- This is a pm2 descriptor file. It tells how the container should be executed. Should be left as is most of the time.
- Dockerfile
- This is the descriptor file for building the Docker Image of the plugin after it is submitted for approval.
- gulpfile
- This is the file for describing gulp automation tasks.
- README.md
- This is where the documentation for the plugin should be written.
- The documentation should detail what the plugin is for and what it does and how it used by the end user.
- Documentation should be written in markdown syntax.
- reekoh.yml
- This file is the plugin package descriptor file. It holds all the details of the plugin and its configuration parameters. For more information on how to package and submit plugins, please refer to the Packaging and Submission section.
Back to Top | < Previous | Next > |
Comments
0 comments
Please sign in to leave a comment.