2

Given that bower support installing items that do not technically exist in the global bower namespace the following problem can arise.

Bower install https://github.com/bitovi/canjs.com/archive/v1.1.6.zip

results in

Components
|- v1.1.6
|--bower.json
|-- (complete installation of all required pieces here).

This can lead to potential confusion and maintenance problems down the road as it is now on the developer to recall that "can.js" lives in v1.1.6. Clearly there are fixes that one can implement (i.e. pointing all items using can.js to this directory) but this doesn't solve the core problem.

bower.json looks like this:

{
  "name": "v1.1.6",
  "main" : "",
  "version": "0.0.0",
  "repository": {
  "type": "asset",
  "url": "https://github.com/bitovi/canjs.com/archive/v1.1.6.zip"
 }
}

Is renaming the directory and updating the bower.json enough or is there another resource that needs to be updated as well?

4

1 回答 1

4

是的,更新 bower.json 就足够了。在下一个 bower 主要版本 (1.0.0) 中,您可以在安装时命名一个包。在你的情况下,你会是这样的:

bower install canjs=git://github.com/bitovi/canjs.com.git#~1.1.6

您可以通过安装来试用此新功能bower-canarynpm install -g -f bower-canary

于 2013-07-21T18:23:15.557 回答