Skip to content

Plugin Development

Danny edited this page Jun 2, 2021 · 1 revision

Plugin Development

A plugin in the context of this framework is a package of modules, this could include controllers, models and more. A plugin must contain a meta section with a set of specified information like author, license, name, config_name and version.

I suggest that if you are going to use plugins, that instead you use them in their non-compiled form alongside TypeScript, instead of compiling them, or offer both, this way it helps with automatic type hinting.

Your plugin should import rewyre, and use the same decorators to define your modules (controllers, models, etc.) and then you should export them in the structure, see the src/interface/plugin.ts for more information of that structure.

Your plugin can have custom configuration by a user given to the normal options that are given to the framework as a parameter.

You can see a really simple example inside of:

test/plugin/some-plugin

And you can see how it's registered inside of:

test/application.ts

Useful Links:

Clone this wiki locally