feat: 大规模去耦合

Moved various helper, event, and utility files from napcat-common to napcat-core/helper for better modularity and separation of concerns. Updated imports across packages to reflect new file locations. Removed unused dependencies from napcat-common and added them to napcat-core where needed. Also consolidated type definitions and cleaned up tsconfig settings for improved compatibility.
This commit is contained in:
手瓜一十雪
2025-11-15 13:36:33 +08:00
parent 43441f285b
commit be87f1f8e5
50 changed files with 87 additions and 465 deletions

View File

@@ -1,6 +1,5 @@
import type { SelfInfo } from 'napcat-core/types';
import type { SelfInfo } from 'napcat-core/index';
import { LogWrapper } from 'napcat-common/src/log';
import { NodeIKernelLoginListener, NodeIKernelSessionListener } from 'napcat-core/listeners';
import { NodeIDependsAdapter, NodeIDispatcherAdapter, NodeIGlobalAdapter } from 'napcat-core/adapters';
import { NapCatPathWrapper } from 'napcat-common/src/path';
@@ -17,9 +16,7 @@ import {
WrapperNodeApi,
WrapperSessionInitConfig,
} from 'napcat-core';
import { QQBasicInfoWrapper } from 'napcat-common/src/qq-basic-info';
import { hostname, systemVersion } from 'napcat-common/src/system';
import { proxiedListenerOf } from 'napcat-common/src/proxy-handler';
import path from 'path';
import fs from 'fs';
import os from 'os';
@@ -31,9 +28,12 @@ import { WebUiDataRuntime } from 'napcat-webui-backend/src/helper/Data';
import { napCatVersion } from 'napcat-common/src/version';
import { NodeIO3MiscListener } from 'napcat-core/listeners/NodeIO3MiscListener';
import { sleep } from 'napcat-common/src/helper';
import { FFmpegService } from 'napcat-common/src/ffmpeg';
import { FFmpegService } from '@/napcat-core/helper/ffmpeg/ffmpeg';
import { connectToNamedPipe } from './pipe';
import { NativePacketHandler } from 'napcat-core/packet/handler/client';
import { LogWrapper } from '@/napcat-core/helper/log';
import { proxiedListenerOf } from '@/napcat-core/helper/proxy-handler';
import { QQBasicInfoWrapper } from '@/napcat-core/helper/qq-basic-info';
// NapCat Shell App ES 入口文件
async function handleUncaughtExceptions (logger: LogWrapper) {
process.on('uncaughtException', (err) => {

View File

@@ -1,4 +1,4 @@
import { LogWrapper } from 'napcat-common/src/log';
import { LogWrapper } from 'napcat-core/helper/log';
import * as net from 'net';
import * as process from 'process';
import { Writable } from 'stream';

View File

@@ -11,7 +11,6 @@
],
"esModuleInterop": true,
"outDir": "dist",
"rootDir": ".",
"noEmit": false,
"sourceMap": true,
"strict": true,