diff --git a/server/src/modules/game/othergame/factorio-deployer.ts b/server/src/modules/game/othergame/factorio-deployer.ts index f6c310d..2aba805 100644 --- a/server/src/modules/game/othergame/factorio-deployer.ts +++ b/server/src/modules/game/othergame/factorio-deployer.ts @@ -1,6 +1,6 @@ import axios from 'axios'; import express, { Request, Response } from 'express'; -import * as fs from 'fs-extra'; +import fs from '../../../utils/fsExtraCompat.js'; import { promises as fsPromises, existsSync } from 'fs'; import { createWriteStream, createReadStream } from 'fs'; import * as path from 'path'; @@ -1061,4 +1061,4 @@ export class FactorioDeployer { return null; } } -} \ No newline at end of file +} diff --git a/server/src/modules/game/othergame/minecraft-server-api.ts b/server/src/modules/game/othergame/minecraft-server-api.ts index c10117c..474fab0 100644 --- a/server/src/modules/game/othergame/minecraft-server-api.ts +++ b/server/src/modules/game/othergame/minecraft-server-api.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import * as fs from 'fs-extra'; +import fs from '../../../utils/fsExtraCompat.js'; import { promises as fsPromises, existsSync, readdirSync } from 'fs'; import { createWriteStream } from 'fs'; import * as path from 'path'; @@ -1240,4 +1240,4 @@ export async function validateJavaEnvironment(): Promise { } // 默认导出主类 -export default MinecraftServerDownloader; \ No newline at end of file +export default MinecraftServerDownloader; diff --git a/server/src/modules/game/othergame/mrpack-server-api.ts b/server/src/modules/game/othergame/mrpack-server-api.ts index 331a1b9..23d59b9 100644 --- a/server/src/modules/game/othergame/mrpack-server-api.ts +++ b/server/src/modules/game/othergame/mrpack-server-api.ts @@ -1,5 +1,5 @@ import axios from 'axios'; -import * as fs from 'fs-extra'; +import fs from '../../../utils/fsExtraCompat.js'; import { promises as fsPromises, existsSync, readdirSync } from 'fs'; import { createWriteStream } from 'fs'; import * as path from 'path'; @@ -1024,4 +1024,4 @@ export class MrpackServerAPI { // ==================== 导出 ==================== -export default MrpackServerAPI; \ No newline at end of file +export default MrpackServerAPI; diff --git a/server/src/modules/game/othergame/unified-functions.ts b/server/src/modules/game/othergame/unified-functions.ts index 9401e0d..78e6700 100644 --- a/server/src/modules/game/othergame/unified-functions.ts +++ b/server/src/modules/game/othergame/unified-functions.ts @@ -3,7 +3,7 @@ // 移除所有API相关代码,专注于核心功能 import axios from 'axios'; -import * as fs from 'fs-extra'; +import fs from '../../../utils/fsExtraCompat.js'; import { createWriteStream, mkdtemp } from 'fs'; import { promises as fsPromises } from 'fs'; import * as path from 'path'; @@ -2056,4 +2056,4 @@ export async function deployBedrockServer(options: BedrockDeployOptions): Promis } // 默认导出统一部署函数 -export default deployGameServer; \ No newline at end of file +export default deployGameServer; diff --git a/server/src/utils/fsExtraCompat.ts b/server/src/utils/fsExtraCompat.ts new file mode 100644 index 0000000..3a9e203 --- /dev/null +++ b/server/src/utils/fsExtraCompat.ts @@ -0,0 +1,4 @@ +import fsExtra from 'fs-extra' + +export { fsExtra } +export default fsExtra