Skip to content

fix: 修复安装断裂(dsh-type-meta 未发布) + feat: Git push/pull/fetch + 资源管理器/Git 自动刷新 - #10

Open
Electricitysheep wants to merge 4 commits into
omdsh-dev:mainfrom
Electricitysheep:fix/install-deps-rc6
Open

fix: 修复安装断裂(dsh-type-meta 未发布) + feat: Git push/pull/fetch + 资源管理器/Git 自动刷新#10
Electricitysheep wants to merge 4 commits into
omdsh-dev:mainfrom
Electricitysheep:fix/install-deps-rc6

Conversation

@Electricitysheep

Copy link
Copy Markdown

概述

解决 README「已知限制」中的三项 + 一个安装断裂 bug:

  1. 安装必失败@deepseek-ai/dsh-type-meta@0.0.1-rc.1 从未发布到 npm(404),按 README 执行 pnpm install 100% 失败。全量升级 @deepseek-ai/*^0.1.0-rc.6(该系列已改用 dsh-typert-protocol)后安装通过。
  2. Git 无 push/pull/fetch:新增 upstreamInfo(ahead/behind,无网络读)、fetchRemote(--all --prune)、pullpush——push 只允许 --force-with-lease(绝不裸 --force)。GitView 显示 ↓behind ↑ahead 徽标与 fetch/pull/push 三个操作按钮(push 走确认弹窗)。
  3. 无文件 watcher(手动刷新):ExplorerView 2s 轮询可见目录,按 name/type/hidden 签名对比,变化才重渲染(无 setState 风暴);GitView 同步轮询 status+upstream。

测试

  • pnpm typecheckpnpm build
  • 全量 pnpm test:408 tests,398 通过 + 7 个 Windows 平台既有失败(defaultShell/CRLF/路径断言,macOS/CI 全绿,与本 PR 无关)
  • 新增 tests/git-sync.spec.ts 6/6(本地 bare-repo 集成:跟踪/推送/拉取快进/fetch 不动 HEAD/force-with-lease 拒绝覆盖他人提交
  • 新增 tests/explorer-auto-refresh.spec.tsx 3/3(外部新文件轮询后出现、无变化不重渲染、签名函数)
  • 端到端实测(Playwright + 真实 dsh web):三个按钮渲染、pull/push 无 upstream 时正确禁用、点击「拉取远端」触发 git.fetch 路由返回 200 并自动刷新面板

破坏性变更

无(仅新增 API 与依赖版本升级;rc.1→rc.6 对齐官方当前发布线)。

dsh-type-meta@0.0.1-rc.1 was never published to npm (404), so
pnpm install fails for every user following the README. The rc.6 line
replaced dsh-type-meta with dsh-typert-protocol; pinning the whole
@deepseek-ai/* set to ^0.1.0-rc.6 resolves the graph. Verified: pnpm
install + build + full test suite (7 pre-existing Windows-only failures
unchanged).
Adds fetch / pull / push to the source-control panel:
- git.ts: upstreamInfo (remote/branch/ahead/behind, network-free),
  fetchRemote (fetch --all --prune), pull, push (--force-with-lease
  only, never bare --force)
- index.ts: git.upstream / git.fetch / git.pull / git.push routes
- GitView: upstream badge (↓behind ↑ahead) + three sync buttons,
  push gated by the existing confirm modal
- tests: local-bare-remote integration suite covering tracking,
  push, pull fast-forward, fetch (HEAD untouched), and the
  force-with-lease refusal when the remote moved unseen

Closes the 'Git 无 push/pull/fetch' limitation from the README.
Closes the '无文件 watcher(手动刷新)' limitation from the README:
- ExplorerView polls the visible levels every 2s and re-renders only
  when a level's name/type/hidden signature changed (server-sorted
  rows make the signature stable), so external edits appear without
  the manual refresh button and no-op polls do not churn React state
- GitView polls status + upstream (cheap local reads) so the badge
  and staged/unstaged lists track external changes; log/branches
  still refresh explicitly
- tests: levelSignature unit cases + jsdom fake-timer component tests
  (new file appears after poll; unchanged level does not rerender)

Full suite: 408 tests, 7 pre-existing Windows-only failures unchanged.
main already carried the rc.6 dependency line and added
@deepseek-ai/cordis + dsh-client-locale; take main's package.json as
the superset and regenerate pnpm-lock.yaml.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant