WritheM / Wallace

https://plug.dj/writhem-radio
Other
4 stars 3 forks source link

Better npm support #52

Open ylt opened 9 years ago

ylt commented 9 years ago

Two issues, can be solved in one go:

  1. npm should manage the project as a whole rather than automating it for each plugin. This allows npm features such as dedupe to work
  2. Wallace should scan for npm modules that list a compatible wallace version as a peer dependency, these can be loaded directly rather than from the directory.

Rather than having a npm postinstall script go through all the plugin folders, it would probably be better to list out the plugins needing dependencies in the package.json. npm should then copy the plugins from the plugin directory into the node_modules.

The old folder loading code can be kept, but plugins loaded this way will not have their npm dependencies installed automatically anymore.

If an identical npm module is found to one that's in a plugin folder, prioritise the npm module unless the bot is in dev mode.