apps/api 单独嵌套 typescript ^7.0.2,`bun run --filter '@oj2/api' typecheck`
从此跑的是原生版;根和 apps/web 留在 5.9.3。api 在 TS 7 下 0 error,
另外塞了个故意写错的文件复检过,确认它真在报错、不是静默跳过。
前端升不了:vue-tsc 启动时要 require.resolve("typescript/lib/tsc"),
而 TS 7 的 exports 里已经没有这个子路径,直接
ERR_PACKAGE_PATH_NOT_EXPORTED。vue-tsc@latest 就是仓库里的 3.3.11,
还没有支持 TS 7 的版本 —— 它 peer 写的是 typescript >=5.0.0,范围太松,
装上去不报冲突、一跑就炸。读源码看到 resolveTscPath 里唯一的适配分支是认
@typescript/typescript6,可见 Vue 侧目前给的路只到 6。硬上的代价是丢掉
刚清零的前端类型门禁,不值得。
顺带清掉一处假配置:apps/web 原本声明着 "typescript": "^7.0.2",是
ae1fb32 从 ojnext 原样搬过来的,**从来没生效过** —— vue-tsc 被 hoist 在根
node_modules/,解析 typescript 时看的是根上那份 5.9.3,压根看不见
apps/web 里嵌套的 7.0.2。留着它有两个坏处:白拉 20 个
@typescript/typescript-* 平台包;哪天 bun 换个 hoist 策略把它提到根上,
vue-tsc 就会以那个看不懂的 ERR_PACKAGE_PATH_NOT_EXPORTED 挂掉。改成显式
跟随根版本。
所以现在的分工是:**vue-tsc 把根上的 typescript 钉死在 5.x**,谁要升根
版本谁先解决 vue-tsc。等 vue-tsc 支持 TS 7,把 apps/api 那行删掉、
根上升到 7 即可。
验证(删空 node_modules 重装后):apps/api tsc 7.0.2 下 0 error、
check:routes 167 条无遮蔽、apps/web vue-tsc 0 error、vite build 通过、
drizzle-kit v0.31.10 正常。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
73 lines
2.1 KiB
JSON
73 lines
2.1 KiB
JSON
{
|
|
"name": "@oj2/web",
|
|
"version": "1.9.0",
|
|
"type": "module",
|
|
"scripts": {
|
|
"dev": "vite",
|
|
"start": "vite",
|
|
"build": "vite build",
|
|
"build:staging": "vite build --mode staging",
|
|
"build:test": "vite build --mode test",
|
|
"fmt": "prettier --write src *.ts",
|
|
"type-check": "vue-tsc --noEmit -p tsconfig.app.json"
|
|
},
|
|
"dependencies": {
|
|
"@codemirror/autocomplete": "^6.20.3",
|
|
"@codemirror/lang-cpp": "^6.0.3",
|
|
"@codemirror/lang-python": "^6.2.1",
|
|
"@codemirror/lang-sql": "^6.10.0",
|
|
"@codemirror/language": "^6.12.4",
|
|
"@codemirror/state": "^6.7.1",
|
|
"@codemirror/view": "^6.43.9",
|
|
"@lezer/highlight": "^1.2.3",
|
|
"@oj2/contract": "workspace:*",
|
|
"@vue-flow/background": "^1.3.2",
|
|
"@vue-flow/controls": "^1.1.3",
|
|
"@vue-flow/core": "^1.48.2",
|
|
"@vue-flow/minimap": "^1.5.4",
|
|
"@vue-flow/node-resizer": "^1.5.1",
|
|
"@vue-flow/node-toolbar": "^1.1.1",
|
|
"@vueuse/core": "^14.4.0",
|
|
"@vueuse/router": "^14.4.0",
|
|
"@wangeditor-next/editor": "^6.2.0",
|
|
"@wangeditor-next/editor-for-vue": "^6.2.0",
|
|
"axios": "^1.19.0",
|
|
"canvas-confetti": "^1.9.4",
|
|
"chart.js": "^4.5.1",
|
|
"chartjs-chart-wordcloud": "^4.4.5",
|
|
"codemirror": "^6.0.2",
|
|
"copy-text-to-clipboard": "^3.2.2",
|
|
"date-fns": "^4.4.0",
|
|
"fflate": "^0.8.3",
|
|
"highlight.js": "^11.12.0",
|
|
"md-editor-v3": "^6.5.6",
|
|
"mermaid": "^11.17.2",
|
|
"mermaid-legacy": "npm:mermaid@^9.4.3",
|
|
"naive-ui": "^2.45.2",
|
|
"nanoid": "^6.0.1",
|
|
"normalize.css": "^8.0.1",
|
|
"pinia": "^4.0.3",
|
|
"skulpt": "^1.2.0",
|
|
"vue": "^3.5.41",
|
|
"vue-chartjs": "^5.3.4",
|
|
"vue-codemirror": "^6.1.1",
|
|
"vue-router": "^5.2.0",
|
|
"y-codemirror.next": "^0.3.6",
|
|
"y-webrtc": "^10.3.0",
|
|
"yjs": "^13.6.32"
|
|
},
|
|
"devDependencies": {
|
|
"@iconify/vue": "^5.0.1",
|
|
"@types/canvas-confetti": "^1.9.0",
|
|
"@types/node": "^26.3.0",
|
|
"@vitejs/plugin-legacy": "^8.2.3",
|
|
"@vitejs/plugin-vue": "^6.0.8",
|
|
"@vue/tsconfig": "^0.9.1",
|
|
"prettier": "^3.9.6",
|
|
"unplugin-auto-import": "^21.1.0",
|
|
"unplugin-vue-components": "^32.1.0",
|
|
"vite": "^8.2.2",
|
|
"vue-tsc": "^3.3.11"
|
|
}
|
|
}
|