mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-18 20:30:08 +08:00
refactor: 重构目录删除旧支持
This commit is contained in:
parent
c1377e6de7
commit
c5db525f4a
@ -32,7 +32,7 @@ function getAddonPath(binaryPath: string): string {
|
||||
} else {
|
||||
throw new Error(`Unsupported platform: ${platformName} ${archName}`);
|
||||
}
|
||||
return path.join(binaryPath, "./nodeffmpeg/", addonFileName);
|
||||
return path.join(binaryPath, "./native/ffmpeg/", addonFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -43,7 +43,7 @@ export class NativePacketClient {
|
||||
this.logStack.pushLogWarn(`NativePacketClient: 不支持的平台: ${platform}`);
|
||||
return false;
|
||||
}
|
||||
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/napi2native.' + platform + '.node');
|
||||
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './native/napi2native/napi2native.' + platform + '.node');
|
||||
if (!fs.existsSync(moehoo_path)) {
|
||||
this.logStack.pushLogWarn(`NativePacketClient: 缺失运行时文件: ${moehoo_path}`);
|
||||
return false;
|
||||
@ -55,7 +55,7 @@ export class NativePacketClient {
|
||||
const platform = process.platform + '.' + process.arch;
|
||||
const isNewQQ = this.napcore.basicInfo.requireMinNTQQBuild("40824");
|
||||
if (isNewQQ) {
|
||||
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './moehoo/napi2native.' + platform + '.node');
|
||||
const moehoo_path = path.join(dirname(fileURLToPath(import.meta.url)), './native/napi2native/napi2native.' + platform + '.node');
|
||||
process.dlopen(this.MoeHooExport, moehoo_path, constants.dlopen.RTLD_LAZY);
|
||||
this.MoeHooExport?.exports.initHook?.(send, recv);
|
||||
this.available = true;
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
src/native/packet/MoeHoo.linux.x64.node
Normal file
BIN
src/native/packet/MoeHoo.linux.x64.node
Normal file
Binary file not shown.
BIN
src/native/packet/MoeHoo.win.x64.node
Normal file
BIN
src/native/packet/MoeHoo.win.x64.node
Normal file
Binary file not shown.
Binary file not shown.
@ -67,11 +67,11 @@ export class WindowsPtyAgent {
|
||||
}
|
||||
if (this._useConpty) {
|
||||
if (!conptyNative) {
|
||||
conptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/conpty.node');
|
||||
conptyNative = require_dlopen('./native/pty/' + process.platform + '.' + process.arch + '/conpty.node');
|
||||
}
|
||||
} else {
|
||||
if (!winptyNative) {
|
||||
winptyNative = require_dlopen('./pty/' + process.platform + '.' + process.arch + '/pty.node');
|
||||
winptyNative = require_dlopen('./native/pty/' + process.platform + '.' + process.arch + '/pty.node');
|
||||
}
|
||||
}
|
||||
this._ptyNative = this._useConpty ? conptyNative : winptyNative;
|
||||
|
||||
@ -31,8 +31,7 @@ const UniversalBaseConfigPlugin: PluginOption[] = [
|
||||
targets: [
|
||||
{ src: './manifest.json', dest: 'dist' },
|
||||
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
|
||||
{ src: './src/native/packet', dest: 'dist/moehoo', flatten: false },
|
||||
{ src: './src/native/pty', dest: 'dist/pty', flatten: false },
|
||||
{ src: './src/native/', dest: 'dist/native', flatten: false },
|
||||
{ src: './napcat.webui/dist/', dest: 'dist/static/', flatten: false },
|
||||
{ src: './src/framework/liteloader.cjs', dest: 'dist' },
|
||||
{ src: './src/framework/napcat.cjs', dest: 'dist' },
|
||||
@ -57,10 +56,9 @@ const FrameworkBaseConfigPlugin: PluginOption[] = [
|
||||
// }),
|
||||
cp({
|
||||
targets: [
|
||||
{ src: './src/native/', dest: 'dist/native', flatten: false },
|
||||
{ src: './manifest.json', dest: 'dist' },
|
||||
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
|
||||
{ src: './src/native/packet', dest: 'dist/moehoo', flatten: false },
|
||||
{ src: './src/native/pty', dest: 'dist/pty', flatten: false },
|
||||
{ src: './napcat.webui/dist/', dest: 'dist/static/', flatten: false },
|
||||
{ src: './src/framework/liteloader.cjs', dest: 'dist' },
|
||||
{ src: './src/framework/napcat.cjs', dest: 'dist' },
|
||||
@ -82,9 +80,7 @@ const ShellBaseConfigPlugin: PluginOption[] = [
|
||||
// }),
|
||||
cp({
|
||||
targets: [
|
||||
{ src: './src/native/ffmpeg', dest: 'dist/nodeffmpeg', flatten: false },
|
||||
{ src: './src/native/packet', dest: 'dist/moehoo', flatten: false },
|
||||
{ src: './src/native/pty', dest: 'dist/pty', flatten: false },
|
||||
{ src: './src/native/', dest: 'dist/native', flatten: false },
|
||||
{ src: './napcat.webui/dist/', dest: 'dist/static/', flatten: false },
|
||||
{ src: './src/core/external/napcat.json', dest: 'dist/config/' },
|
||||
{ src: './package.json', dest: 'dist' },
|
||||
|
||||
Loading…
Reference in New Issue
Block a user