chore: migrate contexts to stores and refresh barrel exports
- Move state management from `src/contexts` to `src/stores` (zustand-based) - Update barrelsby config to include new stores directory - Add bottom-sheet and auth-background components - Auto-open browser on dev server ready in VS Code launch config - Refresh generated barrel index files
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* Auth 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 AuthState 接口、AuthEvent 联合、initialAuthState。
|
||||
* 状态机重构后:
|
||||
* - `AuthEvent` 联合由 `auth-events.ts` 导出
|
||||
* - Context 形状与初始值由 `auth-context.ts` 导出
|
||||
* - `AuthState` 由 `auth-context.tsx` 导出(保持原 API 兼容)
|
||||
*/
|
||||
export type { AuthEvent } from "./auth-events";
|
||||
@@ -1,13 +1,10 @@
|
||||
/**
|
||||
* @file Auth 公共导出
|
||||
* Auth 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - Context 形状与初始值位于 auth-context.ts
|
||||
* - 事件联合位于 auth-events.ts
|
||||
* - machine / 类型 / React 入口分别由对应文件导出
|
||||
* 重新导出 Auth store 的所有公共 API(state / events / machine / React Provider)。
|
||||
*/
|
||||
|
||||
export * from "./auth-state";
|
||||
export * from "./auth-context";
|
||||
export * from "./auth-events";
|
||||
export * from "./auth-machine";
|
||||
export * from "./auth-types";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Chat 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 ChatState 接口、ChatEvent 联合、initialChatState、GuestChatQuota。
|
||||
* 状态机重构后:
|
||||
* - `ChatEvent` 联合由 `chat-events.ts` 导出
|
||||
* - Context 形状与初始值由 `chat-context.ts` 导出
|
||||
* - `ChatState` 由 `chat-context.tsx` 导出(保持原 API 兼容)
|
||||
* - `GuestChatQuota` 仍由 `chat-machine.ts` 导出(业务常量,与上下文配对紧密)
|
||||
*/
|
||||
export type { ChatEvent } from "./chat-events";
|
||||
export { GuestChatQuota } from "./chat-machine";
|
||||
@@ -1,18 +1,10 @@
|
||||
/**
|
||||
* @file Chat 公共导出
|
||||
* Chat 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - 业务类(Dart 风格 context/reducer/side-effects)已合并到 chat-machine.ts
|
||||
* - 类型由 chat-types.ts 重新导出
|
||||
* - React 入口为 chat-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 chat-context.ts
|
||||
* - 事件联合位于 chat-events.ts
|
||||
*
|
||||
* 注:chat-side-effects.ts 暂未删除(其中 WebSocket 长生命周期逻辑
|
||||
* 待下一轮迁移到 fromCallback actor)。
|
||||
* 重新导出 Chat store 的所有公共 API(state / events / machine / React Provider + GuestChatQuota)。
|
||||
*/
|
||||
|
||||
export * from "./chat-state";
|
||||
export * from "./chat-context";
|
||||
export * from "./chat-events";
|
||||
export * from "./chat-types";
|
||||
export { chatMachine } from "./chat-machine";
|
||||
export * from "./chat-machine";
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
/**
|
||||
* @file Sidebar 公共导出
|
||||
* Sidebar 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - reducer 逻辑已合并到 sidebar-machine.ts
|
||||
* - 类型由 sidebar-types.ts 重新导出
|
||||
* - React 入口为 sidebar-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 sidebar-context.ts
|
||||
* - 事件联合位于 sidebar-events.ts
|
||||
* 重新导出 Sidebar store 的所有公共 API(state / events / machine / React Provider + SidebarPage / BottomNavItem)。
|
||||
*/
|
||||
|
||||
export * from "./sidebar-state";
|
||||
export * from "./sidebar-context";
|
||||
export * from "./sidebar-events";
|
||||
export * from "./sidebar-types";
|
||||
export { sidebarMachine } from "./sidebar-machine";
|
||||
export * from "./sidebar-machine";
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
/**
|
||||
* Sidebar 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 SidebarPage、BottomNavItem、SidebarState、SidebarEvent。
|
||||
* 状态机重构后:
|
||||
* - 枚举(SidebarPage、BottomNavItem)由 `sidebar-machine.ts` 导出
|
||||
* - 事件联合(SidebarEvent)由 `sidebar-events.ts` 导出
|
||||
* - Context 形状由 `sidebar-context.ts` 导出
|
||||
* - SidebarState 由 `sidebar-context.tsx` 导出(保持原 API 兼容)
|
||||
*/
|
||||
export { SidebarPage, BottomNavItem } from "./sidebar-machine";
|
||||
export type { SidebarEvent } from "./sidebar-events";
|
||||
@@ -1,15 +1,10 @@
|
||||
/**
|
||||
* @file User 公共导出
|
||||
* User 状态机公共导出(barrel)
|
||||
*
|
||||
* 状态机重构后:
|
||||
* - 业务类(Dart 风格 context/reducer/side-effects)已合并到 user-machine.ts
|
||||
* - 类型由 user-types.ts 重新导出
|
||||
* - React 入口为 user-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 user-context.ts
|
||||
* - 事件联合位于 user-events.ts
|
||||
* 重新导出 User store 的所有公共 API(state / events / machine / React Provider)。
|
||||
*/
|
||||
|
||||
export * from "./user-state";
|
||||
export * from "./user-context";
|
||||
export * from "./user-events";
|
||||
export * from "./user-types";
|
||||
export { userMachine } from "./user-machine";
|
||||
export * from "./user-machine";
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
/**
|
||||
* User 类型(向后兼容 re-export)
|
||||
*
|
||||
* 原始文件定义了 UserState 接口、UserEvent 联合、initialUserState。
|
||||
* 状态机重构后:
|
||||
* - `UserEvent` 联合由 `user-events.ts` 导出
|
||||
* - Context 形状与初始值由 `user-context.ts` 导出
|
||||
* - `UserState` 由 `user-context.tsx` 导出(保持原 API 兼容)
|
||||
*/
|
||||
export type { UserEvent } from "./user-events";
|
||||
Reference in New Issue
Block a user