Files
monkey-ai-web/docs/NPM_MIGRATION.md
T
zhanjunhao 6111bf1a7a chore(deps): 统一使用 npm 并移除 Bun 锁文件
- 纳入 package-lock.json,移除对应 Git 忽略规则
- 删除 bun.lock,移除 ESLint 和国际化脚本的 bunx 依赖
- 声明 Node/npm 版本要求并更新开发文档
- 补充干净安装、128 项测试、生产构建及页面冒烟验收记录
- 记录既有静态检查、翻译及安全审计限制
2026-10-21 12:05:46 +08:00

35 lines
2.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# npm 依赖迁移验收记录
日期:2026-10-21
## 迁移内容
- 以当前 `package.json` 为准,保留并纳入版本管理 `package-lock.json`(lockfileVersion 3)。
- 删除与当前清单不一致的 Bun 锁文件 `bun.lock`。
- 将 ESLint 和 i18next CLI 脚本从 `bunx` 改为直接调用项目本地命令,npm scripts 会自动使用 `node_modules/.bin`。
- 在 `package.json` 增加 Node.js `>=22.13.0`、npm `>=10` 的 `engines`,并记录 `packageManager: npm@10.9.9`。
- 从 `.gitignore` 移除 `package-lock.json`,避免 npm 锁文件再次被忽略。
- 同步更新 README 和项目分析文档中的包管理、安装、命令及验证说明。
## 已执行验证
| 检查 | 结果 |
| --- | --- |
| `npm install --package-lock-only --ignore-scripts --no-audit --no-fund` | 通过 |
| `npm ci --no-audit --no-fund` | 通过;干净安装 1200 个包 |
| `npm test` | 通过;128 项通过,0 项失败 |
| `npm run build` | 通过;Vite 生产构建完成 |
| `npm ls --depth=0` | 通过;无顶层依赖缺失或无效 |
| `npm run i18n:status` | 命令可执行,但项目既有翻译未完成状态导致退出码 1 |
| `npm run eslint` | 命令可执行,但项目既有 3 个版权头错误和 173 个 Hooks 警告 |
| `npm run lint` | 命令可执行,但项目既有 `scripts/translated_ja.json` JSON/编码错误 |
| 生产预览 HTTP 冒烟 | `/`、`/org/login` 返回 200,`/config.js` 返回 JavaScript |
| Chrome headless 页面冒烟 | `/org/login` 的 React root 已挂载,DOM 出现 Semi 布局和输入控件;未进行完整页面交互或浏览器控制台错误采集 |
| `npm audit` | npm 镜像未实现 audit endpoint,返回 404;不是本次代码变更引入的漏洞结论 |
## 验收边界
依赖迁移、Node 测试、生产构建和静态资源预览已验证。真实登录、后端接口、模型调用、SSE、企业权限和线上网关仍需要可用后端、测试账号及部署环境,不能仅凭本地构建代替业务验收。
干净安装曾因正在运行的 Vite/esbuild 进程占用 Windows 原生依赖文件而首次失败;停止占用进程后,`npm ci` 已成功完成。生产构建产生的 `dist/` 已被 `.gitignore` 忽略。