This article introduces "create-plugin", a plug-in development tool designed to make the development of Kintone plug-ins easier.
What is create-plugin?
Create-plugin is a CLI tool that allows users to create templates of Kintone plug-ins through interactive dialogue in the command prompt or terminal.
The tool is published on npm and is available for Windows, macOS, and Linux. Find the source code on GitHub.
* Node.js version 6 or later is needed to use this tool.
An example of global installation of create-plugin using npm:
Entering the following command will create a directory named "dir_name". The name of the directory can be changed to anything by replacing "dir_name" with a different name.
In this article, a template is created with the directory name "Sample_Plugin".
A directory named "Sample_Plugin" will be created. Plug-in template files and directories are included in the src directory of this directory.
*package-lock.json is a file that is generated when installed with npm5 or later.
Details of the templates
The generated templates (src directories) have the following structure. Please see Steps for plug-in development for further information on each file.
Contents of the generated plug-in
The template that was created from create-plugin contains a sample code that allows optional text to be displayed at the top of the record list page.
The displayed text can be changed from the settings page of the plug-in.
Plug-in settings page
Create-plugin also has other useful functions besides creating templates.
Source code check using ESLint
Automatic packaging and upload
Running the following command directly to the plug-in will create a zip file of the plug-in.
If "Use @kintone/plugin-uploader" is chosen when running create-plugin, plugin-uploader will run.
*Plugin-uploader must be run by a user with admin rights for Kintone.
After running the command, the monitoring mode will be activated. Modifying the source code while in monitoring mode will automatically package the plug-in, and upload the changes to the related Kintone subdomain.
*To stop monitoring, cancel the command with "ctrl + c".
Using create-plugin with plugin-uploader creates a very powerful combination of tools that performs plug-in template creation, error checking, packaging, and uploading.
To fully utilize this too, follow this flow:
- Create a plug-in template with create-plugin
- Use the plug-in uploader to upload the plug-in to a Kintone environment
- Use the monitoring mode so that every change made to the plug-in source files will be automatically uploaded and applied to the plug-in within the Kintone subdomain
This allows for speedy and efficient plug-in development.
For questions on how to use the create-plugin tool, post a question in the Kintone Developer Community. For reporting bugs and other issues, post it as a GitHub Issue in the create-plugin repository. Modification, redistribution, and commercial use of the source code is subject to the license agreement.