从供应商目录贡献开源包? [英] Contributing to open source bundles from vendor directory?
问题描述
理想情况
通常在Symfony2项目上工作时,我会发现一些我想要更改的依赖项。如果我能找到一种方法来简单地更改它的供应商,然后轻松推送更改作为拉请求,那么我可能会更频繁地(而不是覆盖部分与本地子包)。
问题
我无法更改供应商目录,没有作曲家在下一次更新时失败。如果我提交一个pull请求,那么它可能需要一段时间才能真正使用代码在供应商,这实际上是一个威慑力量贡献我的新功能。
我现在如何做
我通常对bundle做贡献的方式是做一个fork,把fork放在一个准系统symfony标准版
将fork放在 composer.json
中,然后提交一个拉取请求。 我可以想到的唯一解决方案是删除我正在编辑的包的packagist依赖,然后包括我的fork with composer(作为包)from github。这样,我立即得到我的代码,并仍然可以贡献。
这是唯一的解决方案吗?
对于在同一时间在不同项目上工作的任何提示/建议,我们将不胜感激。
[更新:回答无效]
指出在其中一个意见,这个答案是一对夫妇岁,不再正确。
p>这是由作曲家创作者Jordi Boggiano(@ Seldaek)推荐的方法。
今年早些时候在Symfony Live San Francisco的演讲中看到(2分钟):
http://www.youtube.com/watch?list=PLo7mBDsRHu11ChvScWUE7MN1Qo5QVHQEz&fe==player_detailpage&v=P3NwF8RV1lY#t=120s
Ideal Situation
Often while working on a Symfony2 project I will spot something I want to change in one of my dependencies. If I could find a way to simply change it in vendor and then easily push the changes as a pull request then I would probably contribute more often (rather than overriding the part with a local child bundle).
The Problem
I can't change a vendor directory without composer freaking out on the next update. If I submit a pull request then it may take quite some time before I can actually use the code in vendors, which is actually a deterrent from contributing my new functionality.
How I do it now
The way I typically contribute to a bundle is to make a fork, put the fork in a barebones symfony standard-edition app, make the change and then submit a pull request.
Put fork in composer.json
?
The only solution I can think of, is removing the packagist dependency of the bundle I am editing, and then including my fork with composer (as a package) from github. That way I get my code immediately and can still contribute.
Is this the only solution? How do you do it?
Any tips/advice for contributing to a bundle while working on a different project at the same time would be appreciated!
[UPDATE: Answer Not Valid Anymore]
As pointed out in one of the comments, this answer is a couple years old and not correct anymore. See answers below for the correct way to proceed.
[Original answer below]
This is the approach recommended by Jordi Boggiano (@Seldaek), creator of composer. See from his talk at Symfony Live San Francisco earlier this year (at the 2 minutes mark): http://www.youtube.com/watch?list=PLo7mBDsRHu11ChvScWUE7MN1Qo5QVHQEz&feature=player_detailpage&v=P3NwF8RV1lY#t=120s
这篇关于从供应商目录贡献开源包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!