fedwiki / wiki-server

Federated Wiki client and server in Node.js
Other
153 stars 35 forks source link

server doesn't understand scoped modules when looking for plugins #107

Closed WardCunningham closed 8 years ago

WardCunningham commented 8 years ago

If I install a scoped plugin with a command like this:

npm install @wardcunningham/wiki-plugin-plugins --save

The plugin will be installed within a subdirectory of the node_modules named @wardcunningham/wiki-plugin-plugins. If this is to be supported, then we will have to extend the search inside the server to look inside scope folders.

We have a related but different problem with accessing the bin file when using scoped copies of wiki-node. Nick has a fix for this.

paul90 commented 8 years ago

Rather than using the directory glob to find plugins, I expect we will move to processing package.json.

paul90 commented 8 years ago

We will also need to do some rudimentary checking to ensure that there are not multiple versions of a component installed. For example, adding @wardcunningham/wiki-plugin-plugins does not automatically remove wiki-plugin-plugins, either in package.json or as an installed package.

So, as well as running npm install @wardcunningham/wiki-plugin-plugins --save you really also need to run npm uninstall wiki-plugin-plugins --save to remove the original version of the plugin.

WardCunningham commented 8 years ago

We would avoid the duplicate plugin problem by suggesting site operators simply edit the package.json file, I think.

The npm command-line install/save is looking less and less attractive.

The server would still need to be aware of scoped names, probably by the mechanism you suggest. This does make package.json a part of the server infrastructure which we never addressed in ruby.

paul90 commented 8 years ago

Closing this - there was some discussion and even a pull request looking at this, see https://github.com/fedwiki/wiki/pull/59