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

@@ -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;