volojs / volo

Create front end projects from templates, add dependencies, and automate the resulting projects
https://volojs.github.io/
Other
1.41k stars 100 forks source link

URL resolution error when using `volo.url` for github for v0.0.x tags #210

Closed zanona closed 9 years ago

zanona commented 9 years ago

I have the following package.json for my library:

"volo": {
    "url": "https://raw.github.com/codefolding/eugene/{version}/build/eugene.less",
    "dependencies": {
      "lesshat": "madebysource/lesshat/~3.0.2#build/lesshat.less"
    }
}

However when trying to retrieve the latest version of the library, the result is:

Error: Download failed, HTTP code: 404: https://raw.githubusercontent.com/codefolding/eugene/0.0.4/build/eugene.less

Which is true since my tag styles are like: v0.0.1, v0.0.2 and so on… If settings volo.url to https://raw.github.com/codefolding/eugene/v{version}/build/eugene.less instead, would probably make it work but break when trying to add the library using the master branch with volo add codefolding/eugene/master since it would result in vmaster?

The thing that makes me curious is that by using volo add codefolding/eugene/0.0.3 correctly points to the tag v0.0.3 however, that doesn't seem to be the same when volo.url is set.

The only way that I can make it work is by not creating a volo.url in package.json and when requesting the library, do so through volo add codefolding/eugene#build/eugene.less instead.

It would be quite nice if we could declare volo.url just as we do for dependencies (with support for github aliases) like:

"volo": {
    "url": "codefolding/eugene/{version}#build/eugene.less",
    "dependencies": {
      "lesshat": "madebysource/lesshat/~3.0.2#build/lesshat.less"
    }
}