Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CryptoJS with Bower, how to manage this dependency?

I need to manage CryptoJS with Bower. This project is hosted on code.google.com. Can be downloaded as zip file or through the SVN.

Can Bower download an uncompress the zip file or download all components from the SVN and put them in the crypto folder?

.bowerrc file, defining the download folder:

{
  "directory": "app/vendor"
}

I've tried this component.json file (fails, downloads the page itself):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
     "crypto": "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/"
  }
}

Another try (hmac.js overriders core.js and it's saved as index.js):

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
    "crypto":
       "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/core.js",
    "crypto":
       "http://crypto-js.googlecode.com/svn/tags/3.1.2/build/components/hmac.js"
    }
}
like image 590
gremo Avatar asked Feb 07 '13 15:02

gremo


1 Answers

Found the way reading Bower official page:

As you can see, packages can be installed by name, Git endpoint, GitHub shorthand, URL or local path. If you install from a URL that points to a zip or tar file, bower will automatically extract its contents.

component.json:

{
  "name": "Backbone Client",
  "version": "1.0.0",
  "dependencies": {
    "crypto-js": "http://crypto-js.googlecode.com/files/CryptoJS%20v3.1.2.zip"
  }
}
like image 54
gremo Avatar answered Sep 19 '22 20:09

gremo