fedwiki / wiki-server

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

more specific annotation of json #65

Closed WardCunningham closed 10 years ago

WardCunningham commented 10 years ago

We annotate json as we serve it so that the client can adjust rendering. Example: green border for pages served from plugins.

This commit moves the logic for applying the plugin annotation to a point where we know for sure that we are looking for plugin pages.

This fixes one issue mentioned in https://github.com/fedwiki/wiki-plugin-calculator/pull/2

This pull is pending testing. @nrn has promised to help me straighten out my server build when he returns from jsconf tonight.

WardCunningham commented 10 years ago

This commit has been tested and been shown to work as expected. Merge at will.

My problem testing has been resolved by @nrn. Thanks.

I used npm link to connect the wiki-node and wiki-node-server repos. This causes the packageDir to point to the enclosing directory by default. If this directory also had all the plugins checked out then that would work ok. I didn't. The short term solution is to specify the packageDir on the command line.

 node bin/server.js -p 3090 --packageDir node_modules

This was enough to show that the revised server works correctly annotating normal plugins. I also tested the case where -d referred to a plugin repo (which I had checked out in ./test)

 node bin/server.js -p 3090 --packageDir node_modules -d ../test/wiki-plugin-calculator/

I've asked @nrn to explain how npm link interferes with the packageDir parameter and perhaps suggest a modification. If I misunderstand its purpose please let me know.

nrn commented 10 years ago

Found it easier to submit a pr for what I was thinking than try to explain it, think it's a little cleaner this way and the issue is fixed.