-
Notifications
You must be signed in to change notification settings - Fork 53
Plugin dependencies #37
Comments
nvm. |
I'm not sure there are really many plugins that need dependencies. Mine do of course, but they automatically check for the dependency and let you know if it exists. To have a dependency system, really the best way would cause some restructures of how plugins work in ED. Ideally there would be a separate config files that states plugin info including dependencies that way dependencies can be checked and ensured even before the plugin itself is required that way it can ensure no errors occur and that plugins can require their dependency at any time (as opposed to during That being said, either way of moving forwards would require rewriting the current plugin loader. So it would really be up to you guys and Joe how you would want to move forward (if at all). @jakuski an event like that would be simple enough. But realistically for most dependency cases shouldn't be needed. For instance if I had a plugin that wanted to use |
@rauenzi I was thinking more of something like this
However due to the way plugins are required/loaded, So instead of If it is there, then it could register a chatcommand to show guild emojis. Example: module.exports = new Plugin({
load () {
ED.onPluginsLoaded(() => {
// do something
})
}
}) or maybe module.exports = new Plugin({
load () {}
onPluginsLoaded () {
// do something
})
}) |
well in const myPlugin = new Plugin({});
myPlugin.commands = [];
module.exports = myPlugin; and in another plugin called module.exports = new Plugin({
load () {
const commands = require("ChatCommands").commands;
commands.push("my new command");
}
}); that should work fine since it all refers to the same object. |
Only issue I see with this is user's renaming the file (which is what the |
You can never fully eliminate pebkac errors, that can happen even with a dependency scheme. |
I can sort of see a use for this, but have no idea how to implement it at this time. Hence the 'status:delayed'. |
I could help with implementing this, but like I said above it depends on the structuring you want to go with. |
As more and more util and helper plugins are released, the next logical step would be to add a form of dependency system where you could declare other plugins that your plugin rely on.
I'd imagine it might need to modify how plugins are loaded, as the load order will be important (we skyrim now boys)
The text was updated successfully, but these errors were encountered: