Skip to content

Commit

Permalink
Merge branch 'discordjs:main' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
Asthriona authored Jan 2, 2024
2 parents 456de55 + 136c66c commit f1a8eb5
Show file tree
Hide file tree
Showing 1,434 changed files with 114,835 additions and 35,751 deletions.
1 change: 1 addition & 0 deletions .commitlintrc.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"$schema": "https://json.schemastore.org/commitlintrc.json",
"extends": ["@commitlint/config-angular"],
"rules": {
"type-enum": [
Expand Down
65 changes: 47 additions & 18 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,38 +1,67 @@
# Packages
node_modules/
**/node_modules

# Log files
logs/
*.log
npm-debug.log*
**/logs
**/*.log
**/npm-debug.log*

# Runtime data
pids
*.pid
*.seed
**/pids
**/*.pid
**/*.seed

# Env
.env
**/.env

# Dist
dist/
**/dist/
**/dist-docs/

# Miscellaneous
.tmp/
.vscode/*
!.vscode/extensions.json
!.vscode/settings.json
.idea/
.DS_Store
.turbo
tsconfig.tsbuildinfo
**/.tmp
**/.vscode
**/.idea
**/.DS_Store
**/.turbo
**/tsconfig.tsbuildinfo
**/coverage
**/__tests__
**/out

# yarn
.pnp.*
.yarn/*
!.yarn/cache
!.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

11 changes: 0 additions & 11 deletions .eslintrc.json

This file was deleted.

11 changes: 11 additions & 0 deletions .github/.kodiak.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version = 1

[merge]
require_automerge_label = false
blocking_labels = ['blocked']
method = 'squash'

[merge.message]
title = 'pull_request_title'
strip_html_comments = true
include_coauthors = true
28 changes: 28 additions & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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
38 changes: 35 additions & 3 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,40 @@ is a great boon to your development process.
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
2. Run `yarn --immutable` ([install](https://yarnpkg.com/getting-started/install))
3. Run `yarn build` to build local packages
2. Run `pnpm install --frozen-lockfile` ([install](https://pnpm.io/installation))
3. Run `pnpm run build` to build local packages
4. Code your heart out!
5. Run `yarn test` to run ESLint and ensure any JSDoc changes are valid
5. Run `pnpm run 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))

## 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 local discord.js project you cloned earlier `pnpm link {PATH_TO_DISCORDJS_REPO}`
4. Install packages you'd like to test locally `pnpm add discord.js@latest`, `pnpm add @discordjs/rest@latest`, etc. **Note: Make sure you use `latest` tag or else pnpm will try to install the remote package from npm**
5. 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
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
name: Bug report
description: Report incorrect or unexpected behavior of a package
description: Report an issue with discord.js or another package.
labels: [bug, need repro]
body:
- type: markdown
attributes:
value: |
Use Discord for questions: https://discord.gg/djs
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
- rest
- core
- create-discord-bot
- formatters
- next
- proxy
- proxy-container
- rest
- ui
- util
- voice
- ws
validations:
Expand All @@ -25,57 +34,44 @@ body:
id: description
attributes:
label: Issue description
description: |
Describe the issue in as much detail as possible.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files into it.
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
1. Do thing
2. Do thing in Discord client
3. Observe behavior
4. See error logs below
validations:
required: true
- type: textarea
id: codesample
id: code_sample
attributes:
label: Code sample
description: Include a reproducible, minimal code sample. This will be automatically formatted into code, so no need for backticks.
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
placeholder: |
Your code sample should be...
... Minimal - Use as little code as possible that still produces the same problem (and is understandable)
... Complete - Provide all parts someone else needs to reproduce your problem
... Reproducible - Test the code you're about to provide to make sure it reproduces the problem
- type: input
id: djs-version
attributes:
label: Package version
description: Which version of are you using? Run `npm list <package>` in your project directory and paste the output.
placeholder: We no longer support version 12 or earlier of discord.js
validations:
required: true
- type: input
id: node-version
- type: textarea
id: versions
attributes:
label: Node.js version
description: |
Which version of Node.js are you using? Run `node --version` in your project directory and paste the output.
If you are using TypeScript, please include its version (`npm list typescript`) as well.
placeholder: Node.js version 16.9+ is required for version 14.0.0+
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: input
id: os
attributes:
label: Operating system
description: Which OS does your application run on?
- type: dropdown
id: priority
attributes:
label: Priority this issue should have
description: Please be realistic. If you need to elaborate on your reasoning, please use the Issue description field above.
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)
Expand All @@ -86,12 +82,9 @@ body:
id: partials
attributes:
label: Which partials do you have configured?
description: |
Check your Client constructor for the `partials` key.
Tip: you can select multiple items
description: Check your `Client` constructor for the `partials` key.
options:
- Not applicable (subpackage bug)
- Not applicable
- No Partials
- User
- Channel
Expand All @@ -107,16 +100,13 @@ body:
id: intents
attributes:
label: Which gateway intents are you subscribing to?
description: |
Check your Client constructor options for the `intents` key.
Tip: you can select multiple items
description: Check your `Client` constructor for the `intents` key.
options:
- Not applicable (subpackage bug)
- Not applicable
- No Intents
- Guilds
- GuildMembers
- GuildBans
- GuildModeration
- GuildEmojisAndStickers
- GuildIntegrations
- GuildWebhooks
Expand All @@ -131,11 +121,13 @@ body:
- DirectMessageTyping
- MessageContent
- GuildScheduledEvents
- AutoModerationConfiguration
- AutoModerationExecution
multiple: true
validations:
required: true
- type: input
id: dev-release
id: dev_release
attributes:
label: I have tested this issue on a development release
placeholder: d23280c (commit hash)
Expand Down
Loading

0 comments on commit f1a8eb5

Please sign in to comment.