Skip to content

Conversation

OfficialSirH
Copy link
Contributor

Please describe the changes this PR makes and why it should be merged:
TypeScript rewrite of the discord-rpc library moved to the monorepo

Status and versioning classification:

  • Code changes have been tested against the Discord API, or there are no code changes
  • I know how to update typings and have done so, or typings don't need updating

Copy link

vercel bot commented Aug 2, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

2 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
discord-js Ignored Ignored Preview Sep 6, 2025 3:33pm
discord-js-guide Ignored Ignored Preview Sep 6, 2025 3:33pm

@Jiralite Jiralite self-requested a review August 2, 2025 17:44
Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing stuff:

- 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
- structures
- ui
- util
- voice
- ws
validations:

- 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
- structures
- ui
- util
- voice
- ws

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/structures'
- '@discordjs/util'
- '@discordjs/voice'
- '@discordjs/ws'

- 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" "structures" "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: Move docs to correct directory
if: ${{ env.REF_TYPE == 'branch' }}
run: |
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "structures" "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

package:
description: 'The published name of a single package to release'
type: choice
required: false
options:
- all
- discord.js
- '@discordjs/brokers'
- '@discordjs/builders'
- '@discordjs/collection'
- '@discordjs/core'
- 'create-discord-bot'
- '@discordjs/docgen'
- '@discordjs/formatters'
- '@discordjs/next'
- '@discordjs/proxy'
- '@discordjs/rest'
- '@discordjs/structures'
- '@discordjs/util'
- '@discordjs/voice'
- '@discordjs/ws'

"build:copy_readme": "cpy \"../../packages/(discord.js|brokers|builders|collection|core|formatters|next|proxy|rest|structures|util|voice|ws)/README.md\" \"src/assets/readme\" --rename='home-{{basename}}'",

export const PACKAGES = [
{ name: 'discord.js' },
{ name: 'discord-api-types' },
{ name: 'brokers' },
{ name: 'builders' },
{ name: 'collection' },
{ name: 'core' },
{ name: 'formatters' },
{ name: 'next' },
{ name: 'proxy' },
{ name: 'rest' },
{ name: 'structures' },
{ name: 'util' },
{ name: 'voice' },
{ name: 'ws' },
];

name: 'Upload Coverage'
description: 'Uploads code coverage reports to codecov with separate flags for separate packages'
inputs:
codecov_token:
description: 'Codecov token.'
required: true
runs:
using: 'composite'
steps:
- name: Upload Brokers Coverage
if: ${{ hashFiles('packages/brokers/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/brokers/coverage/cobertura-coverage.xml
disable_search: true
flags: brokers
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Builders Coverage
if: ${{ hashFiles('packages/builders/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/builders/coverage/cobertura-coverage.xml
disable_search: true
flags: builders
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Collection Coverage
if: ${{ hashFiles('packages/collection/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/collection/coverage/cobertura-coverage.xml
disable_search: true
flags: collection
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Core Coverage
if: ${{ hashFiles('packages/core/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/core/coverage/cobertura-coverage.xml
disable_search: true
flags: core
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Discord.js Coverage
if: ${{ hashFiles('packages/discord.js/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/discord.js/coverage/cobertura-coverage.xml
disable_search: true
flags: discord.js
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Formatters Coverage
if: ${{ hashFiles('packages/formatters/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/formatters/coverage/cobertura-coverage.xml
disable_search: true
flags: formatters
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Next Coverage
if: ${{ hashFiles('packages/next/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/next/coverage/cobertura-coverage.xml
disable_search: true
flags: next
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Proxy Coverage
if: ${{ hashFiles('packages/proxy/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/proxy/coverage/cobertura-coverage.xml
disable_search: true
flags: proxy
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Rest Coverage
if: ${{ hashFiles('packages/rest/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/rest/coverage/cobertura-coverage.xml
disable_search: true
flags: rest
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Structures Coverage
if: ${{ hashFiles('packages/structures/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/structures/coverage/cobertura-coverage.xml
disable_search: true
flags: structures
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Util Coverage
if: ${{ hashFiles('packages/util/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/util/coverage/cobertura-coverage.xml
disable_search: true
flags: util
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Voice Coverage
if: ${{ hashFiles('packages/voice/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/voice/coverage/cobertura-coverage.xml
disable_search: true
flags: voice
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload WS Coverage
if: ${{ hashFiles('packages/ws/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/ws/coverage/cobertura-coverage.xml
disable_search: true
flags: ws
token: ${{ inputs.CODECOV_TOKEN }}
- name: Upload Utilities Coverage
if: ${{ hashFiles('packages/actions/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/actions/coverage/cobertura-coverage.xml
disable_search: true
flags: utilities
token: ${{ inputs.CODECOV_TOKEN }}

export const PACKAGES = [
'discord.js',
'brokers',
'builders',
'collection',
'core',
'formatters',
'next',
'proxy',
'rest',
'structures',
'util',
'voice',
'ws',
'discord-api-types',
];

The README.md at the root also needs updating (the source of RPC should ideally be removed and @discordjs/rpc should be added to the list of packages).

@github-project-automation github-project-automation bot moved this from Todo to Review in Progress in discord.js Aug 6, 2025
@devsnek
Copy link
Member

devsnek commented Aug 6, 2025

rpc code is licensed MIT and has several contributors. you'll need to either keep the MIT license (at the top of each file, for example) or reach out to them all to relicense it.

@vladfrangu
Copy link
Member

vladfrangu commented Aug 6, 2025

Wouldn't it be easier to keep RPC MIT licensed by keeping the license file as is? cc @discordjs/core

Copy link
Member

@Jiralite Jiralite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update this too:

[rpc]: https://www.npmjs.com/package/discord-rpc

I believe Vitest can be removed as a dependency now.

* @param options.timeout - Timeout for the command
* @param options.force - Force this move. This should only be done if you
*
* have explicit permission from the user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be here? It looks awkward!

* @param options - Options
* @param options.timeout - Timeout for the command
*
* have explicit permission from the user.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be here? It looks awkward!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Review in Progress
Development

Successfully merging this pull request may close these issues.

6 participants