Appearance
共享层概览
packages/shared/ 下的包供 web、desktop、mobile 通过 pnpm workspace 引用,避免三端重复实现 HTTP、类型、权限逻辑。
包列表
| 包 | 构建 | 框架依赖 |
|---|---|---|
| types | tsc → dist | 无 |
| auth | tsc → dist | types |
| api-client | tsc → dist | types、axios |
| admin | 源码直引 | Vue、Element Plus、Pinia |
| components | Vite library | Vue |
| utils | tsc → dist | 无 |
推荐使用方式
typescript
import type { LoginResponse, User } from '@xichen-full-stack/types'
import { createApiClient } from '@xichen-full-stack/api-client'
import { hasPermission } from '@xichen-full-stack/auth'
import { bootstrapAdminApp } from '@xichen-full-stack/admin'构建顺序
bash
pnpm --filter @xichen-full-stack/types build
pnpm --filter @xichen-full-stack/auth build
pnpm --filter @xichen-full-stack/api-client buildadmin / components 在 dev 模式下由 Vite 直接编译源码。