Repository navigation
chore(frontend):联合升级 vite 8 / plugin-react 6 / TypeScript 7 / Tailwind 4(替代 #60 #61 #64 #65) - #69
Merged
Merged
Conversation
…, TypeScript 7, Tailwind CSS 4 Supersedes Dependabot #60 (vite 8.3.1), #61 (typescript 7.0.2), #64 (@vitejs/plugin-react 6.1.1) and #65 (tailwindcss 4.3.3). They fail one by one because they depend on each other or need config changes: - #60/#64: plugin-react 4 peers vite<=7 and plugin-react 6 peers vite>=8 (npm ERESOLVE), so they must land together. - #61: TypeScript 7 removed compilerOptions.baseUrl (TS5102); paths now resolve relative to the tsconfig, so baseUrl is dropped and paths keep './src/*'. - #65: Tailwind 4 moved the PostCSS plugin to @tailwindcss/postcss. Migrated with the official @tailwindcss/upgrade 4.3.3: CSS-first @theme in src/index.css replaces tailwind.config.js, tailwindcss-animate via @plugin, autoprefixer removed (built in), v4 utility renames in 28 files. One codemod mistake fixed by hand: the Button variant prop 'outline' had been rewritten to 'outline-solid' (TS2322). - vite 8 no longer depends on esbuild, which scripts/build-legacy-pure.mjs resolves from frontend/; esbuild ^0.28 is now an explicit frontend devDependency. Local (Node 22.23.3, the CI version): npm ci + build OK, pure.js/diagnostics.cjs no drift, biome check exit 0 (91 warnings / 159 infos, same as master), npm test 348/348, verify-claims 16 machine-checked · 16 ok · 0 error · 3 manual.
This was referenced Oct 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么要联合升级
4 个 Dependabot 大版本 PR 单独都过不了,原因各不相同(日志来自各 PR 的 test job):
ERESOLVE:@vitejs/plugin-react@4.7.0的 peer 是vite ^4…^7ERESOLVE:plugin-react@6.1.1的 peer 是vite ^8.0.0tsconfig.app.json(23,5): error TS5102: Option 'baseUrl' has been removed[vite:css] [postcss] It looks like you're trying to use tailwindcss directly as a PostCSS plugin…#60 和 #64 互相依赖,必须一起合;#61、#65 需要改配置。
改动(只动 frontend/ 和一行注释)
^8.3.4、@vitejs/plugin-react^6.1.2、typescript~7.0.2、tailwindcss^4.3.3。@tailwindcss/upgrade@4.3.3迁移:postcss.config.js改用@tailwindcss/postcss;删掉tailwind.config.js,主题改成src/index.css里的@import 'tailwindcss'+@theme;tailwindcss-animate改为@plugin;移除 autoprefixer(v4 内置);28 个文件里的 v4 工具类改名(shadow-sm→shadow-xs、outline-none→outline-hidden等)。codemod 把 Button 的variant 'outline'误改成了'outline-solid'(TS2322),已手动改回。components.json的 tailwind.config 置空(v4 的 shadcn 写法)。tsconfig.json/tsconfig.app.json里的baseUrl,paths仍是./src/*(相对 tsconfig 解析)。scripts/build-legacy-pure.mjs要从 frontend/ 解析 esbuild 生成public/js/pure.js,所以把esbuild ^0.28加成 frontend 的显式 devDependency。本地验证(Node 22.23.3,与 CI 同版本)
npm ci(prepare 会完整构建 UI):✓ built in 1.18sgit diff --exit-code public/js/pure.js lib/generated/diagnostics.cjs:无漂移npx biome check .:exit 0(91 warnings / 159 infos,和 master 一致)npm test:# tests 348 · # pass 348 · # fail 016 machine-checked · 16 ok · 0 failed · 0 error · 3 manual合并后可以关掉的 Dependabot PR
#60、#61、#64、#65(本 PR 不自动关闭它们,等你确认后再处理)。dependabot.yml 不需要改:四个升级都迁移成功了。