Skip to content

chore: migrate to @rc-component namespace #158

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

Merged
merged 3 commits into from
Feb 17, 2025

Conversation

thinkasany
Copy link
Contributor

@thinkasany thinkasany commented Feb 17, 2025

Summary by CodeRabbit

  • Chores
    • 软件包名称已更改为全新作用域名称并更新至 1.0.0,提升品牌一致性。
    • 发布流程已优化,配套依赖得到升级,确保体验更稳定流畅。
    • 模块解析配置得到改进,使导入和开发过程更加高效。

Copy link

coderabbitai bot commented Feb 17, 2025

Walkthrough

此次变更主要集中于两个配置文件。 package.json 中更新了包名(从 "rc-switch" 变为 "@rc-component/switch")、版本号(从 "4.1.0" 变为 "1.0.0")、预发布脚本(由 "npm run compile && np --yolo --no-publish" 改为 "npm run compile && rc-np")以及 devDependencies 中的 @rc-component/father-plugin 版本(从 "^1.0.0" 升级到 "^2.0.0")。同时,tsconfig.json 新增了路径映射 "@rc-component/switch" 指向 "src/",以便正确解析模块。

Changes

文件 变更摘要
package.json 更新包名 ("rc-switch" → "@rc-component/switch"),版本号 ("4.1.0" → "1.0.0"),预发布脚本(由 "npm run compile && np --yolo --no-publish" 改为 "npm run compile && rc-np"),以及 devDependencies@rc-component/father-plugin 版本升级 (^1.0.0 → ^2.0.0)
tsconfig.json 新增路径映射:"@rc-component/switch" → ["src/"]
docs/examples/simple.tsx 更新导入语句,修改 JSX 格式以提高可读性
src/index.tsx 更新导入语句,改变依赖路径
tests/index.spec.js 更新导入语句,修改对 KeyCode 的引用

Sequence Diagram(s)

sequenceDiagram
    participant 开发者 as Developer
    participant 终端 as Terminal
    participant 编译器 as Compiler
    participant 发布工具 as "rc-np"
    开发者->>终端: 执行 npm run compile
    终端->>编译器: 发起编译任务
    编译器-->>终端: 编译完成
    终端->>发布工具: 执行 rc-np 发布命令
    发布工具-->>终端: 发布完成
Loading

Suggested reviewers

  • zombieJ

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

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.

docs/examples/simple.tsx

Oops! 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.

tests/index.spec.js

Oops! 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/index.tsx

Oops! 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.


📜 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 ddfcf17 and b8ec113.

📒 Files selected for processing (5)
  • docs/examples/simple.tsx (1 hunks)
  • package.json (4 hunks)
  • src/index.tsx (1 hunks)
  • tests/index.spec.js (1 hunks)
  • tsconfig.json (1 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/index.tsx
  • tests/index.spec.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • tsconfig.json
🔇 Additional comments (6)
docs/examples/simple.tsx (2)

3-4: 导入路径更新正确

导入路径已正确更新为新的 @rc-component/switch 命名空间。


9-9: 代码格式调整合理

代码格式的调整提高了可读性,保持了一致的风格。

Also applies to: 16-16, 27-28

package.json (4)

2-3: 包名和版本号变更需要注意

  • 包名更改为 @rc-component/switch 符合迁移要求
  • 版本号重置为 1.0.0 表示这是一个重大变更,请确保:
    1. 更新 CHANGELOG
    2. 在发布说明中清楚说明迁移步骤

47-47: 依赖更新到 @rc-component 命名空间

rc-util 已正确更新为 @rc-component/util


50-50: 开发依赖更新合理

开发依赖已更新到对应的 @rc-component 版本:

  • @rc-component/father-plugin 升级到 ^2.0.0
  • 使用 @rc-component/np 替代 np

Also applies to: 67-67


35-35: 发布脚本更新正确

发布脚本已更新为使用 rc-np,与新的命名空间保持一致。


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.

Copy link

socket-security bot commented Feb 17, 2025

New, updated, and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@rc-component/[email protected] 🔁 npm/@rc-component/[email protected] None +4 121 kB zombiej
npm/@rc-component/[email protected] Transitive: environment, eval, filesystem, shell, unsafe +142 18.3 MB zombiej
npm/@rc-component/[email protected] environment +1 202 kB zombiej

🚮 Removed packages: npm/@babel/[email protected]

View full report↗︎

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 (2)
tsconfig.json (1)

18-20: 新增路径映射 "@rc-component/switch"
新增的路径映射允许 TypeScript 将模块 "@rc-component/switch" 正确解析到 "src/" 目录。建议确认是否需要同时保留旧的 "rc-switch" 映射以确保向后兼容性,或在文档中标明迁移说明以避免混淆。

package.json (1)

3-3: 版本号更新提醒
版本号已更新为 "1.0.0"。如果这是一次重大重构或迁移,请在发布说明中详细说明变更内容。

📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between 325f3d9 and 4460652.

📒 Files selected for processing (2)
  • package.json (3 hunks)
  • tsconfig.json (1 hunks)
🔇 Additional comments (4)
tsconfig.json (1)

17-17: 确认路径映射 "@@/*" 的配置用途
该配置用于解析 dumi 生成的临时文件路径,请确认此映射在项目中是必须的,且文档中有相应说明。

package.json (3)

2-2: 更新包名称至新命名空间
包名称已更改为 "@rc-component/switch",符合迁移到 scoped package 的要求。请确保代码库内所有引用更新为新名称。


35-35: 调整预发布脚本命令
将 prepublishOnly 脚本从原来的 "npm run compile && np --yolo --no-publish" 修改为 "npm run compile && rc-np",请确认 rc-np 工具功能符合预期发布流程,并更新相应的文档说明。


51-51: 升级 "@rc-component/father-plugin" 依赖版本
将 "@rc-component/father-plugin" 从 "^1.0.0" 升级至 "^2.0.0"。建议验证新版本与现有构建流程的兼容性,并更新开发文档中的说明。

Copy link

codecov bot commented Feb 17, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (325f3d9) to head (b8ec113).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #158   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines           57        34   -23     
  Branches        11         8    -3     
=========================================
- Hits            57        34   -23     

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

@zombieJ zombieJ merged commit 86b7162 into react-component:master Feb 17, 2025
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants