Replies: 1 comment
|
这个提案和社区已有的实现完全对口——dsh-plugin-doctor 就是"装进 profile 之前的预检",只是目前以社区工具形式存在。你的每一项失败模式都能对应到具体检查:
为了和提案术语对齐,v1.5.0 刚加了 dsh-plugin-doctor preflight ./my-plugin # = build + pack + 全新 profile 安装 + 合成配置验证输出 如果官方想把这个 preflight 收编进 Release:https://github.com/zoahdev/dsh-plugin-doctor/releases/tag/v1.5.0 |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
建议:在 profile 激活前增加第三方插件兼容性预检
目前
dsh plugin的安装路径对第三方 bundle 很简洁,但也因此把许多问题推迟到了下一次 profile boot。当前行为
apps/cli/src/plugin.ts将dsh plugin --profile <name> <args...>作为 pnpm forwarder。pnpm 成功后,reconcilePlugins()主要检查依赖解析出的 package manifest 是否声明了dsh.bundle;如果声明存在,就把包名追加到dsh.profile.bundles。docs/user/develop/basic/publish.md也把 bundle manifest 的核心字段描述为:dsh: { bundle: { patch: ./cordis.patch.yml } }当前没有一个面向 out-of-tree bundle 的 Harness compatibility declaration,也没有在加入 profile layer 之前执行的 activation preflight。于是以下问题可能都要到下一次启动才出现:
dsh.bundle.patch指向缺失或不可解析的文件;这与一方包已有的 workspace、artifact 和 publication gates 形成了明显不对称:外部插件只要安装成功且声明了
dsh.bundle,就可能立即进入 profile 的 layer list。建议方向
是否可以增加一个可选的 packaged-plugin compatibility declaration,并在 pnpm 完成物化后、写入
dsh.profile.bundles之前进行有限预检?可考虑放在dsh.bundle下,或放在同级的dsh.plugin中,内容例如:预检应只验证可以确定性判断的事实,不应通过执行第三方插件代码来“证明安全”,也不应把 version-range match 宣称为语义兼容。
当预检失败时,我倾向于:
dsh.profile.bundles,因此不改变当前可启动 profile;在 developer preview 阶段,没有兼容性 metadata 的旧 bundle 可以继续使用,但应明确给出 compatibility-unknown warning。
不建议扩大到的范围
cordis.patch.yml或迁移插件配置。相关源码
apps/cli/src/plugin.tspackages/boot/app-boot/src/profile.tsapps/cli/reference/README.mddocs/user/develop/basic/publish.mddocs/cookbook/adding-a-package.md想请教维护者的问题
dsh.bundle、同级dsh.plugin,还是使用 npm peer dependency 加 Harness 专用 artifact declaration?dsh plugin使整个 pnpm 操作失败?All reactions