-
- Notifications
You must be signed in to change notification settings - Fork 112
chore: migrate to @rc-component namespace and update dependencies #377
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
| The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
| """ Walkthrough本次更新主要涉及多个文件中的导入路径修改,将原来使用的 Changes
Poem
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
src/hooks/useImageTransform.tsOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/Preview.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team. src/Image.tsxOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct. The config "prettier" was referenced from the config file in "/.eslintrc.js". If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
Tip CodeRabbit's docstrings feature is now available as part of our Pro Plan! Simply use the command ✨ Finishing Touches
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? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
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 ( |
| New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@ ## master #377 +/- ## ======================================= Coverage 99.78% 99.79% ======================================= Files 15 15 Lines 470 486 +16 Branches 134 139 +5 ======================================= + Hits 469 485 +16 Misses 1 1 ☔ View full report in Codecov by Sentry. |
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 (1)
src/util.ts (1)
10-27: 添加了从旧版 rc-util 包中复制的遗留工具函数添加了
getOffset函数以维持现有功能,但请注意代码中的 TODO 注释表明这是临时解决方案,未来应当移除。这种方法可以确保在迁移过程中不会破坏现有功能。考虑在未来版本中使用
@rc-component/util提供的等效功能来替代这个临时解决方案。
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (3)
tests/__snapshots__/controlled.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/preview.test.tsx.snapis excluded by!**/*.snaptests/__snapshots__/previewGroup.test.tsx.snapis excluded by!**/*.snap
📒 Files selected for processing (10)
.dumirc.ts(1 hunks)README.md(2 hunks)package.json(2 hunks)src/Image.tsx(3 hunks)src/Preview.tsx(4 hunks)src/getFixScaleEleTransPosition.ts(1 hunks)src/hooks/useImageTransform.ts(1 hunks)src/hooks/useMouseEvent.ts(5 hunks)src/hooks/useTouchEvent.ts(1 hunks)src/util.ts(1 hunks)
🚧 Files skipped from review as they are similar to previous changes (6)
- src/getFixScaleEleTransPosition.ts
- src/hooks/useTouchEvent.ts
- src/hooks/useImageTransform.ts
- src/hooks/useMouseEvent.ts
- src/Preview.tsx
- src/Image.tsx
🔇 Additional comments (9)
README.md (2)
58-58: 更新了导入声明以使用新的包命名空间已将导入语句从
rc-image更新为@rc-component/image,符合组件库迁移到命名空间方式的目标。
99-99: 更新了 Image.PreviewGroup 示例中的导入声明与之前的修改一致,这里将
rc-image更新为@rc-component/image,保持了代码示例的一致性。.dumirc.ts (1)
6-7: 更新了别名配置以匹配新的包命名空间别名配置从
rc-image$和rc-image/es更新为@rc-component/image$和@rc-component/image/es,确保了开发环境中的模块解析可以正确工作。这是组件库命名空间迁移过程中的必要步骤。src/util.ts (1)
29-36: 添加了获取客户端尺寸的工具函数新增的
getClientSize函数用于获取视口的宽度和高度,实现简洁明了。这也是为了从旧版 rc-util 库迁移到新的命名空间结构。package.json (5)
2-3: 更新了包名和版本号将包名从
rc-image更新为@rc-component/image,并将版本重置为1.0.0。这是组件库迁移到新命名空间的核心更改,版本重置符合语义化版本控制规范。
35-36: 更新了发布前脚本将
prepublishOnly脚本从使用np更新为rc-np,与 @rc-component 生态系统的其他工具保持一致。
39-39: 添加了 TypeScript 类型检查脚本新增了
tsc脚本,使用bunx tsc --noEmit进行类型检查但不生成输出文件,有助于提高代码质量。
42-46: 更新了依赖项以使用新的命名空间包将依赖项从旧版的 rc-* 包更新为使用 @rc-component 命名空间的新版本:
- 升级了
@rc-component/portal从^1.0.2到^2.0.0- 新增了
@rc-component/motion、@rc-component/util和@rc-component/dialog依赖这些更改与整体命名空间迁移目标一致,确保了所有依赖都使用新的命名空间格式。
50-51: 更新了开发依赖
- 升级了
@rc-component/father-plugin从^1.0.2到^2.0.2- 添加了
@rc-component/np替代之前的np包这些更改确保开发工具链与新的命名空间结构保持一致。
Summary by CodeRabbit
Chores
Refactor
Tests