用途:接收已通过 dsh-plugin-creator 校验的 DSH 插件包,负责提交之后的全部分发工作,包括校验、仓库门禁、按渠道发布和加载验证。官方没有 DSH 插件市场,支持的渠道为 npm、git 和 tarball,GitHub 的 dsh-plugin 主题用于发现。可在一次运行中发布到多个渠道,保持渠道状态不进入规范源码。
触发条件:用户要求发布 DSH 插件、上架、推到 npm、打 release、导出 tarball。若用户只是新建或修改插件(交给 dsh-plugin-creator),或仅做本地加载验证(dsh --profile demo --dump-config),则不激活。
主要能力与流程:先解析源码根与发布仓库,确认是 DSH 插件;校验源码(type: module、入口声明、files 字段、peer/dev 依赖一致等);在插件自身发布仓库运行门禁,例如 pnpm install、pnpm run typecheck && pnpm run lint && pnpm run build、pnpm pack --dry-run。未指定渠道时,公开的 @lovstudio/dsh-* 默认 npm,源码安装默认 git。
按渠道执行:npm 使用 pnpm publish --access public 并打标签;git 推送仓库与 tag,并用 dsh plugin --profile demo add github:<owner>/<repo>#<sha> 验证;tarball 使用 pnpm pack --out /tmp/<pkg>-<version>.tgz 后在干净 profile 安装。可选社区镜像与 dsh-plugin 主题。最终验证 dsh --profile demo --dump-config 出现对应层,且 dsh --profile demo 能正常启动。
依赖 Node.js >= 20、pnpm >= 10、dsh CLI、git 与 GitHub CLI、npm 凭据。限制:不激活创建或修改插件;不虚构不存在的市场或注册表;发布只更新目标插件代码;平台适配需先核实官方名称、提交契约和完成信号。具体价格、收费等信息暂未提供。