Compare commits
4 Commits
@discordjs
...
11.6.3
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
de0cacdf32 | ||
|
|
bb4cb3e7fe | ||
|
|
08865a98cd | ||
|
|
20075e306b |
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/commitlintrc.json",
|
|
||||||
"extends": ["@commitlint/config-angular"],
|
|
||||||
"rules": {
|
|
||||||
"type-enum": [
|
|
||||||
2,
|
|
||||||
"always",
|
|
||||||
["chore", "build", "ci", "docs", "feat", "fix", "perf", "refactor", "revert", "style", "test", "types", "typings"]
|
|
||||||
],
|
|
||||||
"scope-case": [0]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,67 +0,0 @@
|
|||||||
# Packages
|
|
||||||
**/node_modules
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
**/logs
|
|
||||||
**/*.log
|
|
||||||
**/npm-debug.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
**/pids
|
|
||||||
**/*.pid
|
|
||||||
**/*.seed
|
|
||||||
|
|
||||||
# Env
|
|
||||||
**/.env
|
|
||||||
|
|
||||||
# Dist
|
|
||||||
**/dist/
|
|
||||||
**/dist-docs/
|
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
**/.tmp
|
|
||||||
**/.vscode
|
|
||||||
**/.idea
|
|
||||||
**/.DS_Store
|
|
||||||
**/.turbo
|
|
||||||
**/tsconfig.tsbuildinfo
|
|
||||||
**/coverage
|
|
||||||
**/__tests__
|
|
||||||
**/out
|
|
||||||
|
|
||||||
# yarn
|
|
||||||
.pnp.*
|
|
||||||
.yarn/*
|
|
||||||
!.yarn/patches
|
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/releases
|
|
||||||
!.yarn/sdks
|
|
||||||
!.yarn/versions
|
|
||||||
|
|
||||||
# Cache
|
|
||||||
**/.prettiercache
|
|
||||||
**/.eslintcache
|
|
||||||
**/.vercel
|
|
||||||
|
|
||||||
# Docker specific
|
|
||||||
**/.cliff-jumperrc.json
|
|
||||||
**/api-extractor.json
|
|
||||||
**/api-extractor-docs.json
|
|
||||||
**/.eslintignore
|
|
||||||
**/.eslintrc.json
|
|
||||||
**/.lintstagedrc.js
|
|
||||||
**/.lintstagedrc.cjs
|
|
||||||
**/.lintstagedrc.json
|
|
||||||
**/.prettierignore
|
|
||||||
**/.prettierrc.js
|
|
||||||
**/.prettierrc.cjs
|
|
||||||
**/.prettierrc.json
|
|
||||||
**/cliff.toml
|
|
||||||
**/CHANGELOG.md
|
|
||||||
**/README.md
|
|
||||||
**/LICENSE
|
|
||||||
**/tsconfig.eslint.json
|
|
||||||
**/tsconfig.docs.json
|
|
||||||
**/docs/
|
|
||||||
**/vitest.config.ts
|
|
||||||
|
|
||||||
151
.eslintrc.json
Normal file
@@ -0,0 +1,151 @@
|
|||||||
|
{
|
||||||
|
"extends": "eslint:recommended",
|
||||||
|
"parserOptions": {
|
||||||
|
"ecmaVersion": 6
|
||||||
|
},
|
||||||
|
"env": {
|
||||||
|
"es6": true,
|
||||||
|
"node": true
|
||||||
|
},
|
||||||
|
"rules": {
|
||||||
|
"no-await-in-loop": "warn",
|
||||||
|
"no-compare-neg-zero": "error",
|
||||||
|
"no-extra-parens": ["warn", "all", {
|
||||||
|
"nestedBinaryExpressions": false
|
||||||
|
}],
|
||||||
|
"no-template-curly-in-string": "error",
|
||||||
|
"no-unsafe-negation": "error",
|
||||||
|
"valid-jsdoc": ["error", {
|
||||||
|
"requireReturn": false,
|
||||||
|
"requireReturnDescription": false,
|
||||||
|
"prefer": {
|
||||||
|
"return": "returns",
|
||||||
|
"arg": "param"
|
||||||
|
},
|
||||||
|
"preferType": {
|
||||||
|
"String": "string",
|
||||||
|
"Number": "number",
|
||||||
|
"Boolean": "boolean",
|
||||||
|
"Symbol": "symbol",
|
||||||
|
"object": "Object",
|
||||||
|
"function": "Function",
|
||||||
|
"array": "Array",
|
||||||
|
"date": "Date",
|
||||||
|
"error": "Error",
|
||||||
|
"null": "void"
|
||||||
|
}
|
||||||
|
}],
|
||||||
|
|
||||||
|
"accessor-pairs": "warn",
|
||||||
|
"array-callback-return": "error",
|
||||||
|
"complexity": "warn",
|
||||||
|
"consistent-return": "error",
|
||||||
|
"curly": ["error", "multi-line", "consistent"],
|
||||||
|
"dot-location": ["error", "property"],
|
||||||
|
"dot-notation": "error",
|
||||||
|
"eqeqeq": "error",
|
||||||
|
"no-empty-function": "error",
|
||||||
|
"no-floating-decimal": "error",
|
||||||
|
"no-implied-eval": "error",
|
||||||
|
"no-invalid-this": "error",
|
||||||
|
"no-lone-blocks": "error",
|
||||||
|
"no-multi-spaces": "error",
|
||||||
|
"no-new-func": "error",
|
||||||
|
"no-new-wrappers": "error",
|
||||||
|
"no-new": "error",
|
||||||
|
"no-octal-escape": "error",
|
||||||
|
"no-return-assign": "error",
|
||||||
|
"no-return-await": "error",
|
||||||
|
"no-self-compare": "error",
|
||||||
|
"no-sequences": "error",
|
||||||
|
"no-throw-literal": "error",
|
||||||
|
"no-unmodified-loop-condition": "error",
|
||||||
|
"no-unused-expressions": "error",
|
||||||
|
"no-useless-call": "error",
|
||||||
|
"no-useless-concat": "error",
|
||||||
|
"no-useless-escape": "error",
|
||||||
|
"no-useless-return": "error",
|
||||||
|
"no-void": "error",
|
||||||
|
"no-warning-comments": "warn",
|
||||||
|
"prefer-promise-reject-errors": "error",
|
||||||
|
"require-await": "warn",
|
||||||
|
"wrap-iife": "error",
|
||||||
|
"yoda": "error",
|
||||||
|
|
||||||
|
"no-label-var": "error",
|
||||||
|
"no-shadow": "error",
|
||||||
|
"no-undef-init": "error",
|
||||||
|
|
||||||
|
"callback-return": "error",
|
||||||
|
"getter-return": "off",
|
||||||
|
"handle-callback-err": "error",
|
||||||
|
"no-mixed-requires": "error",
|
||||||
|
"no-new-require": "error",
|
||||||
|
"no-path-concat": "error",
|
||||||
|
|
||||||
|
"array-bracket-spacing": "error",
|
||||||
|
"block-spacing": "error",
|
||||||
|
"brace-style": ["error", "1tbs", { "allowSingleLine": true }],
|
||||||
|
"capitalized-comments": ["error", "always", { "ignoreConsecutiveComments": true }],
|
||||||
|
"comma-dangle": ["error", "always-multiline"],
|
||||||
|
"comma-spacing": "error",
|
||||||
|
"comma-style": "error",
|
||||||
|
"computed-property-spacing": "error",
|
||||||
|
"consistent-this": ["error", "$this"],
|
||||||
|
"eol-last": "error",
|
||||||
|
"func-names": "error",
|
||||||
|
"func-name-matching": "error",
|
||||||
|
"func-style": ["error", "declaration", { "allowArrowFunctions": true }],
|
||||||
|
"indent": ["error", 2, { "SwitchCase": 1 }],
|
||||||
|
"key-spacing": "error",
|
||||||
|
"keyword-spacing": "error",
|
||||||
|
"max-depth": "error",
|
||||||
|
"max-len": ["error", 120, 2],
|
||||||
|
"max-nested-callbacks": ["error", { "max": 4 }],
|
||||||
|
"max-statements-per-line": ["error", { "max": 2 }],
|
||||||
|
"new-cap": "off",
|
||||||
|
"newline-per-chained-call": ["error", { "ignoreChainWithDepth": 3 }],
|
||||||
|
"no-array-constructor": "error",
|
||||||
|
"no-inline-comments": "error",
|
||||||
|
"no-lonely-if": "error",
|
||||||
|
"no-mixed-operators": "error",
|
||||||
|
"no-multiple-empty-lines": ["error", { "max": 2, "maxEOF": 1, "maxBOF": 0 }],
|
||||||
|
"no-new-object": "error",
|
||||||
|
"no-spaced-func": "error",
|
||||||
|
"no-trailing-spaces": "error",
|
||||||
|
"no-unneeded-ternary": "error",
|
||||||
|
"no-whitespace-before-property": "error",
|
||||||
|
"nonblock-statement-body-position": "error",
|
||||||
|
"object-curly-spacing": ["error", "always"],
|
||||||
|
"operator-assignment": "error",
|
||||||
|
"operator-linebreak": ["error", "after"],
|
||||||
|
"padded-blocks": ["error", "never"],
|
||||||
|
"quote-props": ["error", "as-needed"],
|
||||||
|
"quotes": ["error", "single", { "avoidEscape": true, "allowTemplateLiterals": true }],
|
||||||
|
"semi-spacing": "error",
|
||||||
|
"semi": "error",
|
||||||
|
"space-before-blocks": "error",
|
||||||
|
"space-before-function-paren": ["error", "never"],
|
||||||
|
"space-in-parens": "error",
|
||||||
|
"space-infix-ops": "error",
|
||||||
|
"space-unary-ops": "error",
|
||||||
|
"spaced-comment": "error",
|
||||||
|
"template-tag-spacing": "error",
|
||||||
|
"unicode-bom": "error",
|
||||||
|
|
||||||
|
"arrow-body-style": "error",
|
||||||
|
"arrow-parens": ["error", "as-needed"],
|
||||||
|
"arrow-spacing": "error",
|
||||||
|
"no-duplicate-imports": "error",
|
||||||
|
"no-useless-computed-key": "error",
|
||||||
|
"no-useless-constructor": "error",
|
||||||
|
"prefer-arrow-callback": "error",
|
||||||
|
"prefer-numeric-literals": "error",
|
||||||
|
"prefer-rest-params": "error",
|
||||||
|
"prefer-spread": "error",
|
||||||
|
"prefer-template": "error",
|
||||||
|
"rest-spread-spacing": "error",
|
||||||
|
"template-curly-spacing": "error",
|
||||||
|
"yield-star-spacing": "error"
|
||||||
|
}
|
||||||
|
}
|
||||||
1
.gitattributes
vendored
@@ -1,2 +1 @@
|
|||||||
* text=auto eol=lf
|
* text=auto eol=lf
|
||||||
pnpm-lock.yaml linguist-generated=true text=auto eol=lf
|
|
||||||
|
|||||||
11
.github/.kodiak.toml
vendored
@@ -1,11 +0,0 @@
|
|||||||
version = 1
|
|
||||||
|
|
||||||
[merge]
|
|
||||||
require_automerge_label = false
|
|
||||||
blocking_labels = ['blocked', 'in review']
|
|
||||||
method = 'squash'
|
|
||||||
|
|
||||||
[merge.message]
|
|
||||||
title = 'pull_request_title'
|
|
||||||
strip_html_comments = true
|
|
||||||
include_coauthors = true
|
|
||||||
28
.github/CODEOWNERS
vendored
@@ -1,28 +0,0 @@
|
|||||||
# Learn how to add code owners here:
|
|
||||||
# https://help.github.com/en/articles/about-code-owners
|
|
||||||
|
|
||||||
* @iCrawl
|
|
||||||
|
|
||||||
/apps/guide/ @discordjs/website @discordjs/guide
|
|
||||||
/apps/guide/src/content/ @discordjs/guide
|
|
||||||
/apps/website/ @discordjs/website
|
|
||||||
|
|
||||||
/packages/actions/ @discordjs/actions
|
|
||||||
/packages/api-extractor-utils/ @discordjs/api-extractor-utils
|
|
||||||
/packages/brokers/ @discordjs/brokers
|
|
||||||
/packages/builders/ @discordjs/builders
|
|
||||||
/packages/collection/ @discordjs/collection
|
|
||||||
/packages/core/ @discordjs/core
|
|
||||||
/packages/create-discord-bot/ @discordjs/guide
|
|
||||||
/packages/discord.js/ @discordjs/core
|
|
||||||
/packages/docgen/ @iCrawl
|
|
||||||
/packages/formatters/ @discordjs/formatters
|
|
||||||
/packages/next/ @discordjs/core
|
|
||||||
/packages/proxy/ @discordjs/proxy
|
|
||||||
/packages/proxy-container/ @discordjs/proxy
|
|
||||||
/packages/rest/ @discordjs/rest
|
|
||||||
/packages/scripts/ @discordjs/scripts
|
|
||||||
/packages/ui/ @discordjs/ui
|
|
||||||
/packages/util/ @discordjs/util
|
|
||||||
/packages/voice/ @discordjs/core
|
|
||||||
/packages/ws/ @discordjs/ws
|
|
||||||
76
.github/CODE_OF_CONDUCT.md
vendored
@@ -1,76 +0,0 @@
|
|||||||
# Contributor Covenant Code of Conduct
|
|
||||||
|
|
||||||
## Our Pledge
|
|
||||||
|
|
||||||
In the interest of fostering an open and welcoming environment, we as
|
|
||||||
contributors and maintainers pledge to make 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.
|
|
||||||
|
|
||||||
## 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 within all project spaces, and it also applies when
|
|
||||||
an individual is representing the project or its community in public spaces.
|
|
||||||
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.
|
|
||||||
|
|
||||||
## Enforcement
|
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
|
||||||
reported by contacting the project team at https://discord.gg/djs. 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.
|
|
||||||
|
|
||||||
## 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
|
|
||||||
91
.github/COMMIT_CONVENTION.md
vendored
@@ -1,91 +0,0 @@
|
|||||||
## Git Commit Message Convention
|
|
||||||
|
|
||||||
> This is adapted from [Angular's commit convention](https://github.com/conventional-changelog/conventional-changelog/tree/master/packages/conventional-changelog-angular).
|
|
||||||
|
|
||||||
#### TL;DR:
|
|
||||||
|
|
||||||
Messages must be matched by the following regex:
|
|
||||||
|
|
||||||
```js
|
|
||||||
/^(revert: )?(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|types|wip)(\(.+\))?: .{1,72}/;
|
|
||||||
```
|
|
||||||
|
|
||||||
#### Examples
|
|
||||||
|
|
||||||
Appears under "Features" header, `GuildMember` subheader:
|
|
||||||
|
|
||||||
```
|
|
||||||
feat(GuildMember): add 'tag' method
|
|
||||||
```
|
|
||||||
|
|
||||||
Appears under "Bug Fixes" header, `Guild` subheader, with a link to issue #28:
|
|
||||||
|
|
||||||
```
|
|
||||||
fix(Guild): handle events correctly
|
|
||||||
|
|
||||||
close #28
|
|
||||||
```
|
|
||||||
|
|
||||||
Appears under "Performance Improvements" header, and under "Breaking Changes" with the breaking change explanation:
|
|
||||||
|
|
||||||
```
|
|
||||||
perf(core): improve patching by removing 'bar' option
|
|
||||||
|
|
||||||
BREAKING CHANGE: The 'bar' option has been removed.
|
|
||||||
```
|
|
||||||
|
|
||||||
The following commit and commit `667ecc1` do not appear in the changelog if they are under the same release. If not, the revert commit appears under the "Reverts" header.
|
|
||||||
|
|
||||||
```
|
|
||||||
revert: feat(Managers): add Managers
|
|
||||||
|
|
||||||
This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
|
|
||||||
```
|
|
||||||
|
|
||||||
### Full Message Format
|
|
||||||
|
|
||||||
A commit message consists of a **header**, **body** and **footer**. The header has a **type**, **scope** and **subject**:
|
|
||||||
|
|
||||||
```
|
|
||||||
<type>(<scope>): <subject>
|
|
||||||
<BLANK LINE>
|
|
||||||
<body>
|
|
||||||
<BLANK LINE>
|
|
||||||
<footer>
|
|
||||||
```
|
|
||||||
|
|
||||||
The **header** is mandatory and the **scope** of the header is optional.
|
|
||||||
|
|
||||||
### Revert
|
|
||||||
|
|
||||||
If the commit reverts a previous commit, it should begin with `revert:`, followed by the header of the reverted commit. In the body, it should say: `This reverts commit <hash>.`, where the hash is the SHA of the commit being reverted.
|
|
||||||
|
|
||||||
### Type
|
|
||||||
|
|
||||||
If the prefix is `feat`, `fix` or `perf`, it will appear in the changelog. However, if there is any [BREAKING CHANGE](#footer), the commit will always appear in the changelog.
|
|
||||||
|
|
||||||
Other prefixes are up to your discretion. Suggested prefixes are `docs`, `chore`, `style`, `refactor`, and `test` for non-changelog related tasks.
|
|
||||||
|
|
||||||
### Scope
|
|
||||||
|
|
||||||
The scope could be anything specifying the place of the commit change. For example `GuildMember`, `Guild`, `Message`, `TextChannel` etc...
|
|
||||||
|
|
||||||
### Subject
|
|
||||||
|
|
||||||
The subject contains a succinct description of the change:
|
|
||||||
|
|
||||||
- use the imperative, present tense: "change" not "changed" nor "changes"
|
|
||||||
- don't capitalize the first letter
|
|
||||||
- no dot (.) at the end
|
|
||||||
|
|
||||||
### Body
|
|
||||||
|
|
||||||
Just as in the **subject**, use the imperative, present tense: "change" not "changed" nor "changes".
|
|
||||||
The body should include the motivation for the change and contrast this with previous behavior.
|
|
||||||
|
|
||||||
### Footer
|
|
||||||
|
|
||||||
The footer should contain any information about **Breaking Changes** and is also the place to
|
|
||||||
reference GitHub issues that this commit **Closes**.
|
|
||||||
|
|
||||||
**Breaking Changes** should start with the word `BREAKING CHANGE:` with a space or two newlines. The rest of the commit message is then used for this.
|
|
||||||
44
.github/CONTRIBUTING.md
vendored
@@ -1,49 +1,17 @@
|
|||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
**The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the [Discord server](https://discord.gg/djs) instead of opening an issue – you will get redirected there anyway.**
|
**The issue tracker is only for bug reports and enhancement suggestions. If you have a question, please ask it in the [Discord server](https://discord.gg/bRCvFy9) instead of opening an issue – you will get redirected there anyway.**
|
||||||
|
|
||||||
If you wish to contribute to the discord.js codebase or documentation, feel free to fork the repository and submit a
|
If you wish to contribute to the discord.js codebase or documentation, feel free to fork the repository and submit a
|
||||||
pull request. We use ESLint to enforce a consistent coding style, so having that set up in your editor of choice
|
pull request. We use ESLint to enforce a consistent coding style, so having that set up in your editor of choice
|
||||||
is a great boon to your development process.
|
is a great boon to your development process.
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
To get ready to work on the codebase, please do the following:
|
To get ready to work on the codebase, please do the following:
|
||||||
|
|
||||||
1. Fork & clone the repository, and make sure you're on the **main** branch
|
1. Fork & clone the repository, and make sure you're on the **master** branch
|
||||||
2. Run `pnpm install --frozen-lockfile` ([install](https://pnpm.io/installation))
|
2. Run `npm install`
|
||||||
3. Run `pnpm run build` to build local packages
|
3. If you're working on voice, also run `npm install @discordjs/opus` or `npm install opusscript`
|
||||||
4. Code your heart out!
|
4. Code your heart out!
|
||||||
5. Run `pnpm run test` to run ESLint and ensure any JSDoc changes are valid
|
5. Run `npm test` to run ESLint and ensure any JSDoc changes are valid
|
||||||
6. [Submit a pull request](https://github.com/discordjs/discord.js/compare) (Make sure you follow the [conventional commit format](https://github.com/discordjs/discord.js/blob/main/.github/COMMIT_CONVENTION.md))
|
6. [Submit a pull request](https://github.com/discordjs/discord.js/compare)
|
||||||
|
|
||||||
## Testing changes locally
|
|
||||||
|
|
||||||
If you want to test changes you've made locally, you can do so by using `pnpm link <package-you-want-to-link-to-your-current-package>`. This will create a symlink to your local copy of the discord.js libraries.
|
|
||||||
|
|
||||||
1. Create a new directory `mkdir discordjs-test` and move into it `cd discordjs-test`
|
|
||||||
2. Initialize a new pnpm project `pnpm init`
|
|
||||||
3. Now link the discord.js package from the directory you cloned earlier `pnpm link {PATH_TO_DISCORDJS_REPO}/packages/<package>`. (e.g. `pnpm link ~/discord.js/packages/rest`)
|
|
||||||
4. Import the package in your source code and test them out!
|
|
||||||
|
|
||||||
### Working with TypeScript packages
|
|
||||||
|
|
||||||
When testing local changes, you may notice you need to manually recompile TypeScript projects on every change in order to get the latest code changes to test locally.
|
|
||||||
|
|
||||||
To avoid this you can use the `--watch` parameter in the package build script to automatically recompile the project when changes are detected.
|
|
||||||
|
|
||||||
For example, to automatically recompile the `@discordjs/rest` project when changes are detected, run `pnpm turbo run build --filter='@discordjs/rest' -- --watch` in the root folder of where you cloned the discord.js repo.
|
|
||||||
|
|
||||||
## Adding new packages
|
|
||||||
|
|
||||||
If you'd like to create another package under the `@discordjs` organization run the following command:
|
|
||||||
|
|
||||||
```sh
|
|
||||||
pnpm run create-package <package-name> [package-description]
|
|
||||||
```
|
|
||||||
|
|
||||||
This will create new package directory under `packages/` with the required configuration files. You may begin
|
|
||||||
to make changes within the `src/` directory. You may also need to:
|
|
||||||
|
|
||||||
- Update workflows that utilize packages
|
|
||||||
- Update the CODEOWNERS file
|
|
||||||
|
|||||||
2
.github/FUNDING.yml
vendored
@@ -1,2 +0,0 @@
|
|||||||
github: [iCrawl, amishshah, vladfrangu, kyranet]
|
|
||||||
open_collective: discordjs
|
|
||||||
26
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
<!--
|
||||||
|
If you need help with discord.js installation or usage, please go to the discord.js Discord server instead:
|
||||||
|
https://discord.gg/bRCvFy9
|
||||||
|
This issue tracker is only for bug reports and enhancement suggestions. You won't receive any basic help here.
|
||||||
|
-->
|
||||||
|
|
||||||
|
**Please describe the problem you are having in as much detail as possible:**
|
||||||
|
|
||||||
|
|
||||||
|
**Include a reproducible code sample here, if possible:**
|
||||||
|
```js
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
**Further details:**
|
||||||
|
|
||||||
|
- discord.js version:
|
||||||
|
- node.js version:
|
||||||
|
- Operating system:
|
||||||
|
- Priority this issue should have – please be realistic and elaborate if possible:
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Ideally you would also test whether the issue occurs on the latest master branch commit.
|
||||||
|
If you have, please check the following box and insert the hash of the commit you tested:
|
||||||
|
-->
|
||||||
|
- [ ] I have also tested the issue on latest master, commit hash:
|
||||||
139
.github/ISSUE_TEMPLATE/01-package_bug_report.yml
vendored
@@ -1,139 +0,0 @@
|
|||||||
name: Bug report
|
|
||||||
description: Report an issue with discord.js or another package.
|
|
||||||
labels: [bug, need repro]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thank you for filing an issue! If you are here to ask a question, use Discord instead: https://discord.gg/djs
|
|
||||||
|
|
||||||
This issue form is for discord.js, including other packages.
|
|
||||||
- type: dropdown
|
|
||||||
id: package
|
|
||||||
attributes:
|
|
||||||
label: Which package is this bug report for?
|
|
||||||
options:
|
|
||||||
- discord.js
|
|
||||||
- brokers
|
|
||||||
- builders
|
|
||||||
- collection
|
|
||||||
- core
|
|
||||||
- create-discord-bot
|
|
||||||
- formatters
|
|
||||||
- next
|
|
||||||
- proxy
|
|
||||||
- proxy-container
|
|
||||||
- rest
|
|
||||||
- ui
|
|
||||||
- util
|
|
||||||
- voice
|
|
||||||
- ws
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Issue description
|
|
||||||
description: Describe the issue in as much detail as possible.
|
|
||||||
placeholder: |
|
|
||||||
Steps to reproduce with below code sample:
|
|
||||||
1. Do thing
|
|
||||||
2. Do thing in Discord client
|
|
||||||
3. Observe behavior
|
|
||||||
4. See error logs below
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: code_sample
|
|
||||||
attributes:
|
|
||||||
label: Code sample
|
|
||||||
description: |
|
|
||||||
Your code sample should be:
|
|
||||||
1. Minimal - Use as little code as possible that still produces the same problem (and is understandable)
|
|
||||||
2. Complete - Provide all parts someone else needs to reproduce your problem
|
|
||||||
3. Reproducible - Test the code you're about to provide to make sure it reproduces the problem
|
|
||||||
|
|
||||||
This will be automatically formatted into code, so no need for backticks.
|
|
||||||
render: typescript
|
|
||||||
- type: textarea
|
|
||||||
id: versions
|
|
||||||
attributes:
|
|
||||||
label: Versions
|
|
||||||
description: List necessary versions here. This includes your package version, runtime version, operating system etc.
|
|
||||||
placeholder: |
|
|
||||||
- discord.js 14.12.1 (`npm ls discord.js` or another package)
|
|
||||||
- Node.js 16.11.0 (`node --version`)
|
|
||||||
- TypeScript 5.1.6 (`npm ls typescript` if you use it)
|
|
||||||
- macOS Ventura 13.3.1
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: priority
|
|
||||||
attributes:
|
|
||||||
label: Issue priority
|
|
||||||
description: Please be realistic. If you need to elaborate on your reasoning, please use the issue description field above.
|
|
||||||
options:
|
|
||||||
- Low (slightly annoying)
|
|
||||||
- Medium (should be fixed soon)
|
|
||||||
- High (immediate attention needed)
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: partials
|
|
||||||
attributes:
|
|
||||||
label: Which partials do you have configured?
|
|
||||||
description: Check your `Client` constructor for the `partials` key.
|
|
||||||
options:
|
|
||||||
- Not applicable
|
|
||||||
- No Partials
|
|
||||||
- User
|
|
||||||
- Channel
|
|
||||||
- GuildMember
|
|
||||||
- Message
|
|
||||||
- Reaction
|
|
||||||
- GuildScheduledEvent
|
|
||||||
- ThreadMember
|
|
||||||
multiple: true
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: intents
|
|
||||||
attributes:
|
|
||||||
label: Which gateway intents are you subscribing to?
|
|
||||||
description: Check your `Client` constructor for the `intents` key.
|
|
||||||
options:
|
|
||||||
- Not applicable
|
|
||||||
- No Intents
|
|
||||||
- Guilds
|
|
||||||
- GuildMembers
|
|
||||||
- GuildModeration
|
|
||||||
- GuildEmojisAndStickers
|
|
||||||
- GuildIntegrations
|
|
||||||
- GuildWebhooks
|
|
||||||
- GuildInvites
|
|
||||||
- GuildVoiceStates
|
|
||||||
- GuildPresences
|
|
||||||
- GuildMessages
|
|
||||||
- GuildMessageReactions
|
|
||||||
- GuildMessageTyping
|
|
||||||
- DirectMessages
|
|
||||||
- DirectMessageReactions
|
|
||||||
- DirectMessageTyping
|
|
||||||
- MessageContent
|
|
||||||
- GuildScheduledEvents
|
|
||||||
- AutoModerationConfiguration
|
|
||||||
- AutoModerationExecution
|
|
||||||
- GuildMessagePolls
|
|
||||||
- DirectMessagePolls
|
|
||||||
multiple: true
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: input
|
|
||||||
id: dev_release
|
|
||||||
attributes:
|
|
||||||
label: I have tested this issue on a development release
|
|
||||||
placeholder: d23280c (commit hash)
|
|
||||||
description: |
|
|
||||||
The issue might already be fixed in a development release or main. This is not required, but helps us greatly.
|
|
||||||
[discord.js only] To install the latest development release run `npm i discord.js@dev` in your project directory.
|
|
||||||
Run `npm list discord.js` and use the last part of the printed information (`d23280c` for `discord.js@xx.x.x-dev.1530234593.d23280c`)
|
|
||||||
@@ -1,58 +0,0 @@
|
|||||||
name: Websites bug report
|
|
||||||
description: Report an issue with the documentation or guide websites.
|
|
||||||
labels: [bug, need repro]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
Thank you for filing an issue! If you are here to ask a question, use Discord instead: https://discord.gg/djs
|
|
||||||
|
|
||||||
This issue form is for our documentation and guide websites.
|
|
||||||
- type: dropdown
|
|
||||||
id: application
|
|
||||||
attributes:
|
|
||||||
label: Which application is this bug report for?
|
|
||||||
options:
|
|
||||||
- Documentation
|
|
||||||
- Guide
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Issue description
|
|
||||||
description: Describe the issue in as much detail as possible.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: steps_to_reproduce
|
|
||||||
attributes:
|
|
||||||
label: Steps to Reproduce
|
|
||||||
description: What steps must be taken to reproduce this issue?
|
|
||||||
placeholder: |
|
|
||||||
1. Visit a page
|
|
||||||
2. Click a link
|
|
||||||
3. ...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: versions
|
|
||||||
attributes:
|
|
||||||
label: Versions
|
|
||||||
description: List necessary versions here. This includes your browser, operating system etc.
|
|
||||||
placeholder: |
|
|
||||||
- Safari 16.4 (18615.1.26.11.23)
|
|
||||||
- macOS Ventura 13.3.1
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: dropdown
|
|
||||||
id: priority
|
|
||||||
attributes:
|
|
||||||
label: Issue priority
|
|
||||||
description: Please be realistic. If you need to elaborate on your reasoning, please use the issue description field above.
|
|
||||||
options:
|
|
||||||
- Low (slightly annoying)
|
|
||||||
- Medium (should be fixed soon)
|
|
||||||
- High (immediate attention needed)
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
59
.github/ISSUE_TEMPLATE/03-feature_request.yml
vendored
@@ -1,59 +0,0 @@
|
|||||||
name: Feature request
|
|
||||||
description: Request a new feature (discord.js accepts documented features of the official Discord developer API only!)
|
|
||||||
labels: [feature request]
|
|
||||||
body:
|
|
||||||
- type: markdown
|
|
||||||
attributes:
|
|
||||||
value: |
|
|
||||||
We can only implement features that Discord publishes, documents, and merges into the Discord API documentation.
|
|
||||||
We do not implement unreleased features.
|
|
||||||
Use Discord for questions: https://discord.gg/djs
|
|
||||||
- type: dropdown
|
|
||||||
id: application_or_package
|
|
||||||
attributes:
|
|
||||||
label: Which application or package is this feature request for?
|
|
||||||
options:
|
|
||||||
- discord.js
|
|
||||||
- Documentation
|
|
||||||
- Guide
|
|
||||||
- brokers
|
|
||||||
- builders
|
|
||||||
- collection
|
|
||||||
- core
|
|
||||||
- create-discord-bot
|
|
||||||
- formatters
|
|
||||||
- next
|
|
||||||
- proxy
|
|
||||||
- proxy-container
|
|
||||||
- rest
|
|
||||||
- ui
|
|
||||||
- util
|
|
||||||
- voice
|
|
||||||
- ws
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: description
|
|
||||||
attributes:
|
|
||||||
label: Feature
|
|
||||||
description: A clear and concise description of what the problem is, or what feature you want to be implemented.
|
|
||||||
placeholder: I'm always frustrated when..., Discord has recently released..., A good addition would be...
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: solution
|
|
||||||
attributes:
|
|
||||||
label: Ideal solution or implementation
|
|
||||||
description: A clear and concise description of what you want to happen.
|
|
||||||
validations:
|
|
||||||
required: true
|
|
||||||
- type: textarea
|
|
||||||
id: alternatives
|
|
||||||
attributes:
|
|
||||||
label: Alternative solutions or implementations
|
|
||||||
description: A clear and concise description of any alternative solutions or features you have considered.
|
|
||||||
- type: textarea
|
|
||||||
id: additional_context
|
|
||||||
attributes:
|
|
||||||
label: Other context
|
|
||||||
description: Any other context, screenshots, or file uploads that help us understand your feature request.
|
|
||||||
5
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,5 +0,0 @@
|
|||||||
blank_issues_enabled: false
|
|
||||||
contact_links:
|
|
||||||
- name: Discord server
|
|
||||||
url: https://discord.gg/djs
|
|
||||||
about: Please visit our Discord server for questions and support requests.
|
|
||||||
13
.github/PULL_REQUEST_TEMPLATE.md
vendored
@@ -1,12 +1,7 @@
|
|||||||
**Please describe the changes this PR makes and why it should be merged:**
|
**Please describe the changes this PR makes and why it should be merged:**
|
||||||
|
|
||||||
**Status and versioning classification:**
|
|
||||||
|
|
||||||
<!--
|
**Semantic versioning classification:**
|
||||||
Please move lines that apply to you out of the comment:
|
- [ ] This PR changes the library's interface (methods or parameters added)
|
||||||
- Code changes have been tested against the Discord API, or there are no code changes
|
- [ ] This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
|
||||||
- I know how to update typings and have done so, or typings don't need updating
|
- [ ] This PR **only** includes non-code changes, like changes to documentation, README, etc.
|
||||||
- This PR changes the library's interface (methods or parameters added)
|
|
||||||
- This PR includes breaking changes (methods removed or renamed, parameters moved or removed)
|
|
||||||
- This PR **only** includes non-code changes, like changes to documentation, README, etc.
|
|
||||||
-->
|
|
||||||
|
|||||||
7
.github/SUPPORT.md
vendored
@@ -1,7 +0,0 @@
|
|||||||
# Seeking support?
|
|
||||||
|
|
||||||
We only use this issue tracker for bug reports and feature request. We are not able to provide general support or answer questions in the form of GitHub issues.
|
|
||||||
|
|
||||||
For general questions about discord.js installation and use please use the dedicated support channels in our Discord server: https://discord.gg/djs
|
|
||||||
|
|
||||||
Any issues that don't directly involve a bug or a feature request will likely be closed and redirected.
|
|
||||||
51
.github/issue-labeler.yml
vendored
@@ -1,51 +0,0 @@
|
|||||||
apps:guide:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nGuide\\n"
|
|
||||||
apps:website:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nDocumentation\\n"
|
|
||||||
packages:brokers:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nbrokers\\n"
|
|
||||||
packages:builders:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nbuilders\\n"
|
|
||||||
packages:collection:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\ncollection\\n"
|
|
||||||
packages:core:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\ncore\\n"
|
|
||||||
packages:create-discord-bot:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\ncreate-discord-bot\\n"
|
|
||||||
packages:discord.js:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\ndiscord.js\\n"
|
|
||||||
packages:formatters:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nformatters\\n"
|
|
||||||
packages:next:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nnext\\n"
|
|
||||||
packages:proxy:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nproxy\\n"
|
|
||||||
packages:proxy-container:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nproxy-container\\n"
|
|
||||||
packages:rest:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nrest\\n"
|
|
||||||
packages:ui:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\ui\\n"
|
|
||||||
packages:util:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\util\\n"
|
|
||||||
packages:voice:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nvoice\\n"
|
|
||||||
packages:ws:
|
|
||||||
- "### Which (application|package|application or package) is this (bug
|
|
||||||
report|feature request) for\\?\\n\\nws\\n"
|
|
||||||
60
.github/labeler.yml
vendored
@@ -1,60 +0,0 @@
|
|||||||
apps:guide:
|
|
||||||
- apps/guide/*
|
|
||||||
- apps/guide/**/*
|
|
||||||
apps:website:
|
|
||||||
- apps/website/*
|
|
||||||
- apps/website/**/*
|
|
||||||
packages:api-extractor:
|
|
||||||
- packages/api-extractor/*
|
|
||||||
- packages/api-extractor/**/*
|
|
||||||
packages:api-extractor-model:
|
|
||||||
- packages/api-extractor-model/*
|
|
||||||
- packages/api-extractor-model/**/*
|
|
||||||
packages:brokers:
|
|
||||||
- packages/brokers/*
|
|
||||||
- packages/brokers/**/*
|
|
||||||
packages:builders:
|
|
||||||
- packages/builders/*
|
|
||||||
- packages/builders/**/*
|
|
||||||
packages:collection:
|
|
||||||
- packages/collection/*
|
|
||||||
- packages/collection/**/*
|
|
||||||
packages:core:
|
|
||||||
- packages/core/*
|
|
||||||
- packages/core/**/*
|
|
||||||
packages:create-discord-bot:
|
|
||||||
- packages/create-discord-bot/*
|
|
||||||
- packages/create-discord-bot/**/*
|
|
||||||
packages:discord.js:
|
|
||||||
- packages/discord.js/*
|
|
||||||
- packages/discord.js/**/*
|
|
||||||
packages:docgen:
|
|
||||||
- packages/docgen/*
|
|
||||||
- packages/docgen/**/*
|
|
||||||
packages:formatters:
|
|
||||||
- packages/formatters/*
|
|
||||||
- packages/formatters/**/*
|
|
||||||
packages:next:
|
|
||||||
- packages/next/*
|
|
||||||
- packages/next/**/*
|
|
||||||
packages:proxy:
|
|
||||||
- packages/proxy/*
|
|
||||||
- packages/proxy/**/*
|
|
||||||
packages:proxy-container:
|
|
||||||
- packages/proxy-container/*
|
|
||||||
- packages/proxy-container/**/*
|
|
||||||
packages:rest:
|
|
||||||
- packages/rest/*
|
|
||||||
- packages/rest/**/*
|
|
||||||
packages:ui:
|
|
||||||
- packages/ui/*
|
|
||||||
- packages/ui/**/*
|
|
||||||
packages:util:
|
|
||||||
- packages/util/*
|
|
||||||
- packages/util/**/*
|
|
||||||
packages:voice:
|
|
||||||
- packages/voice/*
|
|
||||||
- packages/voice/**/*
|
|
||||||
packages:ws:
|
|
||||||
- packages/ws/*
|
|
||||||
- packages/ws/**/*
|
|
||||||
124
.github/labels.yml
vendored
@@ -1,124 +0,0 @@
|
|||||||
- name: api changes
|
|
||||||
color: '5663e9'
|
|
||||||
- name: api support
|
|
||||||
color: '5663e9'
|
|
||||||
- name: apps:guide
|
|
||||||
color: fbca04
|
|
||||||
- name: apps:website
|
|
||||||
color: fbca04
|
|
||||||
- name: backlog
|
|
||||||
color: 7ef7ef
|
|
||||||
- name: backport
|
|
||||||
color: 88aabb
|
|
||||||
- name: blocked
|
|
||||||
color: fc1423
|
|
||||||
- name: bug
|
|
||||||
color: d73a4a
|
|
||||||
- name: caching
|
|
||||||
color: 80c042
|
|
||||||
- name: chore
|
|
||||||
color: ffffff
|
|
||||||
- name: ci
|
|
||||||
color: 0075ca
|
|
||||||
- name: dependencies
|
|
||||||
color: 276bd1
|
|
||||||
- name: discord
|
|
||||||
color: '5663e9'
|
|
||||||
- name: discussion
|
|
||||||
color: b6b1f9
|
|
||||||
- name: documentation
|
|
||||||
color: 0075ca
|
|
||||||
- name: duplicate
|
|
||||||
color: cfd3d7
|
|
||||||
- name: error handling
|
|
||||||
color: 80c042
|
|
||||||
- name: feature request
|
|
||||||
color: fcf95a
|
|
||||||
- name: gateway
|
|
||||||
color: 80c042
|
|
||||||
- name: good first issue
|
|
||||||
color: 7057ff
|
|
||||||
- name: has PR
|
|
||||||
color: 4b1f8e
|
|
||||||
- name: help wanted
|
|
||||||
color: '008672'
|
|
||||||
- name: in progress
|
|
||||||
color: ffccd7
|
|
||||||
- name: in review
|
|
||||||
color: aed5fc
|
|
||||||
- name: interactions
|
|
||||||
color: 80c042
|
|
||||||
- name: invalid
|
|
||||||
color: e4e669
|
|
||||||
- name: need repro
|
|
||||||
color: c66037
|
|
||||||
- name: packages:api-extractor
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:api-extractor-model
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:brokers
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:builders
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:collection
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:core
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:create-discord-bot
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:discord.js
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:docgen
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:formatters
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:next
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:proxy
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:proxy-container
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:rest
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:ui
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:util
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:voice
|
|
||||||
color: fbca04
|
|
||||||
- name: packages:ws
|
|
||||||
color: fbca04
|
|
||||||
- name: performance
|
|
||||||
color: 80c042
|
|
||||||
- name: permissions
|
|
||||||
color: 80c042
|
|
||||||
- name: priority:high
|
|
||||||
color: fc1423
|
|
||||||
- name: question (please use Discord instead)
|
|
||||||
color: d876e3
|
|
||||||
- name: ratelimits
|
|
||||||
color: 80c042
|
|
||||||
- name: refactor
|
|
||||||
color: 1d637f
|
|
||||||
- name: regression
|
|
||||||
color: ea8785
|
|
||||||
- name: REST
|
|
||||||
color: 80c042
|
|
||||||
- name: semver:major
|
|
||||||
color: c10f47
|
|
||||||
- name: semver:minor
|
|
||||||
color: e4f486
|
|
||||||
- name: semver:patch
|
|
||||||
color: e8be8b
|
|
||||||
- name: sharding
|
|
||||||
color: 80c042
|
|
||||||
- name: tests
|
|
||||||
color: f06dff
|
|
||||||
- name: threads
|
|
||||||
color: 80c042
|
|
||||||
- name: typings
|
|
||||||
color: 80c042
|
|
||||||
- name: utility
|
|
||||||
color: 80c042
|
|
||||||
- name: wontfix
|
|
||||||
color: ffffff
|
|
||||||
6
.github/powered-by-vercel.svg
vendored
|
Before Width: | Height: | Size: 5.2 KiB |
BIN
.github/powered-by-workers.png
vendored
|
Before Width: | Height: | Size: 16 KiB |
18
.github/tsc.json
vendored
@@ -1,18 +0,0 @@
|
|||||||
{
|
|
||||||
"problemMatcher": [
|
|
||||||
{
|
|
||||||
"owner": "tsc",
|
|
||||||
"pattern": [
|
|
||||||
{
|
|
||||||
"regexp": "^(?:\\s+\\d+\\>)?([^\\s].*)\\((\\d+),(\\d+)\\)\\s*:\\s+(error|warning|info)\\s+(\\w{1,2}\\d+)\\s*:\\s*(.*)$",
|
|
||||||
"file": 1,
|
|
||||||
"line": 2,
|
|
||||||
"column": 3,
|
|
||||||
"severity": 4,
|
|
||||||
"code": 5,
|
|
||||||
"message": 6
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
35
.github/workflows/cleanup-cache.yml
vendored
@@ -1,35 +0,0 @@
|
|||||||
# https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#force-deleting-cache-entries
|
|
||||||
name: Cleanup caches
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
types:
|
|
||||||
- closed
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
cleanup:
|
|
||||||
name: Cleanup caches
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Cleanup caches
|
|
||||||
run: |
|
|
||||||
gh extension install actions/gh-actions-cache
|
|
||||||
|
|
||||||
REPO=${{ github.repository }}
|
|
||||||
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge"
|
|
||||||
|
|
||||||
echo "Fetching list of cache key"
|
|
||||||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH | cut -f 1 )
|
|
||||||
|
|
||||||
## Setting this to not fail the workflow while deleting cache keys.
|
|
||||||
set +e
|
|
||||||
echo "Deleting caches..."
|
|
||||||
for cacheKey in $cacheKeysForPR
|
|
||||||
do
|
|
||||||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm
|
|
||||||
done
|
|
||||||
echo "Done"
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
34
.github/workflows/deploy-website.yml
vendored
@@ -1,34 +0,0 @@
|
|||||||
name: Deploy website
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
jobs:
|
|
||||||
deploy-website:
|
|
||||||
name: Deploy website
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
|
|
||||||
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Pull vercel production environment
|
|
||||||
run: vercel pull --yes --environment=production --token=${{ secrets.VERCEL_TOKEN }}
|
|
||||||
|
|
||||||
- name: Build website artifacts
|
|
||||||
run: vercel build --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
||||||
|
|
||||||
- name: Deploy website artifacts to vercel
|
|
||||||
run: vercel deploy --prebuilt --prod --token=${{ secrets.VERCEL_TOKEN }}
|
|
||||||
50
.github/workflows/deprecate-version.yml
vendored
@@ -1,50 +0,0 @@
|
|||||||
name: Deprecate version
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
package:
|
|
||||||
description: Package
|
|
||||||
required: true
|
|
||||||
type: choice
|
|
||||||
options:
|
|
||||||
- '@discordjs/brokers'
|
|
||||||
- '@discordjs/builders'
|
|
||||||
- '@discordjs/collection'
|
|
||||||
- '@discordjs/core'
|
|
||||||
- 'create-discord-bot'
|
|
||||||
- '@discordjs/formatters'
|
|
||||||
- 'discord.js'
|
|
||||||
- '@discordjs/next'
|
|
||||||
- '@discordjs/proxy'
|
|
||||||
- '@discordjs/rest'
|
|
||||||
- '@discordjs/util'
|
|
||||||
- '@discordjs/voice'
|
|
||||||
- '@discordjs/ws'
|
|
||||||
version:
|
|
||||||
description: Version(s)
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
message:
|
|
||||||
description: Deprecation message
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
jobs:
|
|
||||||
deprecate:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install Node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Deprecate
|
|
||||||
run: pnpm exec npm-deprecate --name "${{inputs.version}}" --message "${{inputs.message || 'This version is deprecated. Please use a newer version.'}}" --package ${{inputs.package}}
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
||||||
232
.github/workflows/documentation.yml
vendored
@@ -1,232 +0,0 @@
|
|||||||
name: Documentation
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- 'main'
|
|
||||||
paths:
|
|
||||||
- 'packages/*/src/**'
|
|
||||||
- '!packages/create-discord-bot/**'
|
|
||||||
- '!packages/proxy-container/**'
|
|
||||||
- '!packages/ui/**'
|
|
||||||
tags:
|
|
||||||
- '**'
|
|
||||||
workflow_dispatch:
|
|
||||||
inputs:
|
|
||||||
ref:
|
|
||||||
description: 'The branch, tag or SHA to checkout'
|
|
||||||
required: true
|
|
||||||
ref_type:
|
|
||||||
type: choice
|
|
||||||
description: 'Branch or tag'
|
|
||||||
options:
|
|
||||||
- branch
|
|
||||||
- tag
|
|
||||||
required: true
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
jobs:
|
|
||||||
build-docs:
|
|
||||||
name: Build & upload documentation
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
REF_TYPE: ${{ inputs.ref_type || github.ref_type }}
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
ref: ${{ inputs.ref || '' }}
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Build dependencies
|
|
||||||
run: pnpm run build
|
|
||||||
|
|
||||||
- name: Checkout main repository
|
|
||||||
if: ${{ inputs.ref && inputs.ref != 'main' }}
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
path: 'main'
|
|
||||||
|
|
||||||
- name: Build main
|
|
||||||
if: ${{ inputs.ref && inputs.ref != 'main' }}
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
cd main
|
|
||||||
pnpm install --frozen-lockfile --prefer-offline --loglevel error
|
|
||||||
pnpm run build
|
|
||||||
cd ..
|
|
||||||
|
|
||||||
- name: Extract package and semver from tag
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' }}
|
|
||||||
id: extract-tag
|
|
||||||
uses: ./packages/actions/src/formatTag
|
|
||||||
with:
|
|
||||||
tag: ${{ inputs.ref || github.ref_name }}
|
|
||||||
|
|
||||||
- name: Apply tag to api-extractor config
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' && !inputs.ref }}
|
|
||||||
run: sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ steps.extract-tag.outputs.semver }}!' "packages/${{ steps.extract-tag.outputs.package}}/"
|
|
||||||
|
|
||||||
- name: Build docs
|
|
||||||
run: pnpm run docs
|
|
||||||
|
|
||||||
- name: Build docs with main api-extractor
|
|
||||||
if: ${{ inputs.ref && inputs.ref != 'main' }}
|
|
||||||
run: |
|
|
||||||
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "util" "voice" "ws")
|
|
||||||
for PACKAGE in "${PACKAGES[@]}"; do
|
|
||||||
cd "packages/${PACKAGE}"
|
|
||||||
sed -i 's!https://github.com/discordjs/discord.js/tree/main!https://github.com/discordjs/discord.js/tree/${{ inputs.ref }}!' api-extractor.json
|
|
||||||
../../main/packages/api-extractor/bin/api-extractor run --local --minify
|
|
||||||
../../main/packages/scripts/bin/generateSplitDocumentation.js
|
|
||||||
cd ../..
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Checkout docs repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
repository: 'discordjs/docs'
|
|
||||||
token: ${{ secrets.DJS_DOCS }}
|
|
||||||
path: 'out'
|
|
||||||
|
|
||||||
- name: Upload documentation to database
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
|
|
||||||
env:
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./packages/actions/src/uploadDocumentation
|
|
||||||
with:
|
|
||||||
package: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
version: ${{ steps.extract-tag.outputs.semver }}
|
|
||||||
|
|
||||||
- name: Upload documentation to database
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
|
|
||||||
env:
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./main/packages/actions/src/uploadDocumentation
|
|
||||||
with:
|
|
||||||
package: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
version: ${{ steps.extract-tag.outputs.semver }}
|
|
||||||
|
|
||||||
- name: Upload split documentation to blob storage
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' && (!inputs.ref || inputs.ref == 'main') }}
|
|
||||||
env:
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./packages/actions/src/uploadSplitDocumentation
|
|
||||||
with:
|
|
||||||
package: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
version: ${{ steps.extract-tag.outputs.semver }}
|
|
||||||
|
|
||||||
- name: Upload split documentation to blob storage
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' && inputs.ref && inputs.ref != 'main' }}
|
|
||||||
env:
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./main/packages/actions/src/uploadSplitDocumentation
|
|
||||||
with:
|
|
||||||
package: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
version: ${{ steps.extract-tag.outputs.semver }}
|
|
||||||
|
|
||||||
- name: Move docs to correct directory
|
|
||||||
if: ${{ env.REF_TYPE == 'tag' }}
|
|
||||||
env:
|
|
||||||
PACKAGE: ${{ steps.extract-tag.outputs.package }}
|
|
||||||
SEMVER: ${{ steps.extract-tag.outputs.semver }}
|
|
||||||
run: |
|
|
||||||
mkdir -p "out/${PACKAGE}"
|
|
||||||
if [[ "${PACKAGE}" == "discord.js" ]]; then
|
|
||||||
mv "packages/${PACKAGE}/docs/docs.json" "out/${PACKAGE}/${SEMVER}.json"
|
|
||||||
mv "packages/${PACKAGE}/docs/docs.api.json" "out/${PACKAGE}/${SEMVER}.api.json"
|
|
||||||
else
|
|
||||||
mv "packages/${PACKAGE}/docs/docs.api.json" "out/${PACKAGE}/${SEMVER}.api.json"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Upload documentation to database
|
|
||||||
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
|
|
||||||
env:
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./packages/actions/src/uploadDocumentation
|
|
||||||
|
|
||||||
- name: Upload documentation to database
|
|
||||||
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
|
|
||||||
env:
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./main/packages/actions/src/uploadDocumentation
|
|
||||||
|
|
||||||
- name: Upload split documentation to blob storage
|
|
||||||
if: ${{ env.REF_TYPE == 'branch' && (!inputs.ref || inputs.ref == 'main') }}
|
|
||||||
env:
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./packages/actions/src/uploadSplitDocumentation
|
|
||||||
|
|
||||||
- name: Upload split documentation to blob storage
|
|
||||||
if: ${{ env.REF_TYPE == 'branch' && inputs.ref && inputs.ref != 'main' }}
|
|
||||||
env:
|
|
||||||
BLOB_READ_WRITE_TOKEN: ${{ secrets.BLOB_READ_WRITE_TOKEN }}
|
|
||||||
uses: ./main/packages/actions/src/uploadSplitDocumentation
|
|
||||||
|
|
||||||
- name: Move docs to correct directory
|
|
||||||
if: ${{ env.REF_TYPE == 'branch' }}
|
|
||||||
run: |
|
|
||||||
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "util" "voice" "ws")
|
|
||||||
for PACKAGE in "${PACKAGES[@]}"; do
|
|
||||||
if [[ "${PACKAGE}" == "discord.js" ]]; then
|
|
||||||
mkdir -p "out/${PACKAGE}"
|
|
||||||
mv "packages/${PACKAGE}/docs/docs.json" "out/${PACKAGE}/${GITHUB_REF_NAME}.json"
|
|
||||||
mv "packages/${PACKAGE}/docs/docs.api.json" "out/${PACKAGE}/${GITHUB_REF_NAME}.api.json"
|
|
||||||
else
|
|
||||||
mkdir -p "out/${PACKAGE}"
|
|
||||||
mv "packages/${PACKAGE}/docs/docs.api.json" "out/${PACKAGE}/${GITHUB_REF_NAME}.api.json"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
- name: Commit and push
|
|
||||||
run: |
|
|
||||||
cd out
|
|
||||||
git config user.name github-actions[bot]
|
|
||||||
git config user.email 41898282+github-actions[bot]@users.noreply.github.com
|
|
||||||
git add .
|
|
||||||
git commit -m "Docs build for ${GITHUB_REF_TYPE} ${GITHUB_REF_NAME}: ${GITHUB_SHA}" || true
|
|
||||||
git push
|
|
||||||
|
|
||||||
build-indices:
|
|
||||||
needs: build-docs
|
|
||||||
name: Build & upload search indices
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Build dependencies
|
|
||||||
run: pnpm run build
|
|
||||||
|
|
||||||
- name: Upload search indices to meilisearch
|
|
||||||
env:
|
|
||||||
DATABASE_URL: ${{ secrets.DATABASE_URL }}
|
|
||||||
SEARCH_API_URL: ${{ secrets.SEARCH_API_URL }}
|
|
||||||
SEARCH_API_KEY: ${{ secrets.SEARCH_API_KEY }}
|
|
||||||
uses: ./packages/actions/src/uploadSearchIndices
|
|
||||||
14
.github/workflows/issue-triage.yml
vendored
@@ -1,14 +0,0 @@
|
|||||||
name: 'Issue Labeler'
|
|
||||||
on:
|
|
||||||
issues:
|
|
||||||
types: [opened]
|
|
||||||
jobs:
|
|
||||||
issue-triage:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: github/issue-labeler@v3.2
|
|
||||||
with:
|
|
||||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
||||||
configuration-path: .github/issue-labeler.yml
|
|
||||||
not-before: 2023-01-13T10:25:03.847Z
|
|
||||||
enable-versioned-regex: 0
|
|
||||||
23
.github/workflows/label-sync.yml
vendored
@@ -1,23 +0,0 @@
|
|||||||
name: Label sync
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 0 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
paths:
|
|
||||||
- '.github/labels.yml'
|
|
||||||
jobs:
|
|
||||||
label-sync:
|
|
||||||
name: Label sync
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Label sync
|
|
||||||
uses: crazy-max/ghaction-github-labeler@v4
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
19
.github/workflows/lock.yml
vendored
@@ -1,19 +0,0 @@
|
|||||||
name: Lock Ancient Issues
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 16 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
concurrency:
|
|
||||||
group: lock
|
|
||||||
jobs:
|
|
||||||
action:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
steps:
|
|
||||||
- uses: dessant/lock-threads@v4
|
|
||||||
with:
|
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
issue-inactive-days: 365
|
|
||||||
issue-lock-reason: resolved
|
|
||||||
process-only: issues
|
|
||||||
13
.github/workflows/pr-triage.yml
vendored
@@ -1,13 +0,0 @@
|
|||||||
name: 'PR Triage'
|
|
||||||
on:
|
|
||||||
pull_request_target:
|
|
||||||
jobs:
|
|
||||||
pr-triage:
|
|
||||||
name: PR Triage
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Automatically label PR
|
|
||||||
uses: actions/labeler@v4
|
|
||||||
with:
|
|
||||||
repo-token: '${{ secrets.GITHUB_TOKEN }}'
|
|
||||||
sync-labels: true
|
|
||||||
30
.github/workflows/publish-dev-docker.yml
vendored
@@ -1,30 +0,0 @@
|
|||||||
name: Publish dev docker images
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 */12 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
docker-publish:
|
|
||||||
name: Docker publish
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
|
||||||
|
|
||||||
- name: Build & push docker image
|
|
||||||
run: docker build -f packages/proxy-container/Dockerfile -t discordjs/proxy:latest --push .
|
|
||||||
84
.github/workflows/publish-dev.yml
vendored
@@ -1,84 +0,0 @@
|
|||||||
name: Publish dev
|
|
||||||
on:
|
|
||||||
schedule:
|
|
||||||
- cron: '0 */12 * * *'
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
npm-publish:
|
|
||||||
name: npm publish
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
include:
|
|
||||||
- package: '@discordjs/brokers'
|
|
||||||
folder: 'brokers'
|
|
||||||
- package: '@discordjs/builders'
|
|
||||||
folder: 'builders'
|
|
||||||
- package: '@discordjs/collection'
|
|
||||||
folder: 'collection'
|
|
||||||
- package: '@discordjs/core'
|
|
||||||
folder: 'core'
|
|
||||||
- package: '@discordjs/formatters'
|
|
||||||
folder: 'formatters'
|
|
||||||
- package: 'discord.js'
|
|
||||||
folder: 'discord.js'
|
|
||||||
- package: '@discordjs/next'
|
|
||||||
folder: 'next'
|
|
||||||
- package: '@discordjs/proxy'
|
|
||||||
folder: 'proxy'
|
|
||||||
- package: '@discordjs/rest'
|
|
||||||
folder: 'rest'
|
|
||||||
- package: '@discordjs/util'
|
|
||||||
folder: 'util'
|
|
||||||
- package: '@discordjs/voice'
|
|
||||||
folder: 'voice'
|
|
||||||
- package: '@discordjs/ws'
|
|
||||||
folder: 'ws'
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
env:
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
registry-url: https://registry.npmjs.org/
|
|
||||||
|
|
||||||
- name: Check the current development version
|
|
||||||
id: release-check
|
|
||||||
run: |
|
|
||||||
if [[ $(npm view ${{ matrix.package }}@dev version | grep -e "$(git rev-parse --short HEAD)") ]]; \
|
|
||||||
then echo "RELEASE=0" >> "$GITHUB_OUTPUT"; \
|
|
||||||
else echo "RELEASE=1" >> "$GITHUB_OUTPUT"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
if: steps.release-check.outputs.release == '1'
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Build dependencies
|
|
||||||
if: steps.release-check.outputs.release == '1'
|
|
||||||
run: pnpm run build
|
|
||||||
|
|
||||||
- name: Publish package
|
|
||||||
if: steps.release-check.outputs.release == '1'
|
|
||||||
run: |
|
|
||||||
pnpm --filter=${{ matrix.package }} run release --preid "dev.$(date +%s)-$(git rev-parse --short HEAD)"
|
|
||||||
pnpm --filter=${{ matrix.package }} publish --provenance --no-git-checks --tag dev || true
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
||||||
|
|
||||||
- name: Deprecate prior development releases
|
|
||||||
if: steps.release-check.outputs.release == '1'
|
|
||||||
run: pnpm exec npm-deprecate --name "*dev*" --message "This version is deprecated. Please use a newer version." --package ${{ matrix.package }}
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
||||||
27
.github/workflows/publish-docker.yml
vendored
@@ -1,27 +0,0 @@
|
|||||||
name: Publish docker images
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
jobs:
|
|
||||||
docker-publish:
|
|
||||||
name: Docker publish
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v2
|
|
||||||
|
|
||||||
- name: Login to DockerHub
|
|
||||||
run: echo ${{ secrets.DOCKER_ACCESS_TOKEN }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
|
|
||||||
|
|
||||||
- name: Build & push docker image
|
|
||||||
run: docker build -f packages/proxy-container/Dockerfile -t discordjs/proxy:$(cut -d '.' -f1 <<< $(jq --raw-output '.version' packages/proxy-container/package.json)) --push .
|
|
||||||
41
.github/workflows/publish-release.yml
vendored
@@ -1,41 +0,0 @@
|
|||||||
name: Publish Release
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [released]
|
|
||||||
jobs:
|
|
||||||
npm-publish:
|
|
||||||
name: npm publish
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
id-token: write
|
|
||||||
env:
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
registry-url: https://registry.npmjs.org/
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Build dependencies
|
|
||||||
run: pnpm run build
|
|
||||||
|
|
||||||
- name: Extract package and semver from tag
|
|
||||||
id: extract-tag
|
|
||||||
uses: ./packages/actions/src/formatTag
|
|
||||||
with:
|
|
||||||
tag: ${{ github.ref_name }}
|
|
||||||
|
|
||||||
- name: Publish package
|
|
||||||
run: |
|
|
||||||
pnpm --filter=${{ steps.extract-tag.outputs.subpackage == 'true' && '@discordjs/' || '' }}${{ steps.extract-tag.outputs.package }} publish --provenance --no-git-checks
|
|
||||||
env:
|
|
||||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_PUBLISH_TOKEN }}
|
|
||||||
64
.github/workflows/tests.yml
vendored
@@ -1,64 +0,0 @@
|
|||||||
name: Tests
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
pull_request:
|
|
||||||
concurrency:
|
|
||||||
# Group based on workflow name and PR if it exists, if no PR, let it run so carryforward flags work
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
jobs:
|
|
||||||
tests:
|
|
||||||
name: Tests
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
env:
|
|
||||||
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
||||||
TURBO_TEAM: ${{ secrets.TURBO_TEAM }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout repository
|
|
||||||
uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Install node.js v18
|
|
||||||
uses: actions/setup-node@v3
|
|
||||||
with:
|
|
||||||
node-version: 18
|
|
||||||
|
|
||||||
- name: Install dependencies
|
|
||||||
uses: ./packages/actions/src/pnpmCache
|
|
||||||
|
|
||||||
- name: Build dependencies (PR)
|
|
||||||
if: ${{ github.event_name != 'push' }}
|
|
||||||
run: pnpm exec turbo run build --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=4
|
|
||||||
|
|
||||||
- name: Build dependencies (Push)
|
|
||||||
if: ${{ github.event_name == 'push' }}
|
|
||||||
run: pnpm exec turbo run build --filter="...[HEAD^1]" --concurrency=4
|
|
||||||
|
|
||||||
- name: Tests (PR)
|
|
||||||
if: ${{ github.event_name != 'push' }}
|
|
||||||
run: pnpm exec turbo run test --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=4
|
|
||||||
|
|
||||||
- name: Tests (Push)
|
|
||||||
if: ${{ github.event_name == 'push' }}
|
|
||||||
run: pnpm exec turbo run test --filter="...[HEAD^1]" --concurrency=4
|
|
||||||
|
|
||||||
- name: ESLint (PR)
|
|
||||||
if: ${{ github.event_name != 'push' }}
|
|
||||||
run: pnpm exec turbo run lint --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=4 -- --format=compact
|
|
||||||
|
|
||||||
- name: ESLint (Push)
|
|
||||||
if: ${{ github.event_name == 'push' }}
|
|
||||||
run: pnpm exec turbo run lint --filter="...[HEAD^1]" --concurrency=4 -- --format=compact
|
|
||||||
|
|
||||||
- name: Docs (PR)
|
|
||||||
if: ${{ github.event_name != 'push' }}
|
|
||||||
run: pnpm exec turbo run docs --filter="...[origin/${{ github.event_name == 'pull_request' && github.event.pull_request.base.ref || 'main' }}]" --concurrency=4
|
|
||||||
|
|
||||||
- name: Docs (Push)
|
|
||||||
if: ${{ github.event_name == 'push' }}
|
|
||||||
run: pnpm exec turbo run docs --filter="...[HEAD^1]" --concurrency=4
|
|
||||||
|
|
||||||
- name: Upload Coverage
|
|
||||||
if: github.repository_owner == 'discordjs'
|
|
||||||
uses: ./packages/actions/src/uploadCoverage
|
|
||||||
61
.gitignore
vendored
@@ -1,54 +1,21 @@
|
|||||||
# Packages
|
# Packages
|
||||||
node_modules
|
node_modules/
|
||||||
|
yarn.lock
|
||||||
|
|
||||||
# Log files
|
# Log files
|
||||||
logs
|
logs/
|
||||||
*.log
|
*.log
|
||||||
npm-debug.log*
|
|
||||||
|
|
||||||
# Runtime data
|
# Authentication
|
||||||
pids
|
test/auth.json
|
||||||
*.pid
|
test/auth.js
|
||||||
*.seed
|
docs/deploy/deploy_key
|
||||||
|
docs/deploy/deploy_key.pub
|
||||||
# Env
|
deploy/deploy_key
|
||||||
.env
|
deploy/deploy_key.pub
|
||||||
|
|
||||||
# Dist
|
|
||||||
dist
|
|
||||||
dist-docs
|
|
||||||
|
|
||||||
# Miscellaneous
|
# Miscellaneous
|
||||||
.tmp
|
.tmp/
|
||||||
.vscode/*
|
.vscode/
|
||||||
!.vscode/extensions.json
|
docs/docs.json
|
||||||
!.vscode/settings.json
|
webpack/
|
||||||
.idea
|
|
||||||
.DS_Store
|
|
||||||
.turbo
|
|
||||||
tsconfig.tsbuildinfo
|
|
||||||
coverage
|
|
||||||
out
|
|
||||||
package.tgz
|
|
||||||
tsup.config.bundled*
|
|
||||||
vitest.config.ts.timestamp*
|
|
||||||
|
|
||||||
# Deno
|
|
||||||
deno.lock
|
|
||||||
|
|
||||||
# Bun
|
|
||||||
bun.lockb
|
|
||||||
|
|
||||||
# yarn
|
|
||||||
.pnp.*
|
|
||||||
.yarn/*
|
|
||||||
!.yarn/patches
|
|
||||||
!.yarn/plugins
|
|
||||||
!.yarn/releases
|
|
||||||
!.yarn/sdks
|
|
||||||
!.yarn/versions
|
|
||||||
|
|
||||||
# Cache
|
|
||||||
.prettiercache
|
|
||||||
.eslintcache
|
|
||||||
.vercel
|
|
||||||
|
|||||||
@@ -1 +0,0 @@
|
|||||||
pnpm exec commitlint --edit $1
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
pnpm run build:affected && pnpm exec lint-staged
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/lintstagedrc.schema.json",
|
|
||||||
"*": "prettier --ignore-unknown --write",
|
|
||||||
"{src/**,__tests__/**}.{mjs,js,cjs,ts,tsx}": "eslint --fix",
|
|
||||||
"src/**.ts": "vitest related --run --config ../../vitest.config.ts"
|
|
||||||
}
|
|
||||||
28
.npmignore
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
# Packages
|
||||||
|
node_modules/
|
||||||
|
yarn.lock
|
||||||
|
|
||||||
|
# Log files
|
||||||
|
logs/
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# Authentication
|
||||||
|
deploy/
|
||||||
|
|
||||||
|
# Miscellaneous
|
||||||
|
.tmp/
|
||||||
|
.vscode/
|
||||||
|
docs/
|
||||||
|
|
||||||
|
webpack/
|
||||||
|
|
||||||
|
# NPM ignore
|
||||||
|
.eslintrc.json
|
||||||
|
.gitattributes
|
||||||
|
.gitignore
|
||||||
|
.travis.yml
|
||||||
|
webpack.config.js
|
||||||
|
.github/
|
||||||
|
test/
|
||||||
|
tsconfig.json
|
||||||
|
tslint.json
|
||||||
7
.npmrc
@@ -1,6 +1 @@
|
|||||||
auto-install-peers=false
|
package-json=false
|
||||||
resolution-mode=highest
|
|
||||||
public-hoist-pattern[]=*eslint*
|
|
||||||
public-hoist-pattern[]=*prettier*
|
|
||||||
public-hoist-pattern[]=*@rushstack/node-core-library*
|
|
||||||
public-hoist-pattern[]=*jju*
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
CODEOWNERS
|
|
||||||
CHANGELOG.md
|
|
||||||
tsup.config.bundled*
|
|
||||||
vitest.config.ts.timestamp*
|
|
||||||
pnpm-lock.yaml
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/prettierrc.json",
|
|
||||||
"printWidth": 120,
|
|
||||||
"useTabs": true,
|
|
||||||
"singleQuote": true,
|
|
||||||
"quoteProps": "as-needed",
|
|
||||||
"trailingComma": "all",
|
|
||||||
"endOfLine": "lf"
|
|
||||||
}
|
|
||||||
21
.tern-project
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
{
|
||||||
|
"ecmaVersion": 7,
|
||||||
|
"libs": [],
|
||||||
|
"loadEagerly": [
|
||||||
|
"./src/*.js"
|
||||||
|
],
|
||||||
|
"dontLoad": [
|
||||||
|
"node_modules/**"
|
||||||
|
],
|
||||||
|
"plugins": {
|
||||||
|
"es_modules": {},
|
||||||
|
"node": {},
|
||||||
|
"doc_comment": {
|
||||||
|
"fullDocs": true,
|
||||||
|
"strong": true
|
||||||
|
},
|
||||||
|
"webpack": {
|
||||||
|
"configPath": "./webpack.config.js",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
22
.travis.yml
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
language: node_js
|
||||||
|
node_js:
|
||||||
|
- "6"
|
||||||
|
- "8"
|
||||||
|
- "10"
|
||||||
|
- "12"
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- node_modules
|
||||||
|
install: npm install
|
||||||
|
script: bash ./deploy/test.sh
|
||||||
|
jobs:
|
||||||
|
include:
|
||||||
|
- stage: build
|
||||||
|
node_js: "6"
|
||||||
|
script: bash ./deploy/deploy.sh
|
||||||
|
env:
|
||||||
|
global:
|
||||||
|
- ENCRYPTION_LABEL: "af862fa96d3e"
|
||||||
|
- COMMIT_AUTHOR_EMAIL: "amishshah.2k@gmail.com"
|
||||||
|
dist: trusty
|
||||||
|
sudo: false
|
||||||
13
.vscode/extensions.json
vendored
@@ -1,13 +0,0 @@
|
|||||||
{
|
|
||||||
"recommendations": [
|
|
||||||
"esbenp.prettier-vscode",
|
|
||||||
"dbaeumer.vscode-eslint",
|
|
||||||
"tamasfe.even-better-toml",
|
|
||||||
"github.vscode-pull-request-github",
|
|
||||||
"codezombiech.gitignore",
|
|
||||||
"eamodio.gitlens",
|
|
||||||
"christian-kohler.npm-intellisense",
|
|
||||||
"christian-kohler.path-intellisense",
|
|
||||||
"unifiedjs.vscode-mdx"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
35
.vscode/settings.json
vendored
@@ -1,35 +0,0 @@
|
|||||||
{
|
|
||||||
"eslint.validate": ["javascript", "javascriptreact", "typescript", "typescriptreact"],
|
|
||||||
"eslint.experimental.useFlatConfig": true,
|
|
||||||
"eslint.workingDirectories": [
|
|
||||||
{ "directory": "${workspaceFolder}" },
|
|
||||||
{ "pattern": "./apps/*/" },
|
|
||||||
{ "pattern": "./packages/*/" }
|
|
||||||
],
|
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
|
||||||
"editor.formatOnSave": true,
|
|
||||||
"editor.codeActionsOnSave": {
|
|
||||||
"source.organizeImports": "never",
|
|
||||||
"source.fixAll.eslint": "explicit",
|
|
||||||
"source.fixAll": "explicit"
|
|
||||||
},
|
|
||||||
"editor.trimAutoWhitespace": false,
|
|
||||||
"files.associations": {
|
|
||||||
"api-extractor.json": "jsonc",
|
|
||||||
"api-extractor-docs.json": "jsonc",
|
|
||||||
"tsconfig.json": "jsonc",
|
|
||||||
"tsconfig.eslint.json": "jsonc",
|
|
||||||
"tsconfig.docs.json": "jsonc"
|
|
||||||
},
|
|
||||||
"files.insertFinalNewline": true,
|
|
||||||
"files.eol": "\n",
|
|
||||||
"npm.packageManager": "pnpm",
|
|
||||||
"typescript.tsdk": "node_modules/typescript/lib",
|
|
||||||
"typescript.enablePromptUseWorkspaceTsdk": true,
|
|
||||||
"unocss.disable": true,
|
|
||||||
"deno.enable": false,
|
|
||||||
"deno.enablePaths": ["./packages/create-discord-bot/template/Deno"],
|
|
||||||
"deno.lint": false,
|
|
||||||
"deno.unstable": false,
|
|
||||||
"deno.config": "./packages/create-discord-bot/template/Deno/deno.jsonc"
|
|
||||||
}
|
|
||||||
3
LICENSE
@@ -175,8 +175,7 @@
|
|||||||
|
|
||||||
END OF TERMS AND CONDITIONS
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
Copyright 2021 Noel Buechler
|
Copyright 2017 Amish Shah
|
||||||
Copyright 2015 Amish Shah
|
|
||||||
|
|
||||||
Licensed under the Apache License, Version 2.0 (the "License");
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
you may not use this file except in compliance with the License.
|
you may not use this file except in compliance with the License.
|
||||||
|
|||||||
143
README.md
@@ -1,87 +1,86 @@
|
|||||||
<div align="center">
|
<div align="center">
|
||||||
<br />
|
<br />
|
||||||
<p>
|
<p>
|
||||||
<a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
|
<a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
|
||||||
</p>
|
</p>
|
||||||
<br />
|
<br />
|
||||||
<p>
|
<p>
|
||||||
<a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
|
<a href="https://discord.gg/bRCvFy9"><img src="https://discordapp.com/api/guilds/222078108977594368/embed.png" alt="Discord server" /></a>
|
||||||
<a href="https://www.npmjs.com/package/discord.js"><img src="https://img.shields.io/npm/v/discord.js.svg?maxAge=3600" alt="npm version" /></a>
|
<a href="https://www.npmjs.com/package/discord.js"><img src="https://img.shields.io/npm/v/discord.js.svg?maxAge=3600" alt="NPM version" /></a>
|
||||||
<a href="https://www.npmjs.com/package/discord.js"><img src="https://img.shields.io/npm/dt/discord.js.svg?maxAge=3600" alt="npm downloads" /></a>
|
<a href="https://www.npmjs.com/package/discord.js"><img src="https://img.shields.io/npm/dt/discord.js.svg?maxAge=3600" alt="NPM downloads" /></a>
|
||||||
<a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Tests status" /></a>
|
<a href="https://travis-ci.org/discordjs/discord.js"><img src="https://travis-ci.org/discordjs/discord.js.svg" alt="Build status" /></a>
|
||||||
<a href="https://codecov.io/gh/discordjs/discord.js" ><img src="https://codecov.io/gh/discordjs/discord.js/branch/main/graph/badge.svg?precision=2" alt="Code coverage" /></a>
|
<a href="https://david-dm.org/discordjs/discord.js"><img src="https://img.shields.io/david/discordjs/discord.js.svg?maxAge=3600" alt="Dependencies" /></a>
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
<a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-vercel.svg" alt="Vercel" /></a>
|
<a href="https://nodei.co/npm/discord.js/"><img src="https://nodei.co/npm/discord.js.png?downloads=true&stars=true" alt="NPM info" /></a>
|
||||||
<a href="https://www.cloudflare.com"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-workers.png" alt="Cloudflare Workers" height="44" /></a>
|
</p>
|
||||||
</p>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
## About
|
## About
|
||||||
|
discord.js is a powerful [node.js](https://nodejs.org) module that allows you to interact with the
|
||||||
|
[Discord API](https://discordapp.com/developers/docs/intro) very easily.
|
||||||
|
|
||||||
This repository contains multiple packages with separate [releases][github-releases]. You can find the assembled Discord API wrapper at [`discord.js`][source]. It is a powerful [Node.js](https://nodejs.org/en) module that allows you to easily interact with the [Discord API](https://discord.com/developers/docs/intro).
|
- Object-oriented
|
||||||
|
- Predictable abstractions
|
||||||
|
- Performant
|
||||||
|
- 100% coverage of the Discord API
|
||||||
|
|
||||||
## Packages
|
## Installation
|
||||||
|
**Node.js 6.0.0 or newer is required.**
|
||||||
|
Ignore any warnings about unmet peer dependencies, as they're all optional.
|
||||||
|
|
||||||
- `discord.js` ([source][source]) - A powerful Node.js module for interacting with the Discord API
|
Without voice support: `npm install discord.js`
|
||||||
- `@discordjs/brokers` ([source][brokers-source]) - A collection of brokers for use with discord.js
|
With voice support ([@discordjs/opus](https://www.npmjs.com/package/@discordjs/opus)): `npm install discord.js @discordjs/opus`
|
||||||
- `@discordjs/builders` ([source][builders-source]) - A utility package for easily building Discord API payloads
|
With voice support ([opusscript](https://www.npmjs.com/package/opusscript)): `npm install discord.js opusscript`
|
||||||
- `@discordjs/collection` ([source][collection-source]) - A powerful utility data structure
|
|
||||||
- `@discordjs/core` ([source][core-source]) - A thinly abstracted wrapper around the core components of the Discord API
|
### Audio engines
|
||||||
- `@discordjs/formatters` ([source][formatters-source]) - A collection of functions for formatting strings
|
The preferred audio engine is @discordjs/opus, as it performs significantly better than opusscript. When both are available, discord.js will automatically choose @discordjs/opus.
|
||||||
- `@discordjs/proxy` ([source][proxy-source]) - A wrapper around `@discordjs/rest` for running an HTTP proxy
|
Using opusscript is only recommended for development environments where @discordjs/opus is tough to get working.
|
||||||
- `@discordjs/rest` ([source][rest-source]) - A module for interacting with the Discord REST API
|
For production bots, using @discordjs/opus should be considered a necessity, especially if they're going to be running on multiple servers.
|
||||||
- `@discordjs/voice` ([source][voice-source]) - A module for interacting with the Discord Voice API
|
|
||||||
- `@discordjs/util` ([source][util-source]) - A collection of utility functions
|
### Optional packages
|
||||||
- `@discordjs/ws` ([source][ws-source]) - A wrapper around Discord's gateway
|
- [bufferutil](https://www.npmjs.com/package/bufferutil) to greatly speed up the WebSocket when *not* using uws (`npm install bufferutil`)
|
||||||
|
- [erlpack](https://github.com/hammerandchisel/erlpack) for significantly faster WebSocket data (de)serialisation (`npm install hammerandchisel/erlpack`)
|
||||||
|
- One of the following packages can be installed for faster voice packet encryption and decryption:
|
||||||
|
- [sodium](https://www.npmjs.com/package/sodium) (`npm install sodium`)
|
||||||
|
- [libsodium.js](https://www.npmjs.com/package/libsodium-wrappers) (`npm install libsodium-wrappers`)
|
||||||
|
|
||||||
|
## Example usage
|
||||||
|
```js
|
||||||
|
const Discord = require('discord.js');
|
||||||
|
const client = new Discord.Client();
|
||||||
|
|
||||||
|
client.on('ready', () => {
|
||||||
|
console.log(`Logged in as ${client.user.tag}!`);
|
||||||
|
});
|
||||||
|
|
||||||
|
client.on('message', msg => {
|
||||||
|
if (msg.content === 'ping') {
|
||||||
|
msg.reply('pong');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
client.login('token');
|
||||||
|
```
|
||||||
|
|
||||||
## Links
|
## Links
|
||||||
|
* [Website](https://discord.js.org/) ([source](https://github.com/discordjs/website))
|
||||||
- [Website][website] ([source][website-source])
|
* [Documentation](https://discord.js.org/#/docs)
|
||||||
- [Documentation][documentation]
|
* [Guide](https://discordjs.guide/) ([source](https://github.com/discordjs/guide))
|
||||||
- [Guide][guide] ([source][guide-source])
|
* [Discord.js Discord server](https://discord.gg/bRCvFy9)
|
||||||
Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
|
* [Discord API Discord server](https://discord.gg/discord-api)
|
||||||
- [discord.js Discord server][discord]
|
* [GitHub](https://github.com/discordjs/discord.js)
|
||||||
- [Discord API Discord server][discord-api]
|
* [NPM](https://www.npmjs.com/package/discord.js)
|
||||||
- [GitHub][source]
|
* [Related libraries](https://discordapi.com/unofficial/libs.html)
|
||||||
- [npm][npm]
|
|
||||||
- [Related libraries][related-libs]
|
|
||||||
|
|
||||||
### Extensions
|
### Extensions
|
||||||
|
* [RPC](https://www.npmjs.com/package/discord-rpc) ([source](https://github.com/discordjs/RPC))
|
||||||
- [RPC][rpc] ([source][rpc-source])
|
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
|
||||||
Please read through our [contribution guidelines][contributing] before starting a pull request. We welcome contributions of all kinds, not just code! If you're stuck for ideas, look for the [good first issue][good-first-issue] label on issues in the repository. If you have any questions about the project, feel free to ask them on [Discord][discord]. Before creating your own issue or pull request, always check to see if one already exists! Don't rush contributions, take your time and ensure you're doing it correctly.
|
[documentation](https://discord.js.org/#/docs).
|
||||||
|
See [the contribution guide](https://github.com/discordjs/discord.js/blob/master/.github/CONTRIBUTING.md) if you'd like to submit a PR.
|
||||||
|
|
||||||
## Help
|
## Help
|
||||||
|
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle
|
||||||
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please join our [Discord server][discord].
|
nudge in the right direction, please don't hesitate to join our official [Discord.js Server](https://discord.gg/bRCvFy9).
|
||||||
|
|
||||||
[website]: https://discord.js.org
|
|
||||||
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
|
|
||||||
[documentation]: https://discord.js.org/docs
|
|
||||||
[guide]: https://discordjs.guide/
|
|
||||||
[guide-source]: https://github.com/discordjs/guide
|
|
||||||
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
|
|
||||||
[discord]: https://discord.gg/djs
|
|
||||||
[discord-api]: https://discord.gg/discord-api
|
|
||||||
[source]: https://github.com/discordjs/discord.js/tree/main/packages/discord.js
|
|
||||||
[npm]: https://www.npmjs.com/package/discord.js
|
|
||||||
[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
|
|
||||||
[rpc]: https://www.npmjs.com/package/discord-rpc
|
|
||||||
[rpc-source]: https://github.com/discordjs/RPC
|
|
||||||
[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
|
|
||||||
[github-releases]: https://github.com/discordjs/discord.js/releases
|
|
||||||
[brokers-source]: https://github.com/discordjs/discord.js/tree/main/packages/brokers
|
|
||||||
[builders-source]: https://github.com/discordjs/discord.js/tree/main/packages/builders
|
|
||||||
[collection-source]: https://github.com/discordjs/discord.js/tree/main/packages/collection
|
|
||||||
[core-source]: https://github.com/discordjs/discord.js/tree/main/packages/core
|
|
||||||
[formatters-source]: https://github.com/discordjs/discord.js/tree/main/packages/formatters
|
|
||||||
[proxy-source]: https://github.com/discordjs/discord.js/tree/main/packages/proxy
|
|
||||||
[rest-source]: https://github.com/discordjs/discord.js/tree/main/packages/rest
|
|
||||||
[voice-source]: https://github.com/discordjs/discord.js/tree/main/packages/voice
|
|
||||||
[util-source]: https://github.com/discordjs/discord.js/tree/main/packages/util
|
|
||||||
[ws-source]: https://github.com/discordjs/discord.js/tree/main/packages/ws
|
|
||||||
[good-first-issue]: https://github.com/discordjs/discord.js/contribute
|
|
||||||
|
|||||||
@@ -1,425 +0,0 @@
|
|||||||
/**
|
|
||||||
* Config file for API Extractor. For more info, please visit: https://api-extractor.com
|
|
||||||
*/
|
|
||||||
{
|
|
||||||
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Optionally specifies another JSON config file that this file extends from. This provides a way for
|
|
||||||
* standard settings to be shared across multiple projects.
|
|
||||||
*
|
|
||||||
* If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains
|
|
||||||
* the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be
|
|
||||||
* resolved using NodeJS require().
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: none
|
|
||||||
* DEFAULT VALUE: ""
|
|
||||||
*/
|
|
||||||
// "extends": "./shared/api-extractor-base.json"
|
|
||||||
// "extends": "my-package/include/api-extractor-base.json"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines the "<projectFolder>" token that can be used with other config file settings. The project folder
|
|
||||||
* typically contains the tsconfig.json and package.json config files, but the path is user-defined.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting.
|
|
||||||
*
|
|
||||||
* The default value for "projectFolder" is the token "<lookup>", which means the folder is determined by traversing
|
|
||||||
* parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder
|
|
||||||
* that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error
|
|
||||||
* will be reported.
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <lookup>
|
|
||||||
* DEFAULT VALUE: "<lookup>"
|
|
||||||
*/
|
|
||||||
// "projectFolder": "..",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor
|
|
||||||
* analyzes the symbols exported by this module.
|
|
||||||
*
|
|
||||||
* The file extension must be ".d.ts" and not ".ts".
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
*/
|
|
||||||
"mainEntryPointFilePath": "<projectFolder>/dist-docs/index.d.ts",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* A list of NPM package names whose exports should be treated as part of this package.
|
|
||||||
*
|
|
||||||
* For example, suppose that Webpack is used to generate a distributed bundle for the project "library1",
|
|
||||||
* and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part
|
|
||||||
* of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly
|
|
||||||
* imports library2. To avoid this, we can specify:
|
|
||||||
*
|
|
||||||
* "bundledPackages": [ "library2" ],
|
|
||||||
*
|
|
||||||
* This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been
|
|
||||||
* local files for library1.
|
|
||||||
*/
|
|
||||||
"bundledPackages": [],
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Determines how the TypeScript compiler engine will be invoked by API Extractor.
|
|
||||||
*/
|
|
||||||
"compiler": {
|
|
||||||
/**
|
|
||||||
* Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* Note: This setting will be ignored if "overrideTsconfig" is used.
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<projectFolder>/tsconfig.json"
|
|
||||||
*/
|
|
||||||
// "tsconfigFilePath": "<projectFolder>/tsconfig.json",
|
|
||||||
/**
|
|
||||||
* Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk.
|
|
||||||
* The object must conform to the TypeScript tsconfig schema:
|
|
||||||
*
|
|
||||||
* http://json.schemastore.org/tsconfig
|
|
||||||
*
|
|
||||||
* If omitted, then the tsconfig.json file will be read from the "projectFolder".
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: no overrideTsconfig section
|
|
||||||
*/
|
|
||||||
"overrideTsconfig": {
|
|
||||||
"compilerOptions": {
|
|
||||||
// Type Checking
|
|
||||||
"allowUnreachableCode": false,
|
|
||||||
"allowUnusedLabels": false,
|
|
||||||
"exactOptionalPropertyTypes": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"noImplicitOverride": true,
|
|
||||||
"noImplicitReturns": true,
|
|
||||||
"noPropertyAccessFromIndexSignature": false,
|
|
||||||
"noUncheckedIndexedAccess": true,
|
|
||||||
"noUnusedLocals": true,
|
|
||||||
"noUnusedParameters": true,
|
|
||||||
"strict": true,
|
|
||||||
|
|
||||||
// Modules
|
|
||||||
"allowArbitraryExtensions": false,
|
|
||||||
"allowImportingTsExtensions": false,
|
|
||||||
"module": "ESNext",
|
|
||||||
"moduleResolution": "nodenext",
|
|
||||||
"resolveJsonModule": true,
|
|
||||||
"resolvePackageJsonExports": false,
|
|
||||||
"resolvePackageJsonImports": false,
|
|
||||||
|
|
||||||
// Emit
|
|
||||||
"declaration": true,
|
|
||||||
"declarationMap": true,
|
|
||||||
"importHelpers": false,
|
|
||||||
"newLine": "lf",
|
|
||||||
"noEmitHelpers": true,
|
|
||||||
"outDir": "dist",
|
|
||||||
"removeComments": false,
|
|
||||||
"sourceMap": true,
|
|
||||||
|
|
||||||
// Interop Constraints
|
|
||||||
"esModuleInterop": false,
|
|
||||||
"forceConsistentCasingInFileNames": true,
|
|
||||||
"isolatedModules": true,
|
|
||||||
|
|
||||||
// Language and Environment
|
|
||||||
"experimentalDecorators": true,
|
|
||||||
"lib": ["ESNext"],
|
|
||||||
"target": "ES2022",
|
|
||||||
"useDefineForClassFields": true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended
|
|
||||||
* and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when
|
|
||||||
* dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses
|
|
||||||
* for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck.
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: false
|
|
||||||
*/
|
|
||||||
// "skipLibCheck": true,
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures how the API report file (*.api.md) will be generated.
|
|
||||||
*/
|
|
||||||
"apiReport": {
|
|
||||||
/**
|
|
||||||
* (REQUIRED) Whether to generate an API report.
|
|
||||||
*/
|
|
||||||
"enabled": false
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce
|
|
||||||
* a full file path.
|
|
||||||
*
|
|
||||||
* The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<unscopedPackageName>.api.md"
|
|
||||||
*/
|
|
||||||
// "reportFileName": "<unscopedPackageName>.api.md",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the folder where the API report file is written. The file name portion is determined by
|
|
||||||
* the "reportFileName" setting.
|
|
||||||
*
|
|
||||||
* The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy,
|
|
||||||
* e.g. for an API review.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<projectFolder>/temp/"
|
|
||||||
*/
|
|
||||||
// "reportFolder": "<projectFolder>/temp/",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the folder where the temporary report file is written. The file name portion is determined by
|
|
||||||
* the "reportFileName" setting.
|
|
||||||
*
|
|
||||||
* After the temporary file is written to disk, it is compared with the file in the "reportFolder".
|
|
||||||
* If they are different, a production build will fail.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<projectFolder>/temp/"
|
|
||||||
*/
|
|
||||||
// "reportTempFolder": "<projectFolder>/temp/"
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures how the doc model file (*.api.json) will be generated.
|
|
||||||
*/
|
|
||||||
"docModel": {
|
|
||||||
/**
|
|
||||||
* (REQUIRED) Whether to generate a doc model file.
|
|
||||||
*/
|
|
||||||
"enabled": true,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* The output path for the doc model file. The file extension should be ".api.json".
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<projectFolder>/temp/<unscopedPackageName>.api.json"
|
|
||||||
*/
|
|
||||||
"apiJsonFilePath": "<projectFolder>/docs/docs.api.json"
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures how the .d.ts rollup file will be generated.
|
|
||||||
*/
|
|
||||||
"dtsRollup": {
|
|
||||||
/**
|
|
||||||
* (REQUIRED) Whether to generate the .d.ts rollup file.
|
|
||||||
*/
|
|
||||||
"enabled": false,
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the output path for a .d.ts rollup file to be generated without any trimming.
|
|
||||||
* This file will include all declarations that are exported by the main entry point.
|
|
||||||
*
|
|
||||||
* If the path is an empty string, then this file will not be written.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<projectFolder>/dist/<unscopedPackageName>.d.ts"
|
|
||||||
*/
|
|
||||||
"untrimmedFilePath": "<projectFolder>/dist-docs/index.d.ts"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for an "alpha" release.
|
|
||||||
* This file will include only declarations that are marked as "@public", "@beta", or "@alpha".
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: ""
|
|
||||||
*/
|
|
||||||
// "alphaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-alpha.d.ts",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release.
|
|
||||||
* This file will include only declarations that are marked as "@public" or "@beta".
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: ""
|
|
||||||
*/
|
|
||||||
// "betaTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-beta.d.ts",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release.
|
|
||||||
* This file will include only declarations that are marked as "@public".
|
|
||||||
*
|
|
||||||
* If the path is an empty string, then this file will not be written.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: ""
|
|
||||||
*/
|
|
||||||
// "publicTrimmedFilePath": "<projectFolder>/dist/<unscopedPackageName>-public.d.ts",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When a declaration is trimmed, by default it will be replaced by a code comment such as
|
|
||||||
* "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the
|
|
||||||
* declaration completely.
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: false
|
|
||||||
*/
|
|
||||||
// "omitTrimmingComments": true
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures how the tsdoc-metadata.json file will be generated.
|
|
||||||
*/
|
|
||||||
"tsdocMetadata": {
|
|
||||||
/**
|
|
||||||
* Whether to generate the tsdoc-metadata.json file.
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: true
|
|
||||||
*/
|
|
||||||
// "enabled": true,
|
|
||||||
/**
|
|
||||||
* Specifies where the TSDoc metadata file should be written.
|
|
||||||
*
|
|
||||||
* The path is resolved relative to the folder of the config file that contains the setting; to change this,
|
|
||||||
* prepend a folder token such as "<projectFolder>".
|
|
||||||
*
|
|
||||||
* The default value is "<lookup>", which causes the path to be automatically inferred from the "tsdocMetadata",
|
|
||||||
* "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup
|
|
||||||
* falls back to "tsdoc-metadata.json" in the package folder.
|
|
||||||
*
|
|
||||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
|
||||||
* DEFAULT VALUE: "<lookup>"
|
|
||||||
*/
|
|
||||||
// "tsdocMetadataFilePath": "<projectFolder>/dist/tsdoc-metadata.json"
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Specifies what type of newlines API Extractor should use when writing output files. By default, the output files
|
|
||||||
* will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead.
|
|
||||||
* To use the OS's default newline kind, specify "os".
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: "crlf"
|
|
||||||
*/
|
|
||||||
"newlineKind": "lf",
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures how API Extractor reports error and warning messages produced during analysis.
|
|
||||||
*
|
|
||||||
* There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages.
|
|
||||||
*/
|
|
||||||
"messages": {
|
|
||||||
/**
|
|
||||||
* Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing
|
|
||||||
* the input .d.ts files.
|
|
||||||
*
|
|
||||||
* TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551"
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
|
||||||
*/
|
|
||||||
"compilerMessageReporting": {
|
|
||||||
/**
|
|
||||||
* Configures the default routing for messages that don't match an explicit rule in this table.
|
|
||||||
*/
|
|
||||||
"default": {
|
|
||||||
/**
|
|
||||||
* Specifies whether the message should be written to the the tool's output log. Note that
|
|
||||||
* the "addToApiReportFile" property may supersede this option.
|
|
||||||
*
|
|
||||||
* Possible values: "error", "warning", "none"
|
|
||||||
*
|
|
||||||
* Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail
|
|
||||||
* and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes
|
|
||||||
* the "--local" option), the warning is displayed but the build will not fail.
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: "warning"
|
|
||||||
*/
|
|
||||||
"logLevel": "warning"
|
|
||||||
|
|
||||||
/**
|
|
||||||
* When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md),
|
|
||||||
* then the message will be written inside that file; otherwise, the message is instead logged according to
|
|
||||||
* the "logLevel" option.
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: false
|
|
||||||
*/
|
|
||||||
// "addToApiReportFile": false
|
|
||||||
}
|
|
||||||
|
|
||||||
// "TS2551": {
|
|
||||||
// "logLevel": "warning",
|
|
||||||
// "addToApiReportFile": true
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// . . .
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures handling of messages reported by API Extractor during its analysis.
|
|
||||||
*
|
|
||||||
* API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag"
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings
|
|
||||||
*/
|
|
||||||
"extractorMessageReporting": {
|
|
||||||
"default": {
|
|
||||||
"logLevel": "warning"
|
|
||||||
// "addToApiReportFile": false
|
|
||||||
},
|
|
||||||
|
|
||||||
// Disable the following warning:
|
|
||||||
// (ae-missing-release-tag) "x" is part of the package's API, but it is missing a release tag (@alpha, @beta, @public, or @internal)
|
|
||||||
"ae-missing-release-tag": {
|
|
||||||
"logLevel": "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
// "ae-extra-release-tag": {
|
|
||||||
// "logLevel": "warning",
|
|
||||||
// "addToApiReportFile": true
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// . . .
|
|
||||||
},
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Configures handling of messages reported by the TSDoc parser when analyzing code comments.
|
|
||||||
*
|
|
||||||
* TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text"
|
|
||||||
*
|
|
||||||
* DEFAULT VALUE: A single "default" entry with logLevel=warning.
|
|
||||||
*/
|
|
||||||
"tsdocMessageReporting": {
|
|
||||||
"default": {
|
|
||||||
"logLevel": "warning"
|
|
||||||
// "addToApiReportFile": false
|
|
||||||
}
|
|
||||||
|
|
||||||
// "tsdoc-link-tag-unescaped-text": {
|
|
||||||
// "logLevel": "warning",
|
|
||||||
// "addToApiReportFile": true
|
|
||||||
// },
|
|
||||||
//
|
|
||||||
// . . .
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
METADATA_BASE_URL=http://localhost:3000
|
|
||||||
28
apps/guide/.gitignore
vendored
@@ -1,28 +0,0 @@
|
|||||||
# Packages
|
|
||||||
node_modules
|
|
||||||
|
|
||||||
# Log files
|
|
||||||
logs
|
|
||||||
*.log
|
|
||||||
npm-debug.log*
|
|
||||||
|
|
||||||
# Runtime data
|
|
||||||
pids
|
|
||||||
*.pid
|
|
||||||
*.seed
|
|
||||||
|
|
||||||
# Env
|
|
||||||
.env
|
|
||||||
.env*.local
|
|
||||||
|
|
||||||
# Dist
|
|
||||||
.contentlayer
|
|
||||||
.next
|
|
||||||
public/searchIndex
|
|
||||||
src/styles/unocss.css
|
|
||||||
|
|
||||||
# Miscellaneous
|
|
||||||
.tmp
|
|
||||||
.vscode
|
|
||||||
lighthouse-results
|
|
||||||
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/** @type {import('lint-staged').Config} */
|
|
||||||
module.exports = require('../../.lintstagedrc.json');
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
.contentlayer
|
|
||||||
.next
|
|
||||||
.turbo
|
|
||||||
.vscode
|
|
||||||
coverage
|
|
||||||
src/styles/unocss.css
|
|
||||||
next-env.d.ts
|
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
/** @type {import('prettier').Config} */
|
|
||||||
module.exports = require('../../.prettierrc.json');
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
<div align="center">
|
|
||||||
<br />
|
|
||||||
<p>
|
|
||||||
<a href="https://discord.js.org"><img src="https://discord.js.org/static/logo.svg" width="546" alt="discord.js" /></a>
|
|
||||||
</p>
|
|
||||||
<br />
|
|
||||||
<p>
|
|
||||||
<a href="https://discord.gg/djs"><img src="https://img.shields.io/discord/222078108977594368?color=5865F2&logo=discord&logoColor=white" alt="Discord server" /></a>
|
|
||||||
<a href="https://github.com/discordjs/discord.js/actions"><img src="https://github.com/discordjs/discord.js/actions/workflows/test.yml/badge.svg" alt="Build status" /></a>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<a href="https://vercel.com/?utm_source=discordjs&utm_campaign=oss"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-vercel.svg" alt="Vercel" /></a>
|
|
||||||
<a href="https://www.cloudflare.com"><img src="https://raw.githubusercontent.com/discordjs/discord.js/main/.github/powered-by-workers.png" alt="Cloudflare Workers" height="44" /></a>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
## About
|
|
||||||
|
|
||||||
The official guide for discord.js, made to help you get started easily with the library.
|
|
||||||
|
|
||||||
## Links
|
|
||||||
|
|
||||||
- [Website][website] ([source][website-source])
|
|
||||||
- [Documentation][documentation]
|
|
||||||
- [Guide][guide] ([source][guide-source])
|
|
||||||
Also see the v13 to v14 [Update Guide][guide-update], which includes updated and removed items from the library.
|
|
||||||
- [discord.js Discord server][discord]
|
|
||||||
- [Discord API Discord server][discord-api]
|
|
||||||
- [GitHub][source]
|
|
||||||
- [Related libraries][related-libs]
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
Before creating an issue, please ensure that it hasn't already been reported/suggested, and double-check the
|
|
||||||
[documentation][documentation].
|
|
||||||
See [the contribution guide][contributing] if you'd like to submit a PR.
|
|
||||||
|
|
||||||
## Help
|
|
||||||
|
|
||||||
If you don't understand something in the documentation, you are experiencing problems, or you just need a gentle nudge in the right direction, please don't hesitate to join our official [discord.js Server][discord].
|
|
||||||
|
|
||||||
[website]: https://discord.js.org
|
|
||||||
[website-source]: https://github.com/discordjs/discord.js/tree/main/apps/website
|
|
||||||
[documentation]: https://discord.js.org/docs
|
|
||||||
[guide]: https://discordjs.guide/
|
|
||||||
[guide-source]: https://github.com/discordjs/guide
|
|
||||||
[guide-update]: https://discordjs.guide/additional-info/changes-in-v14.html
|
|
||||||
[discord]: https://discord.gg/djs
|
|
||||||
[discord-api]: https://discord.gg/discord-api
|
|
||||||
[source]: https://github.com/discordjs/discord.js/tree/main/apps/guide
|
|
||||||
[related-libs]: https://discord.com/developers/docs/topics/community-resources#libraries
|
|
||||||
[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
|
|
||||||
@@ -1,94 +0,0 @@
|
|||||||
import { remarkCodeHike } from '@code-hike/mdx';
|
|
||||||
import { defineDocumentType, makeSource } from 'contentlayer/source-files';
|
|
||||||
import { type Node, toString } from 'hast-util-to-string';
|
|
||||||
import { h } from 'hastscript';
|
|
||||||
import { escape } from 'html-escaper';
|
|
||||||
import rehypeAutolinkHeadings from 'rehype-autolink-headings';
|
|
||||||
import rehypeSlug from 'rehype-slug';
|
|
||||||
import remarkGfm from 'remark-gfm';
|
|
||||||
import codeHikeThemeDarkPlus from './src/styles/code-hike-theme-dark-plus.json';
|
|
||||||
|
|
||||||
export const Content = defineDocumentType(() => ({
|
|
||||||
name: 'Content',
|
|
||||||
filePathPattern: `**/*.mdx`,
|
|
||||||
contentType: 'mdx',
|
|
||||||
fields: {
|
|
||||||
title: {
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
category: {
|
|
||||||
type: 'string',
|
|
||||||
required: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
computedFields: {
|
|
||||||
slug: {
|
|
||||||
type: 'string',
|
|
||||||
// eslint-disable-next-line unicorn/prefer-string-replace-all
|
|
||||||
resolve: (doc) => doc._raw.flattenedPath.replace(/\d+-/g, ''),
|
|
||||||
},
|
|
||||||
url: {
|
|
||||||
type: 'string',
|
|
||||||
// eslint-disable-next-line unicorn/prefer-string-replace-all
|
|
||||||
resolve: (doc) => `/guide/${doc._raw.flattenedPath.replace(/\d+-/g, '')}`,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}));
|
|
||||||
|
|
||||||
const LinkIcon = h(
|
|
||||||
'svg',
|
|
||||||
{
|
|
||||||
width: '1.25rem',
|
|
||||||
height: '1.25rem',
|
|
||||||
viewBox: '0 0 24 24',
|
|
||||||
fill: 'none',
|
|
||||||
stroke: 'currentColor',
|
|
||||||
strokeWidth: '2',
|
|
||||||
strokeLinecap: 'round',
|
|
||||||
strokeLinejoin: 'round',
|
|
||||||
},
|
|
||||||
h('path', {
|
|
||||||
// eslint-disable-next-line id-length
|
|
||||||
d: 'M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71',
|
|
||||||
}),
|
|
||||||
h('path', {
|
|
||||||
// eslint-disable-next-line id-length
|
|
||||||
d: 'M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71',
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
|
|
||||||
const createSROnlyLabel = (text: any) => {
|
|
||||||
return h('span', { class: 'sr-only' }, `Section titled ${escape(text)}`);
|
|
||||||
};
|
|
||||||
|
|
||||||
export default makeSource({
|
|
||||||
contentDirPath: 'src/content',
|
|
||||||
documentTypes: [Content],
|
|
||||||
mdx: {
|
|
||||||
remarkPlugins: [remarkGfm, [remarkCodeHike, { theme: codeHikeThemeDarkPlus, lineNumbers: true }]],
|
|
||||||
rehypePlugins: [
|
|
||||||
rehypeSlug,
|
|
||||||
[
|
|
||||||
rehypeAutolinkHeadings,
|
|
||||||
{
|
|
||||||
properties: {
|
|
||||||
class:
|
|
||||||
'relative inline-flex place-items-center place-content-center outline-none text-black dark:text-white pr-2 -ml-8 opacity-0 group-hover:opacity-100',
|
|
||||||
},
|
|
||||||
behavior: 'prepend',
|
|
||||||
content: (heading: Node) => [
|
|
||||||
h(
|
|
||||||
`span.anchor-icon`,
|
|
||||||
{
|
|
||||||
ariaHidden: 'true',
|
|
||||||
},
|
|
||||||
LinkIcon,
|
|
||||||
),
|
|
||||||
createSROnlyLabel(toString(heading)),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
],
|
|
||||||
},
|
|
||||||
});
|
|
||||||
5
apps/guide/next-env.d.ts
vendored
@@ -1,5 +0,0 @@
|
|||||||
/// <reference types="next" />
|
|
||||||
/// <reference types="next/image-types/global" />
|
|
||||||
|
|
||||||
// NOTE: This file should not be edited
|
|
||||||
// see https://nextjs.org/docs/basic-features/typescript for more information.
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-var-requires */
|
|
||||||
/* eslint-disable @typescript-eslint/no-require-imports */
|
|
||||||
// import bundleAnalyzer from '@next/bundle-analyzer';
|
|
||||||
// import { withContentlayer } from 'next-contentlayer';
|
|
||||||
const bundleAnalyzer = require('@next/bundle-analyzer');
|
|
||||||
const { withContentlayer } = require('next-contentlayer');
|
|
||||||
|
|
||||||
const withBundleAnalyzer = bundleAnalyzer({
|
|
||||||
enabled: process.env.ANALYZE === 'true',
|
|
||||||
});
|
|
||||||
|
|
||||||
module.exports = withBundleAnalyzer(
|
|
||||||
withContentlayer({
|
|
||||||
reactStrictMode: true,
|
|
||||||
experimental: {
|
|
||||||
typedRoutes: true,
|
|
||||||
},
|
|
||||||
images: {
|
|
||||||
dangerouslyAllowSVG: true,
|
|
||||||
contentDispositionType: 'attachment',
|
|
||||||
contentSecurityPolicy: "default-src 'self'; frame-src 'none'; sandbox;",
|
|
||||||
},
|
|
||||||
poweredByHeader: false,
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
@@ -1,100 +0,0 @@
|
|||||||
{
|
|
||||||
"$schema": "https://json.schemastore.org/package.json",
|
|
||||||
"name": "@discordjs/guide",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"description": "Imagine a guide... that explores the many possibilities for your discord.js bot",
|
|
||||||
"private": true,
|
|
||||||
"scripts": {
|
|
||||||
"test": "vitest run",
|
|
||||||
"build:check": "tsc --noEmit",
|
|
||||||
"build:local": "pnpm run build:prod",
|
|
||||||
"build:prod": "next build",
|
|
||||||
"build:analyze": "cross-env ANALYZE=true pnpm run build:prod",
|
|
||||||
"preview": "next start",
|
|
||||||
"dev": "next dev",
|
|
||||||
"generate:contentlayer": "contentlayer build",
|
|
||||||
"lint": "pnpm run build:check && prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
|
|
||||||
"format": "pnpm run build:check && prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
|
|
||||||
"fmt": "pnpm run format"
|
|
||||||
},
|
|
||||||
"type": "commonjs",
|
|
||||||
"directories": {
|
|
||||||
"lib": "src"
|
|
||||||
},
|
|
||||||
"contributors": [
|
|
||||||
"Crawl <icrawltogo@gmail.com>"
|
|
||||||
],
|
|
||||||
"license": "Apache-2.0",
|
|
||||||
"keywords": [
|
|
||||||
"discord",
|
|
||||||
"api",
|
|
||||||
"bot",
|
|
||||||
"client",
|
|
||||||
"node",
|
|
||||||
"discordapp",
|
|
||||||
"discordjs"
|
|
||||||
],
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://github.com/discordjs/discord.js.git",
|
|
||||||
"directory": "apps/guide"
|
|
||||||
},
|
|
||||||
"bugs": {
|
|
||||||
"url": "https://github.com/discordjs/discord.js/issues"
|
|
||||||
},
|
|
||||||
"homepage": "https://discord.js.org",
|
|
||||||
"funding": "https://github.com/discordjs/discord.js?sponsor",
|
|
||||||
"dependencies": {
|
|
||||||
"@code-hike/mdx": "^0.9.0",
|
|
||||||
"@discordjs/ui": "workspace:^",
|
|
||||||
"@react-icons/all-files": "^4.1.0",
|
|
||||||
"@vercel/analytics": "^1.2.2",
|
|
||||||
"@vercel/edge-config": "^1.1.0",
|
|
||||||
"@vercel/og": "^0.6.2",
|
|
||||||
"ariakit": "2.0.0-next.44",
|
|
||||||
"cmdk": "^1.0.0",
|
|
||||||
"contentlayer": "^0.3.4",
|
|
||||||
"next": "14.2.1",
|
|
||||||
"next-contentlayer": "^0.3.4",
|
|
||||||
"next-themes": "^0.3.0",
|
|
||||||
"react": "^18.2.0",
|
|
||||||
"react-custom-scrollbars-2": "^4.5.0",
|
|
||||||
"react-dom": "^18.2.0",
|
|
||||||
"rehype-autolink-headings": "^6.1.1",
|
|
||||||
"rehype-slug": "^5.1.0",
|
|
||||||
"remark-gfm": "^3.0.1",
|
|
||||||
"sharp": "^0.33.3"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
|
||||||
"@next/bundle-analyzer": "14.2.1",
|
|
||||||
"@testing-library/react": "^15.0.2",
|
|
||||||
"@testing-library/user-event": "^14.5.2",
|
|
||||||
"@types/html-escaper": "^3.0.2",
|
|
||||||
"@types/node": "18.18.8",
|
|
||||||
"@types/react": "^18.2.79",
|
|
||||||
"@types/react-dom": "^18.2.25",
|
|
||||||
"@unocss/eslint-plugin": "^0.59.3",
|
|
||||||
"@unocss/postcss": "^0.58.5",
|
|
||||||
"@unocss/reset": "^0.59.3",
|
|
||||||
"@vitejs/plugin-react": "^4.2.1",
|
|
||||||
"@vitest/coverage-v8": "^1.5.0",
|
|
||||||
"cross-env": "^7.0.3",
|
|
||||||
"eslint": "^8.57.0",
|
|
||||||
"eslint-config-neon": "^0.1.62",
|
|
||||||
"eslint-formatter-pretty": "^6.0.1",
|
|
||||||
"happy-dom": "^14.7.1",
|
|
||||||
"hast-util-to-string": "^2.0.0",
|
|
||||||
"hastscript": "^8.0.0",
|
|
||||||
"html-escaper": "^3.0.3",
|
|
||||||
"postcss": "^8.4.38",
|
|
||||||
"prettier": "^3.2.5",
|
|
||||||
"turbo": "^1.13.2",
|
|
||||||
"typescript": "^5.4.5",
|
|
||||||
"unocss": "^0.59.3",
|
|
||||||
"vercel": "^34.0.0",
|
|
||||||
"vitest": "^1.5.0"
|
|
||||||
},
|
|
||||||
"engines": {
|
|
||||||
"node": ">=18"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
module.exports = {
|
|
||||||
plugins: {
|
|
||||||
'@unocss/postcss': {},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
Before Width: | Height: | Size: 4.5 KiB |
|
Before Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 1.8 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 1.9 KiB |
|
Before Width: | Height: | Size: 3.8 KiB |
|
Before Width: | Height: | Size: 3.4 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 8.8 KiB |
|
Before Width: | Height: | Size: 182 KiB |
|
Before Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 290 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 164 KiB |
|
Before Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 2.0 KiB |
|
Before Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 76 KiB |
@@ -1,12 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<browserconfig>
|
|
||||||
<msapplication>
|
|
||||||
<tile>
|
|
||||||
<square70x70logo src="/mstile-70x70.png"/>
|
|
||||||
<square150x150logo src="/mstile-150x150.png"/>
|
|
||||||
<square310x310logo src="/mstile-310x310.png"/>
|
|
||||||
<wide310x150logo src="/mstile-310x150.png"/>
|
|
||||||
<TileColor>#090a16</TileColor>
|
|
||||||
</tile>
|
|
||||||
</msapplication>
|
|
||||||
</browserconfig>
|
|
||||||
|
Before Width: | Height: | Size: 561 B |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 5.8 KiB |
|
Before Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 68 KiB |
|
Before Width: | Height: | Size: 5.2 KiB |
@@ -1,32 +0,0 @@
|
|||||||
<?xml version="1.0" standalone="no"?>
|
|
||||||
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
||||||
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
||||||
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
||||||
width="400.000000pt" height="400.000000pt" viewBox="0 0 400.000000 400.000000"
|
|
||||||
preserveAspectRatio="xMidYMid meet">
|
|
||||||
<metadata>
|
|
||||||
Created by potrace 1.14, written by Peter Selinger 2001-2017
|
|
||||||
</metadata>
|
|
||||||
<g transform="translate(0.000000,400.000000) scale(0.100000,-0.100000)"
|
|
||||||
fill="#000000" stroke="none">
|
|
||||||
<path d="M0 2000 l0 -2000 2000 0 2000 0 0 2000 0 2000 -2000 0 -2000 0 0
|
|
||||||
-2000z m1305 795 c219 -47 373 -197 421 -411 24 -109 16 -315 -16 -399 l-23
|
|
||||||
-61 -59 -11 c-110 -21 -182 -92 -203 -202 -11 -56 -11 -56 -68 -79 -76 -30
|
|
||||||
-201 -42 -464 -42 l-223 0 0 610 0 610 283 0 c210 0 300 -4 352 -15z m890
|
|
||||||
-585 c0 -543 -2 -601 -18 -659 -56 -198 -190 -334 -365 -370 -176 -37 -349 5
|
|
||||||
-471 115 -48 44 -111 134 -111 161 0 6 19 14 43 18 23 4 73 18 110 32 l68 24
|
|
||||||
50 -45 c56 -50 98 -66 175 -66 100 0 207 81 234 178 6 23 10 251 10 625 l0
|
|
||||||
588 138 -3 137 -3 0 -595z m930 570 c93 -29 197 -84 252 -134 l44 -41 -61 -75
|
|
||||||
c-34 -41 -67 -81 -74 -88 -10 -10 -25 -4 -78 32 -95 63 -154 81 -268 81 -79 0
|
|
||||||
-103 -4 -142 -23 -62 -31 -90 -71 -96 -137 -8 -94 28 -137 168 -202 157 -73
|
|
||||||
172 -80 240 -108 236 -97 341 -215 356 -400 16 -193 -82 -363 -258 -449 -91
|
|
||||||
-45 -187 -66 -303 -66 -191 0 -390 74 -524 195 l-40 37 80 93 80 94 73 -53
|
|
||||||
c168 -121 353 -155 491 -92 72 33 108 82 113 155 9 122 -37 162 -323 286 -258
|
|
||||||
111 -350 179 -407 300 -69 148 -37 343 75 463 61 65 195 133 300 152 79 14
|
|
||||||
222 4 302 -20z m-1367 -977 c45 -34 65 -69 70 -125 4 -61 -19 -106 -77 -145
|
|
||||||
-90 -60 -226 3 -238 111 -3 24 -3 56 1 70 8 34 54 86 91 102 40 19 120 12 153
|
|
||||||
-13z"/>
|
|
||||||
<path d="M967 2543 c-4 -3 -7 -159 -7 -346 l0 -339 128 4 c101 3 136 8 172 24
|
|
||||||
106 48 162 145 168 292 10 214 -69 334 -238 361 -73 12 -213 15 -223 4z"/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
|
Before Width: | Height: | Size: 1.8 KiB |
@@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "discord.js guide",
|
|
||||||
"short_name": "discord.js guide",
|
|
||||||
"icons": [
|
|
||||||
{
|
|
||||||
"src": "/android-chrome-192x192.png",
|
|
||||||
"sizes": "192x192",
|
|
||||||
"type": "image/png"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"src": "/android-chrome-384x384.png",
|
|
||||||
"sizes": "384x384",
|
|
||||||
"type": "image/png"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"theme_color": "#1a1b1e",
|
|
||||||
"background_color": "#1a1b1e",
|
|
||||||
"display": "standalone"
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
'use client';
|
|
||||||
|
|
||||||
import { inter } from '~/util/fonts';
|
|
||||||
import { Providers } from './providers';
|
|
||||||
|
|
||||||
import '~/styles/cmdk.css';
|
|
||||||
import '~/styles/main.css';
|
|
||||||
|
|
||||||
export default function GlobalError({ error }: { readonly error: Error }) {
|
|
||||||
console.error(error);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<html className={inter.variable} lang="en" suppressHydrationWarning>
|
|
||||||
<body className="bg-light-600 dark:bg-dark-600 dark:text-light-900">
|
|
||||||
<Providers>
|
|
||||||
<main className="mx-auto max-w-2xl min-h-screen">
|
|
||||||
<div className="mx-auto max-w-lg min-h-screen flex flex-col place-content-center place-items-center gap-8 px-8 py-16 lg:px-6 lg:py-0">
|
|
||||||
<h1 className="text-[9rem] font-black leading-none md:text-[12rem]">500</h1>
|
|
||||||
<h2 className="text-[2rem] md:text-[3rem]">Error.</h2>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
</Providers>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
);
|
|
||||||
}
|
|
||||||