Dear all,
I have been hacking away on Kanso to get it working cleanly on Windows. I believe it is just about there now. Primarily this has involved moving over to NodeJS based npm libraries rather than relying on command line tools (e.g. rimraf rather than rm -rf, node-tar and node-zlib rather than tar and mkdirp rather than mdkir -p). Going forward the biggest concern is that Windows paths have backslashes and everyone else, including URLs, use forward slashes so we have to be careful that anything that goes in a design document has a correctly mapped path.
The two projects to which I have made changes are kanso itself and kanso-utils. I have forked both projects (
kanso,
kanso-utils) and created windows-compat branches in each. There are pull requests (
kanso,
kanso-utils) back to the kanso repos, where you can make comments if you wish.
Unfortunately, since they rely upon kanso-utils, it is likely that many of the packages will need to be updated to ensure Windows compatibility across the board. Once the kanso-utils pull request is accepted then a new npm module will need to be built and then each package will need to update their version of it and then publish back to the kanso repository.
If you want to try out kanso on windows here is a quick guide to getting it up and running.
These are both Windows Installer utilities which make life easier. CouchDB should install and start up as a service listening to the default port 5984. You can check this by going to the futon.
Clone my kanso repos:
Checkout the window-compat branch:
- cd kanso
git checkout windows-compat
To run kanso you will need to put the kanso/bin folder in your path or refer to it explicitly. (i.e. c:\path\to\my\kanso\bin\kanso.cmd ...). Note that we are using the kanso.cmd file since it tells Windows to run kanso inside NodeJS. I created a kanso.cmd inside the root of my kanso app that for now.
C:\path\to\my\kanso\app\kanso.cmd:
- node "C:\path\to\my\fork\of\kanso\bin\kanso" %*
Create your kanso app as normal (i.e. your kanso.json file and anything else you need) then try running kanso install in the apps folder. This should pull down any kanso packages you have specified as dependencies in the kanso.json.
Now the tricky bit... We need to go into each package (particularly attachments, modules and properties) that uses kanso-utils (you can find it in the node_modules folder of each package), delete the kanso-utils folder and checkout my fork of kanso-utils instead.
Once you have done this go back up to your application folder and try a kanso show, kanso ls or even a kanso push command. Also try the kanso upload, which should work fine too.
I welcome any feedback if you have a chance to take this for a run or even just have a look at the commits.
One thing I don't like is this reliance on kanso-utils everywhere. It seems to me that we should package that up inside the kanso project and then expose it to the packages when they are run rather than expecting them to manage the dependency themselves. Any thoughts?
Cheers
Pete