Skip to content

DeepSeek Harness Tauri 桌面版 | Only 8mb installer, zero environment setup, preset plugins, Windows / macOS / Linux.

fix: add semver runtime dep and handle dsh-src- prefix

coderstory923265cbf3b6
diff --git a/package.json b/package.json
index 34803da6..1117d66c 100644
--- a/package.json
+++ b/package.json
@@ -38,6 +38,7 @@
"react-i18next": "catalog:runtime",
"react-if-lite": "catalog:runtime",
"react-use": "catalog:runtime",
+ "semver": "catalog:runtime",
"tailwind-variants": "catalog:runtime",
"valtio-define": "catalog:runtime"
},
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index d1a9a614..61834757 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -125,6 +125,9 @@ catalogs:
react-use:
specifier: ^17.6.1
version: 17.6.1
+ semver:
+ specifier: ^7.8.0
+ version: 7.8.5
tailwind-variants:
specifier: ^3.3.1
version: 3.3.1
@@ -257,6 +260,9 @@ importers:
react-use:
specifier: catalog:runtime
+ semver:
+ specifier: catalog:runtime
+ version: 7.8.5
tailwind-variants:
specifier: catalog:runtime
diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml
index 8be49156..d333f9e1 100644
--- a/pnpm-workspace.yaml
+++ b/pnpm-workspace.yaml
@@ -70,6 +70,7 @@ catalogs:
react-i18next: ^17.0.11
react-if-lite: ^0.1.0
react-use: ^17.6.1
+ semver: ^7.8.0
tailwind-variants: ^3.3.1
valtio-define: ^1.4.1
# Tauri 相关
diff --git a/src/components/config-core.tsx b/src/components/config-core.tsx
index 54960ab8..f46e0af0 100644
--- a/src/components/config-core.tsx
+++ b/src/components/config-core.tsx
@@ -398,7 +398,12 @@ function displayVersion(version: HarnessCore): string {
* Returns: negative if a < b, 0 if equal, positive if a > b.
*/
function compareVersions(a: string, b: string): number {
- const clean = (v: string) => v.replace(/^(?:src|dsh)-/, '')
+ const clean = (v: string) => {
+ let s = v
+ while (s.startsWith('dsh-') || s.startsWith('src-'))
+ s = s.replace(/^(?:src|dsh)-/, '')
+ return s
+ }
const pa = semver.parse(clean(a))
const pb = semver.parse(clean(b))
if (!pa || !pb)