@wenbin_wb/dsh-bridge 2.0.2 → 2.0.4
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 +10 -0
- package/README.zh-CN.md +10 -0
- package/client/client.js +34 -21
- package/client/index.js +35 -22
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -95,6 +95,16 @@ dsh plugin --profile web add @wenbin_wb/dsh-bridge@latest
|
|
|
95
95
|
|
|
96
96
|
> **Note**: `update --latest` may fail to reach the newest major version due to version constraints from already-installed dependencies. Use the `add @latest` command above to force-install the latest version (no need to know the exact version number).
|
|
97
97
|
|
|
98
|
+
#### Still on an old version after upgrading? (pnpm 11 new-version filtering)
|
|
99
|
+
|
|
100
|
+
If you upgrade right after a release, `add @latest` may still install an older version. This is caused by **pnpm 11's supply-chain safety mechanism `minimumReleaseAge`** (default: filters versions published less than 24 hours ago) — not a plugin issue.
|
|
101
|
+
|
|
102
|
+
**Solutions** (pick one):
|
|
103
|
+
|
|
104
|
+
1. **Add `minimumReleaseAge: 0` to your profile's `pnpm-workspace.yaml`**, then run `pnpm install` (recommended, permanent)
|
|
105
|
+
2. **Specify the exact version**: `dsh plugin --profile web add @wenbin_wb/dsh-bridge@2.0.2` (works immediately, no waiting)
|
|
106
|
+
3. **Wait 24 hours**: the protection lifts automatically after 1 day
|
|
107
|
+
|
|
98
108
|
After upgrading, restart DSH and **hard-refresh** the browser (Windows: `Ctrl+Shift+R`, macOS: `Cmd+Shift+R`) to clear the cache, then confirm the latest version is shown in settings.
|
|
99
109
|
|
|
100
110
|
---
|
package/README.zh-CN.md
CHANGED
|
@@ -95,6 +95,16 @@ dsh plugin --profile web add @wenbin_wb/dsh-bridge@latest
|
|
|
95
95
|
|
|
96
96
|
> **注意**:`update --latest` 可能因已安装依赖的版本约束而无法升级到最新版。用上面的 `add @latest` 命令即可强制安装最新版(无需知道具体版本号)。
|
|
97
97
|
|
|
98
|
+
#### 升级后仍是旧版本?(pnpm 11 新版本过滤)
|
|
99
|
+
|
|
100
|
+
如果你刚发布后立即升级,`add @latest` 可能仍然装到旧版本。这是 **pnpm 11 的供应链安全机制 `minimumReleaseAge`**(默认过滤发布不足 24 小时的新版本)导致的,不是插件问题。
|
|
101
|
+
|
|
102
|
+
**解决方法**(任选其一):
|
|
103
|
+
|
|
104
|
+
1. **在 profile 的 `pnpm-workspace.yaml` 添加 `minimumReleaseAge: 0`**,然后重新 `pnpm install`(推荐,一劳永逸)
|
|
105
|
+
2. **显式指定版本号**:`dsh plugin --profile web add @wenbin_wb/dsh-bridge@2.0.2`(立即生效,无需等待)
|
|
106
|
+
3. **等待 24 小时**:发布满 1 天后保护自动解除
|
|
107
|
+
|
|
98
108
|
升级完成后重启 DSH,并在浏览器**硬刷新**(Windows: `Ctrl+Shift+R`,macOS: `Cmd+Shift+R`)清除缓存,然后确认设置页显示最新版本号。
|
|
99
109
|
|
|
100
110
|
---
|
package/client/client.js
CHANGED
|
@@ -65,7 +65,13 @@ var GITHUB_URL = "https://github.com/wenbin-wb/dsh-bridge";
|
|
|
65
65
|
var RELEASES_URL = "https://github.com/wenbin-wb/dsh-bridge/releases";
|
|
66
66
|
var ISSUES_URL = "https://github.com/wenbin-wb/dsh-bridge/issues/new";
|
|
67
67
|
var TUNNEL_DOCS_URL = "https://github.com/wenbin-wb/dsh-bridge/blob/main/docs/custom-tunnel.md";
|
|
68
|
-
|
|
68
|
+
function upgradeCommands(latest) {
|
|
69
|
+
const spec = `@wenbin_wb/dsh-bridge@${latest}`;
|
|
70
|
+
return [
|
|
71
|
+
{ id: "dsh", cmd: `dsh plugin --profile web add ${spec}` },
|
|
72
|
+
{ id: "npx", cmd: `npx --yes @deepseek-ai/dsh plugin --profile web add ${spec}` }
|
|
73
|
+
];
|
|
74
|
+
}
|
|
69
75
|
var name = "dsh-bridge";
|
|
70
76
|
var inject = ["slots", "connection"];
|
|
71
77
|
function semverGt(a, b) {
|
|
@@ -614,10 +620,31 @@ function PlatformCard({ platformId, platformName, platformDesc, rpcCall, onStatu
|
|
|
614
620
|
)
|
|
615
621
|
);
|
|
616
622
|
}
|
|
623
|
+
function UpgradeCommandRow({ cmd }) {
|
|
624
|
+
const [copied, copy] = useCopy();
|
|
625
|
+
return React.createElement(
|
|
626
|
+
"div",
|
|
627
|
+
{ style: { display: "flex", alignItems: "center", gap: 8 } },
|
|
628
|
+
React.createElement("code", {
|
|
629
|
+
style: {
|
|
630
|
+
...s.code,
|
|
631
|
+
fontSize: 11,
|
|
632
|
+
color: "var(--dsw-alias-label-secondary,#6b7280)",
|
|
633
|
+
flex: 1,
|
|
634
|
+
minWidth: 0,
|
|
635
|
+
wordBreak: "break-all"
|
|
636
|
+
}
|
|
637
|
+
}, cmd),
|
|
638
|
+
React.createElement("button", {
|
|
639
|
+
style: { ...s.btnGhost, height: 26, padding: "0 10px", fontSize: 12, flexShrink: 0 },
|
|
640
|
+
onClick: () => copy(cmd),
|
|
641
|
+
title: "\u590D\u5236\u5347\u7EA7\u547D\u4EE4"
|
|
642
|
+
}, copied ? "\u2713 \u5DF2\u590D\u5236" : "\u590D\u5236")
|
|
643
|
+
);
|
|
644
|
+
}
|
|
617
645
|
function VersionBanner({ rpcCall }) {
|
|
618
646
|
const [info, setInfo] = React.useState(null);
|
|
619
647
|
const [loading, setLoading] = React.useState(false);
|
|
620
|
-
const [copied, copy] = useCopy();
|
|
621
648
|
const check = React.useCallback(async () => {
|
|
622
649
|
setLoading(true);
|
|
623
650
|
try {
|
|
@@ -654,6 +681,7 @@ function VersionBanner({ rpcCall }) {
|
|
|
654
681
|
}, "\u{1F41B} \u53CD\u9988 Bug")
|
|
655
682
|
);
|
|
656
683
|
if (hasUpdate) {
|
|
684
|
+
const cmds = upgradeCommands(info.latest);
|
|
657
685
|
return React.createElement(
|
|
658
686
|
"div",
|
|
659
687
|
{ style: { marginBottom: 16 } },
|
|
@@ -680,29 +708,14 @@ function VersionBanner({ rpcCall }) {
|
|
|
680
708
|
fontSize: 13,
|
|
681
709
|
fontWeight: 600,
|
|
682
710
|
color: "var(--dsw-alias-state-info-primary,#1e40af)",
|
|
683
|
-
marginBottom:
|
|
711
|
+
marginBottom: 8
|
|
684
712
|
}
|
|
685
713
|
}, `\u53D1\u73B0\u65B0\u7248\u672C v${info.latest}\uFF08\u5F53\u524D v${info.current}\uFF09`),
|
|
714
|
+
// 升级命令:dsh plugin 与 npx 两种,均带复制按钮
|
|
686
715
|
React.createElement(
|
|
687
716
|
"div",
|
|
688
|
-
{
|
|
689
|
-
|
|
690
|
-
},
|
|
691
|
-
React.createElement("code", {
|
|
692
|
-
style: {
|
|
693
|
-
...s.code,
|
|
694
|
-
fontSize: 11,
|
|
695
|
-
color: "var(--dsw-alias-label-secondary,#6b7280)",
|
|
696
|
-
flex: 1,
|
|
697
|
-
minWidth: 0,
|
|
698
|
-
wordBreak: "break-all"
|
|
699
|
-
}
|
|
700
|
-
}, UPGRADE_COMMAND),
|
|
701
|
-
React.createElement("button", {
|
|
702
|
-
style: { ...s.btnGhost, height: 26, padding: "0 10px", fontSize: 12, flexShrink: 0 },
|
|
703
|
-
onClick: () => copy(UPGRADE_COMMAND),
|
|
704
|
-
title: "\u590D\u5236\u5347\u7EA7\u547D\u4EE4"
|
|
705
|
-
}, copied ? "\u2713 \u5DF2\u590D\u5236" : "\u590D\u5236")
|
|
717
|
+
{ style: { display: "flex", flexDirection: "column", gap: 6 } },
|
|
718
|
+
cmds.map(({ id, cmd }) => React.createElement(UpgradeCommandRow, { key: id, cmd }))
|
|
706
719
|
)
|
|
707
720
|
),
|
|
708
721
|
React.createElement("button", {
|
package/client/index.js
CHANGED
|
@@ -7,8 +7,14 @@ const RELEASES_URL = 'https://github.com/wenbin-wb/dsh-bridge/releases';
|
|
|
7
7
|
const ISSUES_URL = 'https://github.com/wenbin-wb/dsh-bridge/issues/new';
|
|
8
8
|
const TUNNEL_DOCS_URL = 'https://github.com/wenbin-wb/dsh-bridge/blob/main/docs/custom-tunnel.md';
|
|
9
9
|
|
|
10
|
-
//
|
|
11
|
-
|
|
10
|
+
// 生成升级命令(拼接具体版本号;用 add 而非 update,update --latest 受已安装依赖版本约束可能无法升级到最新版)
|
|
11
|
+
function upgradeCommands(latest) {
|
|
12
|
+
const spec = `@wenbin_wb/dsh-bridge@${latest}`;
|
|
13
|
+
return [
|
|
14
|
+
{ id: 'dsh', cmd: `dsh plugin --profile web add ${spec}` },
|
|
15
|
+
{ id: 'npx', cmd: `npx --yes @deepseek-ai/dsh plugin --profile web add ${spec}` },
|
|
16
|
+
];
|
|
17
|
+
}
|
|
12
18
|
|
|
13
19
|
const name = 'dsh-bridge';
|
|
14
20
|
const inject = ['slots', 'connection'];
|
|
@@ -539,11 +545,32 @@ function PlatformCard({ platformId, platformName, platformDesc, rpcCall, onStatu
|
|
|
539
545
|
);
|
|
540
546
|
}
|
|
541
547
|
|
|
548
|
+
// 单条升级命令行:命令文本 + 复制按钮
|
|
549
|
+
function UpgradeCommandRow({ cmd }) {
|
|
550
|
+
const [copied, copy] = useCopy();
|
|
551
|
+
return React.createElement('div', { style: { display: 'flex', alignItems: 'center', gap: 8 } },
|
|
552
|
+
React.createElement('code', {
|
|
553
|
+
style: {
|
|
554
|
+
...s.code,
|
|
555
|
+
fontSize: 11,
|
|
556
|
+
color: 'var(--dsw-alias-label-secondary,#6b7280)',
|
|
557
|
+
flex: 1,
|
|
558
|
+
minWidth: 0,
|
|
559
|
+
wordBreak: 'break-all',
|
|
560
|
+
},
|
|
561
|
+
}, cmd),
|
|
562
|
+
React.createElement('button', {
|
|
563
|
+
style: { ...s.btnGhost, height: 26, padding: '0 10px', fontSize: 12, flexShrink: 0 },
|
|
564
|
+
onClick: () => copy(cmd),
|
|
565
|
+
title: '复制升级命令',
|
|
566
|
+
}, copied ? '✓ 已复制' : '复制'),
|
|
567
|
+
);
|
|
568
|
+
}
|
|
569
|
+
|
|
542
570
|
// 版本检查 + GitHub/反馈入口
|
|
543
571
|
function VersionBanner({ rpcCall }) {
|
|
544
572
|
const [info, setInfo] = React.useState(null);
|
|
545
573
|
const [loading, setLoading] = React.useState(false);
|
|
546
|
-
const [copied, copy] = useCopy();
|
|
547
574
|
|
|
548
575
|
const check = React.useCallback(async () => {
|
|
549
576
|
setLoading(true);
|
|
@@ -575,6 +602,7 @@ function VersionBanner({ rpcCall }) {
|
|
|
575
602
|
|
|
576
603
|
// 有新版本:信息卡片
|
|
577
604
|
if (hasUpdate) {
|
|
605
|
+
const cmds = upgradeCommands(info.latest);
|
|
578
606
|
return React.createElement('div', { style: { marginBottom: 16 } },
|
|
579
607
|
React.createElement('div', {
|
|
580
608
|
style: {
|
|
@@ -593,27 +621,12 @@ function VersionBanner({ rpcCall }) {
|
|
|
593
621
|
fontSize: 13,
|
|
594
622
|
fontWeight: 600,
|
|
595
623
|
color: 'var(--dsw-alias-state-info-primary,#1e40af)',
|
|
596
|
-
marginBottom:
|
|
624
|
+
marginBottom: 8,
|
|
597
625
|
},
|
|
598
626
|
}, `发现新版本 v${info.latest}(当前 v${info.current})`),
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
React.createElement('code', {
|
|
603
|
-
style: {
|
|
604
|
-
...s.code,
|
|
605
|
-
fontSize: 11,
|
|
606
|
-
color: 'var(--dsw-alias-label-secondary,#6b7280)',
|
|
607
|
-
flex: 1,
|
|
608
|
-
minWidth: 0,
|
|
609
|
-
wordBreak: 'break-all',
|
|
610
|
-
},
|
|
611
|
-
}, UPGRADE_COMMAND),
|
|
612
|
-
React.createElement('button', {
|
|
613
|
-
style: { ...s.btnGhost, height: 26, padding: '0 10px', fontSize: 12, flexShrink: 0 },
|
|
614
|
-
onClick: () => copy(UPGRADE_COMMAND),
|
|
615
|
-
title: '复制升级命令',
|
|
616
|
-
}, copied ? '✓ 已复制' : '复制'),
|
|
627
|
+
// 升级命令:dsh plugin 与 npx 两种,均带复制按钮
|
|
628
|
+
React.createElement('div', { style: { display: 'flex', flexDirection: 'column', gap: 6 } },
|
|
629
|
+
cmds.map(({ id, cmd }) => React.createElement(UpgradeCommandRow, { key: id, cmd })),
|
|
617
630
|
),
|
|
618
631
|
),
|
|
619
632
|
React.createElement('button', {
|
package/package.json
CHANGED