How to modify package that is dependency of other packages - MeteorJS

回眸只為那壹抹淺笑 提交于 2019-12-24 05:52:34

问题


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.

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. 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)

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?


回答1:


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.

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

You can find more details on the Meteor Guide.



来源:https://stackoverflow.com/questions/42178852/how-to-modify-package-that-is-dependency-of-other-packages-meteorjs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!