Code Refactor (Nov 2013)

See Code Refactor - Starting Point (Nov 2013) for a description of the starting point. github

The next steps aim to remove duplication across the server repositories Smallest-Federated-Wiki and wiki, as far as practical, by:

  1. Separating out the remaining client components, and
  2. Separating out the plugins.

Updates

The refactored version is now available as a combination of npm packages (for the wrapper and plugins), and GitHub branches (for wiki-server and wiki-client). The ReadMe for the wrapper project, see wiki-exp GitHub repository , contains links to GitHub repositories containing the code. N.B. At this stage the code for the wiki-server, and wiki-client packages are contained within the paul90/refactor branch on my fork of the wiki and wiki-client repositories.

To install, and run, the refactored version all you need to do is:

npm install -g wiki-exp wiki-exp --data <<path to where content will be saved>>

If the data parameter is not specified, ~/.wiki will be used.

wiki-client

This will contain all the components required by the client (all the contents from the servers existing server directory), with the exception of the plugins.

Both servers will need updating to alter the static route used, from the server's client directory to the wiki-client package.

The servers will retain the page template files, as these also determine which authentication is used (OpenID, or Persona).

Some other changes such as switching to using CDN links for the script libraries used (jquery,...) where they exist, make sense. See CDN Caching and Fallback

plugins

Plug-ins currently exist in separate directories for each plug-in in the server client/plugins directory except for the favicon which does not have a directory.

Each plug-in directory contains the coffeescript source, compile javascript, and any support files required, for the client (and server component, if there is one), at the top level; with a pages directory containing the user documentation pages.

The proposal is to have client, and server if required directories along with the pages with the just the build files at the directory root. See activity and linkmap plug-ins.

Currently /plugins is exposed merely be being in the server client directory. The server will up modifying to add a static route to each plug-in's client directory, as /plugins/{plug-in name}/.

There are currently some 35 plug-ins in the Smallest Federated Wiki, and wiki, repositories. While it might be tempting to simple split them out into a single plugins repository, this is probably only an intermediate step on route to having a repository, and npm package, for each plugin.

Packaging

One of the current issues is that, with the wiki-client being included as a dependency within the wiki server, it is possible to get into a position were to fix a wiki-client bug an update to the wiki package is required.

The proposed solution is to rename the current wiki package to wiki-server. And to create a new wiki repo/package that includes the wiki-server, wiki-client and the wiki-plugins as dependencies.