dsh-remote-hub 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -4
- package/bin/dsh-remote.mjs +3 -0
- package/lib/index.js +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,7 +28,7 @@ Kotlin/Compose 直连 DSH 自带的 HTTP API + WebSocket 网关。
|
|
|
28
28
|
手机端不通过 npm 分发——npm 包 `dsh-remote-hub` 是电脑侧的 DSH 插件,两者配合使用:
|
|
29
29
|
|
|
30
30
|
```
|
|
31
|
-
电脑:dsh plugin --profile desktop add dsh-remote-hub
|
|
31
|
+
电脑:dsh plugin --profile desktop add dsh-remote-hub@0.4.2 → 起桥接 / 开隧道 / 签 Cookie
|
|
32
32
|
手机:装上面这个 APK → 填电脑给出的地址与 Cookie → 连接
|
|
33
33
|
```
|
|
34
34
|
|
|
@@ -184,8 +184,8 @@ node mint.mjs "127.0.0.1:1815" 30 # 签发 30 天 Cookie
|
|
|
184
184
|
```bash
|
|
185
185
|
# 从 NPM 安装(推荐,会出现在 DSH 内的「插件中心」)
|
|
186
186
|
# https://www.npmjs.com/package/dsh-remote-hub
|
|
187
|
-
dsh plugin --profile desktop add dsh-remote-hub
|
|
188
|
-
dsh plugin --profile web add dsh-remote-hub # web profile 同样可用
|
|
187
|
+
dsh plugin --profile desktop add dsh-remote-hub@0.4.2
|
|
188
|
+
dsh plugin --profile web add dsh-remote-hub@0.4.2 # web profile 同样可用
|
|
189
189
|
|
|
190
190
|
# 或直接从本仓库源码安装(不经过 NPM)
|
|
191
191
|
dsh plugin --profile web add github:liaoguogang-hub/dsh-remote-public
|
|
@@ -222,6 +222,10 @@ dsh-remote start # 不开 DSH 也能单独前台跑(Ctrl+C 退出)
|
|
|
222
222
|
> 公网隧道受网络影响:`api.trycloudflare.com` 不可达时插件会跳过公网、只给局域网地址,
|
|
223
223
|
> 并在 `status.json` 里写明原因,不会假装成功。
|
|
224
224
|
|
|
225
|
+
> **安装时必须带版本号**(如 `@0.4.1`)。pnpm 11 默认开启 `minimumReleaseAge` 安全策略,
|
|
226
|
+
> 新发布的版本在一段时间内不会被 `@latest` 解析到,会**回退安装到很旧的版本**(0.1.0 没有扫码配对,
|
|
227
|
+
> 表现就是「扫码页打不开」)。显式写版本号可绕过该策略。
|
|
228
|
+
|
|
225
229
|
### 装完之后
|
|
226
230
|
|
|
227
231
|
插件随 DSH 启动自动工作,**不需要手动跑 connect.cmd**;装的时候没有提示是正常的,日志里会出现:
|
|
@@ -238,7 +242,7 @@ dsh-remote: ready — 手机端扫码:dsh-remote qr(或浏览器打开 http:
|
|
|
238
242
|
### 升级插件(重要:必须完全重启 DSH)
|
|
239
243
|
|
|
240
244
|
```bash
|
|
241
|
-
dsh plugin --profile desktop add dsh-remote-hub # 或 --profile web
|
|
245
|
+
dsh plugin --profile desktop add dsh-remote-hub@0.4.2 # 或 --profile web
|
|
242
246
|
```
|
|
243
247
|
|
|
244
248
|
**升级后请完全退出 DSH 再重新打开,不要只靠插件热重载。** 原因是旧版本的桥接监听可能不会被热重载回收,
|
|
@@ -313,3 +317,7 @@ dsh-remote qr
|
|
|
313
317
|
| GET | `/_dsh-remote/pair` | 配对页(二维码 HTML) |
|
|
314
318
|
| GET | `/_dsh-remote/pair.svg` | 只要二维码 SVG |
|
|
315
319
|
| POST | `/_dsh-remote/pair/redeem` | `{code}` → `{url, cookie}`;用过即失效 |
|
|
320
|
+
|
|
321
|
+
---
|
|
322
|
+
|
|
323
|
+
发版流程(版本号约定、tag 命名、发布 checklist、踩过的坑):见 [RELEASING.md](RELEASING.md)
|
package/bin/dsh-remote.mjs
CHANGED
|
@@ -23,6 +23,7 @@ import { credentialsPath, mintCookie, readSigningSecret } from '../lib/cookie.js
|
|
|
23
23
|
import { listeningPorts, probePort } from '../lib/discover.js'
|
|
24
24
|
import { findCloudflared, findNgrok } from '../lib/tunnel.js'
|
|
25
25
|
import { CONNECT_FILE, STATUS_FILE, readStatus, start } from '../lib/supervisor.js'
|
|
26
|
+
import { version as VERSION } from '../lib/index.js'
|
|
26
27
|
|
|
27
28
|
const args = process.argv.slice(2)
|
|
28
29
|
const command = args[0] || 'status'
|
|
@@ -42,6 +43,7 @@ function printStatus() {
|
|
|
42
43
|
const remaining = status.cookieExpiresAt ? Math.round((status.cookieExpiresAt - Date.now()) / 86400000) : null
|
|
43
44
|
console.log('')
|
|
44
45
|
console.log(' DSH Remote 状态')
|
|
46
|
+
console.log(` 插件版本 v${VERSION}`)
|
|
45
47
|
console.log(' ' + '-'.repeat(52))
|
|
46
48
|
console.log(` 局域网地址 ${status.lan?.url ?? '(未检测到局域网 IP)'}`)
|
|
47
49
|
console.log(` 公网地址 ${status.public?.url ?? `无(${status.public?.note ?? '未开启'})`}`)
|
|
@@ -58,6 +60,7 @@ function printStatus() {
|
|
|
58
60
|
} else if (status.error) {
|
|
59
61
|
console.log(` 错误 ${status.error}`)
|
|
60
62
|
}
|
|
63
|
+
console.log(` ✔ 插件版本 v${VERSION}`)
|
|
61
64
|
console.log(' ' + '-'.repeat(52))
|
|
62
65
|
console.log('')
|
|
63
66
|
}
|
package/lib/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { start } from './supervisor.js'
|
|
|
16
16
|
|
|
17
17
|
export const name = 'dsh-remote-hub'
|
|
18
18
|
|
|
19
|
-
export const version = '0.4.
|
|
19
|
+
export const version = '0.4.2'
|
|
20
20
|
|
|
21
21
|
/** No host services are required: the plugin only needs Node builtins. */
|
|
22
22
|
export const inject = []
|
|
@@ -56,7 +56,7 @@ export function apply(ctx, config = {}) {
|
|
|
56
56
|
// Make the next step discoverable from the log: after installing the plugin there is no
|
|
57
57
|
// other place telling the user how to get the phone connected.
|
|
58
58
|
log(
|
|
59
|
-
`dsh-remote: ready — 手机端扫码:dsh-remote qr(或浏览器打开 http://127.0.0.1:${started.status.bridgePort}/_dsh-remote/pair);` +
|
|
59
|
+
`dsh-remote: ready (v${version}) — 手机端扫码:dsh-remote qr(或浏览器打开 http://127.0.0.1:${started.status.bridgePort}/_dsh-remote/pair);` +
|
|
60
60
|
'不想装插件时也可以直接双击仓库里的 connect.cmd',
|
|
61
61
|
)
|
|
62
62
|
}
|
package/package.json
CHANGED