Support Center & Knowledge base

Plugins

Plugins are one of the key building blocks in the Tooling Platform. It provides a system for providing new commands, command groups and namespaces into the tooling system.

Extension

Plugins represents one of the two extension points for the tooling. New plugins can be installed and updated without having to to patch the tools, one can simply just install them directly through the tools. Any person can create a plugin for the dolittle tooling system and make it available to anyone by simply publishing it to npmjs.

Structure

A plugin is just a node application that can provide commands, command groups and namespaces. It derives from and uses the constructs in the Tooling Platform to do this however it wants.

There are two things that makes a plugin. First it must adhere to the package rules. Second, it needs a javascript file called index to be at the root directory of the exported node package, or in a ‘lib’ or ‘dist’ folder. That index.js file must export an object called ‘plugin’, the ‘plugin’ object must implement the IPluginInterface, which is just an object with three providers;

A ICanProvideDefaultCommands provider called ‘defaultCommandsProvider’ that has a method called provide that returns a list of commands.

A ICanProvideDefaultCommandGroups provider called ‘defaultCommandGroupsProvider’ that has a method called provide that returns a list of command group.

A ICanProvideNamespaces provider called ‘namespaceProvider’ that has a method called provide that returns a list of namespaces.

In javascript it could simply be done by having this in the index.js:

let plugin = {
    defaultCommandsProvider: {provide: () => [<commands>]},
    defaultCommandGroupsProvider: {provide: () => [<command groups>]},
    namespaceProvider: {provide: () => [<namespaces]},
}

(See here for example on how write a plugin)

A plugin is a node application. Even though it needs to have an index.js file, it does not have a to written with javascript, you could for instance write it with typescript and then make sure that it transpiles the files to a 'dist' or 'lib' folder.