App Plugins - nahkd123/Mixery GitHub Wiki
This feature is documented, but yet not implemented.
App plugins are basically ES6 modules, with exported functions like onLoad()
, or objects like pluginInfo
and can be loaded by Mixery. These app plugins are totally different than generators and effects plugins.
- Make sure you have a decent text editor. I would suggest Visual Studio Code or Atom, but any text editor can be used.
- Clone Mixery repo
git clone https://github.com/nahkd123/Mixery cd Mixery
- Create your new plugin directory in ts/plugins/
- Create index.ts inside ts/plugins/YourPlugin (which is the main file for your plugin)
- If you're using web browser version, add your plugin name inside assets/plugins.json
index.ts is the main file that contains plugin informations, as well as functions
plugin
object contains basic information about plugin, such as the name, list of authors, targeted version and more. This object is required to load plugin, otherwise it will be marked as invaild. See interface PluginInfo
export let plugin: PluginInfo = {
name: "Name",
authors: ["Author"]
}
onLoad()
will be called if the plugin is compatible with current version of Mixery.
export function onLoad(plugin: Plugin) {}
onError()
will be called when an error was thrown from the plugin itself.
export function onError(e: Error) {}
interface PluginInfo {
name: string;
authors: string;
versionNo?: number; // The first version is 0
}
abstract class Plugin {
readonly name: string;
readonly authors: string[];
readonly enabled: boolean;
readonly components: AppComponent[];
readonly tools: Tool[];
readonly bundles: Bundle[];
settings: SettingsSection;
readonly session: Session;
load();
unload();
registerComponent(comp: AppComponent);
}