Skip to content
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

chore: update alias #2908

Merged
merged 3 commits into from
Dec 31, 2024
Merged

chore: update alias #2908

merged 3 commits into from
Dec 31, 2024

Conversation

oasis-cloud
Copy link
Collaborator

@oasis-cloud oasis-cloud commented Dec 31, 2024

🤔 这个变动的性质是?

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

🔗 相关 Issue

💡 需求背景和解决方案

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

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

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

Summary by CodeRabbit

  • 新功能

    • 添加了 Lottie 动画支持
    • 新增了 CardLottie 组件文档
  • 依赖更新

    • 添加了 lottie-miniprogramlottie-react 依赖
  • 包配置

    • 包名从 @nutui/nutui-react-taro 更改为 @dongdesign/components
    • 版本更新为 3.0.0-beta.1
    • 移除了发布配置
  • 样式变更

    • 更新了 CSS 变量,调整了颜色和图标相关变量

Copy link

coderabbitai bot commented Dec 31, 2024

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

概述

演练

这个拉取请求主要涉及包名称、版本和配置的重大变更。主要变化包括将包名从 @nutui/nutui-react-taro 更改为 @dongdesign/components,更新版本号,并移除发布配置。同时,更新了多个文件中的 Lottie 动画导入路径,添加了新的别名映射,并修改了一些组件的文档状态。

变更

文件 变更摘要
package.json 包名更改为 @dongdesign/components,版本更新为 3.0.0-beta.1,移除发布配置
packages/nutui-taro-demo/config/index.js 更新别名配置,移除条件性路径
packages/nutui-taro-demo/package.json 添加 lottie-miniprogramlottie-react 依赖
src/config.json LottieCard 组件的 dd 属性设置为 true
src/packages/configprovider/types.ts 更新 CSS 变量,添加和移除特定变量
多个 Lottie 演示文件 更新 Lottie 动画导入路径为绝对路径
vite.config.site.tsvite.config.ts 添加 Lottie 动画的别名映射

可能相关的 PR

建议标签

size/L

建议审阅者

  • xiaoyatong
  • Alex-huxiyang

诗歌

🐰 代码兔子轻跳跃,
包名变换新模样,
Lottie 动画闪亮登场,
配置重构显神通,
版本更迭如春风! 🌈


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ 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. (Beta)
  • @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 the 3.x label Dec 31, 2024
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
vite.config.ts (1)

4-4: import 顺序被调整,但对编译影响较小。
仅是从 import { resolve, join } 变更为 import { join, resolve },整体功能保持不变,可忽略。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b3ccaa2 and e662d51.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • package.json (2 hunks)
  • packages/nutui-taro-demo/config/index.js (1 hunks)
  • packages/nutui-taro-demo/package.json (1 hunks)
  • src/config.json (1 hunks)
  • src/packages/configprovider/types.ts (1 hunks)
  • src/packages/loading/demos/h5/demo1.tsx (1 hunks)
  • src/packages/loading/demos/taro/demo1.tsx (1 hunks)
  • src/packages/lottie/demos/h5/demo1.tsx (1 hunks)
  • src/packages/lottie/demos/h5/demo2.tsx (1 hunks)
  • src/packages/lottie/demos/taro/demo1.tsx (1 hunks)
  • src/packages/lottie/demos/taro/demo2.tsx (1 hunks)
  • src/packages/lottie/demos/taro/demo3.tsx (1 hunks)
  • vite.config.site.ts (1 hunks)
  • vite.config.ts (2 hunks)
✅ Files skipped from review due to trivial changes (6)
  • src/packages/lottie/demos/taro/demo3.tsx
  • src/packages/loading/demos/h5/demo1.tsx
  • src/packages/lottie/demos/h5/demo1.tsx
  • src/packages/lottie/demos/taro/demo2.tsx
  • src/packages/lottie/demos/taro/demo1.tsx
  • src/packages/lottie/demos/h5/demo2.tsx
🔇 Additional comments (8)
src/packages/loading/demos/taro/demo1.tsx (1)

3-3: 改用绝对导入路径可能是为适配别名或打包需求。
此处将原先的相对路径切换为 @nutui/nutui-react-taro/dist/es/lottie/animation/light/loading.json 的绝对路径,有助于统一管理动画资源文件,避免路径冲突。

vite.config.site.ts (1)

23-64: 新增多组别名映射来指向本地 Lottie 动画 JSON 文件。
这有助于在编译和打包时直接使用项目内的资源,方便对动画进行统一管理与修改。建议在文档中记录这些别名的用途和维护方式,方便后续团队协作和更新。

vite.config.ts (1)

28-69: 新增多组别名映射来指向本地 Lottie 动画 JSON 文件。
vite.config.site.ts 所做的更改一致,这些别名确保了对动画资源的本地化引用,可在不同环境或主题下保持一致的路径解析,提升可维护性。

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

83-133: 对多个 Lottie 动画 JSON 文件及相关路径进行了别名映射。
删除了针对 TARO_ENV 的条件别名声明,统一改用固定路径映射文件位置,便于在 Taro 中管理与维护不同主题的动画资源。若需结合远程加载或大规模动画扩展,建议考虑自动化配置脚本进行管理。

packages/nutui-taro-demo/package.json (1)

89-90: 确认依赖兼容性与必要性

新增了 lottie-miniprogramlottie-react 依赖,请确保在目标端(如小程序、H5 等)使用时无兼容性问题,并确认新依赖是项目必需,避免引入冗余包导致体积增大或构建时间延长。

package.json (2)

2-3: 包名与版本号更新检查

将包名重命名为 @dongdesign/components 且版本号修改为 3.0.0-beta.1。请确认各处文档、脚本、以及发布流程是否都已同步更新,避免后续发布或引入过程出现混淆。


43-43: 移除 publishConfig 后的发布流程确认

删除了原先的 publishConfig 配置后,请确认新的发布流程是否符合项目需求,例如发布到私有仓库或公共 npm 注册表的流程是否可用。

src/config.json (1)

1197-1197: 文档可见性更新

已将 Lottie 组件的 dd 字段更新为 true,确认该组件的示例和文档内容已准备就绪,方便用户查看并使用相关功能。

Comment on lines +9 to +11
| 'nutuiColorPrimaryIcon'
| 'nutuiColorPrimaryIconDisabled'
| 'nutuiColorPrimarySpecialdisabled'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

命名一致性建议

nutuiColorPrimarySpecialdisabled 与其他变量例如 nutuiColorPrimaryIconDisabled 等的大小写形式不一致,建议调整为 nutuiColorPrimarySpecialDisabled 以保持命名统一,便于维护和阅读。

下面提供一个可选的修改示例:

-  | 'nutuiColorPrimarySpecialdisabled'
+  | 'nutuiColorPrimarySpecialDisabled'
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
| 'nutuiColorPrimaryIcon'
| 'nutuiColorPrimaryIconDisabled'
| 'nutuiColorPrimarySpecialdisabled'
| 'nutuiColorPrimaryIcon'
| 'nutuiColorPrimaryIconDisabled'
| 'nutuiColorPrimarySpecialDisabled'

Copy link

@coderabbitai coderabbitai bot left a 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 (3)
vite.config.site.ts (1)

23-64: 新增别名配置可行,但请注意维护统一性。
这些别名映射适用于本地 Lottie JSON 文件,请确保在其它环境(如 CI/CD 或生产环境)中同样生效,避免出现资源无法找到的问题。

vite.config.ts (1)

28-69: 批量添加 Lottie JSON 文件别名有助于统一资源管理,但需注意后续维护成本。
如果后续存在更多动画资源,请考虑集中管理或自动化生成别名,以减少手工修改带来的风险。

src/packages/configprovider/types.ts (1)

9-11: 命名可读性优化建议

新增变量 nutuiColorPrimaryIconDisablednutuiColorPrimarySpecialdisabled 在命名上含义相近,但却使用了不同的大小写和前缀,可能导致使用者困惑。建议统一命名风格,例如统一使用 IconDisabled 来保持一致性。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between b3ccaa2 and e662d51.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (14)
  • package.json (2 hunks)
  • packages/nutui-taro-demo/config/index.js (1 hunks)
  • packages/nutui-taro-demo/package.json (1 hunks)
  • src/config.json (1 hunks)
  • src/packages/configprovider/types.ts (1 hunks)
  • src/packages/loading/demos/h5/demo1.tsx (1 hunks)
  • src/packages/loading/demos/taro/demo1.tsx (1 hunks)
  • src/packages/lottie/demos/h5/demo1.tsx (1 hunks)
  • src/packages/lottie/demos/h5/demo2.tsx (1 hunks)
  • src/packages/lottie/demos/taro/demo1.tsx (1 hunks)
  • src/packages/lottie/demos/taro/demo2.tsx (1 hunks)
  • src/packages/lottie/demos/taro/demo3.tsx (1 hunks)
  • vite.config.site.ts (1 hunks)
  • vite.config.ts (2 hunks)
✅ Files skipped from review due to trivial changes (6)
  • src/packages/lottie/demos/taro/demo3.tsx
  • src/packages/loading/demos/h5/demo1.tsx
  • src/packages/lottie/demos/h5/demo2.tsx
  • src/packages/lottie/demos/taro/demo1.tsx
  • src/packages/lottie/demos/h5/demo1.tsx
  • src/packages/lottie/demos/taro/demo2.tsx
🔇 Additional comments (7)
src/packages/loading/demos/taro/demo1.tsx (1)

3-3: 导入路径变更合理,但需要确保资源文件在目标路径中正确存在。
如果此 JSON 资源文件后续有重构或移动,请及时更新引用,以防止加载失败。

vite.config.ts (1)

4-4: import 顺序变动属微调,不影响主要功能。
若项目中有相关 ESLint 或代码规范,请确保与其保持一致。

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

83-133: 替换原有别名为 Lottie 文件的绝对引用确实提升了配置统一性。
但需要确保其它依赖(如小程序平台、JD 特殊环境)也能正确解析这些别名。可以在不同平台测试一下是否能正常加载动画文件,以免兼容性出现问题。

packages/nutui-taro-demo/package.json (1)

89-90: 建议确认 Lottie 依赖的兼容性

新增的 lottie-miniprogramlottie-react 均可提供动画支持,但需确保同时使用时不会产生冲突。若仅小程序和 React 端各用其一,应在构建脚本或使用文档中明确区分场景,以免混淆。

package.json (2)

2-3: 包名与版本更新检查

将包名改为 @dongdesign/components 且版本降为 3.0.0-beta.1。请确保:

  1. 是否与现有发版计划匹配,以避免错误回退或混淆版本号;
  2. 下游项目或文档引用时,已明晰说明包名变更,防止引用失败。

43-43: 警惕发布配置被移除后可能带来的影响

publishConfig 被去除后,有可能在发版或权限控制方面出现问题(例如无法自动发布到 npm,或不再使用公共 registry)。若确系需求,请确认其他发版流程已做好配置。

src/config.json (1)

1197-1197: 确认文档状态变动正确性

将 Lottie 组件的文档可见性由 dd: false 改为 dd: true 后,请确认相应文档内容已完善并可正常访问,以免用户查阅时出现内容空缺。

Copy link

codecov bot commented Dec 31, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.97%. Comparing base (b3ccaa2) to head (bfe8076).
Report is 1 commits behind head on feat_v3.x.

Additional details and impacted files
@@            Coverage Diff             @@
##           feat_v3.x    #2908   +/-   ##
==========================================
  Coverage      85.97%   85.97%           
==========================================
  Files            277      277           
  Lines          18692    18692           
  Branches        2769     2769           
==========================================
  Hits           16070    16070           
  Misses          2617     2617           
  Partials           5        5           

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

@xiaoyatong xiaoyatong merged commit b85c307 into jdf2e:feat_v3.x Dec 31, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants