From 02b0708426fa007b098f4d4d877e940e488a14dd Mon Sep 17 00:00:00 2001 From: CrescentLeaf Date: Sat, 6 Dec 2025 11:08:39 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/launch.json | 2 +- .vscode/settings.json | 7 ------- client/checkIsAndroidAndBuild.ts | 36 -------------------------------- client/fix-build-on-android.sh | 3 --- client/tsconfig.json | 18 ++++++++++++++++ package.json | 3 ++- 6 files changed, 21 insertions(+), 48 deletions(-) delete mode 100644 .vscode/settings.json delete mode 100644 client/checkIsAndroidAndBuild.ts delete mode 100644 client/fix-build-on-android.sh create mode 100644 client/tsconfig.json diff --git a/.vscode/launch.json b/.vscode/launch.json index 663f719..31a3743 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -5,7 +5,7 @@ "version": "0.2.0", "configurations": [ { - "command": "npm run build-client-and-server", + "command": "npm run debug", "name": "Debug", "request": "launch", "type": "node-terminal" diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index acb8129..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "deno.enable": false, - "deno.disablePaths": [ - "./thewhitesilk_data", - "./mdui_patched" - ] -} \ No newline at end of file diff --git a/client/checkIsAndroidAndBuild.ts b/client/checkIsAndroidAndBuild.ts deleted file mode 100644 index 16ef194..0000000 --- a/client/checkIsAndroidAndBuild.ts +++ /dev/null @@ -1,36 +0,0 @@ -import process from 'node:process' -import child_process from 'node:child_process' -import fs from 'node:fs/promises' - -function spawn(exec: string, args: string[]) { - child_process.spawnSync(exec, args, { - stdio: [process.stdin, process.stdout, process.stderr] - }) -} - -function runBuild() { - const args = [ - "run", - "-A", - "--node-modules-dir", - ] - let i = 0 - for (const arg of process.argv) { - if (i > 1) - args.push(arg) - i++ - } - - spawn('deno', args) -} - -if (process.platform == 'android') { - try { - await fs.stat('./node_modules/.deno/rollup@4.50.1/node_modules/rollup/') - } catch (e) { - spawn('deno', ['install', '--node-modules-dir=auto']) - } - spawn('sh', ["fix-build-on-android.sh"]) -} - -runBuild() diff --git a/client/fix-build-on-android.sh b/client/fix-build-on-android.sh deleted file mode 100644 index f52fa7d..0000000 --- a/client/fix-build-on-android.sh +++ /dev/null @@ -1,3 +0,0 @@ -rm -r ./node_modules/.deno/rollup@4.50.1/node_modules/rollup/ -cp -r ./node_modules/.deno/@rollup+wasm-node@4.48.0/node_modules/@rollup/wasm-node/ node_modules/.deno/rollup@4.50.1/node_modules/rollup/ -echo Replaced rollup with @rollup/wasm-node successfully diff --git a/client/tsconfig.json b/client/tsconfig.json new file mode 100644 index 0000000..306b0c6 --- /dev/null +++ b/client/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "lib": [ + "ES2022", + "DOM", + "DOM.Iterable" + ], + "jsx": "react-jsx", + "module": "ESNext", + "moduleResolution": "Bundler", + "allowImportingTsExtensions": true, + "esModuleInterop": true, + "strict": true, + "skipLibCheck": true, + "noEmit": true + } +} \ No newline at end of file diff --git a/package.json b/package.json index be17400..1349312 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,8 @@ "./client" ], "scripts": { - "build-client-and-server": "npm run build-client && npm run server", + "install-dependencies": "npm install -d --workspaces", + "debug": "npm run build-client && npx tsx --watch ./server/main.ts", "server": "npx tsx ./server/main.ts", "build-client": "cd client && npm run build" },