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

refactor: 4.0.0-第一轮 #520

Merged
merged 12 commits into from
Nov 14, 2024
Merged

refactor: 4.0.0-第一轮 #520

merged 12 commits into from
Nov 14, 2024

Conversation

MliKiowa
Copy link
Member

@MliKiowa MliKiowa commented Nov 14, 2024

Summary by Sourcery

重构 NapCatOneBot11Adapter 和 NapCatCore 类以改进初始化逻辑和代码结构。更新 package.json 以调整 dependencies 和 devDependencies。修改 NodeQQNTWrapperUtil 接口和 NodeIKernelGroupService 方法以更好地处理类型。

增强功能:

  • 通过移除未使用的 nativeCore 属性和 registerNative 方法重构 NapCatOneBot11Adapter 类。
  • 修改 NCoreInitShell 函数以等待 NapCatShell 的初始化。
  • 重构 NapCatCore 类,在新的 initCore 方法中初始化路径和 API。
  • 更新 NodeQQNTWrapperUtil 接口以更正 get 方法的返回类型。
  • 更改 NodeIKernelGroupService 中的 queryCachedEssenceMsg 方法以返回结构化对象。

构建:

  • 在 package.json 的 devDependencies 中添加 fluent-ffmpeg 和 qrcode-terminal。
  • 从 package.json 的 dependencies 中移除 fluent-ffmpeg 和 qrcode-terminal。
Original summary in English

Summary by Sourcery

Refactor the NapCatOneBot11Adapter and NapCatCore classes to improve initialization logic and code structure. Update the package.json to adjust dependencies and devDependencies. Modify the NodeQQNTWrapperUtil interface and NodeIKernelGroupService method for better type handling.

Enhancements:

  • Refactor the NapCatOneBot11Adapter class by removing the unused nativeCore property and the registerNative method.
  • Modify the NCoreInitShell function to await the initialization of NapCatShell.
  • Refactor the NapCatCore class to initialize paths and APIs in a new initCore method.
  • Update the NodeQQNTWrapperUtil interface to correct the return type of the get method.
  • Change the queryCachedEssenceMsg method in NodeIKernelGroupService to return a structured object.

Build:

  • Add fluent-ffmpeg and qrcode-terminal to devDependencies in package.json.
  • Remove fluent-ffmpeg and qrcode-terminal from dependencies in package.json.

Copy link

sourcery-ai bot commented Nov 14, 2024

审核者指南 by Sourcery

此 PR 实现了包依赖重组和接口更新。更改涉及将一些依赖从运行时依赖移动到开发依赖,更新 TypeScript 接口,并相应地调整构建配置。

更新的 NodeQQNTWrapperUtil 接口类图

classDiagram
    class NodeQQNTWrapperUtil {
        +get(): NodeQQNTWrapperUtil
        +getNTUserDataInfoConfig(): string
    }
Loading

文件级更改

更改 详情 文件
将与媒体相关的依赖从运行时依赖移动到开发依赖
  • 将 'fluent-ffmpeg' 和 'qrcode-terminal' 包从 dependencies 移动到 devDependencies
  • 更新构建配置中的外部依赖列表以移除已移动的包
package.json
vite.config.ts
更新 TypeScript 接口以提高类型安全性和清晰度
  • 通过删除不必要的构造函数签名简化 NodeQQNTWrapperUtil 接口
  • 通过包含 items 数组的更具体结构增强 queryCachedEssenceMsg 返回类型
src/core/wrapper.ts
src/core/services/NodeIKernelGroupService.ts

提示和命令

与 Sourcery 互动

  • 触发新审核: 在拉取请求上评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审核评论。
  • 从审核评论生成 GitHub 问题: 通过回复审核评论请求 Sourcery 创建一个问题。
  • 生成拉取请求标题: 在拉取请求标题的任何地方写 @sourcery-ai 以随时生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任何地方写 @sourcery-ai summary 以随时生成 PR 摘要。您也可以使用此命令指定摘要应插入的位置。

自定义您的体验

访问您的仪表板以:

  • 启用或禁用审核功能,例如 Sourcery 生成的拉取请求摘要、审核者指南等。
  • 更改审核语言。
  • 添加、删除或编辑自定义审核说明。
  • 调整其他审核设置。

获取帮助

Original review guide in English

Reviewer's Guide by Sourcery

This PR implements a package dependency reorganization and interface updates. The changes involve moving some dependencies from runtime to development dependencies, updating TypeScript interfaces, and adjusting the build configuration accordingly.

Updated class diagram for NodeQQNTWrapperUtil interface

classDiagram
    class NodeQQNTWrapperUtil {
        +get(): NodeQQNTWrapperUtil
        +getNTUserDataInfoConfig(): string
    }
Loading

File-Level Changes

Change Details Files
Moved media-related dependencies from runtime to development dependencies
  • Moved 'fluent-ffmpeg' and 'qrcode-terminal' packages from dependencies to devDependencies
  • Updated external dependencies list in build configuration to remove the moved packages
package.json
vite.config.ts
Updated TypeScript interfaces for better type safety and clarity
  • Simplified NodeQQNTWrapperUtil interface by removing unnecessary constructor signature
  • Enhanced queryCachedEssenceMsg return type with a more specific structure including items array
src/core/wrapper.ts
src/core/services/NodeIKernelGroupService.ts

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

@MliKiowa - 我已经审查了你的更改 - 这里有一些反馈:

总体评论

  • 请提供重大版本升级到 4.0.0 的破坏性更改的描述
  • 如果 fluent-ffmpeg 和 qrcode-terminal 在运行时需要,将它们移到 devDependencies 可能是不正确的。请验证此更改。
这是我在审查期间查看的内容
  • 🟢 一般问题:一切看起来都很好
  • 🟢 安全性:一切看起来都很好
  • 🟢 测试:一切看起来都很好
  • 🟢 复杂性:一切看起来都很好
  • 🟢 文档:一切看起来都很好

Sourcery 对开源项目免费 - 如果你喜欢我们的评论,请考虑分享它们 ✨
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我将使用反馈来改进你的评论。
Original comment in English

Hey @MliKiowa - I've reviewed your changes - here's some feedback:

Overall Comments:

  • Please provide a description of the breaking changes that justify the major version bump to 4.0.0
  • Moving fluent-ffmpeg and qrcode-terminal to devDependencies may be incorrect if they're needed at runtime. Please verify this change.
Here's what I looked at during the review
  • 🟢 General issues: all looks good
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@MliKiowa MliKiowa self-assigned this Nov 14, 2024
@MliKiowa
Copy link
Member Author

#413 (comment)

@MliKiowa MliKiowa changed the title refactor: 4.0.0 refactor: 4.0.0-第一轮 Nov 14, 2024
@MliKiowa MliKiowa merged commit 1092831 into main Nov 14, 2024
2 checks passed
@MliKiowa MliKiowa deleted the refactor-4.0.0 branch November 21, 2024 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant