Add version information to the lookup request?

已查看 36 次
跳至第一个未读帖子

Tin Tvrtković

未读,
2014年6月5日 16:45:102014/6/5
收件人 twitte...@googlegroups.com
Hello,

I'm the author of https://github.com/Tinche/bower-cache (amongst other things). At my workplace we've been using this caching proxy to automatically cache our third-party Bower packages, and that's all well and good, but now we're thinking of integrating Bower a little more deeply into our JS build process.

We'd like to produce Bower packages. Now, the thing is, we already have release procedures and an artifact repository (Nexus) that we use for our Java artifacts and RPMs, and I'm trying to leverage our existing infrastructure as much as possible. So instead of using separate git repositories for our Bower stuff, we thought we'd make use of the fact Bower can work with zips, so using the aforementioned caching proxy/registry, we'd just make Bower fetch the zips directly off of our Nexus. Now here's the snag...

As far as I can tell, Bower works in two phases - first it looks up the package, then it resolves it based on what gets looked up. Looking at bower-registry-client, the problem is the lookup request has no version information - it just has the package name. This is fine if a git repo with tags gets resolved, but I don't see how this would work with separate zips. Ideally, the lookup request would have the version info too (I'm guessing through a query parameter so it doesn't break backwards compatibility, but the URL would be better), which a smart registry could use to generate the proper zip URL. (Git repos can always return the same git URL.) This version information is useful in other contexts too; for example, I could modify the caching proxy to check if an already cached git repo actually has the required version and trigger a git pull if it doesn't. Lookups without version info should behave just like they do today.

What say you, Bower folks?

Ray Shan

未读,
2014年7月18日 13:40:392014/7/18
收件人 twitte...@googlegroups.com
Hi Tin, we're getting ready to rewrite the registry. Right now the data in registry is pretty limited. I think we can return a lot more info. Version number and associated binaries make sense. The planning is here if you'd like to add your use cases: https://github.com/bower/registry/issues/73.

Ray
回复全部
回复作者
转发
0 个新帖子