Bower seems to deviate from the semver spec in that I sometimes see dependencies that look like this (from 2klic-angular / bower.json ):
"dependencies": { "angulargrid": "s-yadav/angulargrid#^0.4.0" }
This question gives a long way to explain the seven itself, but not so much what happens to the s-yadav / angulargrid # part .
Looking at bower / lib / node_modules / bower-endpoint-parser / index.js
I see the following code:
function decompose(endpoint) { // Note that we allow spaces in targets and sources but they are trimmed var regExp = /^(?:([\w\-]|(?:[\w\.\-]+[\w\-])?)=)?([^\|#]+)(?:#(.*))?$/; var matches = endpoint.match(regExp); var target; var error; if (!matches) { error = new Error('Invalid endpoint: ' + endpoint); error.code = 'EINVEND'; throw error; } target = trim(matches[3]); return { name: trim(matches[1]), source: trim(matches[2]), target: isWildcard(target) ? '*' : target }; }
Thus, it seems that the source of the repository can be specified as part of the dependency version, using # as the delimiter.
However, I could not find anything that describes this in the bower docs.
Are there any other caveats that you need to know with interpretation of Bowers testes or is this the only one, and is it enough to split the string by # to find the expression of the requirement?
source share