-
Notifications
You must be signed in to change notification settings - Fork 192
feat(export)!: restrict to only root path import #661
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
base: master
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Walkthrough本次更改主要包括对 package.json 增加 exports 字段以明确不同模块系统的入口,以及对 src/index.ts 的导出内容进行了大幅扩充和结构化整理,显著增加了对各种工具函数、类型、React 相关工具和 DOM 工具的导出。同时,修正了部分测试文件的导入路径。 Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~18 minutes Possibly related PRs
Poem
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. ✨ Finishing Touches
🧪 Generate unit tests
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 (
|
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: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
package.json
(1 hunks)src/index.ts
(1 hunks)tests/isEqual.test.ts
(1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
- GitHub Check: test / react component workflow
🔇 Additional comments (2)
package.json (1)
24-30
: 正确实现了导入路径限制
exports
字段的实现完美符合PR目标:
- 只暴露根路径
"."
作为入口点,有效阻止了子路径导入- 正确配置了不同模块系统的条件导出:
types
: TypeScript 声明文件require
: CommonJS 模块import
: ES 模块- 这将防止用户使用
import xxx from '@rc-component/util/lib/xxx'
等子路径导入src/index.ts (1)
1-64
: 验证通过:所有导出模块存在且路径正确在
src/index.ts
中列出的所有导出模块(核心工具、React 相关、DOM 工具、Hooks、测试工具)均已在对应路径下找到,文件名与导出路径一致,无需进一步修改。
禁止使用
import xxx from '@rc-component/util/lib/xxx'
,这样有几个好处:这是一个破坏性变更!
Summary by CodeRabbit
新功能
测试