refactor(packages): rename @snowluma/bridge → @snowluma/protocol
The package previously named "bridge" houses the protocol-byte layer (OIDB cmds, msg-push decoders, highway uploaders, element-builder, event bus). The name "bridge" suggested transport/lifecycle, which it isn't — that role lives in core/hook and core/bridge/manager. Rename to match what's actually inside. This is a pure rename: zero logic changes, all 73 import sites updated mechanically and TS-verified. core/onebot dependencies key updated. ESLint override path adjusted for the moved oidb-services directory. Rename detection threshold: git log --find-renames=20% recommended when following history across this commit — content-replacement (@snowluma/bridge → @snowluma/protocol) dropped per-file similarity below git's default 50% on import-heavy files.
This commit is contained in:
238 files changed
+247
-284
No files matched your search
@@ -15,19 +15,19 @@ import type {
|
||||
} from '@snowluma/proto-defs/oidb-actions/media';
|
||||
|
||||
// Post-namespace migration: GroupFileApi forwards single-OIDB methods
|
||||
// through namespaces under @snowluma/bridge/oidb-services/group-file.
|
||||
// through namespaces under @snowluma/protocol/oidb-services/group-file.
|
||||
// The multi-stage methods (`upload` / `uploadPrivate`) keep their
|
||||
// orchestration on the facade; we assert against bridge.sendRawPacket
|
||||
// directly. Highway calls (fetchHighwaySession / uploadHighwayHttp)
|
||||
// and the file-source loader are still module-mocked because the
|
||||
// facade owns those calls directly.
|
||||
|
||||
vi.mock('@snowluma/bridge/highway', () => ({
|
||||
vi.mock('@snowluma/protocol/highway', () => ({
|
||||
fetchHighwaySession: vi.fn(async () => ({})),
|
||||
uploadHighwayHttp: vi.fn(async () => undefined),
|
||||
}));
|
||||
|
||||
vi.mock('@snowluma/bridge/highway/utils', () => ({
|
||||
vi.mock('@snowluma/protocol/highway/utils', () => ({
|
||||
loadBinarySource: vi.fn(async (_src: string, fallback: string) => ({
|
||||
bytes: new Uint8Array([1, 2, 3]),
|
||||
fileName: `${fallback}.bin`,
|
||||
@@ -37,7 +37,7 @@ vi.mock('@snowluma/bridge/highway/utils', () => ({
|
||||
FILE_UPLOAD_MAX_BYTES: 4 * 1024 * 1024 * 1024,
|
||||
}));
|
||||
|
||||
import * as highwayClient from '@snowluma/bridge/highway';
|
||||
import * as highwayClient from '@snowluma/protocol/highway';
|
||||
import { GroupFileApi } from '../../src/bridge/apis/group-file';
|
||||
import { mockBridge } from './_helpers';
|
||||
|
||||
|
||||
Reference in new issue
Block a user