dsh-ide-git 0.4.2 → 0.5.0
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 +7 -1
- package/README_EN.md +7 -1
- package/dsh.plugin.json +1 -1
- package/package.json +1 -1
- package/src/client.js +2974 -1
package/README.md
CHANGED
|
@@ -95,7 +95,7 @@ DSH 自带的 Git 面板覆盖「暂存 / 提交 / 还原 / 看历史」;`dsh-id
|
|
|
95
95
|
|
|
96
96
|
```sh
|
|
97
97
|
# 本插件可以单独使用:面板直接出现在 DSH 原生右侧栏
|
|
98
|
-
dsh plugin --profile web add
|
|
98
|
+
dsh plugin --profile web add dsh-ide-git
|
|
99
99
|
# 可选底座:装了它才会多出底部工作台,并跟随它的侧栏布局
|
|
100
100
|
dsh plugin --profile web add dsh-better-sidebar
|
|
101
101
|
# 重启 dsh web
|
|
@@ -113,6 +113,12 @@ dsh plugin --profile web add dsh-better-sidebar
|
|
|
113
113
|
- 只依赖三样长期契约:宿主半的 `webServer.register({ kind: 'prefix' })` 路由、客户端半的 `window.__ModuleLoader__.load({ id, factory })`、以及客户端的 `slots` 服务。**不引用 `ui-primitives` 图标集**(图标全是自带 SVG),所以宿主删改图标不会波及本插件。
|
|
114
114
|
- 底座是**可选** peer:没装、装坏了、或它自己要等上游修,都不影响本插件挂到原生右侧栏。
|
|
115
115
|
|
|
116
|
+
### 界面语言
|
|
117
|
+
|
|
118
|
+
跟随 DSH 的语言设置(`ctx.locale`)实时切换,内置 **21 种**词典:简繁中文(含 `zh-HK` / `zh-MO` / `zh-TW`)、英语、日语、韩语、德语、法语、意大利语、葡萄牙语、俄语、荷兰语、波兰语、瑞典语、土耳其语、印尼语、越南语、泰语、印地语、阿拉伯语。词典同时注册进 DSH 的 locale 注册表(`ctx.locale.register`);解析顺序是「精确 tag → 主语言子标签 → 英文」,而**英文始终是键完整的那本**,所以任何未覆盖的语言都回退英文,不会露出键名。
|
|
119
|
+
|
|
120
|
+
词典就在 `src/client.js` 的 `LOCALES` 表里:一门语言一个条目,条目前面有一行 `/* locale: <tag> */` 标记。**校验是自动的**——冒烟测试强制每本词典的键集与中文完全一致(缺键会静默回退英文,面板就成了半翻译状态,那正是这条测试要挡住的)。
|
|
121
|
+
|
|
116
122
|
## 工作原理
|
|
117
123
|
|
|
118
124
|
```
|
package/README_EN.md
CHANGED
|
@@ -84,7 +84,7 @@ The panel never guesses: it measures itself with a `ResizeObserver` (width ≥ 6
|
|
|
84
84
|
|
|
85
85
|
```sh
|
|
86
86
|
# works on its own: the panel lands in DSH's native right sidebar
|
|
87
|
-
dsh plugin --profile web add
|
|
87
|
+
dsh plugin --profile web add dsh-ide-git
|
|
88
88
|
# optional: adds the bottom workbench and better-sidebar's sidebar chrome
|
|
89
89
|
dsh plugin --profile web add dsh-better-sidebar
|
|
90
90
|
```
|
|
@@ -101,6 +101,12 @@ Restart `dsh web`, then:
|
|
|
101
101
|
- Three long-lived contracts, nothing else: the host's `webServer.register({ kind: 'prefix' })` route, the client's `window.__ModuleLoader__.load({ id, factory })`, and the client `slots` service. It does **not** import the `ui-primitives` icon set (every icon is an inline SVG), so host icon changes cannot reach it.
|
|
102
102
|
- better-sidebar is an **optional** peer: absent, broken, or waiting on its own upstream fix, the plugin still mounts in the native right sidebar.
|
|
103
103
|
|
|
104
|
+
### Interface language
|
|
105
|
+
|
|
106
|
+
Follows DSH's locale setting (`ctx.locale`) and switches live. **21 dictionaries** ship with the plugin: Simplified and Traditional Chinese (including `zh-HK` / `zh-MO` / `zh-TW`), English, Japanese, Korean, German, French, Italian, Portuguese, Russian, Dutch, Polish, Swedish, Turkish, Indonesian, Vietnamese, Thai, Hindi and Arabic. They are also published to DSH's locale registry through `ctx.locale.register`. Resolution is "exact tag → primary subtag → English", and **English is always the key-complete dictionary** — any language without a dictionary falls back to it rather than showing raw keys.
|
|
107
|
+
|
|
108
|
+
The dictionaries live in the `LOCALES` table inside `src/client.js`: one entry per language, each preceded by a `/* locale: <tag> */` marker. **The check is automatic** — a smoke test requires every dictionary to carry exactly the same key set as Chinese, because a missing key falls back to English silently and leaves the panel half-translated, which is what that test exists to catch.
|
|
109
|
+
|
|
104
110
|
## How it works
|
|
105
111
|
|
|
106
112
|
- **Host half** (`src/index.js`): one prefix route `/dsh-ide-git/api` with a 32-method table. Every git call is an argv array through `spawn` — no shell string, no `exec` — with argument validation (absolute paths, refs never start with `-`, paths stay inside the repository).
|
package/dsh.plugin.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "dsh-external/dsh-ide-git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"main": "./src/index.js",
|
|
5
5
|
"description": "IDE 级 Git 操作面板:分支树 + 提交图谱 + 变更/暂存/提交 + 提交详情。装了 dsh-better-sidebar 时挂成它的原生 tab(右侧栏 + 底部工作台);没装时直接挂 DSH 原生右侧栏,单独安装即可用。JetBrains 风格 Git 工具窗口 for DeepSeek Harness.",
|
|
6
6
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-ide-git",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "DSH plugin: an IDE-grade Git tool window as a native dsh-better-sidebar tab — branch tree, commit graph, changes, commit details, JetBrains-style actions, in the right sidebar and the bottom panel. | DSH 插件:IDE 级 Git 工具窗口,以 dsh-better-sidebar 原生 Tab 挂载——分支树 / 提交图谱 / 变更与提交详情 / JetBrains 风格操作,右侧栏与底部面板双布局自适应。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|