Back to home@baihejiangnan

dsh-plugin-pack

DSH plugin pack manifest, schema, validation and publishing guide

Stars
0
Language
JavaScript
Created
Aug 20, 2026
Updated
Aug 20, 2026
GitHub repo

Introduction

DSH Plugin Pack

规范与示例:如何发布一个可被 DSH 插件包市场发现的插件合集。

这是什么

DSH 插件生态使用 dsh-plugin 作为统一发现入口。插件合集仓库在此基础上再添加 dsh-plugin-pack,表示仓库提供的是一组插件的分发清单,而不是单个插件本体。

单个插件仓库       -> dsh-plugin
插件合集仓库       -> dsh-plugin + dsh-plugin-pack

插件合集不需要复制插件源码,也不需要依赖某个启动器。它只记录插件名称、安装规格、仓库地址和依赖关系。任何兼容 DSH 的客户端都可以读取清单,并为用户执行等价的:

dsh plugin add <spec>

快速开始

  1. 复制本仓库的 dsh-plugin-pack.json
  2. 修改 id、名称、说明和 plugins 列表。
  3. 为仓库添加两个 topic:dsh-plugindsh-plugin-pack
  4. 运行 node scripts/validate.mjs
  5. 发布仓库后,将仓库地址提交到插件包市场或等待市场扫描。

本规范仓库名为 dsh-plugin-pack。其他合集仓库应根据内容命名,例如 dsh-plugin-pack-officedsh-plugin-pack-writingdsh-plugin-pack-better-sidebar

清单格式

规范文件名为 dsh-plugin-pack.json,当前 schemaVersion1。每个插件必须有唯一的 id 和可直接传给 DSH 的 specrequires 使用清单内其他插件的 id 表示安装依赖。

{
  "schemaVersion": 1,
  "id": "dsh-plugin-pack",
  "name": "DSH Plugin Pack Example",
  "version": "0.1.0",
  "description": "A starter pack demonstrating a base plugin and an extension.",
  "license": "MIT",
  "plugins": [
    {
      "id": "better-sidebar",
      "name": "DSH Better Sidebar",
      "kind": "plugin",
      "spec": "github:omdsh-dev/DSH-better-sidebar",
      "repository": "https://github.com/omdsh-dev/DSH-better-sidebar"
    },
    {
      "id": "better-sidebar-office",
      "name": "Better Sidebar Office",
      "kind": "extension",
      "spec": "github:HuanLinOTO/dsh-plugin-better-sidebar-plugin-office",
      "repository": "https://github.com/HuanLinOTO/dsh-plugin-better-sidebar-plugin-office",
      "requires": ["better-sidebar"]
    }
  ]
}

spec 可以是 npm 包名、GitHub 规格、Git URL 或 DSH 支持的其他安装规格。合集市场负责展示和展开清单,插件的实际安装仍由 DSH 完成。

兼容性和安全

  • 合集只声明插件,不托管或修改插件源码。
  • 发布前应确认每个 spec 可以独立安装,并在 README 中说明 DSH 版本要求。
  • requires 只表达安装顺序和依赖关系,不替代插件自身的依赖声明。
  • 市场应将“已发现”和“已验证”分开显示;topic 不代表安全审查或质量保证。
  • 清单中的安装规格应固定到可信仓库或版本,避免无意跟随不稳定分支。

本地校验

npm run validate

GitHub Actions 会在每次提交时运行同一个校验脚本。

插件包市场索引

market/index.json 是第一版插件包市场索引,当前先收录 dsh-plugin-pack-web。它使用 readme-command-list 格式:市场读取其 README 中的 dsh plugin --profile web add ... 命令,将文本记录解析为可安装条目。

市场同时兼容标准 dsh-plugin-pack.json 和旧式 README 文本合集。旧式合集不需要立即重写,只需在索引中声明源文件和格式;新合集推荐使用结构化 JSON 清单。

Topic 约定

仓库类型必须的 topic
单个 DSH 插件dsh-plugin
DSH 插件合集dsh-plugindsh-plugin-pack

GitHub topic 只允许小写字母、数字和连字符,因此规范使用 dsh-plugindsh-plugin-packdsh-plugin-pack 用于让市场区分“插件合集”和“单个插件”。

License

本规范和示例采用 MIT License。清单引用的插件由各自作者按照其仓库许可证发布。