How to modify package that is dependency of other packages

Hi forum!

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.

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

I found the solution by not changing the name of my modified version of the package. This way, the local version overwritten the “official” version.