docs: say which install field takes the git address

The dialog has two inputs: the spec field takes a package name, a git address or a local path, while the install source only decides which registry a package name is looked up in. Git and tarball specs are fetched directly, so the source can stay on its default; the previous wording left that open and the address ended up in the wrong field.
This commit is contained in:
pyh
2026-09-30 13:54:51 +08:00
parent b9445cbf4d
commit d09920363f
+12 -7
View File
@@ -48,31 +48,36 @@ DSH 原本只能归档会话——归档只是把会话从列表里移开,日
## 安装 ## 安装
在 DSH 的 **插件 → 添加插件** 里填下面任意一种。 DSH 的 **插件 → 添加插件** 里有两个输入,含义不同:
- **上面那个输入框**:装什么(包名 / Git 地址 / 本地 tgz 的绝对路径);
- **下面的「安装源」**:只决定**按包名安装时**去哪个注册表查。填 Git 地址或 tgz 时它不参与拉取,保持默认(官方源)即可,不必切到「自定义地址」。
### 1. Git 仓库地址(推荐) ### 1. Git 仓库地址(推荐)
在上面的输入框里填:
```text ```text
https://gitea.iwake.top/dsh-plugin/session-delete.git#v1.0.1 https://gitea.iwake.top/dsh-plugin/session-delete.git#v1.0.1
``` ```
`#` 后面可以跟标签或提交,用来锁定版本;不写则取默认分支。仓库是公开的,不需要凭据。 `#` 后面可以跟标签或提交,用来锁定版本;不写则取默认分支。仓库是公开的,不需要凭据,也不需要改安装源。
### 2. 本地 tgz ### 2. 本地 tgz
把 [session-delete-1.0.1.tgz](https://gitea.iwake.top/api/packages/dsh-plugin/npm/@dsh-plugin%2Fsession-delete/-/1.0.1/session-delete-1.0.1.tgz) 下载到运行 DSH 的机器上,在安装界面里填它的绝对路径。 把 [session-delete-1.0.1.tgz](https://gitea.iwake.top/api/packages/dsh-plugin/npm/@dsh-plugin%2Fsession-delete/-/1.0.1/session-delete-1.0.1.tgz) 下载到运行 DSH 的机器上,把它的绝对路径填进上面的输入框。
### 关于「npm 源」这种方式 ### 关于「npm 源」这条走不通的路
本插件也发布在自建 Gitea 的 npm 仓库里(`https://gitea.iwake.top/api/packages/dsh-plugin/npm/`,包名 `@dsh-plugin/session-delete`),但**目前不能用它安装**:Gitea 返回包清单时只保留 `name`、`version`、`description`、`author`、`homepage`、`license`、`repository`、`readme`、`dist`、`maintainers` 这些字段,插件需要的 `dsh`(即 `dsh.bundle.patch`)会被丢掉;而 DSH 的安装预检要求清单里声明 `dsh.bundle`,于是会报: 本插件也发布在自建 Gitea 的 npm 仓库里(安装源填 `https://gitea.iwake.top/api/packages/dsh-plugin/npm/`、包名填 `@dsh-plugin/session-delete`),但**目前不能用它安装**:Gitea 返回包清单时只保留 `name`、`version`、`description`、`author`、`homepage`、`license`、`repository`、`readme`、`dist`、`maintainers`,插件需要的 `dsh`(即 `dsh.bundle.patch`)会被丢掉;而 DSH 的安装预检要求清单里声明 `dsh.bundle`,于是会报:
```text ```text
这个包没有声明组合包,无法作为插件安装:@dsh-plugin/session-delete declares no dsh.bundle 这个包没有声明组合包,无法作为插件安装:@dsh-plugin/session-delete declares no dsh.bundle
``` ```
git 地址与 tgz 这两条路没有这个问题——它们是先把包取到本地、再读它自己的 `package.json`,字段完整。如果将来把它发到保留自定义字段的注册表(npmjs 等),npm 源那条路才走得通。 Git 地址与 tgz 这两条路没有这个问题——它们是先把包取到本地、再读它自己的 `package.json`,字段完整。若将来把它发到保留自定义字段的注册表(npmjs 等),包名那条路才走得通。
安装或升级后:**宿主半变更需要重启 DSH**(完全退出再打开,仅关闭窗口不一定退出进程);只改浏览器半时刷新页面即可。 安装或升级后:**宿主半变更需要重启 DSH**(完全退出再打开,仅关闭窗口不一定退出进程);只改浏览器半时刷新页面即可。DSH 暂不支持插件自动更新,升级就是用新标签重装一次(建议先移除旧版本)。
## 兼容性 ## 兼容性