forked from danthareja/contribute-to-open-source
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit b769ae8
Showing
13 changed files
with
575 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module.exports = { | ||
"extends": "airbnb-base", | ||
"env": { | ||
"node":true, | ||
"mocha": true, | ||
"es6": true, | ||
}, | ||
"globals": { | ||
"expect": true, | ||
"sinon": true, | ||
}, | ||
"plugins": [ | ||
"import" | ||
], | ||
"rules": { | ||
"no-underscore-dangle": 0, | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<!-- | ||
In order to reduce distractions from the exercise, please open your issue in the partner repo: | ||
https://github.com/danthareja/contribute-to-open-source-server/issues/new | ||
Any issue opened here will be automatically closed. | ||
--> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<!-- | ||
Yay, you found the Pull Request button! | ||
Before submitting your changes for review, consider the message you write here carefully. The goal is to make it as easy as possible for a reviewer to understand, and accept, your changes. Here are some tips for a great message: | ||
* Include context about your changes, linking to relative issues/documentation | ||
* Write clearly and concisely | ||
* Provide screenshots of before/after | ||
* Review the contributing guidelines for any other specifics | ||
--> | ||
|
||
**Delete me and write your Pull Request message here!** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Runtime data | ||
pids | ||
*.pid | ||
*.seed | ||
*.pid.lock | ||
|
||
# Directory for instrumented libs generated by jscoverage/JSCover | ||
lib-cov | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# nyc test coverage | ||
.nyc_output | ||
|
||
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
.grunt | ||
|
||
# Bower dependency directory (https://bower.io/) | ||
bower_components | ||
|
||
# node-waf configuration | ||
.lock-wscript | ||
|
||
# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
jspm_packages/ | ||
|
||
# Typescript v1 declaration files | ||
typings/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Optional REPL history | ||
.node_repl_history | ||
|
||
# Output of 'npm pack' | ||
*.tgz | ||
|
||
# Yarn Integrity file | ||
.yarn-integrity | ||
|
||
# dotenv environment variables file | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
> This file sets ground rules for contributors’ behavior. | ||
> | ||
> While not every project has this file, its presence signals that this is a welcoming project to contribute to. | ||
# Contributor Covenant Code of Conduct | ||
|
||
## Our Pledge | ||
|
||
In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation. | ||
|
||
## Our Standards | ||
|
||
Examples of behavior that contributes to creating a positive environment include: | ||
|
||
* Using welcoming and inclusive language | ||
* Being respectful of differing viewpoints and experiences | ||
* Gracefully accepting constructive criticism | ||
* Focusing on what is best for the community | ||
* Showing empathy towards other community members | ||
|
||
Examples of unacceptable behavior by participants include: | ||
|
||
* The use of sexualized language or imagery and unwelcome sexual attention or advances | ||
* Trolling, insulting/derogatory comments, and personal or political attacks | ||
* Public or private harassment | ||
* Publishing others' private information, such as a physical or electronic address, without explicit permission | ||
* Other conduct which could reasonably be considered inappropriate in a professional setting | ||
|
||
## Our Responsibilities | ||
|
||
Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior. | ||
|
||
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. | ||
|
||
## Scope | ||
|
||
This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers. | ||
|
||
## Enforcement | ||
|
||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at danthareja@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. | ||
|
||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. | ||
|
||
## Attribution | ||
|
||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version] | ||
|
||
[homepage]: http://contributor-covenant.org | ||
[version]: http://contributor-covenant.org/version/1/4/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
> Guess you're a contributor now! | ||
> | ||
> **This is the most important file for you to read as a contributor.** If written well, this file will explain *everything* you need to know in order to successfully contribute to the project. If a project *does not* have this file, you should ask for guidelines by opening an issue. | ||
# Contributing | ||
|
||
Thanks for your interest in contributing! Please read carefully through our guidelines below to ensure that your contribution adheres to our project's standards. | ||
|
||
## Code of Conduct | ||
|
||
In order to hold a safe space for all contributors, we expect all project participants to adhere to our Code of Conduct. Please read the [full text](CODE_OF_CONDUCT.md) so that you can understand what actions will and will not be tolerated. | ||
|
||
## Issue Tracking | ||
|
||
We use [GitHub Issues](https://github.com/danthareja/contribute-to-open-source/issues) to track all tasks related to this project. | ||
|
||
To help you get your feet wet and get you familiar with our contribution process, we have [a list of friendly issues](https://github.com/danthareja/contribute-to-open-source/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) that contain tasks which are fairly easy to fix. This is a great place to get started. | ||
|
||
## Style Guide | ||
|
||
We follow [Airbnb's Style Guide](https://github.com/airbnb/javascript). | ||
|
||
Our linter will catch most styling issues that may exist in your code. You can check the status of your code styling by simply running `npm run lint` after building the project locally. We will not accept contributions with linting errors. | ||
|
||
## Build the project locally | ||
|
||
In order to contribute to a project on GitHub, you must first get a copy of the project running locally on your computer. This process is sometimes called a "build process", and every project's process will have different requirements. Some requirements are due to the project being hosted on GitHub, some are due to the programming language used, some are due to the project's dependencies. | ||
|
||
There are five steps to build this project: | ||
|
||
1. [Set up Git and Install Node.js](#set-up-git-and-install-nodejs) | ||
1. [Fork the repository](#fork-the-repository) | ||
1. [Clone your fork](#clone-your-fork) | ||
1. [Install dependencies](#install-dependencies) | ||
1. [Run the project](#run-the-project) | ||
|
||
Once you get the project built, see if you can fix some [issues](https://github.com/danthareja/contribute-to-open-source/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22). | ||
|
||
### Set up Git and Install Node.js | ||
|
||
> **If you've never written JavaScript before, don't sweat!** This exercises only requires fundamental language skills, you should be able to adapt from your favorite language. | ||
All GitHub projects are backed by a version control software called *Git*. You'll need to [set up Git](https://github.com/danthareja/contribute-to-open-source/wiki/Setting-up-Git) in order to contribute to *any* project on GitHub. | ||
|
||
This specific project is written in JavaScript, and uses Node.js as it's runtime. You'll need to [install Node.js](https://nodejs.org/en/) in order to run the project. | ||
|
||
### Fork the repository | ||
|
||
A *fork* is a copy of a repository. Forking a repository lets you to make changes to your copy without affecting any of the original code. | ||
|
||
Click **Fork** (in the top-right corner of the page) to copy this repository to your GitHub account. | ||
|
||
### Clone your fork | ||
|
||
A *clone* is a downloaded version of a repository. Cloning our fork lets you download a copy of the repository to your computer. | ||
|
||
Use `git` to clone your fork | ||
|
||
``` | ||
$ git clone https://github.com/YOUR-USERNAME/contribute-to-open-source | ||
``` | ||
|
||
### Install dependencies | ||
|
||
Did you know that not all code in a project is usually written by the author? | ||
|
||
The beauty of open source is that you can install and use code that other people have written, allowing you to focus on the unique requirements of your project. Third-party code that your project installs is called a *dependency*, because it is required to work. | ||
|
||
This project uses [npm](https://www.npmjs.com/), a command-line tool bundled with Node.js, to maintain third-party dependencies. | ||
|
||
First, navigate into the project's directory | ||
|
||
``` | ||
$ cd contribute-to-open-source | ||
``` | ||
|
||
Next, use `npm` to install the project' dependencies | ||
``` | ||
$ npm install | ||
``` | ||
|
||
### Run the project | ||
|
||
In addition to installing dependencies, `npm` also lets you run commands defined by the project's author. This project has a few commands defined. | ||
|
||
Check the code's style against the style guide | ||
``` | ||
$ npm run lint | ||
``` | ||
|
||
Run an automated test suite | ||
``` | ||
$ npm test | ||
``` | ||
|
||
Run an automate test suite *and* re-run the tests when a file changes | ||
``` | ||
$ npm test -- --watch | ||
``` | ||
|
||
## Submit a Pull Request | ||
|
||
Remember how a making changes on a *fork* doesn't affect the original code? Well, in order to fix an issue the in the main project, you *want* to change to the original code. A *pull request* is a GitHub feature that lets you do just that! | ||
|
||
There are 3 steps to submitting a pull request: | ||
1. [Save your changes locally](#save-your-changes-locally) | ||
2. [Send your changes to your fork](#send-your-changes-to-your-fork) | ||
3. [Open a Pull Request](#open-a-pull-request) | ||
|
||
These instructions are designed to explain the bare minimum steps in a beginner-friendly way. If you find yourself hungry for more details (or get stuck), I applaud and encourage you to continue research on your own. You'll find no lack of amazing articles about this topic. | ||
|
||
### Save your changes locally | ||
|
||
First, get a list of all the files you have changed. | ||
``` | ||
$ git status | ||
``` | ||
|
||
Next, *stage* the file you want to save. This will add the file to a new list that is ready to be saved. | ||
``` | ||
$ git add src/calculator.js | ||
$ git add src/calculator.test.js | ||
``` | ||
|
||
Next, verify that the file has been staged correctly. Notice that the text color has changed, and your file is now in a list that says "Changes to be committed" instead of "Changes not staged for commit" | ||
``` | ||
$ git status | ||
``` | ||
|
||
Finally, save your staged files. | ||
``` | ||
$ git commit -m "Implement _check" | ||
``` | ||
|
||
You'll often hear this process called *commiting* changes. It's the exact same thing. | ||
|
||
### Send your changes to your fork | ||
|
||
With one simple `git` command, you can send the changes you just committed locally to your *fork* on GitHub. | ||
|
||
``` | ||
$ git push origin master | ||
``` | ||
|
||
### Open a Pull Request | ||
|
||
1. Find the [New Pull Request](https://github.com/danthareja/contribute-to-open-source/compare/) button | ||
2. Select the option to **compare across forks** | ||
3. Select **your username** as the `base` branch and **your fork** as the `head fork`: | ||
 | ||
4. Click **Create Pull Request** | ||
|
||
## License | ||
By contributing, you agree that your contributions will be licensed under its MIT license. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2017 Dan Thareja | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[](CONTRIBUTING.md) | ||
|
||
# Contribute to Open Source | ||
|
||
The goal of this project is to empower you to contribute code to open source projects on GitHub by teaching you the mechanics of the process in an interactive experience. | ||
|
||
## You | ||
|
||
* have started the journey of learning how to code | ||
* have taken an online course or two | ||
* are empowered by your new ability to create | ||
* are curious what "open source" means and how you can do it too | ||
|
||
## Your mission | ||
|
||
Jump right in and fix issue [#1](https://github.com/danthareja/contribute-to-open-source/issues/1). | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# DO NOT EDIT THIS FILE!! | ||
machine: | ||
node: | ||
version: 6 | ||
test: | ||
override: | ||
- mkdir -p $CIRCLE_TEST_REPORTS/reports | ||
- npm run lint --silent -- --format json > $CIRCLE_TEST_REPORTS/reports/eslint.json | ||
- npm test --silent -- --reporter json > $CIRCLE_TEST_REPORTS/reports/mocha.json | ||
notify: | ||
webhooks: | ||
- url: https://alz3i17w81.execute-api.us-west-1.amazonaws.com/prod/hooks/circleci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
{ | ||
"name": "contribute-to-open-source", | ||
"description": "Learn how to contribute to open source projects on GitHub", | ||
"version": "1.0.0", | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/danthareja/contribute-to-open-source.git" | ||
}, | ||
"engine": { | ||
"node": ">=6.0.0" | ||
}, | ||
"keywords": [], | ||
"author": "Dan Thareja <danthareja@gmail.com>", | ||
"license": "MIT", | ||
"bugs": { | ||
"url": "https://github.com/danthareja/contribute-to-open-source/issues" | ||
}, | ||
"homepage": "https://github.com/danthareja/contribute-to-open-source#readme", | ||
"private": true, | ||
"scripts": { | ||
"lint": "eslint src/**/*.js", | ||
"test": "mocha --require test/setup.js src/**/*.test.js" | ||
}, | ||
"devDependencies": { | ||
"chai": "^4.0.0", | ||
"eslint": "^3.18.0", | ||
"eslint-config-airbnb-base": "^11.2.0", | ||
"eslint-plugin-import": "^2.8.0", | ||
"mocha": "^3.4.2", | ||
"sinon": "^2.3.2", | ||
"sinon-chai": "^2.10.0" | ||
} | ||
} |
Oops, something went wrong.