-
-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #78 (v2.2.0) from Sv443/wip/2.2.0
- Loading branch information
Showing
61 changed files
with
6,750 additions
and
1,667 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 |
---|---|---|
@@ -1,4 +1,26 @@ | ||
# Before submitting your contribution, please read the following: | ||
# Contributing Guide | ||
This guide will tell you how you can and should contribute to JokeAPI. | ||
Not following it might cause me to reject your changes but at the very least we will both lose time. | ||
So please read this guide before contributing. Thanks :) | ||
|
||
## Menu: | ||
- [Submitting or editing jokes](#submitting-or-editing-jokes) | ||
- [Contributing to JokeAPI's code](#submitting-code) | ||
- [Submitting a translation](#submitting-translations) | ||
- [Tips and Tricks for contributing](#other-nice-to-know-stuff) | ||
|
||
<br><br><br><br> | ||
|
||
## Submitting or editing jokes: | ||
To submit a joke manually, you can use the form on [this page.](https://sv443.net/jokeapi/v2/#submit) | ||
To submit it through code, you can make use of the ["submit" endpoint.](https://sv443.net/jokeapi/v2/#submit-endpoint) | ||
|
||
If you instead want to *edit* a joke, you can find them in the `jokes-xy.json` files in [`data/jokes/`](../data/jokes/) | ||
Please then follow the [code contribution section](#submitting-code) as well. | ||
|
||
<br><br> | ||
|
||
## Submitting code: | ||
1. [Read the Code_of_Conduct.md file](./Code_of_Conduct.md) (TLDR: just behave in a friendly manner). | ||
2. [Click here](https://github.com/Sv443/JokeAPI/fork) to fork the repository. Afterwards, clone or download it and locate the folder where it is contained. | ||
3. Make the changes you want to make to the code. | ||
|
@@ -7,8 +29,8 @@ | |
- `npm run validate-ids` to verify that all jokes have the correct ID. | ||
- `npm run lint` to check the code for any warnings or errors. | ||
5. Run JokeAPI locally by running the command `node JokeAPI`, request some jokes and test the areas you modified / added to make sure everything still works. | ||
6. Add yourself to the `contributors` object in the file `package.json` :) | ||
- **If it doesn't exist or is empty** please add it using the second format on [this website](https://flaviocopes.com/package-json/#contributors) | ||
6. Add yourself to the `contributors` object in the [`package.json`](../package.json) file :) | ||
<!-- - **If it doesn't exist or is empty** please add it using the second format on [this website](https://flaviocopes.com/package-json/#contributors) --> | ||
7. Submit a pull request on your forked repository, selecting `Sv443/JokeAPI` as the base repo and `master` as the base branch and selecting `YourUsername/JokeAPI` as the head repo and `YourBranch` as the compare branch | ||
- If your pull request is not ready to be merged yet, you can add `[WIP]` to the beginning of the title which will tell the repo maintainer(s) and automated scripts not to merge it yet. | ||
8. Request a review from me (Sv443). | ||
|
@@ -19,9 +41,20 @@ | |
|
||
<br><br> | ||
|
||
### Other nice-to-know stuff: | ||
## Submitting Translations: | ||
If you want to submit a translation, please follow these steps: | ||
1. Find your language's two-character code in the file [`data/languages.json`](../data/languages.json). You'll need to specify it for every translation. | ||
2. Translate coded error messages in the file [`data/errorMessages.js`](../data/errorMessages.js) by following the style of the other translations. | ||
3. Translate the generic strings inside of the file [`data/translations.json`](../data/translations.json) by also following the style of the other translations. | ||
4. Add yourself to the `contributors` object in the [`package.json`](../package.json) file :) | ||
|
||
<br><br> | ||
|
||
## Other nice-to-know stuff: | ||
- I really recommend using [Visual Studio Code](https://code.visualstudio.com/) with the extension [`fabiospampinato.vscode-highlight`](https://marketplace.visualstudio.com/items?itemName=fabiospampinato.vscode-highlight) - it will add custom styling to the syntax highlighting in the editor and make the code easier to read and work with. | ||
- If you want to generate a dependency graph, you need to install [Graphviz](https://graphviz.gitlab.io/download/) and add the path to the `bin` folder to your `%PATH%` environment vaiable. Then, run the command `npm run dependency-graph` and open the file `./dev/dependency-graph.html` in a browser. | ||
- If you need to add an authorization token, you can generate one or multiple tokens with the command `npm run add-token [amount]`. If you omit the "amount" parameter, the script will generate a single token. After you run the command, the tokens will be listed in the console and you can now (after restarting JokeAPI) use it in the `x-api-token` header to gain unlimited access to JokeAPI. | ||
- If you want to generate a dependency graph, you need to install [Graphviz](https://graphviz.gitlab.io/download/) and add the path to the `bin` folder to your `%PATH%` / `$PATH` environment vaiable. Then, run the command `npm run dependency-graph` and open the file [`dev/dependency-graph.html`](../dev/dependency-graph.html) in a browser. | ||
- If you need to add an authorization token, you can generate one or multiple tokens with the command `npm run add-token [amount]`. If you omit the "amount" parameter, the script will generate a single token. After you run the command, the tokens will be listed in the console and you can now (after restarting JokeAPI) use it in the `Authorization` header to gain unlimited access to JokeAPI. | ||
|
||
<br><br> | ||
|
||
## If you need any help, please feel free to contact me through [Discord](https://sv443.net/discord) or [E-Mail](mailto:[email protected]?subject=Questions%20about%20contributing%20to%20JokeAPI) | ||
## If you need any help, feel free to contact me through [Discord](https://sv443.net/discord) (fastest way to contact me) or [E-Mail](mailto:[email protected]?subject=Questions%20about%20contributing%20to%20JokeAPI) |
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,27 @@ | ||
<!--- Provide a short, general summary of your changes in the Title above --> | ||
|
||
## Description | ||
<!-- Describe your changes in detail --> | ||
|
||
## Related Issue | ||
<!-- If there is an issue related to this PR or this PR fixes the issue, please add it here: --> | ||
|
||
## Motivation and Context | ||
<!- Why is this change required? What problem does it solve? --> | ||
|
||
## How Has This Been Tested? | ||
<!-- Please describe in detail how you tested your changes. --> | ||
<!-- Include details of your testing environment, and the tests you ran to --> | ||
<!-- see how your change affects other areas of the code, etc. --> | ||
|
||
## Screenshots (if appropriate): | ||
<!-- Add some screenshots here, if applicable --> | ||
|
||
## Checklist | ||
- [ ] I have read the [Contributing Guide](../Contributing.md) | ||
- [ ] I read and accept the [Code of Conduct](../Code_of_Conduct.md) (TLDR: just behave in a friendly manner) | ||
- [ ] My code follows the general style of this project | ||
- [ ] I have commented my code, particularly in hard-to-understand areas | ||
- [ ] I have made corresponding changes to the documentation (if applicable) | ||
- [ ] I ensured that the automated checks that ran on this PR have completed successfully | ||
- [ ] I added myself to the `package.json` file (optional) |
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
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
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
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
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
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
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
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
Oops, something went wrong.