Hacktoberfest, Contributing to Mozilla, and more

It’s been a really rough yet exciting month or Hacktoberfest. Throughout the previous couple of weeks I was exposed to many emotions based on my experiences in contributing to various Open Source projects. Stay tuned to learn more!

Anton Biriukov
4 min readNov 5, 2019
Photo by Beth Teutschmann on Unsplash

I would like to start off with continuing my previous story about contributing to Mozilla’s web-ext project. Once I had the project running on my local machine, I decided to try to run web-extcommands in order to see what it is capable off. In order to do that, I had to download source code of some existing extension for Mozilla. Thus, I went to Mozilla’s Add-ons website to check out what is available. It did not actually matter to me what the extension would be, as far as there is a GitHub link provided for it. So, I picked the one I bumped into fairly quickly:

https://addons.mozilla.org/en-CA/firefox/addon/darkreader/

You can find the GitHub link attached here.

I was happy to clone the codebase and go into the folder to test out web-ext. Here is what I got after running web-ext build:

I would not be able to run the command due to a missing messages.json file. It might now look as if it was be clear to me at that point. However, it definitely was not! I tried running the command multiple times, deleted and re-cloned the project again, went through web-ext development environment setup for a number of times…I just kept thinking that was my fault, whereas, in fact, it was not. I guess the project just wasn't tested with web-ext, which is why some required files are missing. In the end of the day, I gave up and decided to go for another extension. This time I was luckier and got to run web-ext build from the first time:

“Alright, this seems to be working” — I thought. “Let’s see what else do they have here”

Thus I got to know that there is generally a number of command available, such as

  • build
  • sign
  • run
  • lint
  • docs

Initial work

I started to discover the structure of all components in order to identify where are the files that I would need to touch.

It did not take me too long to find the cmd folder within src directory, where a number of files suspiciously named after existing web-extcommands are located. That is how I got to know about build.js file, where all the logic for thebuild command is stored.

One of the other great options we have is to do a global search through the project using keyword in VS Code:

After researching into the issue description & code base for quite a while, I was able to identify the files that would potentially need to be changed in order to introduce the new feature — an option for the build command to set custom filename to an extension:

  • build.js
  • program.js
  • test.build.js

It was then the time to take a closer look into each file and learn how can I introduce new feature. It was a really long process, that took me around a week or so. With a number of advices, and a decent amount of time spent pn debugging, I was able to finally implement the new filename option, that would somehow work. I decided to create a PR to push it to the issue in order for the maintainers to be able to take a look and provide their feedback. I was then advised to change a number of things, as well as to introduce more functionality to the feature, which is what I currently keep working on!

Hacktoberfest Volume 2

In order to keep pushing my Hacktoberfest goal, I have also chosen a number of new repositories to contribute to:

Yoo-hoo

--

--

Anton Biriukov

Enthusiastic Junior Software Developer striving for discoveries & curious about technology