Remove imports of erlpack in favor of @yukikaze-bot/erlpack due to the former not working on modern node

This commit is contained in:
Emma [it/its]@Rory& 2024-10-29 21:02:03 +01:00
parent 8428d6da6d
commit 25b0a221e1
3 changed files with 6 additions and 21 deletions

View File

@ -30,16 +30,11 @@ import { URL } from "url";
import { Config, ErlpackType } from "@spacebar/util"; import { Config, ErlpackType } from "@spacebar/util";
let erlpack: ErlpackType | null = null; let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import erlpack: ", e);
try { try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType; erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) { } catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e); console.log("Failed to import @yukikaze-bot/erlpack: ", e);
} }
}
// TODO: check rate limit // TODO: check rate limit
// TODO: specify rate limit in config // TODO: specify rate limit in config

View File

@ -28,16 +28,11 @@ import { check } from "../opcodes/instanceOf";
const bigIntJson = BigIntJson({ storeAsString: true }); const bigIntJson = BigIntJson({ storeAsString: true });
let erlpack: ErlpackType | null = null; let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import erlpack: ", e);
try { try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType; erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) { } catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e); console.log("Failed to import @yukikaze-bot/erlpack: ", e);
} }
}
export async function Message(this: WebSocket, buffer: WS.Data) { export async function Message(this: WebSocket, buffer: WS.Data) {
// TODO: compression // TODO: compression

View File

@ -22,16 +22,11 @@ import path from "path";
import { ErlpackType, JSONReplacer } from "@spacebar/util"; import { ErlpackType, JSONReplacer } from "@spacebar/util";
let erlpack: ErlpackType | null = null; let erlpack: ErlpackType | null = null;
try {
erlpack = require("erlpack") as ErlpackType;
} catch (e) {
console.log("Failed to import erlpack: ", e);
try { try {
erlpack = require("@yukikaze-bot/erlpack") as ErlpackType; erlpack = require("@yukikaze-bot/erlpack") as ErlpackType;
} catch (e) { } catch (e) {
console.log("Failed to import @yukikaze-bot/erlpack: ", e); console.log("Failed to import @yukikaze-bot/erlpack: ", e);
} }
}
// don't care // don't care
// eslint-disable-next-line @typescript-eslint/no-explicit-any // eslint-disable-next-line @typescript-eslint/no-explicit-any