进阶安装与开发联调

September 3, 2026 · View on GitHub

面向想要修改本插件的开发者。普通安装见 README「一句话安装」。

本机联调(file: + 符号链接)

适合边改边测:profile 依赖指向本地源码目录,并把 node_modules/@lsqeon/dsh-progress 替换为符号链接,改动 lib/ 后重启 DSH Desktop 即生效。

# 1. 修改 ~/.dsh/profiles/desktop/package.json
#    dependencies: { "@lsqeon/dsh-progress": "file:/绝对路径/dsh-progress" }
#    dsh.profile.bundles 数组加入 "@lsqeon/dsh-progress"
cd ~/.dsh/profiles/desktop && pnpm install

# 2. 换成符号链接(改动即时可见)
rm -rf node_modules/@lsqeon/dsh-progress
mkdir -p node_modules/@lsqeon && ln -s /绝对路径/dsh-progress node_modules/@lsqeon/dsh-progress

# 3. 符号链接按真实路径解析模块,需在源码目录内提供宿主模块链接(永久保留):
cd /绝对路径/dsh-progress
mkdir -p node_modules/@deepseek-ai
ln -sfn "$HOME/.dsh/profiles/node_modules/@deepseek-ai/dsh-tools" node_modules/@deepseek-ai/dsh-tools

说明:github:/npm 安装为真实目录,通过 profiles/node_modules 父目录解析宿主模块, 不需要上面第 3 步的链接;只有符号链接安装才需要。

测试

mkdir -p node_modules/@deepseek-ai
ln -sfn "$HOME/.dsh/profiles/node_modules/@deepseek-ai/dsh-tools" node_modules/@deepseek-ai/dsh-tools   # 运行必需
ln -sfn "$HOME/.dsh/profiles/node_modules/@deepseek-ai/cordis" node_modules/@deepseek-ai/cordis          # 仅测试
node test/smoke.mjs           # 工具+协议+静态+导入导出,38 断言
node test/roundtrip.mjs       # 导入→导出→再导入一致性,5 断言
node test/cordis-boot.mjs     # 真实 cordis fiber 加载
node test/client-module.mjs   # 客户端包模拟浏览器加载,14 断言(无需宿主模块)
node test/compose-dry-run.mjs # 启动组合预检(无桌面环境自动跳过)
rm -f node_modules/@deepseek-ai/cordis   # 只删测试用链接,dsh-tools 保留

CI(.github/workflows/test.yml)在 GitHub Actions 上跑同一套(npm ci 安装 devDependencies 后直接执行,无需任何链接)。

诊断文件

  • boot.log —— 服务端插件每次加载追加三行(apply 进入 / 工具提交 / 路由提交)。重启后是否存在、是否齐全,是判断服务端是否加载的第一证据。
  • access.log —— 每个到达本插件的 HTTP 请求一行(时间、方法、路径、会话、状态)。界面空白时先看它:没有任何界面请求 = 客户端渲染问题;有 info 无 index.html = iframe/静态层问题;全有 = 数据层问题。
  • 两个文件均已 gitignore,不影响仓库。

发布

  • GitHub:push 到 main,打 tag(git tag v0.x.y && git push origin v0.x.y)。
  • npm(可选):npm publish(需 npm 账号;files 字段已限定发布内容)。
  • 市场收录:向 awesome-dsh-plugin 提 PR(data/plugins/<owner>__<repo>.yml + 重生成的两个 README;要求仓库满 1 天、 提交 ≥10、加 dsh-plugin topic)。