twitter/bower — pull request #132 by ahamid (2012-11-12 21:18:52+00:00)
Title: support filesystem-based repos

This is a spike of support for local filesystem-based repos. This makes bower useful for internal modularization of private projects. For example:

```
.bowerrc

{
"directory" : "components",
"json" : "component.json",
"endpoint" : "../shared/"
}
```

This will allow direct install of components that exist locally on the filesystem:

``bower install private-shared-component``

*Isn't this just a file copy task?*

Sure, but bower already provides an existing minimal component structure and development process. In the future you may want to publish the private components and keep the same development workflow. This saves hand rolling even more grunt config/js.

*Caveats with this impl*

This spike is not particularly elegant. It is just checking whether the composed url is a file system path (twice). What is really called for is a decoupling of metadata lookup from url resolution: after the package metadata is looked up, it should be reparsed (the work in ``Package`` constructor) and re-resolved (the work of ``Package.resolve``). The resolve should then be able to determine the correct course of action (i.e. git clone, copy, asset download, etc.). The way bower current implements it, it is just assumed any looked-up metadata will resolve to a git url.

I have not performed a more extensive refactoring in order to get feedback on this first.