My idea on this is to benefit from Duniter autostack feature, which loads all the Duniter compliant dependencies listed in the package.json.
Currently this assertion is not completely true, as Duniter filters on the module name and only accepts duniter-* names for such modules. This limitation can be removed, because the very important thing is that the module respects the module API, i.e. exports a duniter property like this:
"use strict"constco=require('co')module.exports={duniter:{cli:[{name:'hello-world',desc:'Says hello from \`duniter\` command.',onDatabaseExecute:(server,conf,program,params)=>co(function*(){console.log('Hello from within Duniter!')})}]}}
Also, as Duniter necessarily comes with Node.js and NPM, it is possible to install on-the-fly any new module we would like to have. It can come from any source, like:
be an NPM module (official form in Node.js ecosystem)
The most interesting possibility is probably the tarball, which can be downloaded on GitHub when making a new tag, or being uploaded on a third-party website with our own means. In this cas we do not rely on Git to get the code nor need to have an NPM account to publish our module.
This third-party module system could be handled by another module, let's call it duniter-plugin which exposes a new command plug allowing to install or remove plugins. This is possible because Node.js and NPM are embedded in Duniter: we can use the tools to make the installation.
For example, let's say I've developed a new plugin like the one above and named hello-from-duniter, stored in a tarball at https://dl.cgeek.fr/files/hello-from-duniter.tar.gz. Then I would like to be able to do:
$ duniter plug https://dl.cgeek.fr/files/hello-from-duniter.tar.gz$ duniter hello-worldHello from within Duniter!
Of course, the duniter-plugin should take care of compatibility issues, for example it would check if a compliant peerDependency to Duniter is found, may do some extra checks (I don't which ones yet).
And to conclude perfectly this module system, the best would be to have the possibility to make the installation through the UI, and why not add new elements to the UI (new windows, charts, etc.).