perf(bundle): replace broad storage and utils imports

This commit is contained in:
2026-07-14 18:13:55 +08:00
parent e270be9bd9
commit 0033625866
85 changed files with 136 additions and 97 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ import { describe, expect, it, vi } from "vitest";
import type { IAuthStorage } from "@/data/storage/auth";
import { LoginStatus } from "@/data/dto/auth";
import { Result } from "@/utils";
import { Result } from "@/utils/result";
import { hasCompleteBusinessAuthSession } from "../auth_session";
+1 -1
View File
@@ -1,6 +1,6 @@
"use client";
import { Logger } from "@/utils";
import { Logger } from "@/utils/logger";
const log = new Logger("LibBrowserPersistentStorage");
let storagePersistenceRequested = false;
@@ -1,6 +1,6 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
import { Result } from "@/utils";
import { Result } from "@/utils/result";
const getHistoryMock = vi.hoisted(() => vi.fn());
+1 -1
View File
@@ -3,7 +3,7 @@
import { AuthStorage } from "@/data/storage/auth/auth_storage";
import { UserStorage } from "@/data/storage/user/user_storage";
import { ROUTES } from "@/router/routes";
import { UrlLauncherUtil } from "@/utils";
import { UrlLauncherUtil } from "@/utils/url-launcher-util";
export async function openChatInExternalBrowser(): Promise<void> {
const authStorage = AuthStorage.getInstance();
+1 -1
View File
@@ -2,7 +2,7 @@
import type { ChatMediaKind } from "@/data/dto/chat";
import { getChatRepository } from "@/data/repositories/chat_repository";
import { Result, type Result as ResultT } from "@/utils";
import { Result, type Result as ResultT } from "@/utils/result";
import { localChatMediaRowToBlob } from "./chat_media_blob";
+1 -1
View File
@@ -5,7 +5,7 @@ import {
resolveChatCacheOwnerKey,
type ChatCacheIdentityResolver,
} from "@/data/repositories/chat_cache_identity";
import { Result, type Result as ResultT } from "@/utils";
import { Result, type Result as ResultT } from "@/utils/result";
import type { SplashLatestMessageCache } from "./splash_latest_message_cache";
import { getLatestSplashMessagePreview } from "./splash_latest_message_preview";
+4 -1
View File
@@ -3,7 +3,10 @@
import { useEffect, useRef, useState } from "react";
import type { ChatMediaKind } from "@/data/dto/chat";
import { BrowserDetector, Logger, PlatformDetector, Result } from "@/utils";
import { BrowserDetector } from "@/utils/browser-detect";
import { Logger } from "@/utils/logger";
import { PlatformDetector } from "@/utils/platform-detect";
import { Result } from "@/utils/result";
import {
cacheRemoteChatMediaBlob,
+2 -1
View File
@@ -1,6 +1,7 @@
"use client";
import { Logger, Result } from "@/utils";
import { Logger } from "@/utils/logger";
import { Result } from "@/utils/result";
import {
savePendingEzpayOrder,
+2 -2
View File
@@ -3,13 +3,13 @@
import {
PendingPaymentOrderStorage,
type PendingPaymentOrder,
} from "@/data/storage";
} from "@/data/storage/payment/pending_payment_order_storage";
import { ROUTES } from "@/router/routes";
import {
DEFAULT_TIP_COFFEE_TYPE,
TIP_COFFEE_TYPE_PARAM,
} from "@/lib/tip/tip_coffee";
import type { Result } from "@/utils";
import type { Result } from "@/utils/result";
export type PendingPaymentSubscriptionType =
PendingPaymentOrder["subscriptionType"];