dsh-edit-diff 0.2.1 → 0.3.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 CHANGED
@@ -31,15 +31,29 @@
31
31
  | 原版 diff | ![原版离谱显示](docs/原版diff.webp) |
32
32
  | 本插件 | ![插件优化显示](docs/优化diff.webp) |
33
33
 
34
+ ## 演示视频
35
+
36
+ 光看静态截图不过瘾?看看这个插件的实际演示效果:
37
+
38
+ | dsh-edit-diff 插件演示 · 66 秒 |
39
+ | :---: |
40
+ | [![dsh-edit-diff 插件演示](https://i2.hdslb.com/bfs/archive/dd90d9de85da22eae537d53dd77a2034bf841b5e.jpg)](https://www.bilibili.com/video/BV1ect76CENM/) |
41
+
34
42
  ## 安装
35
43
 
44
+ **从 GitHub 安装**:源码在 `src/`,`lib/` 不入仓库,安装时 npm 会触发 `prepare` 脚本现场构建。
45
+
36
46
  ```powershell
37
47
  dsh plugin --profile web add github:better-er/dsh-edit-diff
38
48
  ```
39
49
 
40
- 或安装 npm 发布的版本:`dsh plugin --profile web add dsh-edit-diff`。
50
+ **从 npm 安装**:包内已含构建产物 `lib/index.js` `lib/client.js`,安装时不再构建。
51
+
52
+ ```powershell
53
+ dsh plugin --profile web add dsh-edit-diff
54
+ ```
41
55
 
42
- 一条命令装完即生效,自动挂载,重启 DSH web 后启用,无需手工编辑任何组合文件。
56
+ 两种方式装完都会自动挂载,重启 DSH web 后启用,无需手工编辑任何文件。
43
57
 
44
58
  ## 卸载
45
59
 
@@ -57,9 +71,19 @@ dsh plugin --profile web remove dsh-edit-diff
57
71
  - **UI 挂载点**:接管 keyed 槽位 `tool.call.toolview` 的 `edit` 与 `write` 两个 key。
58
72
  - **遮蔽而非冲突**:注册时显式传 `priority: -1`低于内置 `file-mutation-toolview` 的默认 0,用更低优先级遮蔽默认渲染,而不是在同一优先级上 clash。
59
73
  - **PTC 模式**:通过 `callId` 包含 `:code:` 判断是否为 `run_code` 子调用,从 `argsRaw` 中提取 `old_string`/`new_string` 即 edit 或 `content` 即 write 动态构建 diff。
60
- - **无构建**:`lib/client.js` 是按 DSH client bundle 产出的注册式模块,源码即产物,改完即用。
61
- - JavaScript 单文件,不引入任何额外 npm 依赖diff 算法就地内联。
74
+ - **构建型**:TypeScript 源码位于 `src/`,`pnpm build` 通过 tsdown 生成 `lib/index.js`、`lib/index.d.ts`、`lib/client.js` sourcemap,运行时只加载 `lib/` 发布产物。
75
+ - 无运行时 npm 依赖,diff 算法就地内联;浏览器端只向宿主模块表请求 react。
76
+
77
+ 本地开发:
78
+
79
+ ```powershell
80
+ pnpm install
81
+ pnpm typecheck
82
+ pnpm build
83
+ ```
84
+
85
+ 改完源码需重新 `pnpm build`,DSH web 的 HMR 观察到 `lib/client.js` 变化后自动重载。
62
86
 
63
87
  ## License
64
88
 
65
- [MIT](./LICENSE)
89
+ [MIT](./LICENSE)