Skip to content

Commit cfacc22

Browse files
committed
refactor: 全局重命名 customButton 为 commandDock
- 更新所有命令名称从 customButton.* 到 commandDock.* - 更新配置键名从 customButton.* 到 commandDock.* - 重命名面板ID从 customButtonPanel 到 commandDockPanel - 重命名TypeScript接口 CustomButton 到 CommandDockButton (保留向后兼容别名) - 更新终端显示名称从 'Custom Button:' 到 'Command Dock:' - 更新所有文档和示例配置 - 添加新功能:自动关闭终端和面板位置配置 - 添加配置指南和重大更改说明文档 BREAKING CHANGES: - 配置键名变更,建议用户更新 settings.json - 命令名称变更,影响自定义键绑定 - 面板和视图ID变更
1 parent 81d2da3 commit cfacc22

13 files changed

+418
-115
lines changed

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ make reinstall
145145

146146
| 操作 | 快捷键 | 命令 |
147147
|------|--------|------|
148-
|**添加按钮** | `Cmd+Shift+P` | `Custom Button: Add Custom Button` |
149-
| ✏️ **编辑按钮** | `Cmd+Shift+P` | `Custom Button: Edit Custom Button` |
150-
| 🗑️ **删除按钮** | `Cmd+Shift+P` | `Custom Button: Remove Custom Button` |
148+
|**添加按钮** | `Cmd+Shift+P` | `Command Dock: Add Custom Button` |
149+
| ✏️ **编辑按钮** | `Cmd+Shift+P` | `Command Dock: Edit Custom Button` |
150+
| 🗑️ **删除按钮** | `Cmd+Shift+P` | `Command Dock: Remove Custom Button` |
151151

152152
## 💡 实用示例
153153

@@ -158,7 +158,7 @@ make reinstall
158158

159159
```json
160160
{
161-
"customButton.buttons": [
161+
"commandDock.buttons": [
162162
{
163163
"id": "dev-server",
164164
"name": "🚀 Dev Server",
@@ -200,7 +200,7 @@ make reinstall
200200

201201
```json
202202
{
203-
"customButton.buttons": [
203+
"commandDock.buttons": [
204204
{
205205
"id": "git-status",
206206
"name": "📊 Status",
@@ -232,7 +232,7 @@ make reinstall
232232

233233
```json
234234
{
235-
"customButton.buttons": [
235+
"commandDock.buttons": [
236236
{
237237
"id": "docker-up",
238238
"name": "🐳 Up",

docs/BREAKING_CHANGES.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
# Breaking Changes - v1.0.0
2+
3+
## 重大更改:全局命名统一为 commandDock
4+
5+
为了保持代码的一致性和可读性,我们将所有的 `customButton` 命名更改为 `commandDock`
6+
7+
### 📋 更改清单
8+
9+
#### 1. 配置键名更改
10+
11+
**旧配置键名 → 新配置键名**
12+
- `customButton.buttons``commandDock.buttons`
13+
- `customButton.autoCloseTerminal``commandDock.autoCloseTerminal`
14+
- `customButton.panelLocation``commandDock.panelLocation`
15+
16+
#### 2. 命令名称更改
17+
18+
**旧命令名 → 新命令名**
19+
- `customButton.addButton``commandDock.addButton`
20+
- `customButton.removeButton``commandDock.removeButton`
21+
- `customButton.editButton``commandDock.editButton`
22+
- `customButton.refreshPanel``commandDock.refreshPanel`
23+
- `customButton.executeFromPanel``commandDock.executeFromPanel`
24+
- `customButton.addButtonFromPanel``commandDock.addButtonFromPanel`
25+
- `customButton.editButtonFromPanel``commandDock.editButtonFromPanel`
26+
- `customButton.removeButtonFromPanel``commandDock.removeButtonFromPanel`
27+
- `customButton.execute``commandDock.execute`
28+
- `customButton.openSettings``commandDock.openSettings`
29+
30+
#### 3. 视图和面板 ID 更改
31+
32+
**旧 ID → 新 ID**
33+
- `customButtonPanel``commandDockPanel`
34+
- `customButton` (viewItem) → `commandDockButton`
35+
36+
#### 4. 代码接口更改
37+
38+
**TypeScript 接口更改**
39+
- `CustomButton``CommandDockButton` (保留了类型别名以实现向后兼容)
40+
- `CustomButtonPanelProvider``CommandDockPanelProvider`
41+
- `CustomButtonItem``CommandDockItem`
42+
43+
#### 5. 终端名称更改
44+
45+
**终端显示名称**
46+
- `Custom Button: {buttonName}``Command Dock: {buttonName}`
47+
48+
### 🔄 迁移指南
49+
50+
#### 自动迁移
51+
52+
由于 VSCode 配置的向后兼容性,大部分更改将自动生效。但建议您手动更新配置以确保最佳体验。
53+
54+
#### 手动迁移步骤
55+
56+
1. **更新 settings.json 配置**
57+
58+
将现有配置:
59+
```json
60+
{
61+
"customButton.buttons": [...],
62+
"customButton.autoCloseTerminal": true,
63+
"customButton.panelLocation": "scm"
64+
}
65+
```
66+
67+
更改为:
68+
```json
69+
{
70+
"commandDock.buttons": [...],
71+
"commandDock.autoCloseTerminal": true,
72+
"commandDock.panelLocation": "scm"
73+
}
74+
```
75+
76+
2. **更新自定义键绑定**
77+
78+
如果您在 `keybindings.json` 中定义了自定义快捷键,请将命令名称从 `customButton.*` 更新为 `commandDock.*`
79+
80+
3. **更新扩展设置**
81+
82+
在 VS Code 设置界面中搜索 "commandDock" 而不是 "customButton"。
83+
84+
### ⚠️ 注意事项
85+
86+
1. **配置兼容性**:旧的 `customButton.*` 配置仍然可以工作,但建议更新为新的命名。
87+
88+
2. **命令面板**:在命令面板中搜索命令时,请使用 "Command Dock" 而不是 "Custom Button"。
89+
90+
3. **扩展卸载**:如果需要完全卸载扩展,请使用新的命令:
91+
```bash
92+
code --uninstall-extension CommandDock.command-dock
93+
```
94+
95+
### 🚀 新功能提醒
96+
97+
除了命名更改,此版本还包含以下新功能:
98+
99+
1. **自动关闭终端**:命令执行完毕后可自动关闭终端窗口
100+
2. **面板位置配置**:可将命令面板显示在源代码管理面板中
101+
3. **快速设置访问**:新增设置齿轮图标,快速访问相关配置
102+
103+
### 📞 支持
104+
105+
如果在迁移过程中遇到问题,请:
106+
107+
1. 查看 [配置指南](CONFIGURATION_GUIDE.md)
108+
2. 参考 [使用示例](EXAMPLES.md)
109+
3. 提交 [GitHub Issue](https://github.com/Merlin218/vscode-extension-command-dock/issues)
110+
111+
---
112+
113+
**发布日期**:2024年1月
114+
115+
**向后兼容性**:保留了类型别名,但建议更新到新命名

docs/CONFIGURATION_GUIDE.md

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Command Dock 配置指南
2+
3+
## 新增功能
4+
5+
### 1. 自动关闭终端
6+
7+
**功能描述**: 命令执行完成后,自动关闭打开的终端窗口。
8+
9+
**配置方法**:
10+
1. 打开 VS Code 设置 (Ctrl/Cmd + ,)
11+
2. 搜索 "commandDock.autoCloseTerminal"
12+
3. 勾选复选框启用此功能
13+
14+
**或者在 settings.json 中添加**:
15+
```json
16+
{
17+
"commandDock.autoCloseTerminal": true
18+
}
19+
```
20+
21+
**默认值**: `false` (关闭)
22+
23+
---
24+
25+
### 2. 面板位置配置
26+
27+
**功能描述**: 自定义命令面板的显示位置,可以选择在资源管理器面板或源代码管理面板中显示。
28+
29+
**配置方法**:
30+
1. 打开 VS Code 设置 (Ctrl/Cmd + ,)
31+
2. 搜索 "commandDock.panelLocation"
32+
3. 选择面板位置:
33+
- `explorer`: 显示在资源管理器面板 (默认)
34+
- `scm`: 显示在源代码管理面板
35+
36+
**或者在 settings.json 中添加**:
37+
```json
38+
{
39+
"commandDock.panelLocation": "scm"
40+
}
41+
```
42+
43+
**注意**: 更改面板位置后需要重新加载 VS Code 窗口才能生效。插件会自动提示您进行重新加载。
44+
45+
---
46+
47+
## 快速设置
48+
49+
在命令面板中可以看到一个齿轮图标,点击即可快速打开 Command Dock 相关设置。
50+
51+
## 配置示例
52+
53+
完整的配置示例:
54+
55+
```json
56+
{
57+
"commandDock.buttons": [
58+
{
59+
"id": "build",
60+
"name": "Build",
61+
"command": "npm run build",
62+
"icon": "gear",
63+
"color": "#00ff00"
64+
},
65+
{
66+
"id": "test",
67+
"name": "Test",
68+
"command": "npm test",
69+
"icon": "check",
70+
"color": "#0000ff"
71+
}
72+
],
73+
"commandDock.autoCloseTerminal": true,
74+
"commandDock.panelLocation": "scm"
75+
}
76+
```
77+
78+
这个配置将:
79+
- 创建两个自定义按钮
80+
- 启用命令执行后自动关闭终端
81+
- 将命令面板显示在源代码管理面板中

docs/EXAMPLES.md

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
```json
1010
{
11-
"customButton.buttons": [
11+
"commandDock.buttons": [
1212
{
1313
"id": "dev-server",
1414
"name": "🚀 Dev Server",
@@ -52,7 +52,7 @@
5252

5353
```json
5454
{
55-
"customButton.buttons": [
55+
"commandDock.buttons": [
5656
{
5757
"id": "nextjs-dev",
5858
"name": "⚡ Next Dev",
@@ -87,7 +87,7 @@
8787

8888
```json
8989
{
90-
"customButton.buttons": [
90+
"commandDock.buttons": [
9191
{
9292
"id": "node-dev",
9393
"name": "🔥 Nodemon",
@@ -120,7 +120,7 @@
120120

121121
```json
122122
{
123-
"customButton.buttons": [
123+
"commandDock.buttons": [
124124
{
125125
"id": "django-runserver",
126126
"name": "🐍 Django Server",
@@ -155,7 +155,7 @@
155155

156156
```json
157157
{
158-
"customButton.buttons": [
158+
"commandDock.buttons": [
159159
{
160160
"id": "git-status",
161161
"name": "📊 Status",
@@ -191,7 +191,7 @@
191191

192192
```json
193193
{
194-
"customButton.buttons": [
194+
"commandDock.buttons": [
195195
{
196196
"id": "git-feature-start",
197197
"name": "🌟 New Feature",
@@ -226,7 +226,7 @@
226226

227227
```json
228228
{
229-
"customButton.buttons": [
229+
"commandDock.buttons": [
230230
{
231231
"id": "docker-up",
232232
"name": "🐳 Up",
@@ -267,7 +267,7 @@
267267

268268
```json
269269
{
270-
"customButton.buttons": [
270+
"commandDock.buttons": [
271271
{
272272
"id": "k8s-pods",
273273
"name": "🚀 Pods",
@@ -302,7 +302,7 @@
302302

303303
```json
304304
{
305-
"customButton.buttons": [
305+
"commandDock.buttons": [
306306
{
307307
"id": "db-connect",
308308
"name": "🗄️ Connect DB",
@@ -331,7 +331,7 @@
331331

332332
```json
333333
{
334-
"customButton.buttons": [
334+
"commandDock.buttons": [
335335
{
336336
"id": "deploy-staging",
337337
"name": "🚧 Deploy Staging",
@@ -361,7 +361,7 @@
361361

362362
```json
363363
{
364-
"customButton.buttons": [
364+
"commandDock.buttons": [
365365
{
366366
"id": "gh-actions-status",
367367
"name": "⚡ Actions Status",
@@ -390,7 +390,7 @@
390390

391391
```json
392392
{
393-
"customButton.buttons": [
393+
"commandDock.buttons": [
394394
{
395395
"id": "clean-node-modules",
396396
"name": "🧹 Clean Modules",
@@ -423,7 +423,7 @@
423423

424424
```json
425425
{
426-
"customButton.buttons": [
426+
"commandDock.buttons": [
427427
{
428428
"id": "system-info",
429429
"name": "💻 System Info",

0 commit comments

Comments
 (0)