Bower sembra deviare dalla semver spec in quanto a volte vedo le dipendenze che assomigliano a questo (da 2klic-angolare/bower.json):di analisi Bower
"dependencies": {
"angulargrid": "s-yadav/angulargrid#^0.4.0"
}
This question va un lungo cammino verso la spiegazione del semere stesso ma non tanto su cosa sta succedendo con la porzione s-yadav/angulargrid #.
Guardando pergolato/lib/node_modules/pergolato-endpoint-parser/index.js
vedo il seguente codice:
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
};
}
Così sembra che una fonte repository può essere specificata come parte della versione di dipendenza utilizzando # come delimitatore.
Tuttavia non sono riuscito a trovare nulla che descriva questo nei documenti del bower.
Sono presenti altri avvertimenti con l'interpretazione di Bowers del semere o è l'unico, ed è sufficiente dividere la stringa in # per trovare l'espressione del requisito?
Buona spiegazione, grazie – andrew