Refactor UUID generation, remove unused logger and encryption utilities, and clean up request handling
- Updated `generateUUID` function for improved readability and performance. - Deleted `logger.ts`, `other.ts`, `request.ts`, `storage.ts`, `tansParams.ts`, and `validate.ts` as they were no longer needed. - Simplified TypeScript configuration by removing unnecessary paths and aliases. - Enhanced Vite configuration for better project structure and maintainability.
This commit is contained in:
@@ -193,7 +193,7 @@ ipcMain.handle(IPC_EVENTS.OPEN_CHANNEL, async (_event, channels: any) => { ... }
|
||||
- 修改 `zn-ai/src/pages/home/TaskCenter.vue`:移除硬编码导入,注入 `useChannelStore`,修复 `.value` bug。
|
||||
- 检查 `zn-ai/electron/process/runTaskOperationService.ts` 与 `open_all_channel.js` 的数据格式兼容性,必要时做适配。
|
||||
- 在 `zn-ai/src/pages/home/index.vue` 中添加 `channelStore.loadSelectedChannels()` 初始化(onMounted 或合适位置)。
|
||||
- 运行项目(`npm run dev` 或等效命令),验证:
|
||||
- 运行项目(`pnpm run dev` 或等效命令),验证:
|
||||
1. 脚本管理中有渠道数据时,`AddChannelDialog` 能搜索到;
|
||||
2. 选择并保存后,`TaskCenter` 能正确传递数组;
|
||||
3. `open_all_channel.js` 能正常解析并打开页面。
|
||||
|
||||
@@ -221,11 +221,11 @@
|
||||
- **预估工时**:3小时
|
||||
|
||||
#### 3.6 集成路由和导航
|
||||
- **文件**:`src/router/index.ts`
|
||||
- **文件**:`src-react/router/index.tsx`、`src-react/router/routes.ts`、`src-react/components/layout/Sidebar.tsx`
|
||||
- **内容**:
|
||||
- 添加定时任务页面路由
|
||||
- 更新侧边栏菜单(如果需要)
|
||||
- 添加路由守卫(如果需要)
|
||||
- 在 React 路由表中添加定时任务页面入口
|
||||
- 更新 `NAV_ITEMS` / 侧边栏导航项
|
||||
- 如需鉴权,沿用 `src-react/router/auth.tsx` 中的路由守卫
|
||||
- **依赖**:主页面组件
|
||||
- **预估工时**:2小时
|
||||
|
||||
@@ -446,4 +446,4 @@ src/
|
||||
|
||||
---
|
||||
|
||||
*本计划将根据实际情况进行迭代更新。建议每阶段结束后进行回顾和调整。*
|
||||
*本计划将根据实际情况进行迭代更新。建议每阶段结束后进行回顾和调整。*
|
||||
|
||||
74
docs/React-Migration-Status-2026-04-17.md
Normal file
74
docs/React-Migration-Status-2026-04-17.md
Normal file
@@ -0,0 +1,74 @@
|
||||
# React Migration Status - 2026-04-17
|
||||
|
||||
## Current Verdict
|
||||
|
||||
- The active renderer bootstrap is React-only.
|
||||
- The legacy Vue bootstrap, page tree, component tree, store tree, request/api layer, and the final leftover `src/**` tree have been removed.
|
||||
- The repository source/runtime is now effectively React-only.
|
||||
|
||||
## What Changed In This Pass
|
||||
|
||||
1. `index.html -> src/main.tsx` is now the only active renderer startup path.
|
||||
2. The temporary compatibility shims `renderer-main.ts`, `ui-framework.ts`, `src/main.ts`, and `src/framework.ts` have been removed.
|
||||
3. The dead Vue bootstrap chain was removed:
|
||||
- `src/main-vue.ts`
|
||||
- `src/router/index.ts`
|
||||
- `src/permission.ts`
|
||||
- `src/App.vue`
|
||||
4. The dead Vue runtime tree was removed:
|
||||
- `src/pages/**`
|
||||
- `src/components/**`
|
||||
- `src/stores/**`
|
||||
- `src/api/**`
|
||||
- `src/utils/request.ts`
|
||||
- `src/auto-imports.d.ts`
|
||||
- legacy Vue-only composables and i18n bootstrap files
|
||||
- the remaining `src/main.ts`, `src/framework.ts`, assets, constants, locales, shared helpers, and utility files
|
||||
5. `global.d.ts` no longer declares Vue-era modules or the deleted `@assets/images/*` alias.
|
||||
6. `tsconfig.app.json`, `tsconfig.json`, and `vite.config.ts` no longer keep the stale `src/**` alias surface.
|
||||
7. `openapi-ts-request.config.ts` now points at `src/api`, and `src/api/request.ts` provides the React-side generated request bridge.
|
||||
8. `package.json` no longer lists Vue-era runtime/UI dependencies.
|
||||
|
||||
## Validation On 2026-04-17
|
||||
|
||||
- `pnpm typecheck` passes.
|
||||
- `pnpm build:vite` passes.
|
||||
- The renderer build, Electron main build, and preload build all complete successfully in the current workspace.
|
||||
- The current build still emits a warning and skips bytenode bytecode compilation when the local Electron binary is unavailable in `node_modules/electron`.
|
||||
|
||||
## Remaining Non-Blocking Notes
|
||||
|
||||
1. `package-lock.json` still contains historical Vue-era entries; the active workspace lockfile is `pnpm-lock.yaml`.
|
||||
2. `pnpm-lock.yaml` still includes `@vue/compiler-sfc` transitively through `openapi-ts-request`, not through the application runtime.
|
||||
|
||||
## Remaining Follow-Up
|
||||
|
||||
1. Clean up stale historical docs that still mention `src/**` as a live runtime path.
|
||||
2. Decide whether to keep or remove `package-lock.json` in a `pnpm`-managed repo.
|
||||
3. Keep build and typecheck green while the React/runtime-shared structure continues to evolve.
|
||||
|
||||
## Build Chain Notes
|
||||
|
||||
1. `vite.config.ts` now scopes Electron `build.watch` to development mode so `pnpm build:vite` exits cleanly in production mode.
|
||||
2. The main-process Vite build now uses the same alias map as renderer/preload, so Electron imports like `@lib/constants` resolve correctly.
|
||||
3. `vite-plugin-electron-encrypt` now degrades gracefully when the local Electron executable is missing, logging a warning instead of failing the build.
|
||||
4. React router now guards workspace routes and redirects authenticated users away from `/login`.
|
||||
|
||||
## Practical Boundary After This Pass
|
||||
|
||||
- Safe now:
|
||||
- Treat React as the only supported renderer startup path.
|
||||
- Treat the old Vue tree as fully retired code.
|
||||
- Remove `src/**` from migration planning, because it is no longer part of the repo.
|
||||
- Not safe yet:
|
||||
- Assume every transitive `vue` string in lockfiles is a runtime blocker; some now come only from tooling.
|
||||
- Remove `@runtime/*` without replacing the shared Electron/runtime contract.
|
||||
|
||||
## Recommended Next Gate
|
||||
|
||||
Only consider the final Vue exit once:
|
||||
|
||||
1. No source file imports any Vue-era runtime package.
|
||||
2. `package.json` stays free of the Vue-era dependencies and `pnpm-lock.yaml` stays refreshed.
|
||||
3. Build and typecheck keep passing after future runtime-shared and React-side changes.
|
||||
4. The remaining historical references are treated as documentation cleanup, not runtime migration blockers.
|
||||
@@ -135,7 +135,7 @@ interface Task {
|
||||
### Phase 3:渲染层任务状态管理
|
||||
**目标**:集中管理任务生命周期。
|
||||
|
||||
7. **`src/store/task.ts`**(新建)
|
||||
7. **`src-react/stores/task.ts`**(修改/补齐)
|
||||
```ts
|
||||
export const useTaskStore = defineStore('task', () => {
|
||||
const tasks = ref<Task[]>([]);
|
||||
@@ -163,14 +163,12 @@ interface Task {
|
||||
});
|
||||
```
|
||||
|
||||
8. **`src/App.vue` 或 `src/pages/home/index.vue`**(修改)
|
||||
- 应用挂载时注册 IPC 监听:
|
||||
8. **`src-react/stores/task.ts` / `src-react/pages/Home/index.tsx`**(修改)
|
||||
- 在 `taskStore.init()` 中绑定 IPC 监听,并在页面挂载时调用初始化:
|
||||
```ts
|
||||
onMounted(() => {
|
||||
window.api.onTaskProgress((_, payload) => taskStore.updateSubTaskProgress(...));
|
||||
window.api.onTaskStarted((_, payload) => ...);
|
||||
window.api.onTaskCompleted((_, payload) => taskStore.completeSubTask(...));
|
||||
});
|
||||
useEffect(() => {
|
||||
void taskStore.init();
|
||||
}, []);
|
||||
```
|
||||
|
||||
---
|
||||
@@ -320,8 +318,8 @@ List.vue 调用 taskStore.retryFailedSubTasks(taskId)
|
||||
| Sub-agent | 负责阶段 | 关键文件 | 依赖 |
|
||||
|---|---|---|---|
|
||||
| **SA-1 主进程** | Phase 1 + Phase 2 | `src/lib/task-types.ts`、`src/lib/constants.ts`、`electron/preload/index.ts`、`global.d.ts`、`electron/service/execute-script-service/index.ts`、`electron/process/runTaskOperationService.ts` | 无 |
|
||||
| **SA-2 状态管理** | Phase 3 | `src/store/task.ts`(新建)、`src/App.vue`(挂载监听) | 需 SA-1 的类型与 IPC 契约 |
|
||||
| **SA-3 前端 UI** | Phase 4 + Phase 5 | `src/pages/home/components/TaskList.vue`、`TaskCard.vue`、`TaskOperationDialog.vue` | 需 SA-2 的 Store API(可按本计划接口契约先行开发) |
|
||||
| **SA-2 状态管理** | Phase 3 | `src-react/stores/task.ts`(状态与 IPC 订阅)、`src-react/pages/Home/index.tsx`(触发初始化) | 需 SA-1 的类型与 IPC 契约 |
|
||||
| **SA-3 前端 UI** | Phase 4 + Phase 5 | `src-react/components/chat/TaskBoard.tsx`、`src-react/pages/Home/components/TaskOperationDialog.tsx` | 需 SA-2 的 Store API(可按本计划接口契约先行开发) |
|
||||
| **SA-4 脚本进度** | Phase 6 | `electron/scripts/mt_trace.js`、`fg_trace.js`、`dy_hotel_trace.js`、`dy_hot_spring_trace.js` | 无 |
|
||||
|
||||
### 各 Sub-agent 验收标准
|
||||
|
||||
@@ -1,136 +1,106 @@
|
||||
# zn-ai Vue 退场清单
|
||||
# zn-ai Vue Exit Checklist
|
||||
|
||||
目标:在 React 接管默认入口后,按清单删除所有仅服务 Vue 的资产,最终收敛为 `React-only`。
|
||||
Goal: move `zn-ai` from "React renderer plus leftover Vue-era assets/config" to a truly `React-only` repo, while keeping build and typecheck green at each step.
|
||||
|
||||
## 当前状态
|
||||
## Current Status
|
||||
|
||||
- `Home` 的 React 主链路已经接入真实 `chat/task/channel` store、真实 IPC,以及 `TaskOperationDialog / AddChannelDialog`。
|
||||
- `Home` 这批旧 Vue 文件目前仍被 `src/router/index.ts -> src/pages/home/index.vue` 的 Vue fallback 引用,因此本轮不能直接删除。
|
||||
- 其余主页面虽然已有 `src-react/pages/*` 路由壳,但当前大多还是占位页,尚不满足“删除 Vue 路由与页面”的退场条件。
|
||||
- Renderer bootstrap is React-only.
|
||||
- `index.html`
|
||||
- `src/main.tsx`
|
||||
- `src/**` is now the active React renderer tree and no longer reaches back into the removed Vue code.
|
||||
- Electron/shared runtime no longer imports from `src/lib/*`, `src/shared/*`, or `src/i18n/locales/*`.
|
||||
- active runtime callers now use `@runtime/* -> runtime-shared/*`
|
||||
- Legacy compatibility/config cleanup is complete.
|
||||
- removed `@vitejs/plugin-vue`
|
||||
- removed `unplugin-auto-import`
|
||||
- removed Vue module declarations from `global.d.ts`
|
||||
- removed stale `src/**` path aliases from Vite and TypeScript
|
||||
- moved `openapi-ts-request` output to `src/api`
|
||||
- added `src/api/request.ts` as the React-side generated request bridge
|
||||
- The old Vue tree is gone end-to-end.
|
||||
- deleted `src/main-vue.ts`
|
||||
- deleted `src/router/index.ts`
|
||||
- deleted `src/permission.ts`
|
||||
- deleted `src/App.vue`
|
||||
- deleted the remaining `src/**` directory, including `src/main.ts` and `src/framework.ts`
|
||||
- Vue-era runtime dependencies are gone from `package.json`.
|
||||
- removed `vue`
|
||||
- removed `pinia`
|
||||
- removed `vue-router`
|
||||
- removed `element-plus`
|
||||
- removed `vue-i18n`
|
||||
- removed `@remixicon/vue`
|
||||
- removed `@lucide/vue`
|
||||
- removed `vue-codemirror`
|
||||
- removed `vue-markdown-render`
|
||||
- removed `@vueuse/core`
|
||||
|
||||
当前删除策略:
|
||||
## What This Means
|
||||
|
||||
1. 先停止新增对 `src/pages/home/**`、`src/stores/chat.ts`、`src/stores/task.ts`、`src/stores/channel.ts` 的 React 侧依赖。
|
||||
2. 等 `Agents / Knowledge / Skills / Cron / Scripts / Setting / Login` 的 React 页面完成真实迁移后,再统一删除 `src/router/*`、`.vue` 页面和旧 Pinia store。
|
||||
3. 在此之前,只做“替换引用”和“收口依赖”,不做会破坏 Vue fallback 的物理删除。
|
||||
- The old Vue runtime path is no longer present in the source tree.
|
||||
- `src/**` is no longer a live runtime or config boundary.
|
||||
- The remaining follow-up is mostly housekeeping, not migration-blocking runtime work.
|
||||
- stale historical references in docs
|
||||
- optional cleanup of `package-lock.json` if the repo standardizes on `pnpm` only
|
||||
- the known bytecode warning when the local Electron binary is missing
|
||||
|
||||
## 1. 入口与切换层
|
||||
## File Plan
|
||||
|
||||
- `src/main-vue.ts`
|
||||
- `src/framework.ts`
|
||||
- `src/main.ts`
|
||||
- `src/App.vue`
|
||||
- `src/permission.ts`
|
||||
### 1. `package.json`
|
||||
|
||||
退场标准:
|
||||
#### Done
|
||||
|
||||
- `src/main.ts` 不再分流 Vue 入口。
|
||||
- `src/framework.ts` 不再保留 `vue` 分支。
|
||||
- `src/main-vue.ts` 删除。
|
||||
- `src/App.vue` 和 `src/permission.ts` 只要还依赖 Vue 生命周期或 Router 守卫,就必须迁入 React 后再删除旧文件。
|
||||
- removed the Vue-era runtime/UI dependencies from the manifest
|
||||
- refreshed `pnpm-lock.yaml`
|
||||
|
||||
## 2. Vue 页面
|
||||
### 2. `global.d.ts`
|
||||
|
||||
以下页面都属于 Vue 退场范围,React 版本完成后删除:
|
||||
#### Done
|
||||
|
||||
- `src/pages/home/index.vue`
|
||||
- `src/pages/home/ChatBox.vue`
|
||||
- `src/pages/home/ChatHistory.vue`
|
||||
- `src/pages/home/TaskCenter.vue`
|
||||
- `src/pages/home/components/*.vue`
|
||||
- `src/pages/login/index.vue`
|
||||
- `src/pages/agents/index.vue`
|
||||
- `src/pages/knowledge/index.vue`
|
||||
- `src/pages/skills/index.vue`
|
||||
- `src/pages/skills/components/*.vue`
|
||||
- `src/pages/cron/index.vue`
|
||||
- `src/pages/cron/components/*.vue`
|
||||
- `src/pages/setting/index.vue`
|
||||
- `src/pages/setting/components/*.vue`
|
||||
- removed `declare module "@stores/*";`
|
||||
- removed `declare module "@service/*";`
|
||||
- removed `declare module "@utils/*";`
|
||||
- removed `declare module "@constant/*";`
|
||||
- removed `declare module "vue-router";`
|
||||
- removed `declare module "*.vue"`
|
||||
- removed `declare module "@remixicon/vue"`
|
||||
- removed `declare module "@assets/images/*"`
|
||||
|
||||
建议删除顺序:
|
||||
### 3. `tsconfig.app.json`
|
||||
|
||||
1. 先迁 `home`,再迁其余业务页。
|
||||
2. 先删纯展示/表单页,再删聊天主链路。
|
||||
3. 最后统一清理页面下的 Vue 子组件目录。
|
||||
#### Done
|
||||
|
||||
## 3. Vue Store
|
||||
- removed explicit include for `src/permission.ts`
|
||||
- removed `include: "src/**/*.vue"`
|
||||
- removed the remaining dead `src/**` path aliases
|
||||
|
||||
以下 `Pinia` store 是 Vue 体系的核心状态,React 完成对等实现后删除:
|
||||
### 4. `vite.config.ts`
|
||||
|
||||
- `src/stores/chat.ts`
|
||||
- `src/stores/providers.ts`
|
||||
- `src/stores/channel.ts`
|
||||
- `src/stores/cron.ts`
|
||||
- `src/stores/script.ts`
|
||||
- `src/stores/skills.ts`
|
||||
- `src/stores/task.ts`
|
||||
- `src/stores/theme.ts`
|
||||
- `src/stores/locale.ts`
|
||||
- `src/stores/update.ts`
|
||||
- `src/stores/userinfo.ts`
|
||||
- `src/stores/sharedStore.ts`
|
||||
#### Done
|
||||
|
||||
退场标准:
|
||||
- active renderer build is React-only
|
||||
- Electron shared runtime uses `@runtime/*`
|
||||
- removed the legacy `src/**` alias surface from the Vite config
|
||||
|
||||
- React 侧已具备对等 store 后,旧 Pinia store 不再被任何路由或组件引用。
|
||||
- `src/stores/*` 不再承担主流程状态。
|
||||
## Recommended Execution Order
|
||||
|
||||
## 4. Router 与守卫
|
||||
1. Done: remove low-risk compatibility items from `package.json` and `global.d.ts`
|
||||
2. Done: remove the dead Vue bootstrap chain
|
||||
3. Done: remove the dead Vue page/component/store/request tree
|
||||
4. Done: delete `src/main.ts`, `src/framework.ts`, and the remaining dead `src/**` files
|
||||
5. Done: trim stale TypeScript/Vite/OpenAPI alias surface that pointed into deleted legacy areas
|
||||
6. Done: remove the remaining Vue-era dependencies from `package.json`
|
||||
|
||||
需要替换或删除的 Vue 路由资产:
|
||||
## Residual Notes
|
||||
|
||||
- `src/router/index.ts`
|
||||
- `src/constant/menus.ts`
|
||||
- `src/permission.ts`
|
||||
- `src/components/SideMenus/index.vue`
|
||||
- Keep `@runtime/* -> runtime-shared/*`, which is now the active Electron/shared-runtime boundary.
|
||||
- `package-lock.json` still contains historical Vue-era entries, but the active workspace lockfile is `pnpm-lock.yaml`.
|
||||
|
||||
退场标准:
|
||||
## Next Gate
|
||||
|
||||
- 路由切换完全由 React Router 接管。
|
||||
- 菜单配置不再依赖 Vue 路由表。
|
||||
- 登录守卫迁到 React 侧后,旧守卫文件删除。
|
||||
Vue exit is effectively complete for source/runtime once all of the following remain true:
|
||||
|
||||
## 5. 仅服务 Vue 的共享组件
|
||||
|
||||
这些组件如果只被 Vue 页面使用,应在 React 对等实现后删除:
|
||||
|
||||
- `src/components/Layout/index.vue`
|
||||
- `src/components/Layout/TitleBar/index.vue`
|
||||
- `src/components/NativeTooltip/index.vue`
|
||||
- `src/components/Pagination/index.vue`
|
||||
- `src/components/TitleSection/index.vue`
|
||||
|
||||
## 6. Vue 依赖与构建项
|
||||
|
||||
`package.json` 中后续需要删除或替换的 Vue 依赖:
|
||||
|
||||
- `vue`
|
||||
- `vue-router`
|
||||
- `pinia`
|
||||
- `vue-i18n`
|
||||
- `element-plus`
|
||||
- `@vueuse/core`
|
||||
- `@vitejs/plugin-vue`
|
||||
- `@lucide/vue`
|
||||
- `@remixicon/vue`
|
||||
- `vue-codemirror`
|
||||
- `vue-markdown-render`
|
||||
|
||||
`vite.config.ts` 中后续需要清理的 Vue 构建项:
|
||||
|
||||
- `vue()` 插件
|
||||
- `unplugin-auto-import` 的 Vue 自动导入配置
|
||||
- 与 Vue 页面强绑定的 `src/auto-imports.d.ts` 生成链路
|
||||
- 所有仅为 Vue 入口保留的分支判断
|
||||
|
||||
## 7. 最终删除判定
|
||||
|
||||
只有在以下条件都满足后,才允许进入最终清理提交:
|
||||
|
||||
- 默认入口只剩 React。
|
||||
- 所有主页面都已迁到 `src-react/`。
|
||||
- `src/pages/**` 中不再存在可执行的 Vue 页面。
|
||||
- `src/stores/**` 中不再存在被运行时调用的 Vue 状态。
|
||||
- `package.json` 和 `vite.config.ts` 中不再保留 Vue 构建依赖。
|
||||
- 仓库中不再需要 `VITE_UI_FRAMEWORK=vue` 作为运行开关。
|
||||
1. no source file imports any Vue-era runtime package
|
||||
2. `package.json` stays free of the Vue-era dependencies and `pnpm-lock.yaml` stays refreshed
|
||||
3. Vite/TypeScript/OpenAPI config stays off `src/**`
|
||||
4. `pnpm typecheck` and `pnpm build:vite` stay green
|
||||
|
||||
@@ -18,12 +18,12 @@
|
||||
|
||||
| 维度 | 当前实现 | 关键路径 |
|
||||
| --- | --- | --- |
|
||||
| 应用入口 | Vue 根应用 | `zn-ai/src/main.ts` |
|
||||
| 根组件 | `App.vue + router-view + keep-alive` | `zn-ai/src/App.vue` |
|
||||
| 路由 | `vue-router` | `zn-ai/src/router/index.ts` |
|
||||
| 状态管理 | `Pinia` | `zn-ai/src/stores/*` |
|
||||
| UI 组件体系 | `Element Plus + 自定义 Vue 组件 + Tailwind` | `zn-ai/src/components/*` |
|
||||
| 页面目录 | Vue 页面分散在 `src/pages/*` | `zn-ai/src/pages/*` |
|
||||
| 应用入口 | React-only 兼容引导(`src/main.ts -> src-react/main.tsx`) | `zn-ai/src/main.ts` |
|
||||
| 根组件 | `App.tsx + HashRouter + AppRouter` | `zn-ai/src-react/App.tsx` |
|
||||
| 路由 | `react-router-dom` | `zn-ai/src-react/router/index.tsx` |
|
||||
| 状态管理 | `React stores + shared runtime modules` | `zn-ai/src-react/stores/*` |
|
||||
| UI 组件体系 | `React 组件 + Tailwind` | `zn-ai/src-react/components/*` |
|
||||
| 页面目录 | React 页面位于 `src-react/pages/*`,旧 Vue 页面树已移除 | `zn-ai/src-react/pages/*` |
|
||||
| Electron 交互 | `window.api + hostapi:fetch + gateway:rpc` | `zn-ai/electron/*` `zn-ai/src/lib/*` |
|
||||
| 样式 | `Tailwind v4 + 全局 CSS + Element Plus 主题` | `zn-ai/src/styles/*` |
|
||||
|
||||
@@ -223,12 +223,13 @@ src/
|
||||
|
||||
### 6.1 P0:先迁基础壳
|
||||
|
||||
- `App.vue`
|
||||
- `src/main.ts`
|
||||
- `src/router/index.ts`
|
||||
- `src/components/Layout/index.vue`
|
||||
- `src/components/SideMenus/index.vue`
|
||||
- `src/components/Layout/TitleBar/index.vue`
|
||||
- `src-react/main.tsx`
|
||||
- `src-react/App.tsx`
|
||||
- `src-react/router/*`
|
||||
- `src-react/components/layout/MainLayout.tsx`
|
||||
- `src-react/components/layout/Sidebar.tsx`
|
||||
- `src-react/components/layout/TitleBar.tsx`
|
||||
|
||||
原因:
|
||||
|
||||
@@ -418,8 +419,10 @@ src/
|
||||
|
||||
### 11.6 C1:Vue 清退与依赖下线
|
||||
|
||||
- `zn-ai/src/main-vue.ts`
|
||||
- `zn-ai/src/router/*`
|
||||
- 已删除:`zn-ai/src/main-vue.ts`
|
||||
- 已删除:`zn-ai/src/router/index.ts`
|
||||
- 已删除:`zn-ai/src/permission.ts`
|
||||
- 已删除:`zn-ai/src/App.vue`
|
||||
- `zn-ai/src/stores/*`
|
||||
- `zn-ai/src/components/**/*.vue`
|
||||
- `zn-ai/src/pages/**/*.vue`
|
||||
|
||||
@@ -606,8 +606,8 @@ src/i18n/
|
||||
- 配置智能回退链:`zh-CN` → `zh` → `en`
|
||||
- 添加开发调试选项
|
||||
- [ ] 验证配置正确性:
|
||||
- 运行 `npm run typecheck` 检查类型
|
||||
- 运行 `npm run build:vite` 验证构建
|
||||
- 运行 `pnpm run typecheck` 检查类型
|
||||
- 运行 `pnpm run build:vite` 验证构建
|
||||
- 启动开发服务器测试基础功能
|
||||
|
||||
### 任务 4:Pinia Store 集成
|
||||
@@ -635,9 +635,9 @@ src/i18n/
|
||||
- 验证语言切换实时生效
|
||||
|
||||
### 验收标准
|
||||
- [ ] 类型检查通过 (`npm run typecheck`)
|
||||
- [ ] 生产构建通过 (`npm run build:vite`)
|
||||
- [ ] 开发服务器正常启动 (`npm run dev`)
|
||||
- [ ] 类型检查通过 (`pnpm run typecheck`)
|
||||
- [ ] 生产构建通过 (`pnpm run build:vite`)
|
||||
- [ ] 开发服务器正常启动 (`pnpm run dev`)
|
||||
- [ ] 中英文切换功能正常
|
||||
- [ ] 语言设置持久化生效
|
||||
- [ ] 控制台无 i18n 相关错误
|
||||
@@ -653,8 +653,8 @@ src/i18n/
|
||||
- ✅ **任务 5:基础组件迁移试点** - 已完成(创建 useLocale composable,迁移登录页面)
|
||||
|
||||
### 验证结果
|
||||
- ✅ 类型检查通过 (`npm run typecheck`)
|
||||
- ✅ 生产构建通过 (`npm run build:vite`)
|
||||
- ✅ 类型检查通过 (`pnpm run typecheck`)
|
||||
- ✅ 生产构建通过 (`pnpm run build:vite`)
|
||||
- ✅ 无代码缺失,保持向后兼容
|
||||
|
||||
### 下一步建议
|
||||
@@ -664,4 +664,4 @@ src/i18n/
|
||||
|
||||
ClawX 的 i18n 实现提供了一个优秀的参考架构,其核心思想——**模块化、类型安全、状态集成、智能解析**——完全适用于 zn-ai 项目。通过分阶段实施上述开发计划,zn-ai 可以在 1-2 周内建立专业级的国际化系统,为多语言用户提供更好的体验,同时提高代码的可维护性和开发效率。
|
||||
|
||||
建议立即开始第二阶段实施,逐步推广到全应用。
|
||||
建议立即开始第二阶段实施,逐步推广到全应用。
|
||||
|
||||
20
docs/plan.md
20
docs/plan.md
@@ -191,8 +191,8 @@ zn-ai 项目当前使用以下技术栈:
|
||||
- **代码保护**: bytenode 字节码编译(通过自定义 `vite-plugin-electron-encrypt` 插件实现)
|
||||
|
||||
当前构建流程:
|
||||
1. 开发构建:`npm start`(使用 electron-forge start)
|
||||
2. 生产构建:`npm run package`、`npm run make`、`npm run build:encrypt`
|
||||
1. 开发构建:`pnpm run dev`
|
||||
2. 生产构建:`pnpm run package`、`pnpm run build:encrypt`
|
||||
3. 自定义脚本:`clean.js`、`generateProdEntry.js` 用于清理和生成字节码入口
|
||||
|
||||
## 重构目标
|
||||
@@ -290,11 +290,11 @@ zn-ai 项目当前使用以下技术栈:
|
||||
### 第四阶段:测试与验证(预计 1-2 天)
|
||||
|
||||
#### 4.1 开发构建测试
|
||||
- 运行 `npm run dev`,验证开发服务器正常启动
|
||||
- 运行 `pnpm run dev`,验证开发服务器正常启动
|
||||
- 测试热重载、主进程重载等功能
|
||||
|
||||
#### 4.2 生产构建测试
|
||||
- 运行 `npm run build`,验证完整构建流程
|
||||
- 运行 `pnpm run build`,验证完整构建流程
|
||||
- 检查输出目录结构是否正确
|
||||
- 验证字节码保护是否生效
|
||||
|
||||
@@ -311,7 +311,7 @@ zn-ai 项目当前使用以下技术栈:
|
||||
|
||||
### 开发构建流程
|
||||
```
|
||||
npm run dev
|
||||
pnpm run dev
|
||||
```
|
||||
1. Vite 启动渲染进程开发服务器
|
||||
2. `vite-plugin-electron` 编译主进程和预加载脚本
|
||||
@@ -319,7 +319,7 @@ npm run dev
|
||||
|
||||
### 生产构建流程
|
||||
```
|
||||
npm run build
|
||||
pnpm run build
|
||||
```
|
||||
1. `vite build` 编译渲染进程 → `dist/`
|
||||
2. `vite-plugin-electron` 编译主进程和预加载脚本 → `dist-electron/`
|
||||
@@ -328,9 +328,9 @@ npm run build
|
||||
|
||||
### 平台特定打包
|
||||
```
|
||||
npm run package:win # Windows 安装包
|
||||
npm run package:mac # macOS 安装包
|
||||
npm run package:linux # Linux 安装包
|
||||
pnpm run package:win # Windows 安装包
|
||||
pnpm run package:mac # macOS 安装包
|
||||
pnpm run package:linux # Linux 安装包
|
||||
```
|
||||
|
||||
## 配置迁移对照表
|
||||
@@ -398,4 +398,4 @@ npm run package:linux # Linux 安装包
|
||||
|
||||
将 ClawX 项目的打包编译思路迁移到 zn-ai 项目是可行的,但需要谨慎处理 bytenode 代码保护机制的集成。重构后的构建系统将更现代化、模块化,且易于维护。建议按照上述计划分阶段实施,每个阶段完成后进行验证,确保整体项目稳定性。
|
||||
|
||||
**建议先进行第一阶段的基础配置迁移,验证基础构建流程可行后,再继续进行后续阶段。**
|
||||
**建议先进行第一阶段的基础配置迁移,验证基础构建流程可行后,再继续进行后续阶段。**
|
||||
|
||||
7
docs/prompt-history.md
Normal file
7
docs/prompt-history.md
Normal file
@@ -0,0 +1,7 @@
|
||||
# 提示词历史记录
|
||||
|
||||
- 检查zn-ai项目React平替Vue技术栈是渲染层视觉UI是否完成,现在是否可以直接移除src目录,估算sub-agent数量,安排sub-agent分工开始工作。
|
||||
|
||||
- 本地安装了@vitejs/plugin-react,可以直接构建,下一波直接做Knowledge / Scripts / Login,然后再收 vite.config.ts 和 Vue-only 启动链。估算sub-agent数量,安排sub-agent分工开始工作。
|
||||
|
||||
- 继续做Knowledge / Scripts / Login,构建工作,检查React平替Vue技术栈是否全部完成,估算sub-agent数量,安排sub-agent分工开始工作。
|
||||
Reference in New Issue
Block a user