contribute-to-open-source icon indicating copy to clipboard operation
contribute-to-open-source copied to clipboard

DRY up the codebase

Open danthareja opened this issue 7 years ago • 72 comments

Welcome new contributors!

In this experience, you are a doer. You take action first, and learn about the action afterwards. This design helps you get comfortable in the unknown, an entity that is omnipresent in the coding world. If you're feeling confused, that's ok. Read the instructions carefully, trust the process, and have fun!

To help guide you through the experience, there will be comment blocks (like the one your reading now) that explains just enough context before your next action.

Open Source and GitHub

An open source project is any code that can be freely used, changed, and shared by anyone. An open source project usually contains a license that declares specific terms of use. Open source projects are important because they help develop and spread great ideas and push technology forward.

GitHub is a website that hosts open source projects. A project on GitHub is called a repository (or repo), a folder that holds code. GitHub allows people to collaborate on a repo through features like issues and pull requests. By the end of this experience, you'll understand how to use these features to contribute your ideas to other projects.

Issues

Issues (like this one) allow people to track and discuss any task related to the project. Issues are not always problems with the code. They can also be feature requests or questions about how to use the code.

To help organize the project, issues can be tagged with one or more label. When you graduate from this project and are looking for more ways to contribute, look for projects with issues tagged with labels help wanted, good first issue, up-for-grabs, first-timers-only, or something similarly inviting.

Your turn

Now that you have a bit of context about the experience, continue reading the body of the issue to learn how to fix it.


We're off to an amazing start disrupting the calculator industry. Our beautiful contributors burned all of last week's midnight oil to release our first version and the initial reception has been unprecedented!

After a code review from some experts, we've learned that there's some unnecessary repetition in the codebase. Removing this repetition will make our codebase easier to maintain as we continue to grow into the world's best calculator company.

The team is burnt out from last week's push and needs your help! Before blowing half of our capital investment on a vacation in the Swiss Alps, the team managed to write some tests for this refactor, and left behind a roadmap to the next big release:


This experience can be completed by multiple people. Below, you'll see references to this issue from various other contributors. You can ignore them.

danthareja avatar Nov 07 '17 20:11 danthareja

i am working on it and facing eslint problems since i am working on windows do i need to take care special care?

sourabh1031 avatar Jan 14 '18 02:01 sourabh1031

@sourabh1031, are they the same problems you mentioned in your other issue https://github.com/danthareja/contribute-to-open-source-server/issues/2? If so, did you try what I mentioned in the reply?

danthareja avatar Jan 14 '18 04:01 danthareja

Yes it got solved by your help thanks and now I must switch my work onto Unix based system isn't?

On Jan 14, 2018 9:32 AM, "Dan Thareja" [email protected] wrote:

@sourabh1031 https://github.com/sourabh1031, are they the same problems you mentioned in your other issue danthareja/contribute-to-open- source-server#2 https://github.com/danthareja/contribute-to-open-source-server/issues/2? If so, did you try what I mentioned in the reply?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/danthareja/contribute-to-open-source/issues/1#issuecomment-357487118, or mute the thread https://github.com/notifications/unsubscribe-auth/AYZ7Y0xcUkBTZhPexCCeW7PjDoWCAEsQks5tKXxmgaJpZM4QVZhc .

sourabh1031 avatar Jan 14 '18 04:01 sourabh1031

No need. As long as the styling issues are fixed, you can keep developing on Windows.

danthareja avatar Jan 14 '18 05:01 danthareja

is it still open for contribution?

Ri2parna avatar Oct 21 '18 18:10 Ri2parna

Hey @Ri2parna, thanks for asking if this is still open, you're following a good practice when contributing to a new project.

In short, yes! This project is still open for contribution.

In long, everyone can always contribute to this project because you contribute you work to a branch made just for you (one is automatically created when you fork this repository). This deviates from most projects where you usually contribute to the master, and is done this way so that multiple people can practice contributing the same work.

Follow the instructions above and have fun!

danthareja avatar Oct 22 '18 10:10 danthareja

Hey @danthareja, just wanted to say thanks for putting this little practice scenario together.

I've wanted to get into open source contribution for a while now, but was too intimidated by the Git arena to even get started. However, after going through your training module, I now feel like I have a better understanding of what's going on/how things are done and am confident enough to try to help out on some "real" projects!

scelestus1 avatar Dec 06 '18 21:12 scelestus1

I'm glad you enjoyed it @scelestus1, Have fun contributing out there!

danthareja avatar Dec 06 '18 22:12 danthareja

Aaaaaaaa! I did it. My first PR accepted and the message saying "You did it. You are an open source developer now" is AN ABSOLUTE BLISS! Thank you so much for such amazing and well-detailed guidelines. Means a lot. Thank you.

MisterAwesome23 avatar Dec 22 '18 18:12 MisterAwesome23

Just one question, while contributing to real projects the only difference is in the last step that is creating the pull request across the forks, instead of changing the first base from master to ourselves(our username) we should keep that to master right? Correct me if I am wrong.

MisterAwesome23 avatar Dec 22 '18 19:12 MisterAwesome23

screenshot 28 In node.js the project is not install.What to do?

niteshnanda02 avatar Jan 05 '19 19:01 niteshnanda02

@niteshnanda02, did you figure this one out? Based on the screenshot, it looks like you are inside of the node command-line. If you follow the instruction to exit the (press Control+D), you should exit the node command-line, back to your regular terminal window. Once in the regular terminal window, you should be able to type npm install again.

danthareja avatar Jan 06 '19 21:01 danthareja

@MisterAwesome23, apologies for the delay in getting back to you.

Aaaaaaaa! I did it. My first PR accepted and the message saying "You did it. You are an open source developer now" is AN ABSOLUTE BLISS! Thank you so much for such amazing and well-detailed guidelines. Means a lot. Thank you.

This makes me smile so much, I'm glad you enjoyed the process!

Just one question, while contributing to real projects the only difference is in the last step that is creating the pull request across the forks, instead of changing the first base from master to ourselves(our username) we should keep that to master right? Correct me if I am wrong.

Yes! By convention, most projects live on the master branch, so you would be correct in this case. This is not always the case though! Do make sure to reference the individual project's contributing guidelines to see if they require any special steps.

danthareja avatar Jan 06 '19 21:01 danthareja

Just one question, while contributing to real projects the only difference is in the last step that is creating the pull request across the forks, instead of changing the first base from master to ourselves(our username) we should keep that to master right? Correct me if I am wrong.

danthareja avatar Jan 07 '19 17:01 danthareja

What's the error in this? screenshot 29

niteshnanda02 avatar Jan 12 '19 19:01 niteshnanda02

@niteshnanda02, this is the expected error message you will receive the first time you run npm test. Your job now is to make the red tests turn green by writing code in calculator.js that satisfies the test cases. If you're confused on exactly what the tests are doing, check out the documentation for the test libraries: Mocha and Chai and Sinon

danthareja avatar Jan 13 '19 17:01 danthareja

Yeaaayy, my PR already merged. It's very excited even has been merged by bot.

sog01 avatar Jan 28 '19 08:01 sog01

Yess, my first commit , i am feeling so great !

vinayaksharma082 avatar Apr 11 '19 14:04 vinayaksharma082

Good question, @Xyno18!

There are a few comments that describe how to implement _check inside of the file src/calculator.js. If these comments are confusing, I'd recommend starting with a free introduction to JavaScript course to learn the basic syntax of the language. Once you're familiar with variables, conditional statements, and functions, you should come back here.

danthareja avatar Jun 10 '19 17:06 danthareja

whyerror

why this error?

richard937 avatar Aug 10 '19 04:08 richard937

Hey, Question: On this page Open a Pull Request part,

  • This is a weird requirement. In the real-world, most projects will expect you to open a Pull Request against the master base branch. Can you guess why it's needed here?

Why would be the reason?

qaws01395 avatar May 23 '20 05:05 qaws01395

Good question @qaws01395!

This requirement is necessary here in order to allow multiple people to contribute the same code. Without this requirement, once one contributor's PR was merged into master, no one else would be able to merge the same code.

danthareja avatar May 25 '20 16:05 danthareja

Thanks for the explanation!

qaws01395 avatar May 25 '20 21:05 qaws01395

Hi,

I'm new to open source and would like to contribute.

jpkim921 avatar Jun 23 '20 01:06 jpkim921

Welcome to open-source, @jpkim921!

Have you completed the exercise from this repo? If not, that's a great place to start -- just complete the instructions in the issue's body above. Once you complete the exercise, you'll get an automated comment in your pull request with some ideas for your next contribution.

If you have further questions, feel free to ask here.

danthareja avatar Jun 29 '20 17:06 danthareja

I'm new to Open Source collaboration, I can contribute?

HakaCode avatar Jun 30 '20 04:06 HakaCode

New to OpenSource and would like to contribute

Om-Vg avatar Jul 24 '20 04:07 Om-Vg

Yes! @HakaCode and @OmLakshmi - you both are very welcome to contribute.

Please head over to issue #1 and follow the instructions there.

danthareja avatar Jul 24 '20 04:07 danthareja

OKay, let me have a gpo @danthareja

ghost avatar Sep 01 '20 13:09 ghost

Is this issue still active @danthareja

ghost avatar Sep 01 '20 20:09 ghost

Yes! Everyone can contribute their own solution to this issue @KarenEfereyan. Make sure you read the instructions about submitting a PR to your own branch, and have fun!

danthareja avatar Sep 01 '20 22:09 danthareja

Thank you ❤️ great job

rondog64 avatar Dec 07 '20 16:12 rondog64

Amazing

rondog64 avatar Dec 07 '20 16:12 rondog64

Team work

rondog64 avatar Dec 07 '20 16:12 rondog64

I had some problems with the dependencies, but I think I managed to fix it. Still, kind of afraid of messing everything up.

ghost avatar Dec 28 '20 04:12 ghost

I haven't had this much fun debugging in a long time! I'm not really sure if I've ever had this much fun debugging, to be honest. Haven't fixed it yet, but really loving it. Thank you!

ghost avatar Dec 28 '20 16:12 ghost

I made the PR, thanks for making this. Loved working on it!

ghost avatar Dec 28 '20 18:12 ghost

Nice work @syspentarc, thanks for playing!

danthareja avatar Dec 28 '20 23:12 danthareja

I'm new to GitHub, but I've done one or two PRs before and did my research prior to joining the platform. This really gave me more confidence in working on doing more of these types of contributions instead of looking more to documentation to contribute to.

ghost avatar Dec 28 '20 23:12 ghost

Please consider doing more like this, I'd love to see more stuff exactly like this. :smile:

ghost avatar Dec 28 '20 23:12 ghost

Hi, I am new to contributing to open source and it was a fun little assignment. I just wanted clarification on one thing, we are selecting the base branch with our name so that we don't make changes to the master branch of the repo . Is that so?

satcasm avatar Jan 14 '21 09:01 satcasm

Hi, I am new to contributing to open source and it was a fun little assignment. I just wanted clarification on one thing, we are selecting the base branch with our name so that we don't make changes to the master branch of the repo . Is that so?

Yeah, that's exactly right. That's a distinct difference between this project and one you'll find out in the real world.

If you made changes to the master branch of the repo, only one person would be able to contribute, or we'd have to do some complex revert/pulling which could be hard to understand for new contributors.

danthareja avatar Jan 14 '21 22:01 danthareja

I would like to contribute if possible?

larabee7777 avatar Feb 18 '21 13:02 larabee7777

I get a 185 errors when I run "npm run lint". The errors are all linebreak errors as follows "error Expected linebreaks to be 'LF' but found 'CRLF' linebreak-style" Error

TB9652 avatar Apr 23 '21 22:04 TB9652

Thanks for helping us beginners to take our first steps. Appreciate your efforts 😄

chincholikarsalil avatar Apr 28 '21 16:04 chincholikarsalil

Sorry for the stupid question, but how do I take care of the errors? Have been following the instructions on this but I'm a bit lost now so any guidance would be appreciated.

TB9652 avatar Apr 28 '21 18:04 TB9652

Sorry for the stupid question, but how do I take care of the errors? Have been following the instructions on this but I'm a bit lost now so any guidance would be appreciated.

@TB9652 According to the image that you have posted, I think that you are using Windows to build the project. I recommend using Linux based OS like Ubuntu. Also, if you do not have Ubuntu, you can always try using the Windows Subsystem for Linux (WSL), it is very convenient.

chincholikarsalil avatar Apr 28 '21 19:04 chincholikarsalil

hey @TB9652, sorry for the delay here. there are no stupid questions!

windows and mac have two different default line endings. i authored this on a mac, which defaults to the 'CLRF' line ending. since you're on windows, you're seeing the error message, which is asking you to write to the mac line endings.

to fix the errors, try running npm run lint -- --fix, which tells eslint to self-correct these endings.

danthareja avatar Apr 28 '21 19:04 danthareja

to fix the errors, try running npm run lint -- --fix, which tells eslint to self-correct these endings.

@danthareja @TB9652 Sorry, had no idea about this command.

chincholikarsalil avatar Apr 28 '21 19:04 chincholikarsalil

Thanks for the guidance. I will try that and let you know how it goes. I'm not very well schooled on using Git Bash. I have more experience using Microsoft VS so this is a true learning experience for me.

TB9652 avatar Apr 28 '21 20:04 TB9652

Ok

mspaansen avatar May 14 '21 13:05 mspaansen

Committed to the issue and contributed

Kamalesh3112 avatar Aug 20 '21 13:08 Kamalesh3112

Welcome new contributors!

In this experience, you are a doer. You take action first, and learn about the action afterwards. This design helps you get comfortable in the unknown, an entity that is omnipresent in the coding world. If you're feeling confused, that's ok. Read the instructions carefully, trust the process, and have fun! To help guide you through the experience, there will be comment blocks (like the one your reading now) that explains just enough context before your next action.

Open Source and GitHub

An open source project is any code that can be freely used, changed, and shared by anyone. An open source project usually contains a license that declares specific terms of use. Open source projects are important because they help develop and spread great ideas and push technology forward. GitHub is a website that hosts open source projects. A project on GitHub is called a repository (or repo), a folder that holds code. GitHub allows people to collaborate on a repo through features like issues and pull requests. By the end of this experience, you'll understand how to use these features to contribute your ideas to other projects.

Issues

Issues (like this one) allow people to track and discuss any task related to the project. Issues are not always problems with the code. They can also be feature requests or questions about how to use the code. To help organize the project, issues can be tagged with one or more label. When you graduate from this project and are looking for more ways to contribute, look for projects with issues tagged with labels help wanted, good first issue, up-for-grabs, first-timers-only, or something similarly inviting.

Your turn

Now that you have a bit of context about the experience, continue reading the body of the issue to learn how to fix it.

We're off to an amazing start disrupting the calculator industry. Our beautiful contributors burned all of last week's midnight oil to release our first version and the initial reception has been unprecedented!

After a code review from some experts, we've learned that there's some unnecessary repetition in the codebase. Removing this repetition will make our codebase easier to maintain as we continue to grow into the world's best calculator company.

The team is burnt out from last week's push and needs your help! Before blowing half of our capital investment on a vacation in the Swiss Alps, the team managed to write some tests for this refactor, and left behind a roadmap to the next big release:

This experience can be completed my multiple people. Below, you'll see references to this issue from various other contributors. You can ignore them.

Implement check #27

darkranger778 avatar Feb 05 '22 07:02 darkranger778

How do you get your username to show up in the base ref when opening a new pull request?

PietroLinguini avatar Feb 12 '22 05:02 PietroLinguini

#1512 how to implement check

prasannajeet2002 avatar Jun 21 '22 19:06 prasannajeet2002