简体   繁体   English

使用GitHub版本附件注册bower包

[英]Register bower package with GitHub release attachments

As far as I understand Bower you have to provide a pre-build distribution of your package: 据我所知, Bower你必须提供你的包的预构建分发:

Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading, and saving the stuff you're looking for. Bower的工作原理是从各地获取和安装包裹,负责打猎,查找,下载和保存您正在寻找的东西。

But in many projects such pre-build files are not part of the GitHub repository (for very good reasons). 但是在许多项目中,这样的预构建文件不是GitHub存储库的一部分(出于很好的理由)。 Regarding to this post your are able to attach archives to an release/tag of an GitHub repository. 关于这篇文章,您可以将存档附加到GitHub存储库的发布/标记。 So the best way to register such projects as a Bower package seems to be to use these attachments; 因此,将这些项目注册为Bower包的最佳方式似乎是使用这些附件; instead of a separate repository like suggested here . 而不是像这里建议的单独的存储库。 But it seems this is currently not possible. 似乎目前这是不可能的。 Am I right? 我对吗?

Bower currently looks for tarballs associated with git tags on github. Bower目前在github上寻找与git标签相关的tarball。 Logic is here: https://github.com/bower/bower/blob/master/lib/core/resolvers/GitHubResolver.js 逻辑在这里: https//github.com/bower/bower/blob/master/lib/core/resolvers/GitHubResolver.js

@apatrick is correct, currently best practice is to either have a /dist folder or have a separate shim repo like this: https://github.com/angular/bower-angular @apatrick是正确的,目前最好的做法是要么有一个/dist文件夹或者有一个单独的垫片回购像这样: https//github.com/angular/bower-angular

Using github releases isn't such a bad idea in my opinion. 在我看来,使用github发布并不是一个坏主意。 It's been discussed before. 之前已经讨论过了。 Reason for not implementing is here: https://github.com/bower/bower/issues/584#issuecomment-20456122 没有实施的原因在这里: https//github.com/bower/bower/issues/584#issuecomment-20456122

If you feel strongly about it, please ask the contributors to repon the ticket. 如果您对此感到强烈,请让贡献者重新获得此票。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM