Skip to content
Bradley Matusiak edited this page Sep 13, 2024 · 3 revisions

here is a some todo code

function buildPlugin(pluginName, consumes, plugins) {
    plugin.consumes = consumes;
    if (plugin.consumes.indexOf("rectify") == -1) plugin.consumes.push('rectify')
    plugin.provides = [pluginName];
    async function plugin(imports, register) {
        var { rectify } = imports;

        (function imports_to_rectify() {
            plugin.consumes = [];
            plugin.provides = Object.keys(imports);
            async function plugin(_imports, register) {
                await register(null, imports);
            }
            plugins.push(plugin);
        })();

        var app = rectify.build(plugins);
        var exports = {};
        exports[pluginName] = (await app.start()).services;
        await register(null, exports);
    }
    return plugin;
}

(function() {
  plugin.consumes = [];
  plugin.provides = ["rectify"];
  async function plugin(_i, register) {
    await register(null, { rectify });
  }
  plugins.push(plugin);
})();

above code will pair with more changes, and need to be built in

  • if consuming app , need to make sure the old app is passed to plugin and not a new app object
  • need to include rectify in build like app object
  • new buildPlugin function needs to .... i forgot
Clone this wiki locally