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.

Creating plugin

Prepare

  1. Make sure you have a decent text editor. I would suggest Visual Studio Code or Atom, but any text editor can be used.
  2. Clone Mixery repo
    git clone https://github.com/nahkd123/Mixery
    cd Mixery
    
  3. Create your new plugin directory in ts/plugins/
  4. Create index.ts inside ts/plugins/YourPlugin (which is the main file for your plugin)
  5. If you're using web browser version, add your plugin name inside assets/plugins.json

About index.ts

index.ts is the main file that contains plugin informations, as well as functions

plugin object

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() function (optional)

onLoad() will be called if the plugin is compatible with current version of Mixery.

export function onLoad(plugin: Plugin) {}

onError() function (optional)

onError() will be called when an error was thrown from the plugin itself.

export function onError(e: Error) {}

References

interface PluginInfo

interface PluginInfo {
    name: string;
    authors: string;
    versionNo?: number; // The first version is 0
}

abstract class Plugin

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);
}
⚠️ **GitHub.com Fallback** ⚠️