← Back to home@w1661884010-jpg

dsh-plugin-github-market

DSH web client plugin: browse GitHub dsh-plugin topic repositories - plugin market tab, category tags, three-part filters, growth ranking, fuzzy search, favorites, install-command copy

Stars
1
Language
JavaScript
Created
Aug 14, 2026
Updated
Aug 29, 2026

Introduction

dsh-plugin-github-market

DSH web 客户端插件:在「设置 → 插件 → 插件市场」中浏览 GitHub 上带有 dsh-plugin topic 的插件仓库。

功能

  • 插件市场页签:「设置 → 插件」页内的「插件市场」页签(与「插件配置」并列),默认按 Star 数展示 topic:dsh-plugin 仓库
  • 功能分类标签(可多选):插件按功能分为 8 类 —— 官方核心 / 界面·皮肤·宠物 / 终端 / 桌面 / 视觉·图片 / 技能·Skills / 精选·文档 / 工具·其他;每张卡片头部带彩色分类标签,分类栏可多选标签按类过滤(命中任一选中分类即显示,再点取消,点「全部」复位;分类由插件名称、描述与 GitHub topics 自动判定)
  • 模糊搜索:输入框即时按名称 / 描述 / 标签 / 语言多词模糊过滤;回车后把关键字发给 GitHub Search API 做全局查询
  • 三筛选(字段 × 时间范围 × 方向):排序字段(按 Star 数 / 按最近更新 / 增长最快)× 时间范围(全部 / 近 12 小时 / 近 1 天 / 近 7 天 / 近 30 天 / 近 90 天,created: 过滤)× 方向(倒序 / 顺序)
  • 增长最快:按本地积累的 star 快照排序(每次浏览市场时自动记录各仓库 star 数,比较上次记录与当前计算增长 ★/天,零额外请求,越用越准);首次使用需先浏览一次积累数据
  • 打开仓库:每条卡片可点击在新标签页打开 GitHub 仓库
  • 复制安装命令:一键复制 dsh plugin --profile web add github:<owner>/<repo>
  • 本地收藏:收藏夹存在浏览器 localStorage(键 dsh-plugin-github-market.favorites),可在「收藏」页签查看
  • GitHub Token(可选):市场页顶部输入 Token → 保存 → 测试连接。Token 只存本浏览器(localStorage 键 dsh-plugin-github-market.token),只发给 api.github.com;限流从匿名 60 次/小时提升到 5000 次/小时

安装

# 1. 把本包加入 web profile(file: 路径按你的实际位置调整)
dsh plugin --profile web add "file:<本目录绝对路径>"

# 2. 在 profile 用户补丁层启用插件行
#    编辑 ~/.dsh/profiles/web/cordis.patch.yml,追加:
#    - insert:
#        - id: ui-github-market
#          name: 'dsh-plugin-github-market'

# 3. 重启 web profile 使 loader 生效
#    关闭当前 dsh web 进程后重新运行 dsh web

数据与限流

  • 数据来自 GitHub Search API(GET /search/repositories?q=topic:dsh-plugin ...),浏览器直连
  • 匿名访问限流 60 次/小时/IP;插件对每次搜索响应做 10 分钟 localStorage 缓存
  • 「增长最快」使用本地快照(localStorage 键 dsh-plugin-github-market.snapshots),不依赖 stargazers 端点(GitHub 自 2026-07 起仅允许仓库协作者访问该端点)
  • 遇到 403/429 会显示中文提示,稍后再试或等缓存过期即可

开发

  • 插件是纯客户端 bundle(lib/client.js),手写、无构建工具链
  • 冒烟测试:node tests/bundle-smoke.test.mjs(仓库根目录)
  • 修改 lib/client.js 后重启 dsh web 生效;若在 DSH 源码仓库里跑 pnpm run dev:web,client HMR 会自动热重载