mirror of
https://github.com/chaitin/MonkeyCode.git
synced 2026-11-27 23:19:40 +08:00
用户反馈 desktop 用几分钟就弹「启动异常」:previewArtifact.ts 用了 Array.prototype.toSorted,Safari 16 才有;macOS 上壳内 WKWebView 跟系统走 (bundle.macos 最低 11.0,出厂 Safari 14),一进设计预览工作台就崩。 Vite 只降级语法不补 API,tsconfig lib 又是 ES2023,编译期拦不住。 - Vite 7 -> 8.2.2,引入 @vitejs/plugin-legacy 8:modernPolyfills 按产物 实际用量注入 core-js,modernTargets 定为 safari >= 14 并由插件接管 build.target;不出 legacy 分包,只多一个外链 polyfills 脚本,CSP 不动。 - 新增 src/lib/webApiPolyfills.ts 兜底 crypto.randomUUID(Safari 15.4 才有, core-js 不管 Web API),作为 main.tsx 首个 import。 - previewArtifact.ts 三处 toSorted 改 sort(filter 产出的新数组,不改入参); previewUrl.ts 抽 currentTurnItems 供 ChatView 复用。 - 补测试:入参不被改序、currentTurnItems、randomUUID 兜底格式与不覆盖原生。
47 lines
1.2 KiB
JSON
47 lines
1.2 KiB
JSON
{
|
|
"name": "monkeycode-ui-next",
|
|
"private": true,
|
|
"version": "0.1.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"build": "tsc --noEmit && vite build",
|
|
"typecheck": "tsc --noEmit",
|
|
"lint": "eslint .",
|
|
"test": "vitest run"
|
|
},
|
|
"dependencies": {
|
|
"@tabler/icons-react": "^3.46.0",
|
|
"@xterm/addon-fit": "^0.11.0",
|
|
"@xterm/xterm": "^6.0.0",
|
|
"dompurify": "^3.4.13",
|
|
"highlight.js": "^11.11.1",
|
|
"katex": "^0.16.47",
|
|
"marked": "^18.0.7",
|
|
"mermaid": "^11.16.1",
|
|
"react": "^19.2.0",
|
|
"react-dom": "^19.2.0"
|
|
},
|
|
"devDependencies": {
|
|
"@eslint/js": "^10.0.1",
|
|
"@tailwindcss/vite": "^4.3.3",
|
|
"@testing-library/react": "^16.3.0",
|
|
"@testing-library/user-event": "^14.6.0",
|
|
"@types/node": "^26.1.2",
|
|
"@types/react": "^19.2.0",
|
|
"@types/react-dom": "^19.2.0",
|
|
"@vitejs/plugin-legacy": "^8.2.3",
|
|
"@vitejs/plugin-react": "^5.0.0",
|
|
"daisyui": "^5.7.14",
|
|
"eslint": "^10.8.1",
|
|
"eslint-plugin-react-hooks": "^7.1.1",
|
|
"jsdom": "^29.1.1",
|
|
"tailwindcss": "^4.3.3",
|
|
"terser": "^5.51.2",
|
|
"typescript": "^5.9.0",
|
|
"typescript-eslint": "^8.66.0",
|
|
"vite": "^8.2.2",
|
|
"vitest": "^4.1.10"
|
|
}
|
|
}
|