Skip to content

feat(init): 重构 init 命令以使用新的默认配置结构#12

Merged
huan-yp merged 1 commit intoncatbot:mainfrom
harkerhand:main
Mar 22, 2026
Merged

feat(init): 重构 init 命令以使用新的默认配置结构#12
huan-yp merged 1 commit intoncatbot:mainfrom
harkerhand:main

Conversation

@harkerhand
Copy link
Collaborator

fix(dependencies): 更新版本号至 5.2.11 并添加 httpx 依赖

fix(dependencies): 更新版本号至 5.2.11 并添加 httpx 依赖
Copilot AI review requested due to automatic review settings March 22, 2026 10:52
@huan-yp huan-yp merged commit 5ef93b0 into ncatbot:main Mar 22, 2026
3 checks passed
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

该 PR 主要涉及两块:更新项目依赖/版本号(新增 httpx,版本号调整),以及重构 init 命令生成的默认 config.yaml 以适配新的 adapters 配置结构。

Changes:

  • init 命令默认配置从旧的顶层 napcat/plugin 结构改为新的 adapters 列表结构,并补齐部分全局配置项。
  • 新增依赖 httpx,并调整项目版本号。
  • 更新 uv.lock 中本地 editable 包的依赖声明以包含 httpx

Reviewed changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.

File Description
uv.lock 更新 lock 中的依赖集合(新增 httpx)并调整本地包版本记录(但目前与 pyproject 版本不一致)。
pyproject.toml 项目版本改为 5.2.11.post1,并在 dependencies 中加入 httpx>=0.27
ncatbot/cli/commands/init.py 抽出 _build_default_config,默认配置改为 adapters 结构并扩展若干全局配置项。

Comment on lines 5 to 8
[project]
name = "ncatbot5"
version = "5.2.11"
version = "5.2.11.post1"
description = "NcatBot, NapCat Python SDK"
Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

PR 描述写的是“更新版本号至 5.2.11”,但这里把项目版本改成了 5.2.11.post1;同时 uv.lock 里目前仍是 5.2.11。请确认最终期望版本号,并同步更新 PR 描述与锁文件,避免发布/排查时出现版本歧义。

Copilot uses AI. Check for mistakes.
Comment on lines 29 to 33
bot_uin = click.prompt("请输入机器人 QQ 号", type=str)
root = click.prompt("请输入管理员 QQ 号", type=str)

config_data = {
"bot_uin": bot_uin,
"root": root,
"debug": False,
"napcat": {
"ws_uri": "ws://localhost:3001",
"ws_token": "napcat_ws",
"webui_uri": "http://localhost:6099",
"webui_token": "napcat_webui",
"enable_webui": True,
},
"plugin": {
"plugins_dir": "plugins",
"load_plugin": True,
"plugin_whitelist": [],
"plugin_blacklist": [],
},
}
config_data = _build_default_config(bot_uin=bot_uin, root=root)

Copy link

Copilot AI Mar 22, 2026

Choose a reason for hiding this comment

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

PR 标题聚焦于“重构 init 命令以使用新的默认配置结构”,但 PR 描述是“fix(dependencies)”且强调版本/依赖更新;两者关注点不一致,后续追溯变更原因会比较困难。建议统一 PR 标题与描述(例如在描述中补充 init 重构内容,或拆分为两个 PR)。

Copilot uses AI. Check for mistakes.
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