From bc45edd2d35ad7b534cf20635e792602dee9faae Mon Sep 17 00:00:00 2001 From: Roman Khabarov Date: Sat, 1 Jun 2024 10:46:18 +0200 Subject: [PATCH] chore(fix) add docs --- docs/.editorconfig | 19 + docs/.env.example | 1 + docs/.gitattributes | 4 + docs/.gitignore | 51 + docs/.prettierrc | 7 + docs/Dockerfile | 14 + docs/LICENSE | 21 + docs/README.md | 54 + docs/babel.config.js | 3 + docs/content/assets/.gitkeep | 0 docs/content/contributing/_category_.yml | 4 + docs/content/contributing/code-of-conduct.md | 69 + .../content/contributing/commit-convention.md | 71 + .../contributing/contribution-guide.md | 31 + docs/content/contributing/funding.md | 17 + docs/content/getting-started.md | 127 + docs/content/interactions/_category_.yml | 4 + docs/content/interactions/context-menus.md | 65 + .../interactions/message-components.md | 324 + docs/content/interactions/modals.md | 62 + docs/content/interactions/slash-commands.md | 231 + docs/content/interceptors/_category_.yml | 4 + .../content/interceptors/defer-interceptor.md | 33 + docs/content/intro.md | 102 + docs/content/listeners.md | 217 + docs/content/recipes/_category_.yml | 4 + docs/content/recipes/localization.md | 242 + docs/content/recipes/pagination.md | 87 + docs/content/recipes/stat-reporter.md | 58 + docs/content/techniques/_category_.yml | 4 + .../content/techniques/async-configuration.md | 100 + docs/content/techniques/client-providers.md | 40 + docs/content/techniques/sharding.md | 99 + .../techniques/standalone-application.md | 33 + docs/content/techniques/validation.md | 89 + docs/content/text-commands.md | 63 + docs/docker-compose.yml | 12 + docs/docusaurus.config.js | 201 + docs/package.json | 51 + docs/pnpm-lock.yaml | 11439 ++++++++++++++++ docs/sidebars.js | 33 + docs/static/.nojekyll | 0 docs/static/CNAME | 1 + docs/static/img/content/button.png | Bin 0 -> 17256 bytes docs/static/img/content/context_message.png | Bin 0 -> 10873 bytes docs/static/img/content/context_user.png | Bin 0 -> 12593 bytes docs/static/img/content/modal.png | Bin 0 -> 33168 bytes docs/static/img/content/select-menu.png | Bin 0 -> 42244 bytes .../img/content/slash_command_example.png | Bin 0 -> 11091 bytes .../static/img/content/slash_command_menu.png | Bin 0 -> 108203 bytes docs/static/img/content/text_command.png | Bin 0 -> 38825 bytes docs/static/img/favicon.ico | Bin 0 -> 15406 bytes docs/static/img/icons/icon-128x128.png | Bin 0 -> 6003 bytes docs/static/img/icons/icon-144x144.png | Bin 0 -> 7353 bytes docs/static/img/icons/icon-152x152.png | Bin 0 -> 8047 bytes docs/static/img/icons/icon-192x192.png | Bin 0 -> 12201 bytes docs/static/img/icons/icon-384x384.png | Bin 0 -> 42908 bytes docs/static/img/icons/icon-512x512.png | Bin 0 -> 74428 bytes docs/static/img/icons/icon-72x72.png | Bin 0 -> 2508 bytes docs/static/img/icons/icon-96x96.png | Bin 0 -> 3811 bytes docs/static/img/logo-small.png | Bin 0 -> 74428 bytes docs/static/img/logo.png | Bin 0 -> 3915 bytes docs/static/img/logo.svg | 35 + docs/static/manifest.json | 58 + docs/static/robots.txt | 5 + docs/styles/custom.scss | 146 + docs/tsconfig.json | 7 + 67 files changed, 14342 insertions(+) create mode 100644 docs/.editorconfig create mode 100644 docs/.env.example create mode 100644 docs/.gitattributes create mode 100644 docs/.gitignore create mode 100644 docs/.prettierrc create mode 100644 docs/Dockerfile create mode 100644 docs/LICENSE create mode 100644 docs/README.md create mode 100644 docs/babel.config.js create mode 100644 docs/content/assets/.gitkeep create mode 100644 docs/content/contributing/_category_.yml create mode 100644 docs/content/contributing/code-of-conduct.md create mode 100644 docs/content/contributing/commit-convention.md create mode 100644 docs/content/contributing/contribution-guide.md create mode 100644 docs/content/contributing/funding.md create mode 100644 docs/content/getting-started.md create mode 100644 docs/content/interactions/_category_.yml create mode 100644 docs/content/interactions/context-menus.md create mode 100644 docs/content/interactions/message-components.md create mode 100644 docs/content/interactions/modals.md create mode 100644 docs/content/interactions/slash-commands.md create mode 100644 docs/content/interceptors/_category_.yml create mode 100644 docs/content/interceptors/defer-interceptor.md create mode 100644 docs/content/intro.md create mode 100644 docs/content/listeners.md create mode 100644 docs/content/recipes/_category_.yml create mode 100644 docs/content/recipes/localization.md create mode 100644 docs/content/recipes/pagination.md create mode 100644 docs/content/recipes/stat-reporter.md create mode 100644 docs/content/techniques/_category_.yml create mode 100644 docs/content/techniques/async-configuration.md create mode 100644 docs/content/techniques/client-providers.md create mode 100644 docs/content/techniques/sharding.md create mode 100644 docs/content/techniques/standalone-application.md create mode 100644 docs/content/techniques/validation.md create mode 100644 docs/content/text-commands.md create mode 100644 docs/docker-compose.yml create mode 100644 docs/docusaurus.config.js create mode 100644 docs/package.json create mode 100644 docs/pnpm-lock.yaml create mode 100644 docs/sidebars.js create mode 100644 docs/static/.nojekyll create mode 100644 docs/static/CNAME create mode 100644 docs/static/img/content/button.png create mode 100644 docs/static/img/content/context_message.png create mode 100644 docs/static/img/content/context_user.png create mode 100644 docs/static/img/content/modal.png create mode 100644 docs/static/img/content/select-menu.png create mode 100644 docs/static/img/content/slash_command_example.png create mode 100644 docs/static/img/content/slash_command_menu.png create mode 100644 docs/static/img/content/text_command.png create mode 100644 docs/static/img/favicon.ico create mode 100644 docs/static/img/icons/icon-128x128.png create mode 100644 docs/static/img/icons/icon-144x144.png create mode 100644 docs/static/img/icons/icon-152x152.png create mode 100644 docs/static/img/icons/icon-192x192.png create mode 100644 docs/static/img/icons/icon-384x384.png create mode 100644 docs/static/img/icons/icon-512x512.png create mode 100644 docs/static/img/icons/icon-72x72.png create mode 100644 docs/static/img/icons/icon-96x96.png create mode 100644 docs/static/img/logo-small.png create mode 100644 docs/static/img/logo.png create mode 100644 docs/static/img/logo.svg create mode 100644 docs/static/manifest.json create mode 100644 docs/static/robots.txt create mode 100644 docs/styles/custom.scss create mode 100644 docs/tsconfig.json diff --git a/docs/.editorconfig b/docs/.editorconfig new file mode 100644 index 0000000..ea6cdde --- /dev/null +++ b/docs/.editorconfig @@ -0,0 +1,19 @@ +# editorconfig.org +root = true + +[*] +end_of_line = lf +indent_style = tab +charset = utf-8 +trim_trailing_whitespace = true +insert_final_newline = true +indent_size = 4 +max_line_length = 140 + +[*.{yaml, yml}] +indent_style = space +indent_size = 2 + +[*.md] +indent_style = space +trim_trailing_whitespace = false diff --git a/docs/.env.example b/docs/.env.example new file mode 100644 index 0000000..ef5adb7 --- /dev/null +++ b/docs/.env.example @@ -0,0 +1 @@ +EXPOSED_DOCUSAURUS_PORT=3000 diff --git a/docs/.gitattributes b/docs/.gitattributes new file mode 100644 index 0000000..22a11fb --- /dev/null +++ b/docs/.gitattributes @@ -0,0 +1,4 @@ +yarn.lock -diff -merge +yarn.lock linguist-generated=true +* text eol=lf +*.png binary diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..8e229e2 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,51 @@ +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* + +# Tests +/coverage +/.nyc_output + +# IDEs and editors +.vscode +.idea +.project +.classpath +.c9/ +*.launch +.settings/ +*.sublime-workspace + +# IDE - VSCode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# Dependencies +/node_modules + +# Production +/build + +# Generated files +.docusaurus +.cache-loader + +# Misc +.DS_Store +.env.local +.env.development.local +.env.test.local +.env.production.local + +# Lockfile for other package managers +yarn.locl + +# Docker .env file +.env diff --git a/docs/.prettierrc b/docs/.prettierrc new file mode 100644 index 0000000..d07db92 --- /dev/null +++ b/docs/.prettierrc @@ -0,0 +1,7 @@ +{ + "trailingComma": "none", + "singleQuote": true, + "arrowParens": "avoid", + "endOfLine": "auto", + "printWidth": 100 +} diff --git a/docs/Dockerfile b/docs/Dockerfile new file mode 100644 index 0000000..b688b97 --- /dev/null +++ b/docs/Dockerfile @@ -0,0 +1,14 @@ +# Base +FROM node:18 as base + +## Set a default workdir that's easy to remember/use +WORKDIR /opt/app + +## Expose docusaurus default serve port +EXPOSE 3000 + +## Install docusaurus globally +RUN yarn global add docusaurus + +## Set yarn as entrypoint +ENTRYPOINT [ "yarn" ] diff --git a/docs/LICENSE b/docs/LICENSE new file mode 100644 index 0000000..87fdf67 --- /dev/null +++ b/docs/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2003 GlobalArt Inc + +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. diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 0000000..a1cdaf1 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,54 @@ +
+

+ NestCord Logo +

+ 🤖 A module for creating Discord bots using NestJS, based on Discord.js +

+ Documentation ✨Source code 🪡Examples 🛠️Community 💬 +
+ + +
+ +

+ NPM Version + NPM License + NPM Downloads + Last commit +

+ + +## About + +This package uses the best of the NodeJS world under the hood. [Discord.js](https://github.com/discordjs/discord.js) is the most powerful +library for creating bots and [Nest.js](https://github.com/nestjs) is a progressive framework for creating well-architectured applications. +This module provides fast and easy way for creating Discord bots and deep integration with your NestJS application. + +**Features** + +- Simple. Flexible. Easy to use. +- Ability to create custom decorators. +- Interact with Discord (Slash Commands, Context Menus, Message Components, Listeners). +- Full support of NestJS guards, interceptors, filters and pipes! + +For questions and support please use +the [Issues](https://github.com/GlobalArtInc/nestcord/issues/new?assignees=&labels=question&template=question.yml). + + +## How to update documentation? + +This documentation is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. + +### Installation + +``` +$ yarn +``` + +### Local Development + +``` +$ yarn start +``` + +This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. diff --git a/docs/babel.config.js b/docs/babel.config.js new file mode 100644 index 0000000..e00595d --- /dev/null +++ b/docs/babel.config.js @@ -0,0 +1,3 @@ +module.exports = { + presets: [require.resolve('@docusaurus/core/lib/babel/preset')], +}; diff --git a/docs/content/assets/.gitkeep b/docs/content/assets/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/docs/content/contributing/_category_.yml b/docs/content/contributing/_category_.yml new file mode 100644 index 0000000..a86ae05 --- /dev/null +++ b/docs/content/contributing/_category_.yml @@ -0,0 +1,4 @@ +label: 'Contributing' +position: 99 +collapsible: true +collapsed: false diff --git a/docs/content/contributing/code-of-conduct.md b/docs/content/contributing/code-of-conduct.md new file mode 100644 index 0000000..a44fb36 --- /dev/null +++ b/docs/content/contributing/code-of-conduct.md @@ -0,0 +1,69 @@ +--- +id: code-of-conduct + +title: Code of Conduct + +sidebar_position: 2 +--- + +# 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. + +## 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/ diff --git a/docs/content/contributing/commit-convention.md b/docs/content/contributing/commit-convention.md new file mode 100644 index 0000000..80cf861 --- /dev/null +++ b/docs/content/contributing/commit-convention.md @@ -0,0 +1,71 @@ +--- +id: commit-convention + +title: Commit convention + +sidebar_position: 3 +--- + +## Git Commit Message Convention + +:::info + +This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular). + +::: + +#### TL;DR: + +Commit titles must match the following regex: + +```js +/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/; +``` + +### Full Message Format + +A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**: + +``` +(): + + + +