Contributing To Github Repository
Tags: opensource, html, javascript, github
Published: 2021-09-24 20:20:56

__This is the 3rd Week__ I've been in __OSD 600__. And obviously, I'm gonna have my __Second Lab__ in this week. __Fortunately__, we don't need to create a __new program or project__ to implement the __Lab 2__. Instead, we need to __contribute on other people's program__ that from last 2 weeks. And we are going to __update__ the program to _be able to convert_ `md` file to `html` file _as well_. __Also__, we need to add __one more feature__ for the `md` file __conversion__. It's more like a lab for us to __help improve other people's program with actual code__.

For this __Lab 2__, _I wasn't able to find my partner until 2 days before the due date_. __At the beginning__, I __thought__ there must __many people are looking for a partner__. And I just need to __catch up with them later__. 
__However__, the truth is even though I tried to find a partner on __Tuesday__, which is __two days__ _after the lab released_, there is __nobody looking for a partner__ anymore. 
At that time, I __realized__ that __"time doesn't wait for anyone"__. _If you need to do something, do it now_. __Stop procrastinating__！！! 
_Due to I didn't have a partner to do this Lab 2_, then _I worked on my own code_ with the _Lab 2 requirement_. _Just in case I can't find one, I could work on my own work!_

__Luckily__, later on I found that my friend, __Jiyun__ hasn't have a partner yet. _So we decided to become each other's_ __partners__. After a few words of __communication__, we __forked__ and __cloned__ each other's __repository__ at Github and then _started to work on it_. 

##Contributing on Github
The __first step__ I did was I added an [issue](https://github.com/jjung99/a1-ssg/issues/1) to __Jiyun's repository__ so that she __knows__ _what I'm going to do with her code_ For this __Lab 2__, I'm going to __implement__ the code that __allows__ user __covert__ a `md` file into a `html` file. __Also__, I would like _add_ a __feature__ that be able to __change to header__ in `MD` file that with the `#` into the `<h1></h1>`.

And __my next step__ was _read through my partner's code. After _going through_ my partner's code, _I tried to run it_ on my __PC__. However, when I _tried to run the program by following_ the `README` file my partner provided, there was an __error__ came up, like this:
![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0atl99xf8wwubtawhhon.png)
__Although__, _I didn't know_ the __best way__ to _solve this issue_. I tried to use some _different code_ to __take place of the code style__ `import` that it's using. I changed it to: 
```
let yargs = require('yargs/yargs');
let {hideBin} = require('yargs/helpers');
let fs = require('fs');
``` 
And then __deleted__ the line of ``  "type": "module",`` in the `package.json` file.

##Following Stuffs
__Because__ my partner and I was using the __same language__ to made this program, it was an __easy job__ for me to __understand her code__. And then I just need to __follow her logic__ to add a _new feature_ to her code. By the way, I saw some of my classmates used the __Regular expression__ to _implement their work_, but __I'm not one of them__. __My feature__ is change the header in MD file that with the `#` into the `<h1>`. And the __way__ I did that was to __check if any line contains the symbol__ `#`. If there is one, just __wrap the line within__ the `<h1></h1>`.
Lastly, I committed all the changes into the repository that I cloned from my partner and then `Pull A Request`.

##My Feelings
This is __not__ a very __complicated Lab__ for me. But the __steps__ that I was trying to implement it were __really useful__ for me. _I learned that_ how I can __fork__ and __clone__ _other people's code_. And I can __modify them__ in a different `branch` after _letting them know my purpose and my goal_. When the __modification things done__, I just need to `Pull A Request` to the __owner__ of the original __repository__. Telling them _"Hey, this is what I had done, please check it out. And accept the `pull request` if you think it's useful for you."_ This is an __excellent experience__ for me. It __taught__ me a lot of __amazing stuffs__ when it comes to contributing at __Github__. 
I think I'm gonna __love__ this kind of __contribution__!

Link to my request pull:[https://github.com/jjung99/a1-ssg/pull/3]
Link to the program I worked:[https://github.com/DerekJxy/a1-ssg]