refactor(stores): split state and event unions into separate files

Extract `<Name>Context` interface + `initialContext` const into
`<name>-context.ts` and the event union into `<name>-events.ts` for
all four state machines (auth, chat, sidebar, user) under src/stores/.

- `*-machine.ts` keeps helpers, actors, actions, and the
  `setup().createMachine()` body; re-exports the types/initial value
  to preserve its public API.
- `*-types.ts` re-exports from the new files for backward compatibility
  (sidebar keeps enum re-exports, chat keeps GuestChatQuota).
- `index.ts` barrels updated to re-export the new files.
- Removed unused model imports (AuthMode, AuthPanelMode) from
  auth-machine.ts; kept LoginType, UiMessage, UserView where still
  used by actors/helpers.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
kanban
2026-06-10 18:21:28 +08:00
committed by chenhang
parent 0593920318
commit 744e23fc29
20 changed files with 233 additions and 171 deletions
+7 -2
View File
@@ -1,7 +1,12 @@
/**
* @file Automatically generated by barrelsby.
* @file Auth 公共导出
*
* 状态机重构后:
* - Context 形状与初始值位于 auth-context.ts
* - 事件联合位于 auth-events.ts
* - machine / 类型 / React 入口分别由对应文件导出
*/
export * from "./auth-context";
export * from "./auth-events";
export * from "./auth-machine";
export * from "./auth-types";