fix: 解决taro版本demo变量文件重复注入导致超时的问题#3484
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Walkthrough将 NutUI React 的多个 Taro 端组件 SCSS 合并为单一 bundle,生成并写入 bundle 文件;更新生成脚本与构建管道忽略规则;移除生成的 Taro app.config 模板中的无效 renderingMode 字段,并附带治理方案文档与验证步骤。 变更详情WXSS 编译超时治理
🎯 2 (Simple) | ⏱️ ~12 分钟 可能相关的 PR
建议审阅者
兔兔之歌 🐰
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 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.
Actionable comments posted: 2
🤖 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.
Inline comments:
In @.cursor/skills/nutui-taro-weapp-wxss/SKILL.md:
- Around line 22-23: Summary: The acceptance criteria for duplicate `@font-face`
counts are inconsistent between the table (“2–10”) and line 85 (“个位数”); make
them consistent. Fix: choose a single threshold phrasing (e.g., "<=10" or "1–9")
and update both the table row containing "`@font-face` 重复 | ~216 | ~2–10 |" and
the sentence on line 85 that currently says “个位数” so they match exactly; ensure
the chosen representation is used consistently elsewhere in the document.
In `@scripts/taro/generate-nutui-taro.js`:
- Line 10: The generated bundleScssStr currently emits `@import` with “.scss”
suffix (variable bundleScssStr in scripts/taro/generate-nutui-taro.js), which
violates the scss/load-partial-extension lint rule; update the generator to emit
imports without the “.scss” extension (e.g. "`@import` '../styles/variables';" and
"`@import` '../styles/theme-default';") and apply the same change to the other
generator occurrences noted around the file (the other bundle string
constructions). After changing the generator, regenerate and commit the produced
nutui.react.scss.taro.bundle.scss artifact so the repo no longer contains
lint-failing imports.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: d494a515-ffa0-4f8c-8188-6a3cbdb62933
📒 Files selected for processing (6)
.cursor/skills/nutui-taro-weapp-wxss/SKILL.mdscripts/build-taro.mjsscripts/harmony/update-taro-entry.jsscripts/taro/generate-nutui-taro.jsscripts/taro/generate-taro-route.jssrc/packages/nutui.react.scss.taro.bundle.scss
💤 Files with no reviewable changes (2)
- scripts/taro/generate-taro-route.js
- scripts/harmony/update-taro-entry.js
| | `@font-face` 重复 | ~216 | ~2–10 | | ||
|
|
There was a problem hiding this comment.
验收口径需要统一(“2–10”与“个位数”冲突)。
Line 22-23 写的是修复后 @font-face 约 2–10,但 Line 85 期望写“个位数”。建议统一成同一阈值(例如“<=10”或“1–9”),避免验证时标准不一致。
Also applies to: 85-85
🤖 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 @.cursor/skills/nutui-taro-weapp-wxss/SKILL.md around lines 22 - 23, Summary:
The acceptance criteria for duplicate `@font-face` counts are inconsistent
between the table (“2–10”) and line 85 (“个位数”); make them consistent. Fix:
choose a single threshold phrasing (e.g., "<=10" or "1–9") and update both the
table row containing "`@font-face` 重复 | ~216 | ~2–10 |" and the sentence on line
85 that currently says “个位数” so they match exactly; ensure the chosen
representation is used consistently elsewhere in the document.
| let importRNStr = `` | ||
| let importMarkdownStr = `` | ||
| let importScssStr = `\n` | ||
| let bundleScssStr = `@import '../styles/variables.scss';\n@import '../styles/theme-default.scss';\n` |
There was a problem hiding this comment.
生成的 bundle @import 与当前 stylelint 规则不兼容,会持续产出 lint 错误。
现在脚本会生成带 .scss 后缀的 @import,与 scss/load-partial-extension 规则冲突(在产物文件中已触发整文件报错)。建议在生成阶段去掉后缀,并回刷 nutui.react.scss.taro.bundle.scss。
建议修复
-let bundleScssStr = `@import '../styles/variables.scss';\n@import '../styles/theme-default.scss';\n`
+let bundleScssStr = `@import '../styles/variables';\n@import '../styles/theme-default';\n`
...
- bundleScssStr += `@import './${name.toLowerCase()}/${name.toLowerCase()}.scss';\n`
+ bundleScssStr += `@import './${name.toLowerCase()}/${name.toLowerCase()}';\n`Also applies to: 25-25, 115-122
🤖 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 `@scripts/taro/generate-nutui-taro.js` at line 10, The generated bundleScssStr
currently emits `@import` with “.scss” suffix (variable bundleScssStr in
scripts/taro/generate-nutui-taro.js), which violates the
scss/load-partial-extension lint rule; update the generator to emit imports
without the “.scss” extension (e.g. "`@import` '../styles/variables';" and
"`@import` '../styles/theme-default';") and apply the same change to the other
generator occurrences noted around the file (the other bundle string
constructions). After changing the generator, regenerate and commit the produced
nutui.react.scss.taro.bundle.scss artifact so the repo no longer contains
lint-failing imports.
Source: Linters/SAST tools
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
发布说明