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:
@@ -5,7 +5,10 @@
|
||||
* - reducer 逻辑已合并到 sidebar-machine.ts
|
||||
* - 类型由 sidebar-types.ts 重新导出
|
||||
* - React 入口为 sidebar-context.tsx(useMachine 包装)
|
||||
* - Context 形状与初始值位于 sidebar-context.ts
|
||||
* - 事件联合位于 sidebar-events.ts
|
||||
*/
|
||||
export * from "./sidebar-context";
|
||||
export * from "./sidebar-events";
|
||||
export * from "./sidebar-types";
|
||||
export { sidebarMachine } from "./sidebar-machine";
|
||||
|
||||
Reference in New Issue
Block a user