mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2025-12-18 20:30:08 +08:00
Refactor imports to use package names instead of aliases
Replaced all path alias imports (e.g., '@/napcat-core') with direct package imports (e.g., 'napcat-core/index') across napcat-common, napcat-core, and napcat-webui-backend. This improves compatibility with tooling and workspace resolution, and aligns with standard TypeScript/Node.js import practices.
This commit is contained in:
parent
6e9f448a0c
commit
c8fd66fa9b
@ -1,6 +1,6 @@
|
||||
import { NodeIQQNTWrapperSession } from '@/napcat-core/wrapper';
|
||||
import { NodeIQQNTWrapperSession } from 'napcat-core/wrapper';
|
||||
import { randomUUID } from 'crypto';
|
||||
import { ListenerNamingMapping, ServiceNamingMapping } from '@/napcat-core';
|
||||
import { ListenerNamingMapping, ServiceNamingMapping } from 'napcat-core/index';
|
||||
|
||||
interface InternalMapKey {
|
||||
timeout: number;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Peer } from '@/napcat-core';
|
||||
import { Peer } from 'napcat-core/index';
|
||||
import { randomUUID } from 'crypto';
|
||||
|
||||
class TimeBasedCache<K, V> {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import * as crypto from 'node:crypto';
|
||||
import { PacketMsg } from '@/napcat-core/packet/message/message';
|
||||
import { PacketMsg } from 'napcat-core/packet/message/message';
|
||||
|
||||
interface ForwardMsgJson {
|
||||
app: string
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import path from 'node:path';
|
||||
import fs from 'fs';
|
||||
import os from 'node:os';
|
||||
import { QQLevel } from '@/napcat-core';
|
||||
import { QQLevel } from 'napcat-core/index';
|
||||
import { QQVersionConfigType } from './types';
|
||||
|
||||
export async function solveProblem<T extends (...arg: any[]) => any> (func: T, ...args: Parameters<T>): Promise<ReturnType<T> | undefined> {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Peer } from '@/napcat-core';
|
||||
import { Peer } from 'napcat-core/index';
|
||||
import crypto from 'crypto';
|
||||
|
||||
export class LimitedHashTable<K, V> {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { FriendRequest, FriendV2 } from '@/napcat-core/types';
|
||||
import { BuddyListReqType, InstanceContext, NapCatCore } from '@/napcat-core/index';
|
||||
import { FriendRequest, FriendV2 } from 'napcat-core/types';
|
||||
import { BuddyListReqType, InstanceContext, NapCatCore } from 'napcat-core/index';
|
||||
import { LimitedHashTable } from 'napcat-common/src/message-unique';
|
||||
|
||||
export class NTQQFriendApi {
|
||||
|
||||
@ -6,7 +6,7 @@ import {
|
||||
NTQQSystemApi,
|
||||
NTQQUserApi,
|
||||
NTQQWebApi,
|
||||
} from '@/napcat-core/apis';
|
||||
} from 'napcat-core/apis';
|
||||
import { NTQQCollectionApi } from '@/napcat-core/apis/collection';
|
||||
import {
|
||||
NodeIQQNTWrapperSession,
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ChatType, KickedOffLineInfo, RawMessage } from '@/napcat-core/types';
|
||||
import { CommonFileInfo } from '@/napcat-core';
|
||||
import { CommonFileInfo } from 'napcat-core/index';
|
||||
|
||||
export interface OnRichMediaDownloadCompleteParams {
|
||||
fileModelId: string,
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
"@sinclair/typebox": "^0.34.38",
|
||||
"file-type": "^21.0.0",
|
||||
"napcat-image-size": "workspace:*",
|
||||
"napcat-core": "workspace:*",
|
||||
"napcat-common": "workspace:*",
|
||||
"napcat-onebot": "workspace:*"
|
||||
},
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
PacketMsgReplyElement,
|
||||
PacketMsgVideoElement,
|
||||
} from '@/napcat-core/packet/message/element';
|
||||
import { ChatType, MsgSourceType, NTMsgType, RawMessage } from '@/napcat-core';
|
||||
import { ChatType, MsgSourceType, NTMsgType, RawMessage } from 'napcat-core/index';
|
||||
import { MiniAppRawData, MiniAppReqParams } from '@/napcat-core/packet/entities/miniApp';
|
||||
import { AIVoiceChatType } from '@/napcat-core/packet/entities/aiChat';
|
||||
import { NapProtoDecodeStructType, NapProtoEncodeStructType, NapProtoMsg } from '@napneko/nap-proto-core';
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { PacketHighwayContext } from '@/napcat-core/packet/highway/highwayContext';
|
||||
import { NapCatCore } from '@/napcat-core';
|
||||
import { NapCatCore } from 'napcat-core/index';
|
||||
import { PacketLogger } from '@/napcat-core/packet/context/loggerContext';
|
||||
import { NapCoreContext } from '@/napcat-core/packet/context/napCoreContext';
|
||||
import { PacketClientContext } from '@/napcat-core/packet/context/clientContext';
|
||||
|
||||
@ -32,7 +32,7 @@ import {
|
||||
SendTextElement,
|
||||
SendVideoElement,
|
||||
Peer,
|
||||
} from '@/napcat-core';
|
||||
} from 'napcat-core/index';
|
||||
import { ForwardMsgBuilder } from 'napcat-common/src/forward-msg-builder';
|
||||
import { PacketMsg, PacketSendMsgElement } from '@/napcat-core/packet/message/message';
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { IPacketMsgElement } from '@/napcat-core/packet/message/element';
|
||||
import { SendMessageElement, SendMultiForwardMsgElement } from '@/napcat-core';
|
||||
import { SendMessageElement, SendMultiForwardMsgElement } from 'napcat-core/index';
|
||||
|
||||
export type PacketSendMsgElement = SendMessageElement | SendMultiForwardMsgElement;
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { AnyCnameRecord } from 'node:dns';
|
||||
import { BizKey, ModifyProfileParams, NodeIKernelProfileListener, ProfileBizType, SimpleInfo, UserDetailInfoByUin, UserDetailInfoListenerArg, UserDetailSource } from '@/napcat-core';
|
||||
import { BizKey, ModifyProfileParams, NodeIKernelProfileListener, ProfileBizType, SimpleInfo, UserDetailInfoByUin, UserDetailInfoListenerArg, UserDetailSource } from 'napcat-core/index';
|
||||
import { GeneralCallResult } from '@/napcat-core/services/common';
|
||||
|
||||
export interface NodeIKernelProfileService {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import type { LoginListItem, SelfInfo } from '@/napcat-core';
|
||||
import type { OneBotConfig } from '@/napcat-onebot/config/config';
|
||||
import type { LoginListItem, SelfInfo } from 'napcat-core';
|
||||
import type { OneBotConfig } from 'napcat-onebot/config/config';
|
||||
|
||||
interface LoginRuntimeType {
|
||||
LoginCurrentTime: number;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user