chlorinejs / lein-bower

Leiningen plugin for managing Bower dependencies in Clojure projects
66 stars 13 forks source link

repo depencency #12

Closed kurtharriger closed 10 years ago

kurtharriger commented 10 years ago

bower allows you to install from a github repo such as:

bower install https://github.com/reactjs/react-bower.git

I don't know if bower allows specifying a specific commit or anything as unversioned seems like it might be a bad idea, but I was wondering if this is still possible with lein bower anyway?

myguidingstar-zz commented 10 years ago

I'm afraid I don't get it. Can you please give an example of "unversioned" or whatever you are asking about? Btw, I don't know much about bower itself.

radhikalism commented 10 years ago

lein-bower functions by generating a temporary bower.json description of your project, so you should be able to declare anything in lein-bower that bower.json would normally accept.

This from the bower API docs:

bower install <endpoint> [<endpoint> ..] [<options>]

Installs the project dependencies or a specific set of endpoints.

Endpoints can have multiple forms:

  • <package>
  • ...

Where:

  • <package> is a package URL, physical location or registry name
  • ...

And this from the bower.json spec:

dependencies

Type: Object

Dependencies are specified with a simple hash of package name to a semver compatible identifier or URL.

  • Key must be a valid name.
  • Value must be a valid version, a Git URL, or a URL (inc. tarball and zipball).
  • Value can be an owner/package shorthand, i.e. owner/package. By default, the shorthand resolves to GitHub -> https://github.com/owner/package. This may be changed in .bowerrc shorthand_resolver.
  • Local paths may be used as values for local development, but they will be disallowed when registering.

So declaring a dependency with or without a semantic version should work, e.g.:

:bower-dependencies
[[backbone  "1.1.0"]
 [backbone.hal "master"]
 [react-bootstrap-bower "git://github.com/react-bootstrap/react-bootstrap-bower.git"]]

Is this what you wanted?

kurtharriger commented 10 years ago

Yes exactly. I was trying to figure out how to put in a repo instead of a version. For some reason I couldn't find the bower component, but had no problem finding the github repo. I tried to put repo as a name in quotes with no version, but didn't think to make up a name and use the repo as the version.