Bower不下载git子模块(DojoX候选插件) [英] Bower does not download git submodule (DojoX candidate plugin)

查看:116
本文介绍了Bower不下载git子模块(DojoX候选插件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的项目中使用dojo,dijit,dojox,它们与...安装:

  $ bower install dojo dijit dojox 
bower dijit#* cached git://github.com/dojo/dijit.git#1.9.3
bower dijit#* validate 1.9.3 against git://github.com/dojo/dijit .git#*
bower dojo#* cached git://github.com/dojo/dojo.git#1.9.3
bower dojo#* validate 1.9.3 against git://github.com /dojo/dojo.git#*
bower dojox#* cached git://github.com/dojo/dojox.git#1.9.3
bower dojox#* validate 1.9.3 against git:/ /github.com/dojo/dojox.git#*

一切都很好,直到我发现dojox.calendar不见了。这是DojoX的候选插件,并且使用DojoX git存储库(从Github克隆的git)需要git子模块更新--init --recursive 。



我的选项是:




  • 我可以让Bower下载这个git子模块?或者我应该通过
    a正常的git克隆和只是symlink dojox /日历从dojox包中单独下载这个模块?这将是
    意味着我必须保持这个链接每次bower更新dojox
    包,对吗?



更新:我刚刚发现bower install接受git URL作为参数,但是它输出了一个绝对不是我需要的模块的索引 HTML文件。

解决方案

Dojo真的不支持通过Bower安装。当您使用以下命令时:

  bower install dojo dijit dojox 

所有源文件,测试,文档,...都被下载,不仅可以生产就绪的文件。这不是一个真正的巨大问题,但它会留下更大的脚印。






回到你的问题,我不认为现在可以让Bower安装Dojo,因为您确实需要包含可以安装的子模块:

  git clone --recursive git@github.com:dojo / dojox 

您可以报告这个给Bower团队让他们支持 - 递归部分,或者你报告给Dojo团队,以使他们支持Bower(并且只有最小化/生产文件)






现在,最好的事情是不要将Git用于您的Bower资源库。使用Bower,您实际上可以加载外部存档文件,其中包含所需的所有文件。



所以在你的情况下,将是:

  bower install dojo = http://download.dojotoolkit.org/release-1.9.3/dojo-release-1.9.3.tar.gz 

这将为您提供以下目录结构:




  • bower_components

    • dojo

      • dijit

      • dojo

      • dojox








另一个选择是让自己的Dojo在私有Git仓库上构建和托管它。这可能是企业的一个很好的解决方案,因为它允许您为企业中的所有应用程序配置统一的Dojo版本。


I am using dojo, dijit, dojox in my project, they are installed with:

$ bower install dojo dijit dojox
bower dijit#*                   cached git://github.com/dojo/dijit.git#1.9.3
bower dijit#*                 validate 1.9.3 against git://github.com/dojo/dijit.git#*
bower dojo#*                    cached git://github.com/dojo/dojo.git#1.9.3
bower dojo#*                  validate 1.9.3 against git://github.com/dojo/dojo.git#*
bower dojox#*                   cached git://github.com/dojo/dojox.git#1.9.3
bower dojox#*                 validate 1.9.3 against git://github.com/dojo/dojox.git#*

Everything is fine until I discover dojox.calendar is missing. This is a candidate plugin for DojoX and using it from the DojoX git repository (git cloned from Github) requires "git submodule update --init --recursive".

My options are:

  • Can I get Bower to download this git submodule?
  • Or should I download this module separate from the dojox package via a normal git clone and just symlink dojox/calendar to it? This would mean I have to maintain this link every time bower updates the dojox packages, right?

UPDATE: I've just discovered bower install accepts git URLs as parameters, however it outputs a single index HTML file that is most definitely not the module I need.

解决方案

Dojo does not really support to be installed through Bower. When you use the following command:

bower install dojo dijit dojox

All source files, tests, docs, ... are downloaded and not only the production-ready minified files. This is not really a "huge" problem, but it will leave a bigger footprint behind.


Back to your problem, I don't think it's possible at the moment to make Bower install Dojo as you indeed need to include the submodules, which you could install through:

git clone --recursive git@github.com:dojo/dojox

You can report this to the Bower team to make them support the --recursive part or you report this to the Dojo team, to make them support Bower (and only having minified/production files).


Right now, the best thing you could do is not to use Git for your Bower repository. With Bower you could actually load an external archive file as well, containing all files you need.

So in your case it would be:

bower install dojo=http://download.dojotoolkit.org/release-1.9.3/dojo-release-1.9.3.tar.gz

This will provide you the following directory structure:

  • bower_components
    • dojo
      • dijit
      • dojo
      • dojox

Another alternative is to make your own Dojo build and hosting it on a private Git repository. This might be a good solution for enterprises because it allows you to come with a unified Dojo build for all applications at the enterprise.

这篇关于Bower不下载git子模块(DojoX候选插件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆