Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: discordjs/discord.js
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: @discordjs/collection@1.5.3
Choose a base ref
...
head repository: discordjs/discord.js
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: @discordjs/collection@2.0.0
Choose a head ref

Commits on Aug 17, 2023

  1. Copy the full SHA
    58d9024 View commit details
  2. Copy the full SHA
    67b3035 View commit details
  3. Copy the full SHA
    6da4567 View commit details
  4. Copy the full SHA
    0220fb7 View commit details
  5. Copy the full SHA
    84ead6e View commit details
  6. Copy the full SHA
    4bc2667 View commit details
  7. Copy the full SHA
    4ab05e9 View commit details
  8. Copy the full SHA
    5d1b233 View commit details
  9. Copy the full SHA
    8eb978d View commit details

Commits on Aug 21, 2023

  1. Copy the full SHA
    dd5e745 View commit details
  2. build: bump Undici and discord-api-types (#9779)

    * build: bump discord-api-types
    
    * build: bump Undici too
    
    ---------
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    Jiralite and kodiakhq[bot] authored Aug 21, 2023
    Copy the full SHA
    899bc5f View commit details
  3. chore: deps

    iCrawl committed Aug 21, 2023
    2
    Copy the full SHA
    5d7c59c View commit details
  4. chore: config overhaul

    iCrawl committed Aug 21, 2023
    Copy the full SHA
    1e3aed0 View commit details
  5. 1
    Copy the full SHA
    2e40a05 View commit details

Commits on Aug 22, 2023

  1. build: refactor linting

    iCrawl committed Aug 22, 2023
    2
    Copy the full SHA
    d37632d View commit details
  2. chore: cleanup from debug

    iCrawl committed Aug 22, 2023
    Copy the full SHA
    f6c7c14 View commit details

Commits on Aug 23, 2023

  1. fix(TransformerGraph): Explicitly include input args for readable inp…

    …ut cases instead of just for string input cases (#9793)
    
    Explicitly add input args for readable input cases instead of just for string input cases.
    Change also ensures that constant arrays are passed by value instead of by reference, preventing them from accidentally being modified.
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    White-Wolf and Jiralite authored Aug 23, 2023
    Copy the full SHA
    788888a View commit details

Commits on Aug 24, 2023

  1. build: refactor linting setup

    iCrawl committed Aug 24, 2023
    1
    Copy the full SHA
    fb81f7b View commit details
  2. chore: regen lockfile

    iCrawl committed Aug 24, 2023
    Copy the full SHA
    6ea63d0 View commit details
  3. 2
    Copy the full SHA
    9811514 View commit details
  4. build: fix linting

    iCrawl committed Aug 24, 2023
    2
    Copy the full SHA
    e3127a0 View commit details
  5. build: fixup vscode-eslint

    iCrawl committed Aug 24, 2023
    Copy the full SHA
    2201157 View commit details

Commits on Aug 25, 2023

  1. feat: Implement GET current application (#9797)

    * feat: implement current application route
    
    * refactor: pluralisation
    
    Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Suneet Tipirneni <77477100+suneettipirneni@users.noreply.github.com>
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    3 people authored Aug 25, 2023
    Copy the full SHA
    50106c7 View commit details
  2. feat: add new markdown formatters (#9613)

    * feat: add new markdown formatters
    
    Co-authored-by: Jaw0r3k <jaw0r3k.g@gmail.com>
    
    * Update packages/formatters/src/formatters.ts
    
    Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
    
    * refactor: remove unnecessary index tracking and rename 'array' to 'items'
    
    Co-authored-by: Almeida <almeidx@pm.me>
    
    * refactor: rename 'array' to 'items'
    
    Co-authored-by: Almeida <almeidx@pm.me>
    
    * refactor(heading): consolidate heading functions into a single function
    
    Also correct param names from array to items.
    
    Co-authored-by: Jaw0r3k <jaw0r3k.g@gmail.com>
    
    * refactor: add HeadingLevel enum and use switch case
    
    * fix: export HeadingLevel enum
    
    Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>
    
    * feat(heading): add missing documentation for level parameter
    
    * refactor: update list formatters
    
    * docs: correct heading formatter description
    
    * refactor: update list formatters
    
    * fix(heading): remove unnecessary space
    
    * refactor: move list callback function to outer scope
    
    * test: add tests
    
    * refactor: requested changes
    
    * refactor: suggested changes
    
    * docs: add missing documentation
    
    * style: suggested change
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    
    * refactor: use math max method instead
    
    Co-authored-by: Almeida <almeidx@pm.me>
    
    ---------
    
    Co-authored-by: Jaw0r3k <jaw0r3k.g@gmail.com>
    Co-authored-by: Sugden <28943913+NotSugden@users.noreply.github.com>
    Co-authored-by: Almeida <almeidx@pm.me>
    Co-authored-by: Jaw0r3k <jaworekwiadomosci@gmail.com>
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    Co-authored-by: space <spaceeec@yahoo.com>
    7 people authored Aug 25, 2023
    Copy the full SHA
    0d787e9 View commit details
  3. feat(formatters): add guild navigation mentions (#9436)

    * feat(formatters): add guild navigation mentions
    
    * docs: dont force support article locale
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    almeidx and Jiralite authored Aug 25, 2023
    Copy the full SHA
    566d5e2 View commit details
  4. feat(Presence): Expose sync_id in Activity (#9766)

    * feat(Presence): Expose sync_id in Activity
    
    * chore: mention non-documentation
    
    ---------
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    almostSouji and Jiralite authored Aug 25, 2023
    Copy the full SHA
    485dd71 View commit details

Commits on Aug 26, 2023

  1. feat: Add no-install option (#9604)

    * chore: no install option + fix type
    
    * chore: apply suggestions
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Jaw0r3k <jaw0r3k.git@gmail.com>
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    3 people authored Aug 26, 2023
    Copy the full SHA
    8325fa6 View commit details

Commits on Aug 27, 2023

  1. build: pnpm (#9806)

    iCrawl authored Aug 27, 2023
    2
    Copy the full SHA
    e96a8a9 View commit details
  2. Copy the full SHA
    e1ae7b4 View commit details

Commits on Aug 28, 2023

  1. ci: Stop documentation upload for create-discord-bot (#9781)

    ci: stop documentation upload for create-discord-bot
    Jiralite authored Aug 28, 2023
    Copy the full SHA
    85d03a3 View commit details
  2. 1
    Copy the full SHA
    7157748 View commit details

Commits on Aug 31, 2023

  1. docs(ApplicationsAPI): Fix getCurrent() options description (#9816)

    docs(ApplicationsAPI): fix `getCurrent()` options description
    Jiralite authored Aug 31, 2023
    Copy the full SHA
    23a6424 View commit details

Commits on Sep 2, 2023

  1. feat(CDN): Support emoji size (#9787)

    * feat(CDN): support emoji size
    
    * refactor: try to warn in all environments
    
    * feat: add prefix
    
    * refactor: better feedback message
    
    ---------
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    Jiralite and kodiakhq[bot] authored Sep 2, 2023
    Copy the full SHA
    778df45 View commit details
  2. build: Bump discord-api-types to 0.37.56 (#9815)

    build: bump discord-api-types to 0.37.56
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    Jiralite and kodiakhq[bot] authored Sep 2, 2023
    Copy the full SHA
    ba31972 View commit details
  3. ci: fix npm dev release workflow (#9817)

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    didinele and kodiakhq[bot] authored Sep 2, 2023
    Copy the full SHA
    ff1fda7 View commit details

Commits on Sep 8, 2023

  1. docs(GuildMember): Clarify timeout parameter wording (#9800)

    * Update GuildMember.js
    
    * Update GuildMember.js
    
    * Update GuildMember.js
    
    * Update GuildMember.js
    
    ---------
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    jeremy-rifkin and Jiralite authored Sep 8, 2023
    Copy the full SHA
    8d97e2d View commit details

Commits on Sep 9, 2023

  1. docs: Fix "its" typo (#9825)

    docs: fix "its" typo
    Jiralite authored Sep 9, 2023
    Copy the full SHA
    c50809e View commit details

Commits on Sep 10, 2023

  1. types(Client): fix isReady narrowing (#9828)

    * types(Client): fix isReady narrowing
    
    * chore: add requested changes
    
    * chore: test both ready cases
    
    ---------
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    N1ckPro and kodiakhq[bot] authored Sep 10, 2023
    Copy the full SHA
    6404c01 View commit details
  2. fix(WebSocketManager): available sessions check (#9823)

    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    didinele and kodiakhq[bot] authored Sep 10, 2023
    Copy the full SHA
    e68ab16 View commit details

Commits on Sep 11, 2023

  1. types: don't include dom types (#9831)

    * types: don't include dom types
    
    * types: try to fix websocket imports
    SuperchupuDev authored Sep 11, 2023
    Copy the full SHA
    9dbc954 View commit details

Commits on Sep 15, 2023

  1. feat: add support for teams update (#9805)

    * refactor(TeamMember): deprecate permissions property
    
    * feat: add support for team member roles
    
    * feat: add reference to external team member role enum
    
    * docs: suggested changes
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    3 people authored Sep 15, 2023
    Copy the full SHA
    c66636d View commit details

Commits on Sep 16, 2023

  1. ci: Modify environment variable to fix development releases (#9826)

    * ci: fix development releases
    
    * build: remove .yarnrc.yml
    Jiralite authored Sep 16, 2023
    Copy the full SHA
    7cdfc6c View commit details

Commits on Sep 17, 2023

  1. docs(Attachment): add MIME types link to contentType (#9824)

    * docs(Attachment): add MIME types link to contentType
    
    * docs: don't force locale
    
    ---------
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    sdanialraza and kodiakhq[bot] authored Sep 17, 2023
    Copy the full SHA
    85b2498 View commit details
  2. docs(ApplicationCommandManager): id parameter can take options (#9664)

    * docs: mention about possible options
    
    * chore: add suggested changes
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    
    ---------
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    jaw0r3k and Jiralite authored Sep 17, 2023
    Copy the full SHA
    ed14135 View commit details
  3. feat(GuildAuditLogsEntry): expose extra integrationType in relevant l…

    …og types (#9796)
    
    * feat(GuildAuditLogsEntry): expose ingrationType
    
    * fix: not optional, if extra is present on these types
    
    not necessary, as it is conditionally assigned
    
    * fix: remove non-extra approach
    
    * fix(types): string is not guaranteed to be the known enum
    
    * fix: adapt type tests to new extra properties
    
    * fix: include null in type, since extra is not always populated
    
    ---------
    
    Co-authored-by: Jiralite <33201955+Jiralite@users.noreply.github.com>
    almostSouji and Jiralite authored Sep 17, 2023
    Copy the full SHA
    3109798 View commit details
  4. feat: Support widget image URL (#9782)

    * feat: add widget image URL
    
    * docs(GuildManager): correct parameter type
    
    Co-authored-by: space <spaceeec@yahoo.com>
    
    ---------
    
    Co-authored-by: space <spaceeec@yahoo.com>
    Jiralite and SpaceEEC authored Sep 17, 2023
    Copy the full SHA
    b6a2441 View commit details
  5. docs(DiscordjsErrorCodes): Deprecate unused properties (#9790)

    docs(DiscordjsErrorCodes): deprecate unused properties
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    Jiralite and kodiakhq[bot] authored Sep 17, 2023
    Copy the full SHA
    4588e07 View commit details

Commits on Sep 18, 2023

  1. fix(GuildScheduledEvent): Use if...else pattern and handle partials (

    …#9802)
    
    fix: handle partial case
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    Jiralite and kodiakhq[bot] authored Sep 18, 2023
    Copy the full SHA
    32d614c View commit details
  2. refactor: Stickers are free (no more "premium" packs) (#9791)

    refactor: stickers are free
    
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    Jiralite and kodiakhq[bot] authored Sep 18, 2023
    Copy the full SHA
    e02a59b View commit details
  3. feat: Add media channels (#9662)

    * feat: add media channels
    
    * refactor: rename to `ThreadOnlyChannel`
    
    * feat: support media channels more
    
    * docs(ThreadOnlyChannel): update class description
    
    * types: update references
    
    * test: add more tests
    
    * chore: update code
    
    * refactor: `abstract`
    
    Co-authored-by: space <spaceeec@yahoo.com>
    
    ---------
    
    Co-authored-by: space <spaceeec@yahoo.com>
    Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
    3 people authored Sep 18, 2023
    Copy the full SHA
    571aedd View commit details
Showing 750 changed files with 69,715 additions and 32,098 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": [
11 changes: 0 additions & 11 deletions .eslintrc.json

This file was deleted.

28 changes: 15 additions & 13 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -11,38 +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 `yarn link`. This will create a symlink to your local copy of the discord.js libraries.
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 yarn 3 project `yarn init -2`
3. Disable pnp `yarn config set nodeLinker node-modules`
4. Now link the local discord.js project you cloned earlier `yarn link -A {PATH_TO_DISCORDJS_REPO}`
5. Install packages you'd like to test locally `yarn add discord.js@latest`, `yarn add @discordjs/rest@latest`, etc. **Note: Make sure you use `latest` tag or else yarn will try to install the remote package from npm**
6. Import the package in your source code and test them out!
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 `yarn turbo run build --filter=@discordjs/rest -- --watch` in the root folder of where you cloned the discord.js repo.
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
yarn create-package <package-name> [package-description]
pnpm run create-package <package-name> [package-description]
```

This will create new package directory under `packages/` with the required configuration files. You can
begin to make changes within the `src/` directory. It may also be required to update the CODEOWNERS file.
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
6 changes: 6 additions & 0 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
@@ -4,6 +4,12 @@ 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/**/*
12 changes: 8 additions & 4 deletions .github/labels.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
- name: api changes
color: 5663e9
color: '5663e9'
- name: api support
color: 5663e9
color: '5663e9'
- name: apps:guide
color: fbca04
- name: apps:website
@@ -23,7 +23,7 @@
- name: dependencies
color: 276bd1
- name: discord
color: 5663e9
color: '5663e9'
- name: discussion
color: b6b1f9
- name: documentation
@@ -41,7 +41,7 @@
- name: has PR
color: 4b1f8e
- name: help wanted
color: 008672
color: '008672'
- name: in progress
color: ffccd7
- name: in review
@@ -52,6 +52,10 @@
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
35 changes: 35 additions & 0 deletions .github/workflows/cleanup-cache.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# 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 }}
28 changes: 28 additions & 0 deletions .github/workflows/deploy-website.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
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
permissions:
contents: read
deployments: write
if: github.repository_owner == 'discordjs'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build & deploy website
uses: BetaHuhn/deploy-to-vercel-action@643bc80032ba62ca41d1a9aaba7b38b51c2b8646
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_SCOPE: 'discordjs'
GITHUB_DEPLOYMENT_ENV: 'Production – discord-js'
PRODUCTION: true
50 changes: 50 additions & 0 deletions .github/workflows/deprecate-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 }}
68 changes: 63 additions & 5 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
@@ -5,6 +5,9 @@ on:
- 'main'
paths:
- 'packages/*/src/**'
- '!packages/create-discord-bot/**'
- '!packages/proxy-container/**'
- '!packages/ui/**'
tags:
- '**'
workflow_dispatch:
@@ -23,7 +26,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true
jobs:
build:
build-docs:
name: Build & upload documentation
runs-on: ubuntu-latest
env:
@@ -42,13 +45,13 @@ jobs:
node-version: 18

- name: Install dependencies
uses: ./packages/actions/src/yarnCache
uses: ./packages/actions/src/pnpmCache

- name: Build dependencies
run: yarn build
run: pnpm run build

- name: Build docs
run: yarn docs
run: pnpm run docs

- name: Checkout docs repository
uses: actions/checkout@v3
@@ -82,6 +85,7 @@ jobs:
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
@@ -95,11 +99,12 @@ jobs:
- name: Move docs to correct directory
if: ${{ github.ref_type == 'branch' }}
run: |
declare -a PACKAGES=("brokers" "builders" "collection" "core" "discord.js" "next" "formatters" "proxy" "rest" "util" "voice" "ws")
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"
@@ -114,3 +119,56 @@ jobs:
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

deploy-website:
needs: build-docs
name: Deploy website
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
if: github.repository_owner == 'discordjs'
steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Build & deploy website
uses: BetaHuhn/deploy-to-vercel-action@643bc80032ba62ca41d1a9aaba7b38b51c2b8646
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
VERCEL_SCOPE: 'discordjs'
GITHUB_DEPLOYMENT_ENV: 'Production – discord-js'
PRODUCTION: true
2 changes: 1 addition & 1 deletion .github/workflows/issue-triage.yml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ jobs:
issue-triage:
runs-on: ubuntu-latest
steps:
- uses: github/issue-labeler@v3.1
- uses: github/issue-labeler@v3.2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
configuration-path: .github/issue-labeler.yml
20 changes: 0 additions & 20 deletions .github/workflows/lighthouse-main.yml

This file was deleted.

Loading