如何修改依赖于其他软件包的软件包-MeteorJS [英] How to modify package that is dependency of other packages - MeteorJS

查看:144
本文介绍了如何修改依赖于其他软件包的软件包-MeteorJS的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我的问题是我试图将两个console.log()添加到项目中已经安装的软件包的js文件中.

So, my problem is that I am trying to add a couple of console.log() to a js file of an already installed package that I have in my project.

我要添加这些行的软件包是aldeed:autoform,因为我发现了函数中的一种错误,并且希望为解决方案做出贡献.

The package that I am trying to add these lines to is aldeed:autoform, since I've discovered kind of a bug in a function and I want to contribute with a solution.

为了修改程序包,我已经完成了以下步骤:

In order to modify a package, I have already done the following steps:

  1. myProject/packages/文件夹中克隆用于自动格式化的github存储库.
  2. 修改了我想要的行.
  3. 更改了Package.describe({})内部的名称值(设置为 aldeed-autoform-modified)
  4. 从我的项目(meteor remove aldeed:autoform)中删除了aldeed:autoform
  5. 添加了修改后的自动成型版本(meteor add aldeed:autoform-modified)
  1. Clone the github repo for autoform inside myProject/packages/ folder.
  2. Modified the lines that I wanted to.
  3. Changed the name value inside Package.describe({}) (set to aldeed-autoform-modified)
  4. Removed aldeed:autoform from my project (meteor remove aldeed:autoform)
  5. Added my modified version of autoform (meteor add aldeed:autoform-modified)

问题在于,由于我还使用了具有aldeed:autoform作为依赖项的其他程序包,因此该程序包会自动安装,然后在我运行项目时,它会产生一个错误,指出模板(与AutoForm有关) )定义了两次,这很有意义,因为autoform软件包和修改后的软件包已定义了此模板,并且都包含在项目中.

The problem is that, since I am also using antoher packages that have aldeed:autoform as a dependency, this package gets automatically installed, and then when I run my project, it trhows an error saying that a template (related to AutoForm) is defined twice, and this makes sense since autoform package and the modified one have this templated defined, and both get included in the project.

我该怎么办?修改对他人有依赖性的程序包的正确方法是什么?

What should I do? What is the proper way to modify a package that is a dependency for others?

推荐答案

如果要修改现有软件包,可以使用其本地版本.

If you want to modify an existing package, you can use a local version of it.

无需修改其名称,如果依赖于另一个软件包,则更改名称将导致从属软件包不使用您的修改版本.

There is no need to modify its name, and if another package depends on it, changing the name will cause the dependent package not to use your modified version.

只需将软件包存储库克隆到项目的/packages目录或环境变量METEOR_PACKAGE_DIRS表示的目录中即可.

Simply clone the package repository into your projects's/packages directory or to the directory denoted by the METEOR_PACKAGE_DIRS environment variable.

您可以在流星指南"中找到更多详细信息.

这篇关于如何修改依赖于其他软件包的软件包-MeteorJS的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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