mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
build: switch to bundler moduleResolution
This commit is contained in:
18
.yarn/patches/yaml-npm-2.2.2-6e3cddb343.patch
Normal file
18
.yarn/patches/yaml-npm-2.2.2-6e3cddb343.patch
Normal file
@@ -0,0 +1,18 @@
|
||||
diff --git a/package.json b/package.json
|
||||
index fc35658a40f9ba3e3513c459ba9f4f6e1b3f59f5..bc35eda66f270c95ba52e721cb6976fd61622c58 100644
|
||||
--- a/package.json
|
||||
+++ b/package.json
|
||||
@@ -26,11 +26,13 @@
|
||||
},
|
||||
"exports": {
|
||||
".": {
|
||||
+ "types": "./dist/index.d.ts",
|
||||
"node": "./dist/index.js",
|
||||
"default": "./browser/index.js"
|
||||
},
|
||||
"./package.json": "./package.json",
|
||||
"./util": {
|
||||
+ "types": "./dist/util.d.ts",
|
||||
"node": "./dist/util.js",
|
||||
"default": "./browser/dist/util.js"
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
|
||||
export default function H1({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
export function H1({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
return (
|
||||
<h1 className={`group ${className}`} {...props}>
|
||||
{children}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
|
||||
export default function H2({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
export function H2({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
return (
|
||||
<h2 className={`group ${className}`} {...props}>
|
||||
{children}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
|
||||
export default function H3({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
export function H3({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
return (
|
||||
<h3 className={`group ${className}`} {...props}>
|
||||
{children}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { HTMLAttributes, PropsWithChildren } from 'react';
|
||||
|
||||
export default function H4({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
export function H4({ children, className, ...props }: PropsWithChildren<HTMLAttributes<HTMLHeadingElement>>) {
|
||||
return (
|
||||
<h4 className={`group ${className}`} {...props}>
|
||||
{children}
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
import { Alert, Section, DiscordMessages, DiscordMessage, DiscordMessageEmbed } from '@discordjs/ui';
|
||||
import { useMDXComponent } from 'next-contentlayer/hooks';
|
||||
import H1 from './H1';
|
||||
import H2 from './H2';
|
||||
import H3 from './H3';
|
||||
import H4 from './H4';
|
||||
import { H1 } from './H1';
|
||||
import { H2 } from './H2';
|
||||
import { H3 } from './H3';
|
||||
import { H4 } from './H4';
|
||||
import { DocsLink } from '~/components/DocsLink';
|
||||
import { ResultingCode } from '~/components/ResultingCode';
|
||||
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
"~/*": ["./src/*"],
|
||||
"contentlayer/generated": ["./.contentlayer/generated"]
|
||||
},
|
||||
"strictNullChecks": true
|
||||
"strictNullChecks": true,
|
||||
"moduleResolution": "node"
|
||||
},
|
||||
"include": [
|
||||
"src/**/*.ts",
|
||||
|
||||
@@ -1,8 +1,78 @@
|
||||
'use client';
|
||||
|
||||
import { Analytics } from '@vercel/analytics/react';
|
||||
import type { Metadata } from 'next';
|
||||
import { Providers } from './providers';
|
||||
import { DESCRIPTION } from '~/util/constants';
|
||||
import { inter } from '~/util/fonts';
|
||||
|
||||
import '@unocss/reset/tailwind-compat.css';
|
||||
import '~/styles/unocss.css';
|
||||
import '~/styles/cmdk.css';
|
||||
import '~/styles/main.css';
|
||||
|
||||
export const metadata: Metadata = {
|
||||
title: 'discord.js',
|
||||
description: DESCRIPTION,
|
||||
viewport: {
|
||||
minimumScale: 1,
|
||||
initialScale: 1,
|
||||
width: 'device-width',
|
||||
},
|
||||
icons: {
|
||||
other: [
|
||||
{
|
||||
url: '/favicon-32x32.png',
|
||||
sizes: '32x32',
|
||||
type: 'image/png',
|
||||
},
|
||||
{
|
||||
url: '/favicon-16x16.png',
|
||||
sizes: '16x16',
|
||||
type: 'image/png',
|
||||
},
|
||||
],
|
||||
apple: [
|
||||
'/apple-touch-icon.png',
|
||||
{
|
||||
url: '/safari-pinned-tab.svg',
|
||||
rel: 'mask-icon',
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
manifest: '/site.webmanifest',
|
||||
|
||||
themeColor: [
|
||||
{ media: '(prefers-color-scheme: light)', color: '#f1f3f5' },
|
||||
{ media: '(prefers-color-scheme: dark)', color: '#1c1c1e' },
|
||||
],
|
||||
colorScheme: 'light dark',
|
||||
|
||||
appleWebApp: {
|
||||
title: 'discord.js',
|
||||
},
|
||||
|
||||
applicationName: 'discord.js',
|
||||
|
||||
openGraph: {
|
||||
siteName: 'discord.js',
|
||||
type: 'website',
|
||||
title: 'discord.js',
|
||||
description: DESCRIPTION,
|
||||
images: 'https://discordjs.dev/api/open-graph.png',
|
||||
},
|
||||
|
||||
twitter: {
|
||||
card: 'summary_large_image',
|
||||
creator: '@iCrawlToGo',
|
||||
},
|
||||
|
||||
other: {
|
||||
'msapplication-TileColor': '#1c1c1e',
|
||||
},
|
||||
};
|
||||
|
||||
export default function GlobalError({ error }: { error: Error }) {
|
||||
console.error(error);
|
||||
|
||||
@@ -17,6 +87,7 @@ export default function GlobalError({ error }: { error: Error }) {
|
||||
</div>
|
||||
</main>
|
||||
</Providers>
|
||||
<Analytics />
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { addPackageToModel } from '@discordjs/scripts';
|
||||
import { ApiModel, ApiFunction } from '@microsoft/api-extractor-model';
|
||||
import { notFound } from 'next/navigation';
|
||||
import { OVERLOAD_SEPARATOR, PACKAGES } from './constants';
|
||||
import { findMember, findMemberByKey } from './model';
|
||||
import { fetchModelJSON } from '~/app/docAPI';
|
||||
import { OVERLOAD_SEPARATOR, PACKAGES } from './constants.js';
|
||||
import { findMember, findMemberByKey } from './model.js';
|
||||
import { fetchModelJSON } from '~/app/docAPI.js';
|
||||
|
||||
export interface ItemRouteParams {
|
||||
item: string;
|
||||
|
||||
@@ -63,7 +63,9 @@
|
||||
},
|
||||
"resolutions": {
|
||||
"@microsoft/tsdoc-config@~0.16.1": "patch:@microsoft/tsdoc-config@npm%3A0.16.2#./.yarn/patches/@microsoft-tsdoc-config-npm-0.16.2-30fd115d09.patch",
|
||||
"@microsoft/tsdoc-config@0.16.2": "patch:@microsoft/tsdoc-config@npm%3A0.16.2#./.yarn/patches/@microsoft-tsdoc-config-npm-0.16.2-30fd115d09.patch"
|
||||
"@microsoft/tsdoc-config@0.16.2": "patch:@microsoft/tsdoc-config@npm%3A0.16.2#./.yarn/patches/@microsoft-tsdoc-config-npm-0.16.2-30fd115d09.patch",
|
||||
"yaml@^2.2.2": "patch:yaml@npm%3A2.2.2#./.yarn/patches/yaml-npm-2.2.2-6e3cddb343.patch",
|
||||
"yaml@2.2.2": "patch:yaml@npm%3A2.2.2#./.yarn/patches/yaml-npm-2.2.2-6e3cddb343.patch"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=16.9.0"
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"format": "prettier --write . && cross-env TIMING=1 eslint src __tests__ --ext .mjs,.js,.ts --fix --format=pretty",
|
||||
"fmt": "yarn format"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"directories": {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ApiModel, ApiItem } from '@microsoft/api-extractor-model';
|
||||
import type { DocBlock } from '@microsoft/tsdoc';
|
||||
import { blockTag, type DocBlockTagJSON } from './CommentBlockTag.js';
|
||||
import { type AnyDocNodeJSON, type DocNodeJSON, node } from './CommentNode.js';
|
||||
import { createCommentNode } from '.';
|
||||
import { createCommentNode } from './index.js';
|
||||
|
||||
export interface DocBlockJSON extends DocNodeJSON {
|
||||
content: AnyDocNodeJSON[];
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
|
||||
import type { DocNodeContainer } from '@microsoft/tsdoc';
|
||||
import { type AnyDocNodeJSON, type DocNodeJSON, node } from './CommentNode.js';
|
||||
import { createCommentNode } from '.';
|
||||
import { createCommentNode } from './index.js';
|
||||
|
||||
export interface DocNodeContainerJSON extends DocNodeJSON {
|
||||
nodes: AnyDocNodeJSON[];
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ApiItem, ApiModel } from '@microsoft/api-extractor-model';
|
||||
import type { DocComment } from '@microsoft/tsdoc';
|
||||
import { block, type DocBlockJSON } from './CommentBlock.js';
|
||||
import { type DocNodeJSON, node } from './CommentNode.js';
|
||||
import { createCommentNode } from '.';
|
||||
import { createCommentNode } from './index.js';
|
||||
|
||||
export interface DocCommentJSON extends DocNodeJSON {
|
||||
customBlocks: DocBlockJSON[];
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -101,6 +101,7 @@ describe('Button Components', () => {
|
||||
button.toJSON();
|
||||
}).toThrowError();
|
||||
|
||||
// @ts-expect-error: Invalid style
|
||||
expect(() => buttonComponent().setStyle(24)).toThrowError();
|
||||
expect(() => buttonComponent().setLabel(longStr)).toThrowError();
|
||||
// @ts-expect-error: Invalid parameter for disabled
|
||||
|
||||
@@ -240,8 +240,10 @@ describe('Slash Commands', () => {
|
||||
});
|
||||
|
||||
test('GIVEN a builder with valid channel options and channel_types THEN does throw an error', () => {
|
||||
// @ts-expect-error: Invalid channel type
|
||||
expect(() => getBuilder().addChannelOption(getChannelOption().addChannelTypes(100))).toThrowError();
|
||||
|
||||
// @ts-expect-error: Invalid channel types
|
||||
expect(() => getBuilder().addChannelOption(getChannelOption().addChannelTypes(100, 200))).toThrowError();
|
||||
});
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./http-only": {
|
||||
"types": "./dist/http-only.d.ts",
|
||||
"import": "./dist/http-only.mjs",
|
||||
"require": "./dist/http-only.js",
|
||||
"types": "./dist/http-only.d.ts"
|
||||
"require": "./dist/http-only.js"
|
||||
}
|
||||
},
|
||||
"directories": {
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -18,14 +18,14 @@
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./*": {
|
||||
"types": "./dist/exports/*.d.ts",
|
||||
"import": "./dist/exports/*.mjs",
|
||||
"require": "./dist/exports/*.js",
|
||||
"types": "./dist/exports/*.d.ts"
|
||||
"require": "./dist/exports/*.js"
|
||||
}
|
||||
},
|
||||
"directories": {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
"prepack": "yarn lint && yarn build"
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./dist/index.js",
|
||||
"main": "./dist/index.js",
|
||||
"directories": {
|
||||
"lib": "src"
|
||||
},
|
||||
|
||||
@@ -2,7 +2,7 @@ import { createServer } from 'node:http';
|
||||
import { REST } from '@discordjs/rest';
|
||||
import supertest from 'supertest';
|
||||
import { MockAgent, setGlobalDispatcher, type Interceptable } from 'undici';
|
||||
import type { MockInterceptor } from 'undici/types/mock-interceptor';
|
||||
import type { MockInterceptor } from 'undici/types/mock-interceptor.js';
|
||||
import { beforeEach, afterAll, afterEach, test, expect } from 'vitest';
|
||||
import { proxyRequests } from '../src/index.js';
|
||||
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { URL } from 'node:url';
|
||||
import type { RequestMethod, REST, RouteLike } from '@discordjs/rest';
|
||||
import { populateSuccessfulResponse, populateErrorResponse } from '../util/responseHelpers.js';
|
||||
import type { RequestHandler } from '../util/util';
|
||||
import type { RequestHandler } from '../util/util.js';
|
||||
|
||||
/**
|
||||
* Creates an HTTP handler used to forward requests to Discord
|
||||
|
||||
@@ -4,7 +4,7 @@ import { performance } from 'node:perf_hooks';
|
||||
import { MockAgent, setGlobalDispatcher } from 'undici';
|
||||
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
|
||||
import { beforeEach, afterEach, test, expect, vitest } from 'vitest';
|
||||
import { DiscordAPIError, HTTPError, RateLimitError, REST, BurstHandlerMajorIdKey } from '../src/index.js';
|
||||
import { DiscordAPIError, REST, BurstHandlerMajorIdKey } from '../src/index.js';
|
||||
import { BurstHandler } from '../src/lib/handlers/BurstHandler.js';
|
||||
import { genPath } from './util.js';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import type { Snowflake } from 'discord-api-types/v10';
|
||||
import { Routes } from 'discord-api-types/v10';
|
||||
import type { FormData } from 'undici';
|
||||
import { File as UndiciFile, MockAgent, setGlobalDispatcher } from 'undici';
|
||||
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
|
||||
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor.js';
|
||||
import { beforeEach, afterEach, test, expect } from 'vitest';
|
||||
import { REST } from '../src/index.js';
|
||||
import { genPath } from './util.js';
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { performance } from 'node:perf_hooks';
|
||||
import { setInterval, clearInterval, setTimeout } from 'node:timers';
|
||||
import { MockAgent, setGlobalDispatcher } from 'undici';
|
||||
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor';
|
||||
import type { Interceptable, MockInterceptor } from 'undici/types/mock-interceptor.js';
|
||||
import { beforeEach, afterEach, test, expect, vitest } from 'vitest';
|
||||
import { DiscordAPIError, HTTPError, RateLimitError, REST, RESTEvents } from '../src/index.js';
|
||||
import { genPath } from './util.js';
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { RateLimitData } from '../REST';
|
||||
import type { RateLimitData } from '../REST.js';
|
||||
|
||||
export class RateLimitError extends Error implements RateLimitData {
|
||||
public timeToReset: number;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import type { Dispatcher } from 'undici';
|
||||
import type { RequestOptions } from '../REST';
|
||||
import type { RequestOptions } from '../REST.js';
|
||||
import type { HandlerRequestData, RouteData } from '../RequestManager.js';
|
||||
|
||||
export interface IHandler {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { setTimeout as sleep } from 'node:timers/promises';
|
||||
import { AsyncQueue } from '@sapphire/async-queue';
|
||||
import type { Dispatcher } from 'undici';
|
||||
import type { RateLimitData, RequestOptions } from '../REST';
|
||||
import type { HandlerRequestData, RequestManager, RouteData } from '../RequestManager';
|
||||
import type { RateLimitData, RequestOptions } from '../REST.js';
|
||||
import type { HandlerRequestData, RequestManager, RouteData } from '../RequestManager.js';
|
||||
import { RESTEvents } from '../utils/constants.js';
|
||||
import { hasSublimit, onRateLimit, parseHeader } from '../utils/utils.js';
|
||||
import type { IHandler } from './IHandler.js';
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src"
|
||||
@@ -52,7 +52,7 @@
|
||||
"fs-extra": "^11.1.1",
|
||||
"tslib": "^2.5.0",
|
||||
"undici": "^5.22.0",
|
||||
"yaml": "^2.2.2"
|
||||
"yaml": "2.2.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/fs-extra": "^11.0.1",
|
||||
|
||||
@@ -17,9 +17,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -15,11 +15,11 @@
|
||||
"chromatic": "chromatic"
|
||||
},
|
||||
"type": "module",
|
||||
"module": "./dist/ui.js",
|
||||
"main": "./dist/ui.js",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"import": "./dist/ui.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/ui.js"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"directories": {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DiscordMessageEmbedField, type IDiscordMessageEmbedField } from './MessageEmbedField.js';
|
||||
import { DiscordMessageEmbedField, type IDiscordMessageEmbedField } from './MessageEmbedField.jsx';
|
||||
|
||||
export interface IDiscordMessageEmbedFields {
|
||||
fields: IDiscordMessageEmbedField[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expectType } from 'tsd';
|
||||
import type { Equatable } from '../../dist';
|
||||
import type { Equatable } from '../../dist/index.js';
|
||||
import { isEquatable } from '../../src/index.js';
|
||||
|
||||
declare const unknownObj: unknown;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { expectType } from 'tsd';
|
||||
import type { JSONEncodable } from '../../dist';
|
||||
import type { JSONEncodable } from '../../dist/index.js';
|
||||
import { isJSONEncodable } from '../../src/index.js';
|
||||
|
||||
declare const unknownObj: unknown;
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"types": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src"
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"module": "./dist/index.mjs",
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"directories": {
|
||||
"lib": "src",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { setTimeout as sleep } from 'node:timers/promises';
|
||||
import { expect, test, vi, type Mock } from 'vitest';
|
||||
import { expect, test, vi } from 'vitest';
|
||||
import { SimpleIdentifyThrottler } from '../../src/index.js';
|
||||
|
||||
vi.mock('node:timers/promises', () => ({
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
"typings": "./dist/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"types": "./dist/index.d.ts",
|
||||
"import": "./dist/index.mjs",
|
||||
"require": "./dist/index.js",
|
||||
"types": "./dist/index.d.ts"
|
||||
"require": "./dist/index.js"
|
||||
},
|
||||
"./defaultWorker": {
|
||||
"import": "./dist/defaultWorker.mjs",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import type { Awaitable } from '@discordjs/util';
|
||||
import type { APIGatewayBotInfo } from 'discord-api-types/v10';
|
||||
import type { SessionInfo, WebSocketManager, WebSocketManagerOptions } from '../../ws/WebSocketManager';
|
||||
import type { SessionInfo, WebSocketManager, WebSocketManagerOptions } from '../../ws/WebSocketManager.js';
|
||||
|
||||
export interface FetchingStrategyOptions
|
||||
extends Omit<
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Collection } from '@discordjs/collection';
|
||||
import type { Awaitable } from '@discordjs/util';
|
||||
import type { GatewaySendPayload } from 'discord-api-types/v10';
|
||||
import type { WebSocketShardDestroyOptions, WebSocketShardStatus } from '../../ws/WebSocketShard';
|
||||
import type { WebSocketShardDestroyOptions, WebSocketShardStatus } from '../../ws/WebSocketShard.js';
|
||||
|
||||
/**
|
||||
* Strategies responsible for spawning, initializing connections, destroying shards, and relaying events
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Collection } from '@discordjs/collection';
|
||||
import type { GatewaySendPayload } from 'discord-api-types/v10';
|
||||
import type { WebSocketManager } from '../../ws/WebSocketManager';
|
||||
import type { WebSocketManager } from '../../ws/WebSocketManager.js';
|
||||
import { WebSocketShard, WebSocketShardEvents, type WebSocketShardDestroyOptions } from '../../ws/WebSocketShard.js';
|
||||
import { managerToFetchingStrategyOptions } from '../context/IContextFetchingStrategy.js';
|
||||
import { SimpleContextFetchingStrategy } from '../context/SimpleContextFetchingStrategy.js';
|
||||
|
||||
@@ -3,9 +3,13 @@ import { join, isAbsolute, resolve } from 'node:path';
|
||||
import { Worker } from 'node:worker_threads';
|
||||
import { Collection } from '@discordjs/collection';
|
||||
import type { GatewaySendPayload } from 'discord-api-types/v10';
|
||||
import type { IIdentifyThrottler } from '../../throttling/IIdentifyThrottler';
|
||||
import type { SessionInfo, WebSocketManager } from '../../ws/WebSocketManager';
|
||||
import type { WebSocketShardDestroyOptions, WebSocketShardEvents, WebSocketShardStatus } from '../../ws/WebSocketShard';
|
||||
import type { IIdentifyThrottler } from '../../throttling/IIdentifyThrottler.js';
|
||||
import type { SessionInfo, WebSocketManager } from '../../ws/WebSocketManager.js';
|
||||
import type {
|
||||
WebSocketShardDestroyOptions,
|
||||
WebSocketShardEvents,
|
||||
WebSocketShardStatus,
|
||||
} from '../../ws/WebSocketShard.js';
|
||||
import { managerToFetchingStrategyOptions, type FetchingStrategyOptions } from '../context/IContextFetchingStrategy.js';
|
||||
import type { IShardingStrategy } from './IShardingStrategy.js';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { setTimeout as sleep } from 'node:timers/promises';
|
||||
import { Collection } from '@discordjs/collection';
|
||||
import { AsyncQueue } from '@sapphire/async-queue';
|
||||
import type { IIdentifyThrottler } from './IIdentifyThrottler';
|
||||
import type { IIdentifyThrottler } from './IIdentifyThrottler.js';
|
||||
|
||||
/**
|
||||
* The state of a rate limit key's identify queue.
|
||||
|
||||
@@ -10,8 +10,8 @@ import {
|
||||
type GatewayIntentBits,
|
||||
type GatewaySendPayload,
|
||||
} from 'discord-api-types/v10';
|
||||
import type { IShardingStrategy } from '../strategies/sharding/IShardingStrategy';
|
||||
import type { IIdentifyThrottler } from '../throttling/IIdentifyThrottler';
|
||||
import type { IShardingStrategy } from '../strategies/sharding/IShardingStrategy.js';
|
||||
import type { IIdentifyThrottler } from '../throttling/IIdentifyThrottler.js';
|
||||
import { DefaultWebSocketManagerOptions, type CompressionMethod, type Encoding } from '../utils/constants.js';
|
||||
import type { WebSocketShardDestroyOptions, WebSocketShardEventsMap } from './WebSocketShard.js';
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
} from 'discord-api-types/v10';
|
||||
import { WebSocket, type RawData } from 'ws';
|
||||
import type { Inflate } from 'zlib-sync';
|
||||
import type { IContextFetchingStrategy } from '../strategies/context/IContextFetchingStrategy';
|
||||
import type { IContextFetchingStrategy } from '../strategies/context/IContextFetchingStrategy.js';
|
||||
import { ImportantGatewayOpcodes, getInitialSendRateLimitState } from '../utils/constants.js';
|
||||
import type { SessionInfo } from './WebSocketManager.js';
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
|
||||
// Modules
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
|
||||
// Emit
|
||||
|
||||
15
yarn.lock
15
yarn.lock
@@ -2356,7 +2356,7 @@ __metadata:
|
||||
typescript: ^5.0.4
|
||||
undici: ^5.22.0
|
||||
vitest: ^0.29.8
|
||||
yaml: ^2.2.2
|
||||
yaml: 2.2.2
|
||||
languageName: unknown
|
||||
linkType: soft
|
||||
|
||||
@@ -26052,6 +26052,13 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yaml@npm:2.2.2, yaml@npm:^2.1.1":
|
||||
version: 2.2.2
|
||||
resolution: "yaml@npm:2.2.2"
|
||||
checksum: d90c235e099e30094dcff61ba3350437aef53325db4a6bcd04ca96e1bfe7e348b191f6a7a52b5211e2dbc4eeedb22a00b291527da030de7c189728ef3f2b4eb3
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yaml@npm:^1.10.2":
|
||||
version: 1.10.2
|
||||
resolution: "yaml@npm:1.10.2"
|
||||
@@ -26059,10 +26066,10 @@ __metadata:
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
"yaml@npm:^2.1.1, yaml@npm:^2.2.2":
|
||||
"yaml@patch:yaml@npm%3A2.2.2#./.yarn/patches/yaml-npm-2.2.2-6e3cddb343.patch::locator=%40discordjs%2Fdiscord.js%40workspace%3A.":
|
||||
version: 2.2.2
|
||||
resolution: "yaml@npm:2.2.2"
|
||||
checksum: d90c235e099e30094dcff61ba3350437aef53325db4a6bcd04ca96e1bfe7e348b191f6a7a52b5211e2dbc4eeedb22a00b291527da030de7c189728ef3f2b4eb3
|
||||
resolution: "yaml@patch:yaml@npm%3A2.2.2#./.yarn/patches/yaml-npm-2.2.2-6e3cddb343.patch::version=2.2.2&hash=2af928&locator=%40discordjs%2Fdiscord.js%40workspace%3A."
|
||||
checksum: 3ef8fd54fae7a810ea323a9d183b37698aaf7c0ab03334a4740a919489361ef7014c8ffefe561f21086cd697ec7c3643cb0551c9f729f24ce9d1c2904a213727
|
||||
languageName: node
|
||||
linkType: hard
|
||||
|
||||
|
||||
Reference in New Issue
Block a user