Skip to content

Conversation

@Miles-hxy
Copy link
Collaborator

@Miles-hxy Miles-hxy commented Mar 17, 2025

🤔 这个变动的性质是?

  • 新特性提交
  • 日常 bug 修复
  • 站点、文档改进
  • 演示代码改进
  • 组件样式/交互改进
  • TypeScript 定义更新
  • 包体积优化
  • 性能优化
  • 功能增强
  • 国际化改进
  • 重构
  • 代码风格优化
  • 测试用例
  • 分支合并
  • 其他改动(是关于什么的改动?)

🔗 相关 Issue

💡 需求背景和解决方案

☑️ 请求合并前的自查清单

⚠️ 请自检并全部勾选全部选项⚠️

  • 文档已补充或无须补充
  • 代码演示已提供或无须提供
  • TypeScript 定义已补充或无须补充
  • fork仓库代码是否为最新避免文件冲突
  • Files changed 没有 package.json lock 等无关文件

Summary by CodeRabbit

  • 重构
    • 更新了国际化和默认主题的引用路径,切换到新的ES模块目录结构,提升了模块一致性。
  • 文档
    • 调整了文档示例代码和部分格式,使语言支持和样式引用与最新配置保持一致。
  • 杂务
    • 优化了构建配置中的路径映射和别名设置,实现了更精准的模块解析。

@coderabbitai
Copy link

coderabbitai bot commented Mar 17, 2025

Walkthrough

该 PR 更新了多个文件中关于英语 locale 文件的引用路径,将旧的目录结构(如 localeslocale)更改为新的 ES 模块结构(如 es/localeses/locale)。同时,部分文档中全局主题样式的导入从 SCSS 文件切换为 CSS 文件,并修正了少量格式问题。配置文件中的路径映射也同步调整。此修改仅影响文件引用方式,并未改变任何业务逻辑。

Changes

文件 变更概述
tsconfig.json, vite.config.demo.ts, vite.config.mts 更新路径映射与别名,将 nutui-react 及 nutui-react-taro 的英语 locale 导入路径从旧目录更新至新 ES 模块目录(如 /locale(s)/en-US/es/locale(s)/en-US)。
packages/nutui-taro-demo/config/index.js,
src/packages/configprovider/demos/h5/demo4.tsx,
src/packages/configprovider/demos/taro/demo4.tsx
修改示例组件中的英语 locale 导入路径,使其指向新的 ES 模块目录。
src/sites/sites-react/doc/docs/react/…,
src/sites/sites-react/doc/docs/taro/…
更新文档中的英语 locale 导入路径,同时将全局主题样式从 SCSS 文件转换为 CSS 文件,并调整部分格式细节(如移除标题冒号)。

Possibly related issues

Possibly related PRs

Suggested reviewers

  • oasis-cloud

Poem

我是小兔,在代码间欢跳,
新路径如嫩草般清新妙。
旧别名悄然隐退不见,
新目录闪耀着 ES 的炫彩。
SCSS化作 CSS轻盈流转,
代码花园里满是跳跃的韵律,
啾啾!我的心为改动喝彩。

Warning

There were issues while running some tools. Please review the errors and either fix the tool’s configuration or disable the tool if it’s a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/nutui-taro-demo/config/index.js

Oops! Something went wrong! :(

ESLint: 8.57.1

ESLint couldn't find the config "taro/react" to extend from. Please check that the name of the config is correct.

The config "taro/react" was referenced from the config file in "/packages/nutui-taro-demo/.eslintrc".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.

Tip

⚡🧪 Multi-step agentic review comment chat (experimental)
  • We're introducing multi-step agentic chat in review comments. This experimental feature enhances review discussions with the CodeRabbit agentic chat by enabling advanced interactions, including the ability to create pull requests directly from comments.
    - To enable this feature, set early_access to true under in the settings.

📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 33b3745 and bd9a110.

📒 Files selected for processing (14)
  • packages/nutui-taro-demo/config/index.js (1 hunks)
  • src/packages/configprovider/demos/h5/demo4.tsx (1 hunks)
  • src/packages/configprovider/demos/taro/demo4.tsx (1 hunks)
  • src/sites/sites-react/doc/docs/react/international-react.en-US.md (1 hunks)
  • src/sites/sites-react/doc/docs/react/international-react.md (2 hunks)
  • src/sites/sites-react/doc/docs/react/start-react.en-US.md (1 hunks)
  • src/sites/sites-react/doc/docs/react/start-react.md (1 hunks)
  • src/sites/sites-react/doc/docs/taro/international-react.en-US.md (1 hunks)
  • src/sites/sites-react/doc/docs/taro/international-react.md (1 hunks)
  • src/sites/sites-react/doc/docs/taro/start-react.en-US.md (1 hunks)
  • src/sites/sites-react/doc/docs/taro/start-react.md (1 hunks)
  • tsconfig.json (1 hunks)
  • vite.config.demo.ts (1 hunks)
  • vite.config.mts (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test
🔇 Additional comments (18)
src/packages/configprovider/demos/taro/demo4.tsx (1)

3-3: 更新了英语语言包的导入路径

导入路径已更新为使用 ES 模块结构,这与 PR 的目标一致,修正了导入路径以使用正确的模块结构。

src/packages/configprovider/demos/h5/demo4.tsx (1)

3-3: 英语语言包导入路径更新

导入路径已更新为使用 ES 模块结构,与其他文件的更改保持一致,正确地指向了 ES 模块的位置。

src/sites/sites-react/doc/docs/react/start-react.en-US.md (1)

56-56: 主题样式文件导入路径从 SCSS 更新为 CSS

将导入语句从 SCSS 文件更改为 CSS 文件,这样更符合使用编译后的 CSS 文件而不是 SCSS 源文件的最佳实践。这与 PR 的目标一致,正确修复了导入路径。

src/sites/sites-react/doc/docs/react/start-react.md (1)

56-56: 主题样式文件导入路径从 SCSS 更新为 CSS

将导入语句从 SCSS 文件更改为 CSS 文件,保持了中英文文档的一致性,并使用了编译后的 CSS 文件而非 SCSS 源文件。

src/sites/sites-react/doc/docs/taro/start-react.en-US.md (1)

118-118: 文件更新已导入的样式文件格式

从 SCSS 文件切换到 CSS 文件进行导入是一个好的改进,这样可以直接使用预编译的 CSS 文件,减少了对 SCSS 编译器的依赖,简化了构建过程。

src/sites/sites-react/doc/docs/taro/start-react.md (1)

121-121: 样式导入路径已更新为 CSS 格式

将导入路径从 SCSS 文件更改为 CSS 文件是一个良好的实践,可以直接使用预编译的样式,避免用户需要配置 SCSS 处理器。这与英文文档中的更改保持一致。

src/sites/sites-react/doc/docs/taro/international-react.md (1)

14-14: 本地化文件导入路径已更新

导入路径更新为使用 ES 模块结构 (dist/es/locales/en-US) 是一个良好的改进,符合现代 JavaScript 模块系统标准,并与项目中其他本地化文件的导入方式保持一致。

vite.config.mts (2)

75-75: 别名路径已更新为 ES 模块结构

更新别名路径以指向 ES 模块版本的本地化文件是正确的,这确保了当代码中导入这些路径时,它们能够解析到正确的本地文件。


79-79: Taro 版本本地化别名路径已更新

将 Taro 版本的本地化文件别名路径更新为 ES 模块结构,与前一个更改保持一致,确保整个项目的导入路径标准化。

packages/nutui-taro-demo/config/index.js (1)

115-115: 路径更改与项目标准保持一致

该路径更改将locale文件的引用从 dist/locales 更新为 dist/es/locales,与项目中其他ES模块引用保持一致,提高了代码的一致性。

vite.config.demo.ts (2)

66-66: 正确更新了locale路径引用

@nutui/nutui-react 英文语言包的引用路径从 dist/locale/en-US 更新为 dist/es/locale/en-US,符合ES模块的标准引用方式。


70-70: 正确更新了Taro版本的locale路径引用

@nutui/nutui-react-taro 英文语言包的引用路径从 dist/locales/en-US 更新为 dist/es/locales/en-US,使其与React版本的引用方式保持一致。

tsconfig.json (2)

30-30: 统一更新TypeScript路径映射

正确更新了TypeScript配置中 @nutui/nutui-react 英文locale文件的路径映射,确保TypeScript编译器能够正确解析ES模块路径。


33-33: 保持TypeScript配置与项目引用一致

更新了 @nutui/nutui-react-taro 英文locale的路径映射,与项目中其他配置文件的更改保持一致,避免了潜在的模块解析错误。

src/sites/sites-react/doc/docs/taro/international-react.en-US.md (1)

13-13: 文档示例代码同步更新

将文档中的示例代码引用路径从 @nutui/nutui-react-taro/dist/locales/en-US 更新为 @nutui/nutui-react-taro/dist/es/locales/en-US,保持了文档与实际代码的一致性。

src/sites/sites-react/doc/docs/react/international-react.en-US.md (1)

12-13: 更新导入路径
此处将导入语句中的路径更新为 @nutui/nutui-react/dist/es/locales/en-US,符合当前 ES 模块化结构的要求。请确保其它相关文档或代码中的路径保持一致。

src/sites/sites-react/doc/docs/react/international-react.md (2)

13-14: 更新导入英语 Locale 路径
将导入路径修改为 @nutui/nutui-react/dist/es/locales/en-US,符合最新的 ES 模块结构,请确认其他引用此 locale 的地方也一并更新。


26-26: 调整标题格式
将 “## 目前支持的语言:” 修改为 “## 目前支持的语言” 符合 Markdown 标题的格式规范,去掉多余的冒号可提升阅读的一致性。

✨ Finishing Touches
  • 📝 Generate Docstrings

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added 3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) labels Mar 17, 2025
@codecov
Copy link

codecov bot commented Mar 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.29%. Comparing base (fd0c0df) to head (bd9a110).
Report is 4 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #3089   +/-   ##
==========================================
  Coverage      86.29%   86.29%           
==========================================
  Files            279      279           
  Lines          18225    18225           
  Branches        2774     2774           
==========================================
  Hits           15727    15727           
  Misses          2493     2493           
  Partials           5        5           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@oasis-cloud oasis-cloud merged commit 41d4495 into jdf2e:feat_v3.x Mar 18, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3.x Target branch 3.x action:review This PR needs more reviews (less than 2 approvals) size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants