pluggable-electron
pluggable-electron copied to clipboard
Allow dependencies between plugins
Pluggable Electron makes it possible for plugins to add their own extension points that can be registered to by other plugins. Whilst this is useful, this can become confusing if a plugin requires that other plugin to be present but it is not.
But since Pluggable Electron is based on npm packages, the obvious solution here would be to usilise the dependencies these packages.
There is some issues with this solution though:
- The dependency has to be a valid plugin, not just a valid npm package. This needs to be validated and handled somehow.
- Plugin developers might want to use dependencies to add npm packages used in their package. These dependencies can not be installed by Pluggable Electron since it accesses them from the browser whilst npm is designed for node.js access. Instead, they should be packaged in the build process of the plugin.
To handle this I see 2 possible solutions:
- Use the dependencies in package.json for plugins only. Pluggable Electron will try to install the dependencies along with the plugin and ignore any package that is not a valid plugin, reporting a warning. Developers should then add any of their packaged dependencies as devDependencies.
- Install plugin dependencies from a pluginDependencies entry in package.json and allow developers to use the dependencies and devDependencies entries as normal.