Skip to content

Add repo-specific CONTRIBUTING.md #518

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# The Odin Project JavaScript Exercises Contributing Guide

Thank you for expressing interest in contributing to The Odin Project (TOP) JavaScript exercises! Before continuing through this guide, be sure you've read our [general contributing guide](https://github.com/TheOdinProject/.github/blob/main/CONTRIBUTING.md), as it contains information that is important for all of our repos.

This contributing guide assumes you have followed the instructions in our general contributing guide to fork and clone our JavaScript exercises repo.

## Table of Contents

- [How to Contribute](#how-to-contribute)
- [Prerequisites](#prerequisites)
- [Adding New Exercises](#adding-new-exercises)

## How to Contribute

### Prerequisites

- Node v18.0.0 or higher
- npm v8.5.5 or higher

### Adding New Exercises

> [!IMPORTANT]
> Please do not open a pull request with a new exercise unless you have opened an issue in this repo with your proposal **and** it has been approved by a maintainer.

If a maintainer has approved a new exercise to be added, the new exercise(s) must follow the same format as existing exercises.

To generate a new exercise template, do the following:

1. Be sure to run `npm install` at the root of the `javascript-exercises` directory to install the necessary dependencies.
1. Run the command `npm run generate`.
1. When prompted, enter the name of the new exercise in "camelCase" syntax. This will create a new directory with the necessary files included.
1. Update the `README.md` and `.spec.js` file, as well as the files inside the `solution` directory of the new exercise.
1. Open a pull request with the new exercise.
12 changes: 1 addition & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ These JavaScript exercises are intended to complement the JavaScript content on

## Contributing

If you have a suggestion to improve an exercise, an idea for a new exercise, or notice an issue with an exercise, please feel free to open an issue after thoroughly reading our [contributing guide](https://github.com/TheOdinProject/.github/blob/main/CONTRIBUTING.md).
If you have a suggestion to improve an exercise, an idea for a new exercise, or notice an issue with an exercise, please feel free to open an issue after thoroughly reading our [contributing guide](https://github.com/TheOdinProject/javascript-exercises/blob/main/CONTRIBUTING.md).

## How To Use These Exercises

Expand Down Expand Up @@ -38,13 +38,3 @@ The first exercise, `helloWorld`, will walk you through the process in-depth.
## Debugging

To debug functions, you can run the tests in the Visual Studio Code debugger terminal. You can open this by clicking the "Run and Debug" icon on the left or pressing <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>D</kbd>, then clicking JavaScript Debug Terminal. You will be able to set breakpoints as you would in the Chrome DevTools debugger. You can run `npm test exerciseName.spec.js` to then execute your code up until your breakpoint and step through your code as necessary. **NOTE**: To take advantage of the debugger, you **MUST** run the script in the debugger terminal, not the bash or zsh terminal.

## Adding a new exercise

To add a new exercise:

1. Be sure to run `npm install` at the root of the `javascript-exercises` directory.
2. Run the command `npm run generate`.
3. When prompted, enter the name of the new exercise in "camelCase" syntax.

After entering an exercise name, a new directory with the necessary files will be created. You will then need to update the `README.md` and `spec.js` files as well as the files in the `solution` directory of the new exercise.