Browse Source

and the rest of the files

Sv443 5 months ago
parent
commit
f2ddec9c30

+ 89 - 0
.github/Code_of_Conduct.md

@@ -0,0 +1,89 @@
+# Contributor Covenant Code of Conduct
+## ▶️ Please read this before contributing to JokeAPI
+
+<br><br>
+
+## 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, sex characteristics, gender identity and expression,
+level of experience, education, socio-economic status, nationality, personal
+appearance, race, religion, or sexual identity and orientation.
+  
+<br>
+  
+## 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 overly 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
+ businessy-casual setting
+  
+<br>
+
+## 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.
+  
+<br>
+
+## 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.
+  
+<br>
+
+## Enforcement:
+
+Instances of abusive, harassing, or otherwise unacceptable behavior may be
+reported by contacting the project team at [email protected]. All
+complaints will be reviewed and investigated and will result in a response that
+is deemed necessary and 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.
+
+<br>
+  
+## Attribution:
+
+This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
+available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
+
+[homepage]: https://www.contributor-covenant.org
+
+For answers to common questions about this code of conduct, see
+https://www.contributor-covenant.org/faq

+ 66 - 0
.github/Contributing.md

@@ -0,0 +1,66 @@
+# 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 :)
+
+## Table of Contents:
+- [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://v2.jokeapi.dev/#submit)  
+To submit it through code, you can make use of the ["submit" endpoint.](https://v2.jokeapi.dev/#submit-endpoint)  
+  
+If you instead want to edit a joke yourself, you can find them in the `jokes-xy.json` files in [`data/jokes/`](../data/jokes/)  
+To submit your changes, create a pull request. Also make sure to follow the [code contribution instructions.](#submitting-code)  
+  
+If you want a joke to be edited or deleted, please submit a new issue [here.](https://github.com/Sv443/JokeAPI/issues/new?assignees=Sv443&labels=reported+joke&template=3_report_a_joke.md&title=)  
+Keep in mind, though, that I will not remove jokes based on opinions as that would defeat the API's main purpose, to provide jokes for everyone's taste.  
+
+<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.
+4. Run the script `npm run all` which will run these commands:
+    - `npm run validate-jokes` to make sure all jokes are formatted correctly.
+    - `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.
+    - `npm run dep-graph` to generate a new dependency graph.
+    - `npm run generate-changelog` to generate a Markdown changelog out of the plaintext one.
+    - `npm run test`, which runs the unit tests for JokeAPI. If you are colorblind, you can run the command `npm run test-colorblind` (will turn green into cyan and red into magenta).
+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 [`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).
+9. Check if the CI script and other checks for your pull request were successful (they can be found below the comments).
+    - **If they were unsuccessful:** view the log, fix the errors, commit the code and push to the same branch. This will automatically update your pull request and re-run the checks.
+10. Once the pull request is approved and merged, you can delete the source branch and your forked repo if you want to.  
+    - **If it isn't**, please read the comments from the reviewer(s) and make the necessary changes.
+  
+<br><br>
+
+## 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%` / `$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 [(better explanation here).](https://jokeapi.dev/#api-tokens)  
+
+<br><br>
+
+## 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)

+ 10 - 0
.github/FUNDING.yml

@@ -0,0 +1,10 @@
+github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
+patreon: Sv443
+open_collective: sv443
+ko_fi: Sv443_
+tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
+community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
+liberapay: # Replace with a single Liberapay username
+issuehunt: # Replace with a single IssueHunt username
+otechie: # Replace with a single Otechie username
+custom: ['paypal.me/SvenFehler']

+ 37 - 0
.github/ISSUE_TEMPLATE/1_bug_report.md

@@ -0,0 +1,37 @@
+---
+name: Bug report
+about: Create a bug report to help improve JokeAPI
+title: ''
+labels: bug
+assignees: Sv443
+
+---
+
+## Describe the bug
+A clear and concise description of what the bug is.
+
+## Steps to reproduce
+Steps to reproduce the unwanted behavior:
+1. Go to '...'
+2. Click on '....'
+3. Scroll down to '....'
+4. See error
+
+## Expected behavior
+A clear and concise description of what you expected to happen.
+
+## Screenshots
+If applicable and possible, add screenshots to help explain your problem.
+
+## Additional information
+ - OS: [e.g. Windows 10 - Build 1803]
+ - Your client's language [e.g. Node.js, Java, ...]
+ - Your client's language's version [e.g. Node.js v12.0.0]
+ - The endpoint(s) you are having problems with (if applicable)
+
+## Code snippet
+If this bug is caused by a piece of code, send the code right here and mark the line where it is caused.  
+I only know JavaScript, C++ and C#, but I can probably interpret other languages.
+
+## Additional context
+Add any other context about the problem here.

+ 21 - 0
.github/ISSUE_TEMPLATE/2_feature_request.md

@@ -0,0 +1,21 @@
+---
+name: Feature request
+about: Suggest an idea / feature for JokeAPI
+title: ''
+labels: enhancement
+assignees: Sv443
+
+---
+
+## Is your feature request related to a problem? Please describe.
+A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
+If it is related to a GitHub issue or merge request, provide the issue's or merge request's number here [e.g. This feature request is related to issue #3]
+
+## Describe the solution you'd like
+A clear and concise description of what you want to happen.
+
+## Describe alternatives you've considered
+A clear and concise description of any alternative solutions or features you've considered and how they are inferior to your proposed feature.
+
+## Additional context
+Add any other context or screenshots about the feature request here.

+ 17 - 0
.github/ISSUE_TEMPLATE/3_report_a_joke.md

@@ -0,0 +1,17 @@
+---
+name: Report a joke
+about: Report a joke that is too offensive / needs to be reflagged or recategorized
+title: ''
+labels: reported joke
+assignees: Sv443
+
+---
+
+## The joke's ID:
+Each joke comes with a unique ID. Put this ID right here.
+
+## Why the joke should be removed / reflagged / recategorized:
+Tell me why I should remove the joke (if a law was broken, upload screenshots of this law or leave a link to the law) or in what way it should be reflagged.
+
+## Alternative to the joke:
+If you know a good alternative to the joke you want to report, put it here and I will consider replacing the reported joke with this one.

+ 52 - 0
.github/ISSUE_TEMPLATE/4_add_dependent.md

@@ -0,0 +1,52 @@
+---
+name: Dependent
+about: Request your project to be added to the dependent lists in the readme and documentation or suggest an edit to a dependent
+title: 'New dependent: '
+labels: dependent
+assignees: Sv443
+
+---
+
+<!--
+    If this issue is approved, your project will be added to these dependent lists:
+    - https://jokeapi.dev/#dependents
+    - https://github.com/Sv443/JokeAPI#readme    (scroll down all the way)
+-->
+
+## Link to the project:
+<!-- Add a single URL to the dependent project here -->
+```
+https://github.com/example/My_Project
+```
+
+
+<br><br>
+
+## Link to my personal website / GitHub page (optional):
+<!-- Add a single URL to your website or GitHub page (or something similar) here -->
+```
+https://github.com/example
+```
+
+
+<br><br>
+
+## Is your project explicit or unsafe for minors to view?
+<!-- Please check the option that fits your project (add an x between the square brackets or submit the issue, then click the checkbox) -->
+- [ ] **Yes**, it contains explicit material
+- [ ] **No**, it doesn't contain explicit material
+
+
+<br><br>
+
+## Notes:
+<!-- If you only want your project to show up on one of the dependent lists or you have some other thing you need the developer(s) to know, put it in this section -->
+
+
+
+<br><br>
+
+## Checklist:
+- [ ] I have added my project's name to the title of this issue
+- [ ] I have filled out at least the first URL (second one is optional)
+- [ ] I have specified whether or not my project is explicit

+ 37 - 0
.github/ISSUE_TEMPLATE/5_wrong_translation.md

@@ -0,0 +1,37 @@
+---
+name: Wrong Translation(s)
+about: Use this template if you noticed one or multiple wrong translations
+title: ''
+labels: translation
+assignees: Sv443
+
+---
+
+## Language code of the translation(s):
+<!-- Add the two character language code of the translation(s) here. If you are unsure, please use this for reference: https://jokeapi.dev/languages?format=txt -->
+**`xy`**
+
+
+<br><br>
+
+## Full translation text (or translation key):
+<!-- Please provide the full text of the broken translation(s) -->
+<!-- Alternatively, you can also provide the key of the translation node in the file ./data/translations.json (for example "messageOfTheDay") -->
+```
+A horse walks into a bar...
+```
+
+
+<br><br>
+
+## The correct version of this translation / these translations:
+<!-- Please correct the wrong translation(s) and add the result here: -->
+```
+A horse runs into a bar...
+```
+
+
+<br><br>
+
+## Checklist:
+- [ ] I have verified that the fixed translation I provided is (to my knowledge) correct

+ 15 - 0
.github/ISSUE_TEMPLATE/config.yml

@@ -0,0 +1,15 @@
+--- 
+blank_issues_enabled: true
+contact_links:
+  -
+    name: "Documentation"
+    about: "Please read the documentation before opening a new issue"
+    url: "https://jokeapi.dev/"
+  -
+    name: "Discussions"
+    about: "If there's some topic you want to talk about, please open a new thread on the JokeAPI discussion board"
+    url: "https://github.com/Sv443/JokeAPI/discussions"
+  -
+    name: "Chat"
+    about: "If you want to chat with the JokeAPI community, you can join my Discord server"
+    url: "https://sv443.net/discord"

+ 29 - 0
.github/PULL_REQUEST_TEMPLATE.md

@@ -0,0 +1,29 @@
+<!-- ^ 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 and followed the [Contributing Guide](https://github.com/Sv443/JokeAPI/blob/master/.github/Contributing.md)
+- [ ] I have read and accept the [Code of Conduct](https://github.com/Sv443/JokeAPI/blob/master/.github/Code_of_Conduct.md) (TLDR: just behave in a friendly manner)
+- [ ] My code follows the general style of this project ([explained here](https://github.com/Sv443/JokeAPI/blob/version/2.4.0/dev/docs/code-style.md#readme))
+- [ ] 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 but highly encouraged :)
+
+**^ Please complete the checklist to the best of your abilities ^**

+ 18 - 0
.github/SECURITY.md

@@ -0,0 +1,18 @@
+# Security Policy
+
+## Reporting a Vulnerability
+To report a vulnerability or security issue, please directly contact me via [Email](mailto:[email protected]) or [Discord](https://sv443.net/discord).  
+Please **do not** create a GitHub issue!
+
+## Supported Versions
+These versions are still supported and will be receiving security updates:
+| Version | Supported | Location | Status |
+| --- | --- | --- | --- |
+| v1.0 | ❌ | `/` | deprecated |
+| v1.1 | ❌ | `/` | deprecated |
+| v2.0 | ❌ | `v2` | outdated / unavailable |
+| v2.1 | ❌ | `v2` | outdated / unavailable |
+| v2.2 | ❌ | `v2` | outdated / unavailable |
+| v2.3 | ✅ | `v2` | active |
+
+Location = subdomain or part of the URL path (eg. `/jokeapi/v2/` or `v2.jokeapi.dev`)

+ 54 - 0
.github/dependabot.yml

@@ -0,0 +1,54 @@
+version: 2
+updates:
+- package-ecosystem: npm
+  directory: "/"
+  schedule:
+    interval: daily
+    time: "04:00"
+  open-pull-requests-limit: 10
+  target-branch: master
+  assignees:
+  - Sv443
+  ignore:
+  - dependency-name: dependency-cruiser
+    versions:
+    - "> 9.23.2, < 10"
+  - dependency-name: eslint
+    versions:
+    - "> 7.17.0, < 8"
+  - dependency-name: eslint
+    versions:
+    - "> 7.3.0, < 7.4"
+  - dependency-name: farmhash
+    versions:
+    - "> 3.1.0, < 4"
+  - dependency-name: fuse.js
+    versions:
+    - "> 6.4.1, < 6.5"
+  - dependency-name: madge
+    versions:
+    - "> 3.9.0, < 3.10"
+  - dependency-name: madge
+    versions:
+    - "> 4.0.1, < 5"
+  - dependency-name: rate-limiter-flexible
+    versions:
+    - "> 2.1.10, < 2.2"
+  - dependency-name: snyk
+    versions:
+    - "> 1.369.2, < 1.370"
+  - dependency-name: snyk
+    versions:
+    - "> 1.511.0, < 2"
+  - dependency-name: table
+    versions:
+    - "> 6.0.1, < 6.1"
+  - dependency-name: table
+    versions:
+    - "> 6.0.1, < 7"
+  - dependency-name: dependency-cruiser
+    versions:
+    - 9.23.2
+  - dependency-name: lodash
+    versions:
+    - 4.17.21

+ 71 - 0
.github/workflows/codeql-analysis.yml

@@ -0,0 +1,71 @@
+# For most projects, this workflow file will not need changing; you simply need
+# to commit it to your repository.
+#
+# You may wish to alter this file to override the set of languages analyzed,
+# or to provide custom queries or build logic.
+#
+# ******** NOTE ********
+# We have attempted to detect the languages in your repository. Please check
+# the `language` matrix defined below to confirm you have the correct set of
+# supported CodeQL languages.
+#
+name: "CodeQL"
+
+on:
+  push:
+    branches: [ master ]
+  pull_request:
+    # The branches below must be a subset of the branches above
+    branches: [ master ]
+  schedule:
+    - cron: '23 12 * * 4'
+
+jobs:
+  analyze:
+    name: Analyze
+    runs-on: ubuntu-latest
+    permissions:
+      actions: read
+      contents: read
+      security-events: write
+
+    strategy:
+      fail-fast: false
+      matrix:
+        language: [ 'javascript' ]
+        # CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python' ]
+        # Learn more:
+        # https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed
+
+    steps:
+    - name: Checkout repository
+      uses: actions/checkout@v2
+
+    # Initializes the CodeQL tools for scanning.
+    - name: Initialize CodeQL
+      uses: github/codeql-action/init@v1
+      with:
+        languages: ${{ matrix.language }}
+        # If you wish to specify custom queries, you can do so here or in a config file.
+        # By default, queries listed here will override any specified in a config file.
+        # Prefix the list here with "+" to use these queries and those in the config file.
+        # queries: ./path/to/local/query, your-org/your-repo/queries@main
+
+    # Autobuild attempts to build any compiled languages  (C/C++, C#, or Java).
+    # If this step fails, then you should remove it and run the build manually (see below)
+    - name: Autobuild
+      uses: github/codeql-action/autobuild@v1
+
+    # ℹ️ Command-line programs to run using the OS shell.
+    # 📚 https://git.io/JvXDl
+
+    # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
+    #    and modify them (or add more) to build your code if your project
+    #    uses a compiled language
+
+    #- run: |
+    #   make bootstrap
+    #   make release
+
+    - name: Perform CodeQL Analysis
+      uses: github/codeql-action/analyze@v1

+ 52 - 0
.github/workflows/validate.yml

@@ -0,0 +1,52 @@
+name: "Validate"
+
+on:
+  pull_request:
+    # The branches below must be a subset of the branches above
+    branches: [ master ] # runs on every push
+
+
+jobs:
+  validate:
+    name: Build and Validate
+    runs-on: ubuntu-latest
+
+    timeout-minutes: 10
+
+    strategy:
+      fail-fast: false
+      matrix:
+        node-version: [14.x]
+
+    steps:
+    - uses: actions/checkout@v1 # checkout latest commit
+    - name: Use Node.js ${{ matrix.node-version }} # set up Node.js
+      uses: actions/setup-node@v1
+      with:
+        node-version: ${{ matrix.node-version }}
+    - name: Clean install of dependencies # runs the npm ci command to install all dependencies
+      run: npm ci
+      env:
+        CI: "true"
+    - name: Validate joke files # validates the joke files
+      run: npm run validate-jokes
+      env:
+        CI: "true"
+    - name: Validate joke IDs # makes sure all jokes have the correct ID
+      run: npm run validate-ids
+      env:
+        CI: "true"
+    - name: Send Discord success notification # sends a Discord notification
+      env:
+        DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+      uses: Ilshidur/action-discord@master
+      with:
+        args: '✅ **JokeAPI CI** (on `{{GITHUB_HEAD_REF}}`) was successful (see https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}})'
+      if: ${{ github.actor != 'dependabot' }} # don't trigger on dependabot PRs since they don't have access to secrets
+    - name: Send Discord failure notification # sends a Discord notification
+      env:
+        DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
+      uses: Ilshidur/action-discord@master
+      with:
+        args: '🚫 **JokeAPI CI** (on `{{GITHUB_HEAD_REF}}`) has failed (see https://github.com/{{GITHUB_REPOSITORY}}/actions/runs/{{GITHUB_RUN_ID}})'
+      if: ${{ failure() && github.actor != 'dependabot' }} # don't trigger on dependabot PRs since they don't have access to secrets

+ 60 - 0
.vscode/launch.json

@@ -0,0 +1,60 @@
+{
+    // Use IntelliSense to learn about possible attributes.
+    // Hover to view descriptions of existing attributes.
+    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
+    "version": "0.2.0",
+    "configurations": [
+        {
+            "type": "node",
+            "request": "launch",
+            "name": "JokeAPI",
+            "skipFiles": [
+                "<node_internals>/**"
+            ],
+            "program": "${workspaceFolder}/JokeAPI.js",
+            "args": [
+                "--trace-deprecation"
+            ]
+        },
+        {
+            "program": "${workspaceFolder}/tools/test.js",
+            "name": "Unit Tests",
+            "request": "launch",
+            "type": "node",
+            "skipFiles": [
+                "<node_internals>/**"
+            ],
+            "args": [
+                "--trace-deprecation"
+            ],
+            "console": "integratedTerminal"
+        },
+        {
+            "program": "${workspaceFolder}/tools/info.js",
+            "name": "Tools/xy",
+            "request": "launch",
+            "type": "node",
+            "skipFiles": [
+                "<node_internals>/**"
+            ],
+            "args": [
+                "--trace-deprecation"
+            ],
+            "console": "integratedTerminal"
+        },
+        {
+            "program": "${workspaceFolder}/tools/cli.js",
+            "name": "CLI",
+            "request": "launch",
+            "type": "node",
+            "skipFiles": [
+                "<node_internals>/**"
+            ],
+            "args": [
+                "--trace-deprecation"
+            ],
+            "console": "integratedTerminal"
+        }
+    ],
+    "debug.javascript.usePreview": true
+}

+ 56 - 0
.vscode/settings.json

@@ -0,0 +1,56 @@
+{
+    "highlight.regexes": { // REQUIRES EXTENSION: fabiospampinato.vscode-highlight
+        "(((jsl|scl)\\.)?unused\\([a-zA-Z_,\\[\\]\\s\\-\":.]+\\);*)": [ // jsl.unused([some_var, some_other_var]); or scl.unused(xy);
+            {
+                "backgroundColor": "rgba(0, 0, 0, 0.2)",
+                "color": "#f88"
+            }
+        ],
+        "(#MARKER)": [ // #MARKER test
+            {
+                "backgroundColor": "#f41",
+                "color": "#fff",
+                "isWholeLine": true,
+                "overviewRulerColor": "#f41"
+            }
+        ],
+        "(#SECTION ([^\\S\\r\\n]*[\\w,.\\-_]+)*[:]*)": [ // #SECTION test, 123
+            {
+                "backgroundColor": "#44f",
+                "color": "white",
+                "overviewRulerColor": "#44f"
+            }
+        ],
+        "(#DEBUG#)": [ // #DEBUG#
+            {
+                "backgroundColor": "#ff0",
+                "color": "blue",
+                "overviewRulerColor": "#ff0"
+            }
+        ],
+        "(<!--%#INSERT:[a-zA-Z0-9\\-]+#%-->|<!--%#INJECT:[a-zA-Z0-9\\-]+#%-->)": [ // <!--%#INSERT:TEST#%--> / <!--%#INJECT:TEST#%-->
+            {
+                "color": "orange",
+                "fontStyle": "italic",
+                "outline": "1px solid orange"
+            }
+        ],
+        "(<%#INSERT:[a-zA-Z0-9\\-]+#%>|<%#INJECT:[a-zA-Z0-9\\-]+#%>)": [ // <%#INSERT:TEST#%> / <%#INJECT:TEST#%>
+            {
+                "color": "orange",
+                "fontStyle": "italic",
+                "outline": "1px solid orange"
+            }
+        ],
+    },
+    "npm-scripts.showStartNotification": false,
+
+    // JokeAPI-specific:
+
+    "files.exclude": {         // hide files so they can't be opened in the IDE
+        "docs/compiled": true, // to prevent accidentally changing the compiled documentation to only have it be overridden after the next compile
+        "dev/madge": true,     // the files don't need to be modified, they only serve as a distraction
+    },
+
+    "deno.enable": false
+}