-
Notifications
You must be signed in to change notification settings - Fork 273
fix(configprovider): 调整demo,修复web h5 下引入不一致问题,修复文档 #3244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Walkthrough本次更新主要涉及文档和演示代码的修正,包括将演示组件中的 TextArea 替换为 Pagination,修正多处 CSS 变量和 SCSS 变量的命名规范,以及调整英文语言包的导入路径。此外,TypeScript 配置中的路径映射也进行了相应修正。 Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant DemoComponent
participant ConfigProvider
participant Pagination
User->>DemoComponent: 打开演示页面
DemoComponent->>ConfigProvider: 使用(含本地化配置)
ConfigProvider->>Pagination: 渲染 Pagination 组件
Pagination-->>User: 展示分页控件
Possibly related PRs
Suggested reviewers
Poem
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feat_v3.x #3244 +/- ##
=============================================
- Coverage 87.59% 87.58% -0.01%
=============================================
Files 290 290
Lines 19102 19102
Branches 2930 2929 -1
=============================================
- Hits 16732 16731 -1
- Misses 2365 2366 +1
Partials 5 5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (2)
src/packages/configprovider/demo.tsx (1)
18-18
: 建议优化英文示例说明
当前英文翻译为 “Pagination zh-CN and en-US”,可考虑改为更自然的 “Pagination in Chinese and English” 或 “Pagination (zh-CN & en-US)” 以提升可读性。src/packages/configprovider/demo.taro.tsx (1)
24-24
: 建议优化英文示例说明
英文text
字段为 “Pagination zh-CN and en-US”,建议调整为更易读的 “Pagination in Chinese and English” 或 “Pagination (zh-CN & en-US)”。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (13)
src/packages/configprovider/demo.taro.tsx
(1 hunks)src/packages/configprovider/demo.tsx
(1 hunks)src/packages/configprovider/demos/h5/demo2.tsx
(1 hunks)src/packages/configprovider/demos/taro/demo2.tsx
(1 hunks)src/packages/configprovider/doc.en-US.md
(1 hunks)src/packages/configprovider/doc.md
(1 hunks)src/packages/configprovider/doc.taro.md
(1 hunks)src/packages/configprovider/doc.zh-TW.md
(1 hunks)src/sites/sites-react/doc/docs/react/theme-react.en-US.md
(2 hunks)src/sites/sites-react/doc/docs/react/theme-react.md
(2 hunks)src/sites/sites-react/doc/docs/taro/theme-react.en-US.md
(3 hunks)src/sites/sites-react/doc/docs/taro/theme-react.md
(3 hunks)tsconfig.json
(1 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (1)
src/packages/configprovider/demo.taro.tsx (1)
src/utils/taro/platform.ts (1)
harmony
(3-7)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: build
- GitHub Check: test
🔇 Additional comments (21)
tsconfig.json (1)
30-32
: 路径映射修正正确
将@nutui/nutui-react/dist/es/locales/en-US
的路径从单数locale
修正为复数locales
,已与实际文件结构src/locales/en-US.ts
保持一致。src/packages/configprovider/doc.taro.md (1)
27-28
: CSS 变量命名添加中横线符合规范
已将--nutui-color-primary-stop1/stop2
修改为--nutui-color-primary-stop-1/stop-2
,与其他文档中主题变量命名保持一致。请确认
doc.md
、doc.en-US.md
等其他文档文件中也同步更新了相同命名。src/packages/configprovider/doc.zh-TW.md (1)
27-28
: CSS 變數命名調整正確
已為--nutui-color-primary-stop1
與--nutui-color-primary-stop2
添加中橫線,符合命名慣例,與其他語言文檔保持一致。src/packages/configprovider/demo.tsx (2)
10-10
: 已更新简体中文示例说明
text
字段已由 “Textarea 中文与英文” 更新为 “Pagination 中文与英文”,示例组件与文档保持一致。
14-14
: 已更新繁體中文示例說明
text
字段已由 “Textarea 中文與英文” 更新为 “Pagination 中文與英文”,與其他示例保持一致。src/packages/configprovider/demo.taro.tsx (2)
14-14
: 已更新简体中文示例说明
text
字段由 “Textarea 中文与英文” 修改为 “Pagination 中文与英文”,示例与文档保持一致。
19-19
: 已更新繁體中文示例說明
text
字段由 “Textarea 中文與英文” 修改為 “Pagination 中文與英文”,與其他示例保持一致。src/sites/sites-react/doc/docs/react/theme-react.md (2)
28-28
: SASS变量重命名符合命名规范变量名从
$color-primary-end
改为$color-primary-stop-1
与CSS变量的命名保持一致,提高了代码的可读性和一致性。
62-62
: 导入路径修正正确将导入路径从
@nutui/nutui
修正为@nutui/nutui-react
确保了文档中的配置示例使用正确的React包,避免了开发者的困惑。src/packages/configprovider/doc.md (1)
27-28
: CSS变量命名规范修正添加连字符使CSS变量名遵循标准的CSS命名约定(kebab-case),从
--nutui-color-primary-stop1
改为--nutui-color-primary-stop-1
,提高了代码规范性。src/sites/sites-react/doc/docs/react/theme-react.en-US.md (2)
31-31
: SASS变量重命名与中文文档保持一致英文文档中的变量重命名与中文版本保持一致,确保了多语言文档的统一性。
65-65
: 导入路径修正与中文文档一致英文文档的导入路径修正与中文版本保持同步,确保了文档的准确性和一致性。
src/packages/configprovider/doc.en-US.md (1)
27-28
: CSS变量命名与中文文档保持一致英文文档中的CSS变量命名修正与中文版本一致,确保了多语言文档的统一性和规范性。
src/packages/configprovider/demos/taro/demo2.tsx (2)
10-10
: 确认组件属性配置的合理性
Pagination
组件配置了total={20}
和pageSize={5}
,这个配置在国际化演示中是合适的,因为分页组件的文本会根据语言包显示不同的内容。Also applies to: 15-15
2-2
:✅ Verification successful
验证组件替换的完整性
从
TextArea
组件替换为Pagination
组件是一个重要的功能性变更。需要确认相关的翻译文本和其他演示文件是否已相应更新。检查以下内容以确保变更的一致性:
🏁 Script executed:
#!/bin/bash # 描述:检查ConfigProvider相关文件中的组件变更是否一致 # 检查是否还有其他地方引用了TextArea组件在ConfigProvider的demo中 echo "=== 检查ConfigProvider demo中是否还有TextArea的引用 ===" rg -A 3 -B 3 "TextArea" src/packages/configprovider/ # 检查翻译文本是否已更新 echo "=== 检查翻译文本是否提到了Pagination ===" rg -A 2 -B 2 "Pagination.*中文.*英文|text.*Pagination" src/packages/configprovider/ # 检查其他demo文件是否有类似更新 echo "=== 检查其他ConfigProvider demo文件 ===" fd "demo.*\.tsx$" src/packages/configprovider/ --exec cat {}Length of output: 8186
✅ 验证通过:组件替换完整性良好
ConfigProvider 相关的所有 demo 中已将 TextArea 完全替换为 Pagination,翻译文本也已同步更新,无残留引用。无需额外修改。
src/sites/sites-react/doc/docs/taro/theme-react.md (2)
28-28
: SCSS 变量重命名改进了命名规范将
$color-primary-end
重命名为$color-primary-stop-1
使变量名称更加描述性和标准化,符合颜色渐变停止点的命名惯例。
45-45
: 导入路径修正符合 Taro 环境要求将导入路径从通用的
@nutui/nutui-react
更正为 Taro 专用的@nutui/nutui-react-taro
包,这修复了在 Taro 环境下的导入不一致问题,与 PR 目标一致。Also applies to: 62-62
src/sites/sites-react/doc/docs/taro/theme-react.en-US.md (2)
31-31
: SCSS 变量重命名保持了多语言版本的一致性英文文档中的变量重命名与中文版本保持一致,从
$color-primary-end
更改为$color-primary-stop-1
,体现了良好的多语言文档维护实践。
48-48
: 导入路径修正在多语言文档间保持一致英文文档的导入路径修正与中文版本完全一致,确保了 Taro 环境下的正确包引用,维护了文档的准确性和一致性。
Also applies to: 65-65
src/packages/configprovider/demos/h5/demo2.tsx (2)
2-3
: 组件替换和导入路径修正适当且必要将
TextArea
替换为Pagination
组件更适合演示国际化功能,因为 Pagination 包含可翻译的文本元素。同时修正了语言包导入路径从locale/en-US
到locales/en-US
,这修复了实际的导入错误。
10-10
: Pagination 组件配置合理
Pagination
组件使用total={20}
和pageSize={5}
的配置是合理的,能够有效展示分页组件在不同语言环境下的表现,符合演示目的。Also applies to: 15-15
🤔 这个变动的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
☑️ 请求合并前的自查清单
Summary by CodeRabbit
新功能
文档
其他