From 2193e7746761f996977255b2d9dbb76fa50c29f9 Mon Sep 17 00:00:00 2001 From: Souji Date: Sun, 15 Jun 2025 22:33:38 +0200 Subject: [PATCH 1/2] chore(readme): clarify the use of ES modules in readme examples resolves #10932 --- packages/api-extractor-model/README.md | 2 +- packages/brokers/README.md | 2 ++ packages/core/README.md | 2 ++ packages/discord.js/README.md | 2 ++ packages/formatters/README.md | 2 ++ packages/ws/README.md | 2 ++ 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/api-extractor-model/README.md b/packages/api-extractor-model/README.md index ded4e361bb4f..99983ccbfea0 100644 --- a/packages/api-extractor-model/README.md +++ b/packages/api-extractor-model/README.md @@ -9,7 +9,7 @@ API documentation for this package: https://rushstack.io/pages/api/api-extractor ## Example Usage The following code sample shows how to load `example.api.json`, which would be generated by API Extractor -when it analyzes a hypothetical NPM package called `example`: +when it analyzes a hypothetical NPM package called `example`. The example uses [ES modules](https://nodejs.org/api/esm.html#enabling). ```ts import { ApiModel, ApiPackage } from '@discordjs/api-extractor-model'; diff --git a/packages/brokers/README.md b/packages/brokers/README.md index f50a7ebfac43..a742d4be0701 100644 --- a/packages/brokers/README.md +++ b/packages/brokers/README.md @@ -34,6 +34,8 @@ pnpm add @discordjs/brokers ## Example usage +These examples use [ES modules](https://nodejs.org/api/esm.html#enabling). + ### pub sub ```ts diff --git a/packages/core/README.md b/packages/core/README.md index ed90d42c6b9f..203d7a487c60 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -34,6 +34,8 @@ pnpm add @discordjs/core ## Example usage +These examples use [ES modules](https://nodejs.org/api/esm.html#enabling). + ```ts import { REST } from '@discordjs/rest'; import { WebSocketManager } from '@discordjs/ws'; diff --git a/packages/discord.js/README.md b/packages/discord.js/README.md index b7c530348568..7545460bc72b 100644 --- a/packages/discord.js/README.md +++ b/packages/discord.js/README.md @@ -56,6 +56,8 @@ pnpm add discord.js bun add discord.js ``` +These examples use [ES modules](https://nodejs.org/api/esm.html#enabling). + Register a slash command against the Discord API: ```js diff --git a/packages/formatters/README.md b/packages/formatters/README.md index 04f373cd80bc..9f6351c6c090 100644 --- a/packages/formatters/README.md +++ b/packages/formatters/README.md @@ -35,6 +35,8 @@ bun add @discordjs/formatters ## Example usage +The example uses [ES modules](https://nodejs.org/api/esm.html#enabling). + ````ts import { codeBlock } from '@discordjs/formatters'; diff --git a/packages/ws/README.md b/packages/ws/README.md index 655d5db9ab5a..9b0827801c85 100644 --- a/packages/ws/README.md +++ b/packages/ws/README.md @@ -40,6 +40,8 @@ bun add @discordjs/ws ## Example usage +The example uses [ES modules](https://nodejs.org/api/esm.html#enabling). + ```ts import { WebSocketManager, WebSocketShardEvents, CompressionMethod } from '@discordjs/ws'; import { REST } from '@discordjs/rest'; From 76324df1c3539996a2781d294bf1b8d0b23bcdef Mon Sep 17 00:00:00 2001 From: Souji Date: Sun, 15 Jun 2025 22:46:36 +0200 Subject: [PATCH 2/2] fix: revert api extractor readme changes --- packages/api-extractor-model/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/api-extractor-model/README.md b/packages/api-extractor-model/README.md index 99983ccbfea0..ded4e361bb4f 100644 --- a/packages/api-extractor-model/README.md +++ b/packages/api-extractor-model/README.md @@ -9,7 +9,7 @@ API documentation for this package: https://rushstack.io/pages/api/api-extractor ## Example Usage The following code sample shows how to load `example.api.json`, which would be generated by API Extractor -when it analyzes a hypothetical NPM package called `example`. The example uses [ES modules](https://nodejs.org/api/esm.html#enabling). +when it analyzes a hypothetical NPM package called `example`: ```ts import { ApiModel, ApiPackage } from '@discordjs/api-extractor-model';