Skip to content

Commit

Permalink
Merge branch 'discordjs:main' into types/format-emoji
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMythicalYT committed Nov 23, 2022
2 parents 6fae76f + ee7d2fd commit 2e455e3
Show file tree
Hide file tree
Showing 105 changed files with 5,376 additions and 2,199 deletions.
19 changes: 19 additions & 0 deletions .github/CONTRIBUTING.md
Expand Up @@ -17,6 +17,25 @@ To get ready to work on the codebase, please do the following:
5. Run `yarn 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.

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!

### 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.

## Adding new packages

If you'd like to create another package under the `@discordjs` organization run the following command:
Expand Down
2 changes: 2 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Expand Up @@ -132,6 +132,8 @@ body:
- DirectMessageTyping
- MessageContent
- GuildScheduledEvents
- AutoModerationConfiguration
- AutoModerationExecution
multiple: true
validations:
required: true
Expand Down
50 changes: 25 additions & 25 deletions apps/guide/package.json
Expand Up @@ -34,54 +34,54 @@
},
"homepage": "https://discord.js.org",
"dependencies": {
"@astrojs/image": "^0.10.0",
"@astrojs/mdx": "^0.11.4",
"@astrojs/react": "^1.2.1",
"@astrojs/image": "^0.11.6",
"@astrojs/mdx": "^0.11.6",
"@astrojs/react": "^1.2.2",
"@code-hike/mdx": "^0.7.4",
"@discordjs/ui": "workspace:^",
"ariakit": "^2.0.0-next.41",
"cmdk": "^0.1.20",
"meilisearch": "^0.28.0",
"meilisearch": "^0.29.1",
"react": "^17.0.2",
"react-custom-scrollbars-2": "^4.5.0",
"react-dom": "^17.0.2",
"react-icons": "^4.6.0",
"react-use": "^17.4.0",
"sharp": "^0.31.1",
"sharp": "^0.31.2",
"shiki": "^0.11.1"
},
"devDependencies": {
"@astrojs/prefetch": "^0.1.0",
"@astrojs/prefetch": "^0.1.1",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "16.11.68",
"@types/react": "^17.0.50",
"@types/react-dom": "^17.0.17",
"@types/node": "16.18.3",
"@types/react": "^17.0.52",
"@types/react-dom": "^17.0.18",
"@types/react-syntax-highlighter": "^15.5.5",
"@unocss/cli": "^0.45.30",
"@unocss/reset": "^0.45.30",
"@vitejs/plugin-react": "^2.1.0",
"@vitest/coverage-c8": "^0.24.3",
"astro": "^1.5.2",
"astro-compress": "^1.0.12",
"astro-critters": "^1.0.5",
"@unocss/cli": "^0.46.5",
"@unocss/reset": "^0.46.5",
"@vitejs/plugin-react": "^2.2.0",
"@vitest/coverage-c8": "^0.25.2",
"astro": "^1.6.10",
"astro-compress": "^1.1.8",
"astro-critters": "^1.1.8",
"cross-env": "^7.0.3",
"eslint": "^8.25.0",
"eslint-config-neon": "^0.1.39",
"eslint": "^8.28.0",
"eslint-config-neon": "^0.1.40",
"eslint-formatter-pretty": "^4.1.0",
"happy-dom": "^7.6.0",
"happy-dom": "^7.7.0",
"hast-util-to-string": "^2.0.0",
"hastscript": "^7.1.0",
"html-escaper": "^3.0.3",
"prettier": "^2.7.1",
"prettier-plugin-astro": "^0.6.0",
"prettier-plugin-astro": "^0.7.0",
"prettier-plugin-tailwindcss": "^0.1.13",
"rehype-autolink-headings": "^6.1.1",
"rehype-slug": "^5.0.1",
"typescript": "^4.8.4",
"unocss": "^0.45.30",
"vercel": "^28.4.12",
"vitest": "^0.24.3"
"rehype-slug": "^5.1.0",
"typescript": "^4.9.3",
"unocss": "^0.46.5",
"vercel": "^28.5.6",
"vitest": "^0.25.2"
},
"engines": {
"node": ">=16.9.0"
Expand Down
1 change: 1 addition & 0 deletions apps/website/.prettierignore
Expand Up @@ -13,3 +13,4 @@ api/
.next/
.vercel/
.cache/
public/searchIndex
46 changes: 23 additions & 23 deletions apps/website/package.json
Expand Up @@ -45,13 +45,13 @@
"@discordjs/ui": "workspace:^",
"@microsoft/api-extractor-model": "7.24.0",
"@microsoft/tsdoc": "0.14.1",
"@vercel/og": "^0.0.19",
"@vercel/og": "^0.0.21",
"@vscode/codicons": "^0.0.32",
"ariakit": "^2.0.0-next.41",
"cmdk": "^0.1.20",
"meilisearch": "^0.28.0",
"next": "^12.3.1",
"next-mdx-remote": "^4.1.0",
"meilisearch": "^0.29.1",
"next": "^12.3.4",
"next-mdx-remote": "^4.2.0",
"next-progress": "^2.2.0",
"next-themes": "^0.2.1",
"react": "^18.2.0",
Expand All @@ -60,38 +60,38 @@
"react-icons": "^4.6.0",
"react-syntax-highlighter": "^15.5.0",
"react-use": "^17.4.0",
"rehype-ignore": "^1.0.1",
"rehype-pretty-code": "^0.4.0",
"rehype-ignore": "^1.0.3",
"rehype-pretty-code": "^0.5.0",
"rehype-raw": "^6.1.1",
"rehype-slug": "^5.0.1",
"rehype-slug": "^5.1.0",
"remark-gfm": "^3.0.1",
"sharp": "^0.31.1",
"sharp": "^0.31.2",
"shiki": "^0.11.1",
"swr": "^1.3.0"
},
"devDependencies": {
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "16.11.68",
"@types/react": "^18.0.21",
"@types/react-dom": "^18.0.6",
"@types/node": "16.18.3",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.9",
"@types/react-syntax-highlighter": "^15.5.5",
"@unocss/cli": "^0.45.30",
"@unocss/reset": "^0.45.30",
"@vitejs/plugin-react": "^2.1.0",
"@vitest/coverage-c8": "^0.24.3",
"concurrently": "^7.4.0",
"@unocss/cli": "^0.46.5",
"@unocss/reset": "^0.46.5",
"@vitejs/plugin-react": "^2.2.0",
"@vitest/coverage-c8": "^0.25.2",
"concurrently": "^7.6.0",
"cross-env": "^7.0.3",
"eslint": "^8.25.0",
"eslint-config-neon": "^0.1.39",
"eslint": "^8.28.0",
"eslint-config-neon": "^0.1.40",
"eslint-formatter-pretty": "^4.1.0",
"happy-dom": "^7.6.0",
"happy-dom": "^7.7.0",
"prettier": "^2.7.1",
"prettier-plugin-tailwindcss": "^0.1.13",
"typescript": "^4.8.4",
"unocss": "^0.45.30",
"vercel": "^28.4.12",
"vitest": "^0.24.3"
"typescript": "^4.9.3",
"unocss": "^0.46.5",
"vercel": "^28.5.6",
"vitest": "^0.25.2"
},
"engines": {
"node": ">=16.9.0"
Expand Down
1 change: 1 addition & 0 deletions apps/website/src/pages/docs/[...slug].tsx
@@ -1,6 +1,7 @@
/* eslint-disable no-case-declarations */
import { readFile } from 'node:fs/promises';
import { join } from 'node:path';
// eslint-disable-next-line n/prefer-global/process
import process, { cwd } from 'node:process';
import {
findPackage,
Expand Down
18 changes: 9 additions & 9 deletions package.json
Expand Up @@ -38,19 +38,19 @@
},
"homepage": "https://discord.js.org",
"devDependencies": {
"@commitlint/cli": "^17.1.2",
"@commitlint/config-angular": "^17.1.0",
"@favware/cliff-jumper": "^1.8.8",
"@commitlint/cli": "^17.3.0",
"@commitlint/config-angular": "^17.3.0",
"@favware/cliff-jumper": "^1.9.0",
"@favware/npm-deprecate": "^1.0.5",
"conventional-changelog-cli": "^2.2.2",
"husky": "^8.0.1",
"husky": "^8.0.2",
"is-ci": "^3.0.1",
"lint-staged": "^13.0.3",
"tsup": "^6.3.0",
"turbo": "^1.5.6",
"typescript": "^4.8.4",
"unocss": "^0.45.30",
"vitest": "^0.24.3"
"tsup": "^6.5.0",
"turbo": "^1.6.3",
"typescript": "^4.9.3",
"unocss": "^0.46.5",
"vitest": "^0.25.2"
},
"resolutions": {
"@microsoft/tsdoc-config": "patch:@microsoft/tsdoc-config@npm:0.16.1#.yarn/patches/@microsoft-tsdoc-config-npm-0.16.1-81031b1bbf.patch"
Expand Down
16 changes: 8 additions & 8 deletions packages/actions/package.json
Expand Up @@ -40,19 +40,19 @@
"homepage": "https://discord.js.org",
"dependencies": {
"@actions/core": "^1.10.0",
"tslib": "^2.4.0"
"tslib": "^2.4.1"
},
"devDependencies": {
"@types/node": "16.11.68",
"@vitest/coverage-c8": "^0.24.3",
"@types/node": "16.18.3",
"@vitest/coverage-c8": "^0.25.2",
"cross-env": "^7.0.3",
"eslint": "^8.25.0",
"eslint-config-neon": "^0.1.39",
"eslint": "^8.28.0",
"eslint-config-neon": "^0.1.40",
"eslint-formatter-pretty": "^4.1.0",
"prettier": "^2.7.1",
"tsup": "^6.3.0",
"typescript": "^4.8.4",
"vitest": "^0.24.3"
"tsup": "^6.5.0",
"typescript": "^4.9.3",
"vitest": "^0.25.2"
},
"engines": {
"node": ">=16.9.0"
Expand Down
10 changes: 5 additions & 5 deletions packages/api-extractor-utils/package.json
Expand Up @@ -35,14 +35,14 @@
"@microsoft/tsdoc": "0.14.1"
},
"devDependencies": {
"@types/node": "16.11.68",
"@types/node": "16.18.3",
"cross-env": "^7.0.3",
"eslint": "^8.25.0",
"eslint-config-neon": "^0.1.39",
"eslint": "^8.28.0",
"eslint-config-neon": "^0.1.40",
"eslint-formatter-pretty": "^4.1.0",
"prettier": "^2.7.1",
"tsup": "^6.3.0",
"typescript": "^4.8.4"
"tsup": "^6.5.0",
"typescript": "^4.9.3"
},
"engines": {
"node": ">=16.9.0"
Expand Down
6 changes: 6 additions & 0 deletions packages/brokers/__tests__/index.test.ts
Expand Up @@ -2,6 +2,12 @@ import type Redis from 'ioredis';
import { test, expect, vi } from 'vitest';
import { PubSubRedisBroker } from '../src/index.js';

vi.mock('node:fs', () => {
return {
readFileSync: vi.fn(),
};
});

const mockRedisClient = {
defineCommand: vi.fn(),
xadd: vi.fn(),
Expand Down
23 changes: 12 additions & 11 deletions packages/brokers/package.json
Expand Up @@ -26,7 +26,8 @@
"test": "__tests__"
},
"files": [
"dist"
"dist",
"scripts"
],
"contributors": [
"Crawl <icrawltogo@gmail.com>",
Expand Down Expand Up @@ -57,21 +58,21 @@
"dependencies": {
"@msgpack/msgpack": "^2.8.0",
"@vladfrangu/async_event_emitter": "^2.1.2",
"ioredis": "^5.2.3"
"ioredis": "^5.2.4"
},
"devDependencies": {
"@favware/cliff-jumper": "^1.8.8",
"@microsoft/api-extractor": "^7.33.4",
"@types/node": "^16.11.68",
"@vitest/coverage-c8": "^0.24.3",
"@favware/cliff-jumper": "^1.9.0",
"@microsoft/api-extractor": "^7.33.6",
"@types/node": "16.18.3",
"@vitest/coverage-c8": "^0.25.2",
"cross-env": "^7.0.3",
"eslint": "^8.25.0",
"eslint-config-neon": "^0.1.39",
"eslint": "^8.28.0",
"eslint-config-neon": "^0.1.40",
"eslint-formatter-pretty": "^4.1.0",
"prettier": "^2.7.1",
"tsup": "^6.3.0",
"typescript": "^4.8.4",
"vitest": "^0.24.3"
"tsup": "^6.5.0",
"typescript": "^4.9.3",
"vitest": "^0.25.2"
},
"engines": {
"node": ">=16.9.0"
Expand Down
2 changes: 1 addition & 1 deletion packages/brokers/src/brokers/redis/BaseRedis.ts
Expand Up @@ -61,7 +61,7 @@ export abstract class BaseRedisBroker<TEvents extends Record<string, any>>
this.options = { ...DefaultBrokerOptions, ...options };
options.redisClient.defineCommand('xcleangroup', {
numberOfKeys: 1,
lua: readFileSync(resolve(__dirname, '..', '..', '..', 'scripts', 'xcleangroup.lua'), 'utf8'),
lua: readFileSync(resolve(__dirname, '..', 'scripts', 'xcleangroup.lua'), 'utf8'),
});
this.streamReadClient = options.redisClient.duplicate();
}
Expand Down

0 comments on commit 2e455e3

Please sign in to comment.