Repository navigation
fix(classic): fix classic web build failures - #5892
Conversation
- replace the Slack OAuth icon with FaSlack from react-icons/fa to avoid the missing SiSlack export. - add a classic Rsbuild alias for date-fns so Semi resolves its compatible date-fns v2 dependency.
- rename Makefile variables and targets from backend to api for naming consistency. - update dev command messages and reset setup restart flow to use api terminology.
WalkthroughThis PR contains three unrelated changes: a makefile rename from backend to API naming for local dev/reset targets, an rsbuild config addition that aliases ChangesMakefile API Rename
date-fns Alias Resolution
Slack Icon Swap
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
web/classic/rsbuild.config.ts (1)
13-16: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winFragile relative-path traversal to locate nested
date-fns.
semiDateFnsDiris derived by hardcoding'../semi-foundation/node_modules/date-fns'relative tosemiUiDir. This assumes a specific package layout (semi-foundation as a sibling scope folder with its own un-hoisteddate-fns), which can silently break if package hoisting differs across package managers/versions, or if semi-ui's entry-file depth changes in a future release — with no existence check or fallback if the path is wrong.Consider resolving via Node's module resolution instead of manual relative traversal, e.g.:
♻️ Suggested more robust resolution
-const semiDateFnsDir = path.resolve( - semiUiDir, - '../semi-foundation/node_modules/date-fns', -) +const semiDateFnsDir = path.dirname( + require.resolve('date-fns/package.json', { + paths: [require.resolve('`@douyinfe/semi-foundation/package.json`')], + }), +)This resolves the actual installed
date-fnsused bysemi-foundationregardless of hoisting/layout differences.Also applies to: 54-54
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@web/classic/rsbuild.config.ts` around lines 13 - 16, The `semiDateFnsDir` resolution in `rsbuild.config.ts` is brittle because it hardcodes a relative traversal from `semiUiDir` to `semi-foundation/node_modules/date-fns`. Replace that manual path construction with Node module resolution so the config locates the installed `date-fns` for `semi-foundation` regardless of hoisting or package layout changes. Update the related `semiDateFnsDir` usage and any other mirrored resolution in the same config so both references use the same robust lookup path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@web/classic/rsbuild.config.ts`:
- Around line 13-16: The `semiDateFnsDir` resolution in `rsbuild.config.ts` is
brittle because it hardcodes a relative traversal from `semiUiDir` to
`semi-foundation/node_modules/date-fns`. Replace that manual path construction
with Node module resolution so the config locates the installed `date-fns` for
`semi-foundation` regardless of hoisting or package layout changes. Update the
related `semiDateFnsDir` usage and any other mirrored resolution in the same
config so both references use the same robust lookup path.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 4de765b5-957e-462e-b426-a1b1bd2aa615
📒 Files selected for processing (3)
makefileweb/classic/rsbuild.config.tsweb/classic/src/helpers/render.jsx
Merge pull request QuantumNous#5892 from QuantumNous/fix/classic-web-build
Merge pull request QuantumNous#5892 from QuantumNous/fix/classic-web-build
Merge pull request QuantumNous#5892 from QuantumNous/fix/classic-web-build
Merge pull request QuantumNous#5892 from QuantumNous/fix/classic-web-build
Merge pull request QuantumNous#5892 from QuantumNous/fix/classic-web-build
Important
📝 变更描述 / Description
(简述:做了什么?为什么这样改能生效?请基于你对代码逻辑的理解来写,避免粘贴未经整理的内容)
问题描述
修复方式
测试说明
🚀 变更类型 / Type of change
🔗 关联任务 / Related Issue
✅ 提交前检查项 / Checklist
Bug fix,我已提交或关联对应 Issue,且不会将设计取舍、预期不一致或理解偏差直接归类为 bug。📸 运行证明 / Proof of Work
(请在此粘贴截图、关键日志或测试报告,以证明变更生效)
Summary by CodeRabbit