From 9420f155b26e33b682ba36f05cf08b4880d73f1e Mon Sep 17 00:00:00 2001 From: Alina Sireneva Date: Fri, 1 Mar 2024 04:53:01 +0300 Subject: [PATCH] fix: tsconfig refs --- packages/http-proxy/tsconfig.json | 3 ++- packages/mtproxy/tsconfig.json | 3 ++- packages/socks-proxy/index.ts | 2 -- packages/socks-proxy/tsconfig.json | 5 ++--- packages/wasm/build.config.cjs | 21 +-------------------- 5 files changed, 7 insertions(+), 27 deletions(-) diff --git a/packages/http-proxy/tsconfig.json b/packages/http-proxy/tsconfig.json index 1793937a..e2709ab7 100644 --- a/packages/http-proxy/tsconfig.json +++ b/packages/http-proxy/tsconfig.json @@ -7,6 +7,7 @@ "./index.ts", ], "references": [ - { "path": "../core" } + { "path": "../core" }, + { "path": "../node" } ] } diff --git a/packages/mtproxy/tsconfig.json b/packages/mtproxy/tsconfig.json index a975a7d0..b33880ef 100644 --- a/packages/mtproxy/tsconfig.json +++ b/packages/mtproxy/tsconfig.json @@ -8,6 +8,7 @@ "./fake-tls.ts", ], "references": [ - { "path": "../core" } + { "path": "../core" }, + { "path": "../node" } ] } diff --git a/packages/socks-proxy/index.ts b/packages/socks-proxy/index.ts index a08ea7f0..2007f05d 100644 --- a/packages/socks-proxy/index.ts +++ b/packages/socks-proxy/index.ts @@ -1,5 +1,3 @@ -// ^^ because of this._socket. we know it's not null, almost everywhere, but TS doesn't - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error import { normalize } from 'ip6' diff --git a/packages/socks-proxy/tsconfig.json b/packages/socks-proxy/tsconfig.json index 4aac0c93..29e70eda 100644 --- a/packages/socks-proxy/tsconfig.json +++ b/packages/socks-proxy/tsconfig.json @@ -7,8 +7,7 @@ "./index.ts" ], "references": [ - { - "path": "../core" - } + { "path": "../core" }, + { "path": "../node" } ] } diff --git a/packages/wasm/build.config.cjs b/packages/wasm/build.config.cjs index 163724d9..14c5233f 100644 --- a/packages/wasm/build.config.cjs +++ b/packages/wasm/build.config.cjs @@ -1,22 +1,3 @@ -// /* eslint-disable no-console */ -// import * cp from 'child_process' -// import * as fs from 'fs' -// import { join } from 'path' - -// const root = new URL('.', import.meta.url).pathname - -module.exports = ({ path: { join }, fs, outDir, packageDir, transformFile }) => ({ +module.exports = () => ({ esmOnlyDirectives: true, - final() { - const fixWasmPath = (path) => { - transformFile(join(outDir, path), (data) => data.replace('../lib/mtcute.wasm', '../mtcute.wasm')) - } - - fixWasmPath('cjs/init.js') - fixWasmPath('cjs/init.web.js') - fixWasmPath('esm/init.js') - fixWasmPath('esm/init.web.js') - - fs.cpSync(join(packageDir, 'lib/mtcute.wasm'), join(outDir, 'mtcute.wasm')) - }, })