From fc7be22c6c15974c7394790e93de2a23a6627153 Mon Sep 17 00:00:00 2001 From: PalmDevs Date: Sat, 22 Jun 2024 22:09:19 +0700 Subject: [PATCH] fix(apis/websocket): builds not working due to dynamic import requirement --- apis/websocket/after_build.ts | 3 +++ apis/websocket/package.json | 2 +- apis/websocket/src/utils/config.ts | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) create mode 100644 apis/websocket/after_build.ts diff --git a/apis/websocket/after_build.ts b/apis/websocket/after_build.ts new file mode 100644 index 0000000..d7c41f7 --- /dev/null +++ b/apis/websocket/after_build.ts @@ -0,0 +1,3 @@ +import * as fs from 'fs' + +fs.cpSync('../../node_modules/tesseract.js', './dist/tesseract.js', { recursive: true }) diff --git a/apis/websocket/package.json b/apis/websocket/package.json index b5159cf..c9fd4d2 100755 --- a/apis/websocket/package.json +++ b/apis/websocket/package.json @@ -6,7 +6,7 @@ "description": "🧦 WebSocket API server for bots assisting ReVanced", "main": "dist/index.js", "scripts": { - "bundle": "bun build src/index.ts --outdir=dist --target=bun", + "bundle": "bun build src/index.ts --outdir=dist --target=bun && bun run after_build.ts", "dev": "bun run src/index.ts --watch", "build": "bun bundle", "watch": "bun dev" diff --git a/apis/websocket/src/utils/config.ts b/apis/websocket/src/utils/config.ts index 7beb09b..4415c0d 100755 --- a/apis/websocket/src/utils/config.ts +++ b/apis/websocket/src/utils/config.ts @@ -19,8 +19,8 @@ type BaseTypeOf = T extends (infer U)[] : T extends (...args: unknown[]) => infer U ? (...args: unknown[]) => U : T extends object - ? { [K in keyof T]: T[K] } - : T + ? { [K in keyof T]: T[K] } + : T export type Config = Omit, '$schema'>