ProjectImplicit/PIPlayer — pull request #20 by danfunk (2014-07-09 03:07:30+00:00)
Title: Add bower support, for easy integration

http://bower.io/ is a popular (very nearly ubiquitous) method of managing javascript dependencies. I've tried a number of methods over the last few weeks, but they are either limited in the number of libraries they support, or add many additional demands on the structure of the projects concerned.

This pull request looks pretty benign, and it is. But actually making it work, takes a few more steps. I have already created a bower repository for the PIPlayer. You can test it out by executing `bower install PIPlayer` on any machine with Bower correctly installed and configured.

To make this work on the ProjectImplicit/PIPlayer Git hub repository, we will need to:

1) de-register the PIPlayer I created on this fork (it's a simple bower command line, I'll need to run from my fork)
2) re-register the PIPlayer from the github (full command shown below)
`bower register PIPlayer git@github.com:ProjectImplicit/PIPlayer.git`
3) Create a new tag of the PIPlayer (say 0.1.4) that INCLUDES the dist diretory. --- Going forward, each tag would need to include a dist directory fully built. This seems a common practice on Github, at least it's the method used by JQuery.

There is one more snag. Currently, when I pull in PIPlayer, I have manually edit js/config.js. The baseURL must be changed from "js" to "PIPlayer/dist/js" I'd love to find a way to correct for this. Otherwise, this whole setup is working flawlessly for me on the PIServer I've developed.

Down the line we should consider cleaning up the dependency managment of PIPlayer so that it uses bower for all the javascript dependencies, and npm for it's server side dependencies. There is a good article on this here: stackoverflow.com/questions/21198977/difference-between-grunt-npm-and-bower-package-json-vs-bower-json That suggests that node dependencies are placed in package.json, and other dependencies (jquery etc... should be in the bower.json file). I think this would make having a dependecy on the PIPlayer work more smoothly, but I can't prove that right at the moment.