@young1lin/dsh-ui-gitworkbench 0.1.14 → 0.1.15
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/CHANGELOG.md +7 -0
- package/CHANGELOG_EN.md +7 -0
- package/README.md +25 -0
- package/lib/client.js +297 -297
- package/lib/index.js +163 -85
- package/lib/repo-root.js +60 -0
- package/package.json +5 -5
- package/src/index.ts +164 -84
- package/src/repo-root.ts +66 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
本文件记录面向使用者的变更。格式参考 [Keep a Changelog](https://keepachangelog.com/zh-CN/1.1.0/),版本号遵循语义化版本。
|
|
4
4
|
|
|
5
|
+
## [0.1.15] - 2026-08-31
|
|
6
|
+
|
|
7
|
+
### 修复
|
|
8
|
+
|
|
9
|
+
- **workspace 打开的是仓库子目录时,变更页的每个文件都能打开了。** 此前树是对的、点开全空白:抽屉里的路径全部来自 `git status` / `git diff --numstat`,它们无论在哪个目录运行,输出的都是仓库根相对路径;而 diff 的 pathspec、`:path`、blame、`hash-object`、`ls-tree` 清单和宿主侧的文件读取,全部相对命令的运行目录解析——两种「相对」只在仓库根重合。git 根在 `C:/mattermost/`、workspace 开在 `C:/mattermost/server` 时,`diff HEAD -- server/main.go` 在 `server/` 下运行会去找 `server/server/main.go`,匹配不到并以 exit 0 返回空输出;勾选暂存报 pathspec 不匹配,blame 直接失败,历史按路径过滤永远为空,路径选择器给出的树也缺着前缀。现在每个带路径的 RPC 先解析一次仓库根(`rev-parse --show-toplevel`,不在仓库里则原样回落、让调用方自己的 git 错误照旧冒出来),git 与文件读全部在根上进行;`stats` 的轮询把这次解析并进已有的并行批次,墙钟时间不变。实测(git for Windows,git 根与打开的 workspace 分处两级的 fixture):同一条 diff 在根 11 行、在子目录 0 行,修复后所有视图都从根读取。
|
|
10
|
+
- **peer 依赖范围跟上了当前 dsh 版本线。** 四个 `@deepseek-ai/*` peer 从 `^0.1.0-rc.2` 提到 `^0.1.1-rc.2`(当前发布并在跑的线)。带预发布号的 semver range 只匹配同 `主.次.补丁` 三元组的预发布版本,所以旧范围对 `0.1.1-rc.2` 实际是「不满足」——peer 在场时的兼容性检查会误报。`cordis` 的 `^4.0.1-rc.1` 已覆盖稳定版 `4.0.1`,不动。
|
|
11
|
+
|
|
5
12
|
## [0.1.14] - 2026-08-31
|
|
6
13
|
|
|
7
14
|
### 修复
|
package/CHANGELOG_EN.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
User-facing changes, newest first. Format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versioning follows SemVer.
|
|
4
4
|
|
|
5
|
+
## [0.1.15] - 2026-08-31
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- **Every file opens from the Changes tab when the workspace is a subdirectory of the repository.** The tree was right and the pane was blank: the drawer's paths all come from `git status` / `git diff --numstat`, which print repository-relative paths wherever they run, while diff pathspecs, `:path` revisions, blame, `hash-object`, `ls-tree` listings and the host's own file reads all resolve against the directory the command runs in — and the two notions of "relative" agree only at the root. With the git root at `C:/mattermost/` and the workspace opened at `C:/mattermost/server`, `diff HEAD -- server/main.go` run from `server/` looked for `server/server/main.go`, matched nothing, and came back exit 0 with empty output; the stage tick died on "pathspec did not match", blame went fatal, a path-filtered history came back empty, and the path picker's tree lost its prefix. Every path-carrying RPC now resolves the repository root once (`rev-parse --show-toplevel`, falling back to the directory itself outside a repository so the caller's own git error still surfaces) and runs git and file reads there; the polled `stats` folds the resolve into its existing parallel batch, so its wall time is unchanged. Measured on git for Windows with a fixture whose git root and opened workspace sit two levels apart: the same diff was 11 lines from the root and 0 from the subdirectory, and every view now reads through the root.
|
|
10
|
+
- **The peer dependency ranges catch up with the current dsh line.** The four `@deepseek-ai/*` peers move from `^0.1.0-rc.2` to `^0.1.1-rc.2` — the line currently published and running. A semver range with a prerelease only matches prereleases of the same `major.minor.patch` tuple, so the old range actually FAILED against `0.1.1-rc.2`, making the compatibility check that runs when a peer is present report a mismatch. `cordis` stays at `^4.0.1-rc.1`, which already covers the stable `4.0.1`.
|
|
11
|
+
|
|
5
12
|
## [0.1.14] - 2026-08-31
|
|
6
13
|
|
|
7
14
|
### Fixed
|
package/README.md
CHANGED
|
@@ -457,6 +457,31 @@ DOM 里**。`page.get_by_text('会话标题')` 于是永远找不到,再怎么
|
|
|
457
457
|
所以没有重叠」——不是「没有 bug」。按 gutter 自身宽度加一条缝算目标宽度,再
|
|
458
458
|
`scrollLeft = scrollWidth` 滚到底,重叠就一定发生在最坏处。
|
|
459
459
|
|
|
460
|
+
### 6.22 workspace 打开的是仓库子目录时,Changes 列得出文件、点开全是空白
|
|
461
|
+
|
|
462
|
+
git 的两种「路径」只在仓库根相等:`git status --porcelain` 和 `git diff --numstat`
|
|
463
|
+
无论在哪个目录运行,输出的都是**仓库根相对**路径(抽屉里的 `path` 全部来自这里);
|
|
464
|
+
而 pathspec、`:path` 版本语法、`hash-object` 的文件参数、`ls-tree` 的清单,全部相对
|
|
465
|
+
**当前运行目录**解析。会话打开的就是仓库根时两者天然一致;一旦 workspace 打开的是
|
|
466
|
+
子目录(如 git 根在 `C:/mattermost/`、workspace 开在 `C:/mattermost/server`),抽屉就
|
|
467
|
+
成了「树是对的,其余全空」:`diff HEAD -- server/main.go` 在 `server/` 下运行会去找
|
|
468
|
+
`server/server/main.go`,匹配不到,**exit 0、空输出**——点开改动文件一片空白,任何错
|
|
469
|
+
都不报;勾选暂存报 `pathspec did not match`;blame 直接 fatal;`ls-tree` 从子目录吐出
|
|
470
|
+
**剥掉前缀**的清单,路径选择器给历史过滤喂的 pathspec 从此永远匹配不到;宿主侧
|
|
471
|
+
`join(cwd, path)` 读未跟踪文件同样拼出双前缀路径(实测 git for Windows:同一条
|
|
472
|
+
`diff HEAD -- server/main.go`,在根 11 行,在 `server/` 0 行)。
|
|
473
|
+
|
|
474
|
+
修法:所有带路径的 RPC 先解析一次仓库根(`rev-parse --show-toplevel`,纯模块
|
|
475
|
+
`src/repo-root.ts` 的 `rootedDir`;不在仓库里则回落原目录,让调用方自己的 git 失败
|
|
476
|
+
照旧冒出来),git 与文件读全部在根上做。`stats` 是轮询的,这次解析并进它已有的
|
|
477
|
+
并行批次,墙钟零增加(status/numstat/rev-parse 本就 cwd 无关,仍跑在会话目录);
|
|
478
|
+
`commitStats` 把解析放在缓存探测之后,命中不多花 spawn。刻意**不缓存**解析结果:
|
|
479
|
+
会话中途在子目录里 `git init`,下一次轮询就该认到新根。守卫两条:
|
|
480
|
+
`tests/repo-root.git.test.ts` 把 git 侧行为逐条钉死(子目录下 pathspec 匹配不到、
|
|
481
|
+
`ls-tree` 剥前缀、`hash-object` 双前缀报错——git 哪天改了行为它会先叫);
|
|
482
|
+
`tests/host-rooted-paths.test.ts` 源码扫描钉布线(先剥注释;断言带 path 的 @Remote
|
|
483
|
+
恰好十个、每个方法体内必须出现 `rootedDirOf`;已做变异测试,改掉一个方法它会点名)。
|
|
484
|
+
|
|
460
485
|
---
|
|
461
486
|
|
|
462
487
|
## 7. dsh 仓库里的关键参考文件(去哪里抄)
|