From 58df2c049560c2674d92a744cf1844893b232fc4 Mon Sep 17 00:00:00 2001
From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:56:10 +0000
Subject: [PATCH 1/6] Add contributing guide file
---
CONTRIBUTING.md | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100644 CONTRIBUTING.md
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
new file mode 100644
index 0000000..648f5c1
--- /dev/null
+++ b/CONTRIBUTING.md
@@ -0,0 +1,30 @@
+# 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
+
+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.
+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.
From 7ef188212edb5e2b90c8bb12dbead3e08ca8293f Mon Sep 17 00:00:00 2001
From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:58:38 +0000
Subject: [PATCH 2/6] Remove 'Adding New Exercises' section from general
README.md
---
README.md | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/README.md b/README.md
index 8b248fe..dfd0761 100644
--- a/README.md
+++ b/README.md
@@ -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 Ctrl + Shift + D, 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.
From bc1a836bbb516ada5228f0b8edfa730556dd1d9c Mon Sep 17 00:00:00 2001
From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Date: Wed, 29 Jan 2025 14:59:32 +0000
Subject: [PATCH 3/6] Use repo-specific contributing guide link
---
README.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/README.md b/README.md
index dfd0761..0244a43 100644
--- a/README.md
+++ b/README.md
@@ -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
From 39169ed45d56e6ddeeed9b05859e0398a32c2952 Mon Sep 17 00:00:00 2001
From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Date: Wed, 29 Jan 2025 15:07:27 +0000
Subject: [PATCH 4/6] Use lazy numbering for ordered list
---
CONTRIBUTING.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 648f5c1..829ee7e 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -24,7 +24,7 @@ If a maintainer has approved a new exercise to be added, the new exercise(s) mus
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.
-2. Run the command `npm run generate`.
-3. When prompted, enter the name of the new exercise in "camelCase" syntax.
+1. Run the command `npm run generate`.
+1. 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.
From b4be1d87527a896eba35d9087a3bbb1bebbe2459 Mon Sep 17 00:00:00 2001
From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Date: Tue, 4 Feb 2025 16:05:32 +0000
Subject: [PATCH 5/6] Combine separate instruction sentence with instruction
list
---
CONTRIBUTING.md | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 829ee7e..35057c3 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -25,6 +25,6 @@ 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.
-
-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.
+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.
From 098f3f473308427a4a50da00c06d4b36036d0268 Mon Sep 17 00:00:00 2001
From: MaoShizhong <122839503+MaoShizhong@users.noreply.github.com>
Date: Tue, 4 Feb 2025 16:08:11 +0000
Subject: [PATCH 6/6] Add important reminder about approved issue before PR
---
CONTRIBUTING.md | 3 +++
1 file changed, 3 insertions(+)
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 35057c3..cb8925a 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -19,6 +19,9 @@ This contributing guide assumes you have followed the instructions in our genera
### 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: