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

Bug: config的两处显示问题 #314

Open
Hieuzest opened this issue Feb 18, 2024 · 0 comments
Open

Bug: config的两处显示问题 #314

Hieuzest opened this issue Feb 18, 2024 · 0 comments
Labels
bug Something isn't working plugin: config

Comments

@Hieuzest
Copy link

Hieuzest commented Feb 18, 2024

(以下均为config插件的显示问题,cordis行为没有问题,在开发环境下测试。)

  • 假设A插件依赖B插件导出的服务,那么在插件配置中停用B插件,A插件右侧仍然显示绿灯,查看packages[name].runtime.id仍然有值。(即便事实上已经正确dispose)
    image

  • 注意到

    // check peer dependencies
    for (const name in local.package.peerDependencies ?? {}) {
    if (!name.includes('@koishijs/plugin-') && !name.includes('koishi-plugin-')) continue
    if (coreDeps.includes(name)) continue
    const required = !local.package.peerDependenciesMeta?.[name]?.optional
    const active = !!store.packages[name]?.runtime?.id
    result.peer[name] = { required, active }
    for (const service of store.packages[name]?.manifest?.service.implements ?? []) {
    services.add(service)
    }
    }

    此处排除了插件peerDep的插件所导出的服务。这是出于什么理由?依赖的插件不一定出于启用状态。
    假设我有服务插件@foo/core和插件@foo/local,后者peerDep前者且inject前者,那么在后者的配置页面将不会显示服务依赖信息。此时如果服务处于停用状态,从后者的配置页会很难判断原因。

@shigma shigma added bug Something isn't working plugin: config labels Feb 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working plugin: config
Projects
None yet
Development

No branches or pull requests

2 participants