refactor: remove obsolete config and cross-layer exports
Drop the temporary static-generation retry override and stale hydration suppression. Refresh outdated Next.js and migration comments, and stop re-exporting Result through the storage layer.
This commit is contained in:
+3
-12
@@ -1,16 +1,7 @@
|
||||
/**
|
||||
* 仓库层统一 Result<T>
|
||||
* 仓库和持久化操作共享的 Result<T>。
|
||||
*
|
||||
* 与 `src/data/storage/result.ts` 的 `Result<T>`(`{kind, value}` 形态)并存:
|
||||
* - 本类型供仓库层(`src/data/repositories/*`)使用,`{success, data}` 形态更贴近
|
||||
* 原 Dart `Result.success` / `Result.failure` 命名与 API 端 envelope 风格。
|
||||
* - 存储层继续使用 `{kind, value}`,因为它的消费者(localStorage、Dexie)已经在
|
||||
* 大量代码中 pattern-match `r.kind`。
|
||||
* - 两个类型路径不同(`@/data/result` vs `@/data/storage/result`),不冲突;
|
||||
* 如需在同模块中混用,可用 `import { Result as StorageResult } from
|
||||
* "@/data/storage/result"` 别名。
|
||||
*
|
||||
* `error` 仍固定为 `Error`(非 `unknown`):仓库 `Result.wrap` 捕获后用
|
||||
* `error` 固定为 `Error`(非 `unknown`):`Result.wrap` 捕获后用
|
||||
* `ExceptionHandler` 统一归一化为 `AppException`,调用方可以稳定读取
|
||||
* `error.message`;需要结构化错误时可继续通过 `ExceptionHandler.handle(error)`
|
||||
* 得到简化后的 `{ code, message }`。
|
||||
@@ -23,7 +14,7 @@ export type Result<T> =
|
||||
| { readonly success: true; readonly data: T }
|
||||
| { readonly success: false; readonly error: Error };
|
||||
|
||||
/** 仓库层 Result.wrap 专用 logger —— 自动带 component: "Result" 标签 */
|
||||
/** Result.wrap 专用 logger —— 自动带 component: "Result" 标签 */
|
||||
const log = new Logger("Result");
|
||||
|
||||
export const Result = {
|
||||
|
||||
Reference in New Issue
Block a user