koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.37k stars 239 forks source link

Feature: 创建项目时根据当前 registry 设置确定市场所使用的 registry #1287

Closed bili-22 closed 9 months ago

bili-22 commented 9 months ago

Describe the problem related to the feature request

创建项目时市场默认使用了镜像源,但某些国外网络环境下镜像源比官方源慢。

Describe the solution you'd like

创建项目时市场 register 设置跟随本地设置

Describe alternatives you've considered

No response

Additional context

No response

ilharp commented 9 months ago

创建项目后,可以直接在控制台中点击「恢复默认配置」恢复到官方镜像,也可直接删除 koishi.yml 中配置项。

shigma commented 9 months ago
image

模板项目中的 registry 配置不符合同源下载原则,应该删掉。

PS:我们的模板项目中的 .yarnrc.yml 已经声明了 npmmirror 镜像。删掉 market 插件的 registry 配置不会造成任何影响。

ilharp commented 9 months ago
  1. .yarnrc.yml 中的配置在现时点仅对命令行的 yarn add 等操作生效,对「依赖管理」页面无效;
  2. 删掉 market 配置的话,yarnrc 配置会对「依赖管理」页面和 yarn add 命令行操作均生效;

现在是这样的情况吧。

基于这样的情况,删掉 market 插件的 registry 配置,应当不会发生体验降级,是安全的吧

shigma commented 9 months ago

image

删掉配置将会自动从环境获取。对于使用 yarn start 启动的 Koishi 内的依赖管理是有效的;其他情况下 Koishi 我没有测试过。

我不知道 Koishi Desktop 是否属于使用 yarn start 的范畴。如果属于就是安全的。如果不属于,那依赖管理将无法读取 .yarnrc.yml

ilharp commented 9 months ago

属于,是安全的。

shigma commented 9 months ago

Fixed in the latest boilerplate.