Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pnpm-lock.yaml @discordjs/core
/packages/proxy/ @discordjs/proxy
/packages/proxy-container/ @discordjs/proxy
/packages/rest/ @discordjs/rest
/packages/rpc/ @discordjs/rpc
/packages/scripts/ @discordjs/scripts
/packages/structures/ @discordjs/structures
/packages/ui/ @discordjs/ui
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/01-package_bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ body:
- proxy
- proxy-container
- rest
- rpc
- structures
- ui
- util
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/03-feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ body:
- proxy
- proxy-container
- rest
- rpc
- structures
- ui
- util
Expand Down
3 changes: 3 additions & 0 deletions .github/issue-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ packages:proxy-container:
packages:rest:
- "### Which (application|package|application or package) is this (bug
report|feature request) for\\?\\n\\nrest\\n"
packages:rpc:
- "### Which (application|package|application or package) is this (bug
report|feature request) for\\?\\n\\nrpc\\n"
packages:structures:
- "### Which (application|package|application or package) is this (bug
report|feature request) for\\?\\n\\nstructures\\n"
Expand Down
5 changes: 5 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ packages:rest:
- any-glob-to-any-file:
- packages/rest/*
- packages/rest/**/*
packages:rpc:
- changed-files:
- any-glob-to-any-file:
- packages/rpc/*
- packages/rpc/**/*
packages:structures:
- changed-files:
- any-glob-to-any-file:
Expand Down
2 changes: 2 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@
color: fbca04
- name: packages:rest
color: fbca04
- name: packages:rpc
color: fbca04
- name: packages:structures
color: fbca04
- name: packages:ui
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/deprecate-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ on:
- '@discordjs/next'
- '@discordjs/proxy'
- '@discordjs/rest'
- '@discordjs/rpc'
- '@discordjs/structures'
- '@discordjs/util'
- '@discordjs/voice'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
- 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")
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "rpc" "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
Expand Down Expand Up @@ -219,7 +219,7 @@ jobs:
- 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")
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "formatters" "next" "proxy" "rest" "rpc" "structures" "util" "voice" "ws")
for PACKAGE in "${PACKAGES[@]}"; do
if [[ "${PACKAGE}" == "discord.js" ]]; then
mkdir -p "out/${PACKAGE}"
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ on:
- '@discordjs/next'
- '@discordjs/proxy'
- '@discordjs/rest'
- '@discordjs/rpc'
- '@discordjs/structures'
- '@discordjs/util'
- '@discordjs/voice'
Expand Down
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ This repository contains multiple packages with separate [releases][github-relea
- `@discordjs/formatters` ([source][formatters-source]) - A collection of functions for formatting strings
- `@discordjs/proxy` ([source][proxy-source]) - A wrapper around `@discordjs/rest` for running an HTTP proxy
- `@discordjs/rest` ([source][rest-source]) - A module for interacting with the Discord REST API
- `@discordjs/rpc` ([source][rpc-source]) - A simple RPC client for Discord
- `@discordjs/structures` ([source][structures-source]) - A wrapper around Discord's structures
- `@discordjs/voice` ([source][voice-source]) - A module for interacting with the Discord Voice API
- `@discordjs/util` ([source][util-source]) - A collection of utility functions
Expand All @@ -50,10 +51,6 @@ This repository contains multiple packages with separate [releases][github-relea
- [npm][npm]
- [Related libraries][related-libs]

### Extensions

- [RPC][rpc] ([source][rpc-source])

## Contributing

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.
Expand All @@ -73,8 +70,6 @@ If you don't understand something in the documentation, you are experiencing pro
[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
Expand All @@ -84,6 +79,7 @@ If you don't understand something in the documentation, you are experiencing pro
[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
[rpc-source]: https://github.com/discordjs/discord.js/tree/main/packages/rpc
[structures-source]: https://github.com/discordjs/discord.js/tree/main/packages/structures
[voice-source]: https://github.com/discordjs/discord.js/tree/main/packages/voice
[util-source]: https://github.com/discordjs/discord.js/tree/main/packages/util
Expand Down
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"description": "Imagine a bot... the most popular way to build discord bots",
"private": true,
"scripts": {
"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}}'",
"build:copy_readme": "cpy \"../../packages/(discord.js|brokers|builders|collection|core|formatters|next|proxy|rest|rpc|structures|util|voice|ws)/README.md\" \"src/assets/readme\" --rename='home-{{basename}}'",
"build:check": "tsc --noEmit",
"build:local": "cross-env NEXT_PUBLIC_LOCAL_DEV=true pnpm run build:prod",
"build:prod": "pnpm run build:copy_readme && pnpm run build:next",
Expand Down
1 change: 1 addition & 0 deletions apps/website/src/util/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const PACKAGES = [
{ name: 'next' },
{ name: 'proxy' },
{ name: 'rest' },
{ name: 'rpc' },
{ name: 'structures' },
{ name: 'util' },
{ name: 'voice' },
Expand Down
9 changes: 9 additions & 0 deletions packages/actions/src/uploadCoverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,15 @@ runs:
flags: rest
token: ${{ inputs.CODECOV_TOKEN }}

- name: Upload RPC Coverage
if: ${{ hashFiles('packages/rpc/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
with:
files: ./packages/rpc/coverage/cobertura-coverage.xml
disable_search: true
flags: rpc
token: ${{ inputs.CODECOV_TOKEN }}

- name: Upload Structures Coverage
if: ${{ hashFiles('packages/structures/coverage/cobertura-coverage.xml') != '' }}
uses: codecov/codecov-action@v4
Expand Down
4 changes: 2 additions & 2 deletions packages/discord.js/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ If you don't understand something in the documentation, you are experiencing pro
[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
[rpc]: https://www.npmjs.com/package/@discordjs/rpc
[rpc-source]: https://github.com/discordjs/discord.js/tree/main/packages/rpc
[contributing]: https://github.com/discordjs/discord.js/blob/main/.github/CONTRIBUTING.md
6 changes: 6 additions & 0 deletions packages/rpc/.cliff-jumperrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "rpc",
"org": "discordjs",
"packagePath": "packages/rpc",
"identifierBase": false
}
28 changes: 28 additions & 0 deletions packages/rpc/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Packages
node_modules

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

# Runtime data
pids
*.pid
*.seed

# Env
.env

# Dist
dist
dist-docs

# Docs
docs/**/*
!docs/README.md

# Miscellaneous
.turbo
.tmp
coverage
2 changes: 2 additions & 0 deletions packages/rpc/.lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');
7 changes: 7 additions & 0 deletions packages/rpc/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.turbo
coverage
dist
dist-docs
docs/docs.api.json
CHANGELOG.md
tsup.config.bundled*
2 changes: 2 additions & 0 deletions packages/rpc/.prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');
21 changes: 21 additions & 0 deletions packages/rpc/LICENSE
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to do something about the license at the root of the monorepo as this license differs from it?

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 devsnek

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
6 changes: 6 additions & 0 deletions packages/rpc/api-extractor.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../../api-extractor.json",
"docModel": {
"projectFolderUrl": "https://github.com/discordjs/discord.js/tree/main/packages/rpc"
}
}
79 changes: 79 additions & 0 deletions packages/rpc/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
[changelog]
header = """
# Changelog

All notable changes to this project will be documented in this file.\n
"""
body = """
{%- macro remote_url() -%}
https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
{%- endmacro -%}
{% if version %}\
# [{{ version | trim_start_matches(pat="v") }}]\
{% if previous %}\
{% if previous.version %}\
({{ self::remote_url() }}/compare/{{ previous.version }}...{{ version }})\
{% else %}\
({{ self::remote_url() }}/tree/{{ version }})\
{% endif %}\
{% endif %} \
- ({{ timestamp | date(format="%Y-%m-%d") }})
{% else %}\
# [unreleased]
{% endif %}\
{% for group, commits in commits | group_by(attribute="group") %}
## {{ group | upper_first }}
{% for commit in commits %}
- {% if commit.scope %}\
**{{commit.scope}}:** \
{% endif %}\
{{ commit.message | upper_first }} ([{{ commit.id | truncate(length=7, end="") }}]({{ self::remote_url() }}/commit/{{ commit.id }}))\
{% if commit.github.username %} by @{{ commit.github.username }}{%- endif %}\
{% if commit.breaking %}\
{% for footer in commit.footers %}\
{% if footer.breaking %}\
\n{% raw %} {% endraw %}- **{{ footer.token }}{{ footer.separator }}** {{ footer.value }}\
{% endif %}\
{% endfor %}\
{% endif %}\
{% endfor %}
{% endfor %}\
{% if github.contributors | filter(attribute="is_first_time", value=true) | length %}\
\n### New Contributors\n
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}\
* @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }}
{% endfor %}\
{% endif %}\n
"""
trim = true
footer = ""

[git]
conventional_commits = true
filter_unconventional = true
commit_parsers = [
{ message = "^feat", group = "Features"},
{ message = "^fix", group = "Bug Fixes"},
{ message = "^docs", group = "Documentation"},
{ message = "^perf", group = "Performance"},
{ message = "^refactor", group = "Refactor"},
{ message = "^types", group = "Typings"},
{ message = ".*deprecated", body = ".*deprecated", group = "Deprecation"},
{ message = "^revert", skip = true},
{ message = "^style", group = "Styling"},
{ message = "^test", group = "Testing"},
{ message = "^chore", skip = true},
{ message = "^ci", skip = true},
{ message = "^build", skip = true},
{ body = ".*security", group = "Security"},
]
filter_commits = true
protect_breaking_commits = true
tag_pattern = "@discordjs/rpc@[0-9]*"
ignore_tags = ""
topo_order = false
sort_commits = "newest"

[remote.github]
owner = "discordjs"
repo = "discord.js"
1 change: 1 addition & 0 deletions packages/rpc/docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
## [View the documentation here.](https://discord.js.org/docs/packages/rpc/main)
9 changes: 9 additions & 0 deletions packages/rpc/examples/boops-javascript/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
4 changes: 4 additions & 0 deletions packages/rpc/examples/boops-javascript/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
dist
out
.gitignore
3 changes: 3 additions & 0 deletions packages/rpc/examples/boops-javascript/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['eslint:recommended', '@electron-toolkit', '@electron-toolkit/eslint-config-prettier']
}
5 changes: 5 additions & 0 deletions packages/rpc/examples/boops-javascript/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
dist
out
.DS_Store
*.log*
1 change: 1 addition & 0 deletions packages/rpc/examples/boops-javascript/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
shamefully-hoist=true
6 changes: 6 additions & 0 deletions packages/rpc/examples/boops-javascript/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
out
dist
pnpm-lock.yaml
LICENSE.md
tsconfig.json
tsconfig.*.json
4 changes: 4 additions & 0 deletions packages/rpc/examples/boops-javascript/.prettierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
singleQuote: true
semi: false
printWidth: 100
trailingComma: none
Loading
Loading