Create controller
Content Table
Currently all the controllers must be implemented inside of the everdev
package.
To create a new controller:
Clone
git@github.com:tonlabs/everdev.git
.Create and checkout branch for the new controller.
Create a folder under
src/controllers
.Implement the controller code.
Include the new controller in file
src/controllers/index.js
.Create pull request.
What a controller should and what it shouldn't to do
Controller should:
Expose functionality to the user as a list of commands.
Install the required tool components on demand (on first usage).
Start and stop the tool components that acts like a demons.
Define three commands to control the tool version:
version
to show the currently installed tool version;update
to update the tool to the latest available version;use
to select the specified tool version as the current version.
Controller shouldn't:
Implement tool functionality itself. Controller is a connector between the user and the existing development tool.
Implement user interaction itself. All user interaction must be implemented exactly in the terms of everdev extensibility.
How to implement a Controller
Create a folder for a new controller:
Create index.ts
with the controller's definition:
Create installer.ts
to implement all the code related to the tool installation:
Create version.ts
command handler:
Create update.ts
command handler:
Create run.ts
command handler:
Controller API Reference
You can find API reference in form of TSDoc in src/core/index.ts
.
Last updated