build: bump dependencies (#10457)

* build: bump `@vladfrangu/async_event_emitter`

* chore: bump again + fixes

* build: bump types/node and some dev deps

* build: bump discord-api-types again

* style: remove unused eslint-ignore comment

* build: sync dependencies and update templates

* build: bump turbo

* build: vercel + vitest

* build: bump undici

---------

Co-authored-by: Vlad Frangu <me@vladfrangu.dev>
This commit is contained in:
Almeida
2024-08-22 16:33:35 +01:00
committed by GitHub
parent bddf018f26
commit e2e71b4d09
75 changed files with 6887 additions and 10885 deletions

View File

@@ -69,14 +69,14 @@
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/html-escaper": "^3.0.2",
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@unocss/eslint-plugin": "^0.60.4",
"@unocss/postcss": "^0.60.4",
"@unocss/reset": "^0.60.4",
"@vitejs/plugin-react": "^4.3.0",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
@@ -86,12 +86,12 @@
"hastscript": "^8.0.0",
"html-escaper": "^3.0.3",
"postcss": "^8.4.38",
"prettier": "^3.3.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"prettier": "^3.3.3",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"unocss": "^0.60.4",
"vercel": "^34.2.4",
"vitest": "^1.6.0"
"vercel": "^37.0.0",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -50,10 +50,9 @@
"@radix-ui/react-collapsible": "^1.0.3",
"@react-icons/all-files": "^4.1.0",
"@vercel/analytics": "^1.3.1",
"@vercel/blob": "^0.23.3",
"@vercel/edge-config": "^1.1.1",
"@vercel/og": "^0.6.2",
"@vercel/postgres": "^0.8.0",
"@vercel/postgres": "^0.9.0",
"cmdk": "^1.0.0",
"geist": "^1.3.0",
"jotai": "^2.8.2",
@@ -76,11 +75,11 @@
"@tailwindcss/typography": "^0.5.13",
"@testing-library/react": "^15.0.7",
"@testing-library/user-event": "^14.5.2",
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@vitejs/plugin-react": "^4.3.0",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"autoprefixer": "^10.4.19",
"babel-plugin-react-compiler": "0.0.0-experimental-592953e-20240517",
"cpy-cli": "^5.0.0",
@@ -90,16 +89,16 @@
"eslint-formatter-pretty": "^6.0.1",
"happy-dom": "^14.12.0",
"postcss": "^8.4.38",
"prettier": "^3.3.0",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.5.14",
"remark-gfm": "^4.0.0",
"remark-rehype": "^11.1.0",
"shiki": "^1.6.2",
"tailwindcss": "^3.4.3",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vercel": "^34.2.4",
"vitest": "^1.6.0"
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vercel": "^37.0.0",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -4,7 +4,7 @@ import { BuiltinDocumentationLinks } from '~/util/builtinDocumentationLinks';
export async function ExcerptNode({ node, version }: { readonly node?: any; readonly version: string }) {
const createExcerpt = (excerpts: any) => {
const excerpt = Array.isArray(excerpts) ? excerpts : excerpts.excerpts ?? [excerpts];
const excerpt = Array.isArray(excerpts) ? excerpts : (excerpts.excerpts ?? [excerpts]);
return (
<span

View File

@@ -50,28 +50,28 @@
"homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor",
"devDependencies": {
"@commitlint/cli": "^19.3.0",
"@commitlint/cli": "^19.4.0",
"@commitlint/config-angular": "^19.3.0",
"@favware/cliff-jumper": "^3.0.3",
"@favware/npm-deprecate": "^1.0.7",
"@types/lodash.merge": "^4.6.9",
"@unocss/eslint-plugin": "^0.59.4",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"conventional-changelog-cli": "^4.1.0",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"husky": "^9.0.11",
"husky": "^9.1.5",
"is-ci": "^3.0.1",
"lint-staged": "^15.2.5",
"lint-staged": "^15.2.9",
"lodash.merge": "^4.6.2",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"typescript-eslint": "^7.11.0",
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"typescript-eslint": "^8.2.0",
"unocss": "^0.60.4",
"vercel": "^34.2.4",
"vitest": "^1.6.0"
"vercel": "^37.0.0",
"vitest": "^2.0.5"
},
"pnpm": {
"peerDependencyRules": {
@@ -97,5 +97,5 @@
"engines": {
"node": ">=18"
},
"packageManager": "pnpm@9.1.4"
"packageManager": "pnpm@9.8.0"
}

View File

@@ -42,27 +42,27 @@
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/glob": "^0.4.0",
"@actions/glob": "^0.5.0",
"@discordjs/scripts": "workspace:^",
"@vercel/blob": "^0.22.3",
"@vercel/postgres": "^0.8.0",
"@vercel/blob": "^0.23.4",
"@vercel/postgres": "^0.9.0",
"meilisearch": "^0.38.0",
"p-limit": "^5.0.0",
"tslib": "^2.6.2",
"undici": "6.18.2"
"p-limit": "^6.1.0",
"tslib": "^2.6.3",
"undici": "6.19.8"
},
"devDependencies": {
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -4,7 +4,7 @@ export function formatTag(tag: string) {
if (parsed?.groups) {
const isSubpackage = typeof parsed.groups.package === 'string';
const pkg = isSubpackage ? parsed.groups.package : parsedPackage?.groups?.package ?? 'discord.js';
const pkg = isSubpackage ? parsed.groups.package : (parsedPackage?.groups?.package ?? 'discord.js');
const semver = parsed.groups.semver;
return {

View File

@@ -53,7 +53,6 @@ try {
console.log('Uploading indices...');
try {
// eslint-disable-next-line @typescript-eslint/no-floating-promises
promises = indices.map(async (index) =>
limit(async () => {
console.log(`Uploading ${index.index}...`);

View File

@@ -37,14 +37,14 @@
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/node": "^18.19.33",
"@types/node": "^18.19.45",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"jest": "^29.7.0",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14"
}
}

View File

@@ -380,7 +380,7 @@ export class ApiPackage extends ApiItemContainerMixin(ApiNameMixin(ApiDocumented
toolPackage: ioptions.toolPackage ?? packageJson.name,
// In test mode, we don't write the real version, since that would cause spurious diffs whenever
// the version is bumped. Instead we write a placeholder string.
toolVersion: ioptions.testMode ? '[test mode]' : ioptions.toolVersion ?? packageJson.version,
toolVersion: ioptions.testMode ? '[test mode]' : (ioptions.toolVersion ?? packageJson.version),
schemaVersion: ApiJsonSchemaVersion.LATEST,
oldestForwardsCompatibleVersion: ApiJsonSchemaVersion.OLDEST_FORWARDS_COMPATIBLE,
tsdocConfig,

View File

@@ -182,7 +182,9 @@ export interface DocgenJson {
}
function formatVarType(type: DocgenVarTypeJson): string {
return (Array.isArray(type) ? type : type.types ?? []).map((t1) => t1.map((t2) => t2.join('')).join('')).join(' | ');
return (Array.isArray(type) ? type : (type.types ?? []))
.map((t1) => t1.map((t2) => t2.join('')).join(''))
.join(' | ');
}
function getFirstType(type: DocgenVarTypeJson): string {
@@ -192,7 +194,7 @@ function getFirstType(type: DocgenVarTypeJson): string {
// function mapEvent(_event: DocgenEventJson, _package: string, _parent: DocgenClassJson): void {}
function mapVarType(type: DocgenVarTypeJson, _package: string): IExcerptToken[] {
const mapper = Array.isArray(type) ? type : type.types ?? [];
const mapper = Array.isArray(type) ? type : (type.types ?? []);
return mapper.flatMap((typ) =>
typ.reduce<IExcerptToken[]>(
(arr, [_class, symbol]) => [

View File

@@ -50,15 +50,15 @@
"@microsoft/tsdoc": "0.14.2"
},
"devDependencies": {
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4"
},
"engines": {
"node": ">=18"

View File

@@ -199,7 +199,7 @@ export function genToken(model: ApiModel, token: ExcerptToken, version: string)
}
const item = token.canonicalReference
? model.resolveDeclarationReference(token.canonicalReference, undefined).resolvedApiItem ?? null
? (model.resolveDeclarationReference(token.canonicalReference, undefined).resolvedApiItem ?? null)
: null;
return {

View File

@@ -61,12 +61,12 @@
"resolve": "~1.22.1",
"semver": "~7.5.4",
"source-map": "0.6.1",
"typescript": "^5.4.5"
"typescript": "~5.5.4"
},
"devDependencies": {
"@types/jest": "^29.5.12",
"@types/lodash": "^4.17.4",
"@types/node": "^18.19.33",
"@types/node": "^18.19.45",
"@types/resolve": "^1.20.6",
"@types/semver": "^7.5.8",
"cpy-cli": "^5.0.0",
@@ -75,8 +75,8 @@
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"jest": "^29.7.0",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14"
}
}

View File

@@ -1423,7 +1423,9 @@ export class ApiModelGenerator {
}${
'returns' in jsDoc
? jsDoc.returns
.map((ret) => ` * @returns ${Array.isArray(ret) ? '' : this._fixLinkTags(ret.description) ?? ''}\n`)
.map(
(ret) => ` * @returns ${Array.isArray(ret) ? '' : (this._fixLinkTags(ret.description) ?? '')}\n`,
)
.join('')
: ''
} */`,
@@ -1764,7 +1766,7 @@ export class ApiModelGenerator {
}
private _mapVarType(typey: DocgenVarTypeJson): IExcerptToken[] {
const mapper = Array.isArray(typey) ? typey : typey.types ?? [];
const mapper = Array.isArray(typey) ? typey : (typey.types ?? []);
const lookup: { [K in ts.SyntaxKind]?: string } = {
[ts.SyntaxKind.ClassDeclaration]: 'class',
[ts.SyntaxKind.EnumDeclaration]: 'enum',

View File

@@ -68,25 +68,25 @@
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@msgpack/msgpack": "^3.0.0-beta2",
"@vladfrangu/async_event_emitter": "^2.2.4",
"@vladfrangu/async_event_emitter": "^2.4.6",
"ioredis": "^5.4.1"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -30,17 +30,17 @@ export const DefaultBrokerOptions = {
} as const satisfies Required<BaseBrokerOptions>;
export type ToEventMap<
TRecord extends Record<string, any>,
TRecord extends Record<string, any[]>,
TResponses extends Record<keyof TRecord, any> | undefined = undefined,
> = {
[TKey in keyof TRecord]: [
event: TResponses extends Record<keyof TRecord, any>
? { ack(): Promise<void>; reply(data: TResponses[TKey]): Promise<void> }
: { ack(): Promise<void> } & { data: TRecord[TKey] },
: { ack(): Promise<void>; data: TRecord[TKey] },
];
} & { [K: string]: any };
};
export interface IBaseBroker<TEvents extends Record<string, any>> {
export interface IBaseBroker<TEvents extends {}> {
/**
* Subscribes to the given events
*/
@@ -51,7 +51,7 @@ export interface IBaseBroker<TEvents extends Record<string, any>> {
unsubscribe(events: (keyof TEvents)[]): Promise<void>;
}
export interface IPubSubBroker<TEvents extends Record<string, any>>
export interface IPubSubBroker<TEvents extends {}>
extends IBaseBroker<TEvents>,
AsyncEventEmitter<ToEventMap<TEvents>> {
/**
@@ -60,7 +60,7 @@ export interface IPubSubBroker<TEvents extends Record<string, any>>
publish<Event extends keyof TEvents>(event: Event, data: TEvents[Event]): Promise<void>;
}
export interface IRPCBroker<TEvents extends Record<string, any>, TResponses extends Record<keyof TEvents, any>>
export interface IRPCBroker<TEvents extends Record<string, any[]>, TResponses extends Record<keyof TEvents, any>>
extends IBaseBroker<TEvents>,
AsyncEventEmitter<ToEventMap<TEvents, TResponses>> {
/**

View File

@@ -57,8 +57,11 @@ export const DefaultRedisBrokerOptions = {
/**
* Helper class with shared Redis logic
*/
export abstract class BaseRedisBroker<TEvents extends Record<string, any>>
extends AsyncEventEmitter<ToEventMap<TEvents>>
export abstract class BaseRedisBroker<
TEvents extends Record<string, any[]>,
TResponses extends Record<keyof TEvents, any> | undefined = undefined,
>
extends AsyncEventEmitter<ToEventMap<TEvents, TResponses>>
implements IBaseBroker<TEvents>
{
/**
@@ -182,6 +185,7 @@ export abstract class BaseRedisBroker<TEvents extends Record<string, any>>
}
}
} catch (error) {
// @ts-expect-error: Intended
this.emit('error', error);
break;
}

View File

@@ -48,6 +48,7 @@ export class PubSubRedisBroker<TEvents extends Record<string, any>>
},
};
// @ts-expect-error: Intended
this.emit(event, payload);
}
}

View File

@@ -54,8 +54,8 @@ export const DefaultRPCRedisBrokerOptions = {
* await broker.subscribe('responders', ['testcall']);
* ```
*/
export class RPCRedisBroker<TEvents extends Record<string, any>, TResponses extends Record<keyof TEvents, any>>
extends BaseRedisBroker<TEvents>
export class RPCRedisBroker<TEvents extends Record<string, any[]>, TResponses extends Record<keyof TEvents, any>>
extends BaseRedisBroker<TEvents, TResponses>
implements IRPCBroker<TEvents, TResponses>
{
/**
@@ -125,6 +125,7 @@ export class RPCRedisBroker<TEvents extends Record<string, any>, TResponses exte
},
};
// @ts-expect-error: Intended
this.emit(event, payload);
}
}

View File

@@ -68,27 +68,27 @@
"@discordjs/formatters": "workspace:^",
"@discordjs/util": "workspace:^",
"@sapphire/shapeshift": "^4.0.0",
"discord-api-types": "0.37.96",
"discord-api-types": "0.37.97",
"fast-deep-equal": "^3.1.3",
"ts-mixer": "^6.0.4",
"tslib": "^2.6.2"
"tslib": "^2.6.3"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "16.18.60",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^16.18.105",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=16.11.0"

View File

@@ -64,18 +64,18 @@
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -69,25 +69,25 @@
"@discordjs/util": "workspace:^",
"@discordjs/ws": "workspace:^",
"@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.2.4",
"discord-api-types": "0.37.96"
"@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "0.37.97"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -6,7 +6,7 @@ import {
type RESTGetAPIEntitlementsQuery,
type RESTGetAPIEntitlementsResult,
type RESTGetAPISKUsResult,
type RESTPostAPIEntitlementBody,
type RESTPostAPIEntitlementJSONBody,
type RESTPostAPIEntitlementResult,
type Snowflake,
} from 'discord-api-types/v10';
@@ -53,7 +53,7 @@ export class MonetizationAPI {
*/
public async createTestEntitlement(
applicationId: Snowflake,
body: RESTPostAPIEntitlementBody,
body: RESTPostAPIEntitlementJSONBody,
{ signal }: Pick<RequestData, 'signal'> = {},
) {
return this.rest.post(Routes.entitlements(applicationId), {

View File

@@ -3,7 +3,7 @@
import type { RequestData, REST } from '@discordjs/rest';
import {
Routes,
type RESTGetAPIStickerPack,
type RESTGetAPIStickerPackResult,
type RESTGetAPIStickerResult,
type RESTGetStickerPacksResult,
type Snowflake,
@@ -20,7 +20,7 @@ export class StickersAPI {
* @param options - The options for fetching the sticker pack
*/
public async getStickerPack(packId: Snowflake, { signal }: Pick<RequestData, 'signal'> = {}) {
return this.rest.get(Routes.stickerPack(packId), { signal }) as Promise<RESTGetAPIStickerPack>;
return this.rest.get(Routes.stickerPack(packId), { signal }) as Promise<RESTGetAPIStickerPackResult>;
}
/**

View File

@@ -238,11 +238,9 @@ export class Client extends AsyncEventEmitter<MappedEvents> {
});
try {
const iterator = AsyncEventEmitter.on<
typeof this,
ManagerShardEventsMap,
GatewayDispatchEvents.GuildMembersChunk
>(this, GatewayDispatchEvents.GuildMembersChunk, { signal: controller.signal });
const iterator = AsyncEventEmitter.on(this, GatewayDispatchEvents.GuildMembersChunk, {
signal: controller.signal,
});
for await (const [{ data }] of iterator) {
if (data.nonce !== nonce) continue;

View File

@@ -58,19 +58,19 @@
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"@types/prompts": "^2.4.9",
"@types/validate-npm-package-name": "^4.0.2",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"prettier": "^3.3.3",
"terser": "^5.31.0",
"tsup": "^8.1.0",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"tsup": "^8.2.4",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -12,14 +12,13 @@
},
"dependencies": {
"@discordjs/core": "^1.2.0",
"discord.js": "^14.15.0"
"discord.js": "^14.15.3"
},
"devDependencies": {
"@sapphire/ts-config": "^4.0.1",
"eslint": "^8.53.0",
"eslint-config-neon": "^0.1.57",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.1.0",
"zod": "^3.22.4"
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.3",
"zod": "^3.23.8"
}
}

View File

@@ -12,16 +12,16 @@
},
"dependencies": {
"@discordjs/core": "^1.2.0",
"discord.js": "^14.15.0"
"discord.js": "^14.15.3"
},
"devDependencies": {
"@sapphire/ts-config": "^5.0.0",
"bun-types": "^1.0.9",
"eslint": "^8.53.0",
"eslint-config-neon": "^0.1.57",
"eslint-formatter-pretty": "^5.0.0",
"@sapphire/ts-config": "^5.0.1",
"@types/bun": "^1.1.6",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.1.0",
"typescript": "^5.2.2",
"zod": "^3.22.4"
"typescript": "~5.5.4",
"zod": "^3.23.8"
}
}

View File

@@ -10,7 +10,6 @@
"outDir": "dist",
"noEmit": true,
"allowImportingTsExtensions": true,
"types": ["bun-types"],
"skipLibCheck": true
}
}

View File

@@ -1,5 +1,5 @@
import type { RESTPostAPIApplicationCommandsJSONBody, CommandInteraction } from 'npm:discord.js@^14.14.1';
import { z } from 'npm:zod@^3.22.4';
import type { RESTPostAPIApplicationCommandsJSONBody, CommandInteraction } from 'npm:discord.js@^14.15.3';
import { z } from 'npm:zod@^3.23.8';
import type { StructurePredicate } from '../util/loaders.ts';
/**

View File

@@ -1,5 +1,5 @@
import type { ClientEvents } from 'npm:discord.js@^14.14.1';
import { z } from 'npm:zod@^3.22.4';
import type { ClientEvents } from 'npm:discord.js@^14.15.3';
import { z } from 'npm:zod@^3.23.8';
import type { StructurePredicate } from '../util/loaders.ts';
/**

View File

@@ -1,6 +1,6 @@
import 'https://deno.land/std@0.199.0/dotenv/load.ts';
import { URL } from 'node:url';
import { Client, GatewayIntentBits } from 'npm:discord.js@^14.15.0';
import { Client, GatewayIntentBits } from 'npm:discord.js@^14.15.3';
import { loadCommands, loadEvents } from './util/loaders.ts';
import { registerEvents } from './util/registerEvents.ts';

View File

@@ -1,7 +1,7 @@
import 'https://deno.land/std@0.199.0/dotenv/load.ts';
import 'https://deno.land/std@0.223.0/dotenv/load.ts';
import { URL } from 'node:url';
import { API } from 'npm:@discordjs/core@^1.1.1/http-only';
import { REST } from 'npm:discord.js@^14.14.1';
import { API } from 'npm:@discordjs/core@^1.2.0/http-only';
import { REST } from 'npm:discord.js@^14.15.3';
import { loadCommands } from './loaders.ts';
const commands = await loadCommands(new URL('../commands/', import.meta.url));

View File

@@ -12,14 +12,14 @@
},
"dependencies": {
"@discordjs/core": "^1.2.0",
"discord.js": "^14.15.0",
"dotenv": "^16.3.1"
"discord.js": "^14.15.3",
"dotenv": "^16.4.5"
},
"devDependencies": {
"eslint": "^8.53.0",
"eslint-config-neon": "^0.1.57",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.1.0",
"zod": "^3.22.4"
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.3",
"zod": "^3.23.8"
}
}

View File

@@ -13,17 +13,17 @@
},
"dependencies": {
"@discordjs/core": "^1.2.0",
"discord.js": "^14.15.0",
"dotenv": "^16.3.1"
"discord.js": "^14.15.3",
"dotenv": "^16.4.5"
},
"devDependencies": {
"@sapphire/ts-config": "^5.0.0",
"@types/node": "^18.18.8",
"eslint": "^8.53.0",
"eslint-config-neon": "^0.1.57",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.1.0",
"typescript": "^5.2.2",
"zod": "^3.22.4"
"@sapphire/ts-config": "^5.0.1",
"@types/node": "^18.19.45",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.3",
"typescript": "~5.5.4",
"zod": "^3.23.8"
}
}

View File

@@ -72,30 +72,30 @@
"@discordjs/util": "workspace:^",
"@discordjs/ws": "1.1.1",
"@sapphire/snowflake": "3.5.3",
"discord-api-types": "0.37.96",
"discord-api-types": "0.37.97",
"fast-deep-equal": "3.1.3",
"lodash.snakecase": "4.1.1",
"tslib": "2.6.2",
"undici": "6.18.2"
"tslib": "^2.6.3",
"undici": "6.19.8"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/docgen": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "3.0.2",
"@types/node": "16.18.60",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@favware/cliff-jumper": "^3.0.2",
"@types/node": "^16.18.105",
"@typescript-eslint/eslint-plugin": "^8.2.0",
"@typescript-eslint/parser": "^8.2.0",
"cross-env": "^7.0.3",
"dtslint": "4.2.1",
"eslint": "8.57.0",
"eslint-formatter-pretty": "5.0.0",
"eslint": "^8.57.0",
"eslint-formatter-pretty": "^5.0.0",
"jest": "29.7.0",
"prettier": "3.2.5",
"tsd": "0.31.0",
"prettier": "^3.3.3",
"tsd": "^0.31.1",
"tslint": "6.1.3",
"turbo": "^1.13.3",
"typescript": "5.4.5"
"turbo": "^2.0.14",
"typescript": "~5.5.4"
},
"engines": {
"node": ">=16.11.0"

View File

@@ -65,7 +65,7 @@ class BaseInteraction extends Base {
* If this interaction was sent in a guild, the member which sent it
* @type {?(GuildMember|APIInteractionGuildMember)}
*/
this.member = data.member ? this.guild?.members._add(data.member) ?? data.member : null;
this.member = data.member ? (this.guild?.members._add(data.member) ?? data.member) : null;
/**
* The version

View File

@@ -184,7 +184,7 @@ class ClientApplication extends Application {
? new Team(this.client, data.team)
: data.owner
? this.client.users._add(data.owner)
: this.owner ?? null;
: (this.owner ?? null);
}
/**

View File

@@ -193,7 +193,7 @@ class Embed {
get hexColor() {
return typeof this.data.color === 'number'
? `#${this.data.color.toString(16).padStart(6, '0')}`
: this.data.color ?? null;
: (this.data.color ?? null);
}
/**

View File

@@ -154,7 +154,7 @@ class GuildAuditLogsEntry {
this.executor = data.user_id
? guild.client.options.partials.includes(Partials.User)
? guild.client.users._add({ id: data.user_id })
: guild.client.users.cache.get(data.user_id) ?? null
: (guild.client.users.cache.get(data.user_id) ?? null)
: null;
/**
@@ -300,7 +300,7 @@ class GuildAuditLogsEntry {
} else if (targetType === Targets.User && data.target_id) {
this.target = guild.client.options.partials.includes(Partials.User)
? guild.client.users._add({ id: data.target_id })
: guild.client.users.cache.get(data.target_id) ?? null;
: (guild.client.users.cache.get(data.target_id) ?? null);
} else if (targetType === Targets.Guild) {
this.target = guild.client.guilds.cache.get(data.target_id);
} else if (targetType === Targets.Webhook) {
@@ -323,8 +323,8 @@ class GuildAuditLogsEntry {
// Discord sends a channel id for the MessageBulkDelete action type.
this.target =
data.action_type === AuditLogEvent.MessageBulkDelete
? guild.channels.cache.get(data.target_id) ?? { id: data.target_id }
: guild.client.users.cache.get(data.target_id) ?? null;
? (guild.channels.cache.get(data.target_id) ?? { id: data.target_id })
: (guild.client.users.cache.get(data.target_id) ?? null);
} else if (targetType === Targets.Integration) {
this.target =
logs?.integrations.get(data.target_id) ??

View File

@@ -192,7 +192,7 @@ class MessagePayload {
let message_reference;
if (typeof this.options.reply === 'object') {
const reference = this.options.reply.messageReference;
const message_id = this.isMessage ? reference.id ?? reference : this.target.messages.resolveId(reference);
const message_id = this.isMessage ? (reference.id ?? reference) : this.target.messages.resolveId(reference);
if (message_id) {
message_reference = {
message_id,

View File

@@ -86,7 +86,7 @@ class ThreadChannel extends BaseChannel {
* <info>This property is always `null` in public threads.</info>
* @type {?boolean}
*/
this.invitable = this.type === ChannelType.PrivateThread ? data.thread_metadata.invitable ?? false : null;
this.invitable = this.type === ChannelType.PrivateThread ? (data.thread_metadata.invitable ?? false) : null;
/**
* Whether the thread is archived

View File

@@ -99,7 +99,7 @@ function transformAPIGuildForumTag(tag) {
name: tag.name,
moderated: tag.moderated,
emoji:
tag.emoji_id ?? tag.emoji_name
(tag.emoji_id ?? tag.emoji_name)
? {
id: tag.emoji_id,
name: tag.emoji_name,

View File

@@ -62,21 +62,21 @@
"dependencies": {
"commander": "^12.1.0",
"jsdoc-to-markdown": "^8.0.1",
"tslib": "^2.6.2",
"tslib": "^2.6.3",
"typedoc": "^0.25.13"
},
"devDependencies": {
"@favware/cliff-jumper": "^3.0.3",
"@types/jsdoc-to-markdown": "^7.0.6",
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4"
},
"engines": {
"node": ">=18"

View File

@@ -112,11 +112,11 @@ export class DocumentedClass extends DocumentedItem<Class | DeclarationReflectio
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
abstract: signature.comment?.blockTags?.some((block) => block.tag === '@abstract') || undefined,
deprecated: signature.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? signature.comment.blockTags
? (signature.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
construct: this.construct?.serialize(),
props: this.props.size ? [...this.props.values()].map((param) => param.serialize()) : undefined,

View File

@@ -44,11 +44,11 @@ export class DocumentedEvent extends DocumentedItem<DeclarationReflection | Even
: undefined,
examples,
deprecated: signature.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? signature.comment.blockTags
? (signature.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
// @ts-expect-error: Parameters type is not available
params: signature.parameters

View File

@@ -39,11 +39,11 @@ export class DocumentedMember extends DocumentedItem<DeclarationReflection | Mem
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
abstract: signature.comment?.blockTags?.some((block) => block.tag === '@abstract') || undefined,
deprecated: signature.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? signature.comment.blockTags
? (signature.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
default:
(data.defaultValue === '...' ? undefined : data.defaultValue) ??
@@ -92,11 +92,11 @@ export class DocumentedMember extends DocumentedItem<DeclarationReflection | Mem
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
abstract: getter.comment?.blockTags?.some((block) => block.tag === '@abstract') || undefined,
deprecated: getter.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? getter.comment.blockTags
? (getter.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
default:
base.default ??

View File

@@ -46,11 +46,11 @@ export class DocumentedMethod extends DocumentedItem<DeclarationReflection | Met
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
abstract: signature.comment?.blockTags?.some((block) => block.tag === '@abstract') || undefined,
deprecated: signature.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? signature.comment.blockTags
? (signature.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
// emits: signature.comment?.blockTags?.filter((t) => t.tag === '@emits').map((t) => t.content),
// @ts-expect-error: Typescript doesn't know that this is a SignatureReflection

View File

@@ -36,11 +36,11 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
? 'private'
: undefined,
deprecated: signature.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? signature.comment.blockTags
? (signature.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
type: signature.type
? new DocumentedVarType({ names: [parseType(signature.type)] }, this.config).serialize()
@@ -163,11 +163,11 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
? 'private'
: undefined,
deprecated: sig?.comment?.blockTags?.some((block) => block.tag === '@deprecated')
? sig.comment.blockTags
? (sig.comment.blockTags
.find((block) => block.tag === '@deprecated')
// eslint-disable-next-line no-param-reassign
?.content.reduce((prev, curr) => (prev += curr.text), '')
.trim() ?? true
.trim() ?? true)
: undefined,
params,
returns: sig?.type

View File

@@ -55,24 +55,24 @@
"homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"discord-api-types": "0.37.96"
"discord-api-types": "0.37.97"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "16.18.60",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^16.18.105",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=16.11.0"

View File

@@ -72,24 +72,24 @@
"@discordjs/rest": "workspace:^",
"@discordjs/util": "workspace:^",
"@discordjs/ws": "workspace:^",
"discord-api-types": "0.37.96"
"discord-api-types": "0.37.97"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -47,18 +47,18 @@
"dependencies": {
"@discordjs/proxy": "workspace:^",
"@discordjs/rest": "workspace:^",
"tslib": "^2.6.2"
"tslib": "^2.6.3"
},
"devDependencies": {
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4"
},
"engines": {
"node": ">=18"

View File

@@ -67,27 +67,27 @@
"dependencies": {
"@discordjs/rest": "workspace:^",
"@discordjs/util": "workspace:^",
"tslib": "^2.6.2",
"undici": "6.18.2"
"tslib": "^2.6.3",
"undici": "6.19.8"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"@types/supertest": "^6.0.2",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"prettier": "^3.3.3",
"supertest": "^7.0.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -85,30 +85,30 @@
"dependencies": {
"@discordjs/collection": "workspace:^",
"@discordjs/util": "workspace:^",
"@sapphire/async-queue": "^1.5.2",
"@sapphire/async-queue": "^1.5.3",
"@sapphire/snowflake": "^3.5.3",
"@vladfrangu/async_event_emitter": "^2.2.4",
"discord-api-types": "0.37.96",
"@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "0.37.97",
"magic-bytes.js": "^1.10.0",
"tslib": "^2.6.2",
"undici": "6.18.2"
"tslib": "^2.6.3",
"undici": "6.19.8"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.17.9",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=16.11.0"

View File

@@ -59,32 +59,32 @@
"homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@actions/glob": "^0.4.0",
"@actions/glob": "^0.5.0",
"@discordjs/api-extractor-model": "workspace:^",
"@discordjs/api-extractor-utils": "workspace:^",
"@microsoft/tsdoc": "0.14.2",
"@microsoft/tsdoc-config": "0.16.2",
"@vercel/blob": "^0.22.3",
"@vercel/postgres": "^0.8.0",
"@vercel/blob": "^0.23.4",
"@vercel/postgres": "^0.9.0",
"commander": "^12.1.0",
"tslib": "^2.6.2",
"undici": "6.18.2",
"yaml": "2.4.3"
"tslib": "^2.6.3",
"undici": "6.19.8",
"yaml": "^2.5.0"
},
"devDependencies": {
"@turbo/gen": "^1.13.3",
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^1.6.0",
"@turbo/gen": "^2.0.14",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"env-cmd": "^10.1.0",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -376,7 +376,7 @@ function itemTsDoc(item: DocNode, apiItem: ApiItem) {
resolvedPackage: {
packageName: resolved?.package ?? apiItem.getAssociatedPackage()?.displayName.replace('@discordjs/', ''),
version: resolved?.package
? apiItem.getAssociatedPackage()?.dependencies?.[resolved.package] ?? null
? (apiItem.getAssociatedPackage()?.dependencies?.[resolved.package] ?? null)
: null,
},
};
@@ -999,7 +999,7 @@ export async function generateSplitDocumentation({
containerKey = ApiFunction.getContainerKey(name, Number.parseInt(overloadIndex, 10));
}
const foundMember = memberName && containerKey ? findMemberByKey(model, pkgName, containerKey) ?? null : null;
const foundMember = memberName && containerKey ? (findMemberByKey(model, pkgName, containerKey) ?? null) : null;
const returnValue = memberKind(foundMember);

View File

@@ -1 +1,6 @@
{ "name": "{{name}}", "org": "discordjs", "packagePath": "packages/{{name}}", "identifierBase": false }
{
"name": "{{name}}",
"org": "discordjs",
"packagePath": "packages/{{name}}",
"identifierBase": false
}

View File

@@ -1,2 +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
# 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

View File

@@ -1 +1,2 @@
/** @type {import('lint-staged').Config} */
module.exports = require('../../.lintstagedrc.json');

View File

@@ -1 +1,7 @@
.turbo coverage dist dist-docs docs/docs.api.json CHANGELOG.md tsup.config.bundled*
.turbo
coverage
dist
dist-docs
docs/docs.api.json
CHANGELOG.md
tsup.config.bundled*

View File

@@ -1 +1,2 @@
/** @type {import('prettier').Config} */
module.exports = require('../../.prettierrc.json');

View File

@@ -1,13 +1,15 @@
{
"$schema": "https://json.schemastore.org/package.json",
"name": "@discordjs/{{name}}",
"version": "0.1.0",
"description": "{{description}}",
"scripts": {
"test": "vitest run",
"build": "tsc --noEmit && tsup",
"build:docs": "tsc -p tsconfig.docs.json",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src __tests__",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src __tests__",
"test": "vitest run",
"lint": "prettier --check . && cross-env TIMING=1 eslint --format=pretty src",
"format": "prettier --write . && cross-env TIMING=1 eslint --fix --format=pretty src",
"fmt": "pnpm run format",
"docs": "pnpm run build:docs && api-extractor run --local",
"prepack": "pnpm run build && pnpm run lint",
"changelog": "git cliff --prepend ./CHANGELOG.md -u -c ./cliff.toml -r ../../ --include-path 'packages/{{name}}/*'",
@@ -32,7 +34,9 @@
"lib": "src",
"test": "__tests__"
},
"files": ["dist"],
"files": [
"dist"
],
"contributors": [
"Crawl <icrawltogo@gmail.com>",
"SpaceEEC <spaceeec@yahoo.com>",
@@ -54,18 +58,19 @@
"dependencies": {},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@favware/cliff-jumper": "^2.2.1",
"@types/node": "18.18.8",
"@vitest/coverage-v8": "^0.34.6",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.53.0",
"eslint-config-neon": "^0.1.57",
"eslint-formatter-pretty": "^5.0.0",
"prettier": "^3.1.0",
"tsup": "^7.2.0",
"typescript": "^5.2.2",
"vitest": "^0.34.6"
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -68,27 +68,27 @@
"@storybook/react": "^8.1.5",
"@storybook/react-vite": "^8.1.5",
"@storybook/testing-library": "^0.2.2",
"@types/node": "18.18.8",
"@types/node": "^18.19.45",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"@unocss/eslint-plugin": "^0.60.4",
"@unocss/reset": "^0.60.4",
"@vitejs/plugin-react": "^4.3.0",
"@vitest/coverage-v8": "^1.6.0",
"@vitest/coverage-v8": "^2.0.5",
"chromatic": "^11.5.0",
"cross-env": "^7.0.3",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"prettier": "^3.3.3",
"prop-types": "^15.8.1",
"storybook": "^8.1.5",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"unocss": "^0.60.4",
"vite": "^5.2.12",
"vite-plugin-dts": "^3.9.1",
"vitest": "^1.6.0"
"vitest": "^2.0.5"
},
"engines": {
"node": ">=18"

View File

@@ -31,12 +31,12 @@ export function DiscordMessage({
className={`pl-18 hover:bg-[rgb(4_4_5)]/7 group py-0.5 pr-12 leading-snug ${followUp ? '' : 'mt-4'}`}
id="message-wrapper"
>
{(reply || replyNode) && !followUp ? reply ? <DiscordMessageReply {...reply} /> : replyNode ?? null : null}
{(reply || replyNode) && !followUp ? reply ? <DiscordMessageReply {...reply} /> : (replyNode ?? null) : null}
{(interaction || interactionNode) && !(reply || replyNode) && !followUp ? (
interaction ? (
<DiscordMessageInteraction {...interaction} />
) : (
interactionNode ?? null
(interactionNode ?? null)
)
) : null}
<div className="static" id="content-wrapper">

View File

@@ -36,12 +36,12 @@ export function DiscordMessageEmbed({
<div className="grid max-w-max border-l-4 border-l-blurple rounded bg-[rgb(47_49_54)]" id="embed-wrapper">
<div className="max-w-128 flex">
<div className="pb-4 pl-3 pr-4 pt-2">
{author ? <DiscordMessageEmbedAuthor {...author} /> : authorNode ?? null}
{title ? <DiscordMessageEmbedTitle {...title} /> : titleNode ?? null}
{author ? <DiscordMessageEmbedAuthor {...author} /> : (authorNode ?? null)}
{title ? <DiscordMessageEmbedTitle {...title} /> : (titleNode ?? null)}
{children ? <div className="mt-2 text-sm">{children}</div> : null}
{fields ? <DiscordMessageEmbedFields fields={fields} /> : null}
{image ? <DiscordMessageEmbedImage {...image} /> : null}
{footer ? <DiscordMessageEmbedFooter {...footer} /> : footerNode ?? null}
{footer ? <DiscordMessageEmbedFooter {...footer} /> : (footerNode ?? null)}
</div>
{thumbnail ? <DiscordMessageEmbedThumbnail {...thumbnail} /> : null}

View File

@@ -65,19 +65,19 @@
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "16.18.60",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^16.18.105",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"prettier": "^3.3.0",
"tsd": "^0.31.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"vitest": "^1.6.0"
"prettier": "^3.3.3",
"tsd": "^0.31.1",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"vitest": "^2.0.5"
},
"engines": {
"node": ">=16.11.0"

View File

@@ -63,11 +63,11 @@
"homepage": "https://discord.js.org",
"funding": "https://github.com/discordjs/discord.js?sponsor",
"dependencies": {
"@types/ws": "^8.5.10",
"discord-api-types": "0.37.96",
"@types/ws": "^8.5.12",
"discord-api-types": "0.37.97",
"prism-media": "^1.3.5",
"tslib": "^2.6.2",
"ws": "^8.17.0"
"tslib": "^2.6.3",
"ws": "^8.18.0"
},
"devDependencies": {
"@babel/core": "^7.24.6",
@@ -77,7 +77,7 @@
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/jest": "^29.5.12",
"@types/node": "16.18.60",
"@types/node": "^16.18.105",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
@@ -86,11 +86,11 @@
"jest": "^29.7.0",
"jest-websocket-mock": "^2.5.0",
"mock-socket": "^9.3.1",
"prettier": "^3.3.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"tweetnacl": "^1.0.3",
"typescript": "^5.4.5"
"typescript": "~5.5.4"
},
"engines": {
"node": ">=16.11.0"

View File

@@ -6,7 +6,6 @@
export function abortAfter(delay: number): [AbortController, AbortSignal] {
const ac = new AbortController();
const timeout = setTimeout(() => ac.abort(), delay);
// @ts-expect-error: No type for timeout
ac.signal.addEventListener('abort', () => clearTimeout(timeout));
return [ac, ac.signal];
}

View File

@@ -76,32 +76,32 @@
"@discordjs/collection": "workspace:^",
"@discordjs/rest": "workspace:^",
"@discordjs/util": "workspace:^",
"@sapphire/async-queue": "^1.5.2",
"@types/ws": "^8.5.10",
"@vladfrangu/async_event_emitter": "^2.2.4",
"discord-api-types": "0.37.96",
"tslib": "^2.6.2",
"ws": "^8.17.0"
"@sapphire/async-queue": "^1.5.3",
"@types/ws": "^8.5.12",
"@vladfrangu/async_event_emitter": "^2.4.6",
"discord-api-types": "0.37.97",
"tslib": "^2.6.3",
"ws": "^8.18.0"
},
"devDependencies": {
"@discordjs/api-extractor": "workspace:^",
"@discordjs/scripts": "workspace:^",
"@favware/cliff-jumper": "^3.0.3",
"@types/node": "18.17.9",
"@vitest/coverage-v8": "^1.6.0",
"@types/node": "^18.19.45",
"@vitest/coverage-v8": "^2.0.5",
"cross-env": "^7.0.3",
"esbuild-plugin-version-injector": "^1.2.1",
"eslint": "^8.57.0",
"eslint-config-neon": "^0.1.62",
"eslint-formatter-pretty": "^6.0.1",
"mock-socket": "^9.3.1",
"prettier": "^3.3.0",
"tsd": "^0.31.0",
"tsup": "^8.1.0",
"turbo": "^1.13.3",
"typescript": "^5.4.5",
"undici": "6.18.2",
"vitest": "^1.6.0",
"prettier": "^3.3.3",
"tsd": "^0.31.1",
"tsup": "^8.2.4",
"turbo": "^2.0.14",
"typescript": "~5.5.4",
"undici": "6.19.8",
"vitest": "^2.0.5",
"zlib-sync": "^0.1.9"
},
"engines": {

View File

@@ -27,7 +27,9 @@ export class SimpleShardingStrategy implements IShardingStrategy {
for (const shardId of shardIds) {
const strategy = new SimpleContextFetchingStrategy(this.manager, strategyOptions);
const shard = new WebSocketShard(strategy, shardId);
for (const event of Object.values(WebSocketShardEvents)) {
// @ts-expect-error Ugly casts are needed because when we try to collect all args, TS doesn't handle that nicely due to the strictness + lack of context
shard.on(event, (...args) => this.manager.emit(event, ...args, shardId));
}

View File

@@ -148,13 +148,14 @@ export class WorkerBootstrapper {
for (const shardId of this.data.shardIds) {
const shard = new WebSocketShard(new WorkerContextFetchingStrategy(this.data), shardId);
for (const event of options.forwardEvents ?? Object.values(WebSocketShardEvents)) {
shard.on(event, (...args) => {
shard.on(event, (...args: unknown[]) => {
const payload: WorkerReceivePayload = {
op: WorkerReceivePayloadOp.Event,
event,
data: args,
shardId,
};
parentPort!.postMessage(payload);
});
}

View File

@@ -115,7 +115,7 @@ export class WebSocketShard extends AsyncEventEmitter<WebSocketShardEventsMap> {
private initialHeartbeatTimeoutController: AbortController | null = null;
private heartbeatInterval: NodeJS.Timer | null = null;
private heartbeatInterval: NodeJS.Timeout | null = null;
private lastHeartbeatAt = -1;

17010
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff

View File

@@ -4,18 +4,18 @@
"enabled": true
},
"globalDependencies": ["tsconfig.json"],
"pipeline": {
"tasks": {
"build": {
"dependsOn": ["^build"],
"inputs": ["bin/**", "src/**", "scripts/**", "package.json", "tsconfig.json", "tsup.config.ts", "vite.config.ts"],
"outputs": ["dist/**"],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"@discordjs/ui#build-storybook": {
"dependsOn": ["build"],
"inputs": [".storybook/**/*", "src/**", "package.json", "tsconfig.json", "vite.config.ts"],
"outputs": ["dist/**", "storybook-static/**"],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"@discordjs/guide#build:local": {
"dependsOn": ["^build"],
@@ -29,7 +29,7 @@
"tsconfig.json"
],
"outputs": [".next/**", ".next/cache/**", ".contentlayer/**"],
"outputMode": "full"
"outputLogs": "full"
},
"@discordjs/guide#build:prod": {
"dependsOn": ["^build"],
@@ -43,7 +43,7 @@
"tsconfig.json"
],
"outputs": [".next/**", ".next/cache/**", ".contentlayer/**"],
"outputMode": "full"
"outputLogs": "full"
},
"@discordjs/website#build:local": {
"env": ["VERCEL_ENV", "NEXT_PUBLIC_LOCAL_DEV"],
@@ -60,7 +60,7 @@
"tsconfig.json"
],
"outputs": [".next/**", ".next/cache/**", "src/assets/readme/**"],
"outputMode": "full"
"outputLogs": "full"
},
"@discordjs/website#build:prod": {
"env": ["VERCEL_ENV", "NEXT_PUBLIC_LOCAL_DEV"],
@@ -77,18 +77,18 @@
"tsconfig.json"
],
"outputs": [".next/**", ".next/cache/**", "src/assets/readme/**"],
"outputMode": "full"
"outputLogs": "full"
},
"@discordjs/guide#generate:contentlayer": {
"inputs": ["src/**/*.mdx"],
"outputs": [".contentlayer/**"],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"test": {
"dependsOn": ["^build"],
"inputs": ["__mocks__/**", "__tests__/**", "src/**", "jest.config.js", "package.json", "tsconfig.json"],
"outputs": ["coverage/**"],
"outputMode": "new-only"
"outputLogs": "new-only"
},
"lint": {
"dependsOn": ["^build"],
@@ -104,7 +104,7 @@
"tsconfig.eslint.json"
],
"outputs": [],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"@discordjs/guide#lint": {
"dependsOn": ["^build", "build:local", "generate:contentlayer"],
@@ -118,7 +118,7 @@
"tsconfig.eslint.json"
],
"outputs": [],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"@discordjs/website#lint": {
"dependsOn": ["^build", "build:local"],
@@ -132,7 +132,7 @@
"tsconfig.eslint.json"
],
"outputs": [],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"format": {
"dependsOn": ["^build"],
@@ -148,7 +148,7 @@
"tsconfig.eslint.json"
],
"outputs": [],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"@discordjs/guide#format": {
"dependsOn": ["^build", "generate:contentlayer"],
@@ -163,7 +163,7 @@
"tsconfig.eslint.json"
],
"outputs": [],
"outputMode": "errors-only"
"outputLogs": "errors-only"
},
"docs": {
"dependsOn": ["build"],
@@ -181,38 +181,38 @@
"tsconfig.docs.json"
],
"outputs": ["dist-docs/**", "docs/docs.json", "docs/docs.api.json", "docs/*/split/**"],
"outputMode": "errors-only",
"cache": false
"cache": false,
"outputLogs": "errors-only"
},
"changelog": {
"inputs": ["cliff.toml"],
"outputs": ["CHANGELOG.md"],
"outputMode": "full"
"outputLogs": "full"
},
"release": {
"dependsOn": ["^build"],
"inputs": ["CHANGELOG.md", "package.json"],
"outputs": [],
"outputMode": "full"
"outputLogs": "full"
},
"dev": {
"dependsOn": ["^build"],
"outputMode": "full",
"cache": false,
"persistent": true
"persistent": true,
"outputLogs": "full"
},
"@discordjs/guide#dev": {
"dependsOn": ["^build"],
"outputMode": "full",
"cache": false,
"persistent": true
"persistent": true,
"outputLogs": "full"
},
"@discordjs/website#dev": {
"env": ["VERCEL_ENV", "NEXT_PUBLIC_LOCAL_DEV"],
"dependsOn": ["^build", "^docs"],
"outputMode": "full",
"cache": false,
"persistent": true
"persistent": true,
"outputLogs": "full"
}
}
}

View File

@@ -6,7 +6,7 @@ export default defineConfig({
passWithNoTests: true,
typecheck: {
enabled: true,
include: ["**/__tests__/types.test.ts"]
include: ['**/__tests__/types.test.ts'],
},
coverage: {
enabled: true,