Skip to content

Commit 23812e8

Browse files
committed
refactor(vscode): 优化 VSCode 伴侣扩展构建与发布流程
- 移除旧的 esbuild 打包配置,改用 npm 脚本分步骤构建 - 先构建 webview,再构建扩展,最后打包成 .vsix 文件 - 删除对模板文件的拷贝与清理操作,简化构建过程 - 更新 clean 脚本,移除无用的输出目录删除 - 为发布脚本增加预发布选项,支持版本自动识别和命令行参数 - 修改 package.json,移除无用的 files 配置 - 新增详细的 README 文档,介绍插件功能、配置及使用说明 - 添加 .vscodeignore 文件,排除无关文件以减小发布包体积 - 更新 RELEASE.md,补充预发布命令行参数文档
1 parent 05af920 commit 23812e8

12 files changed

Lines changed: 316 additions & 52 deletions

File tree

RELEASE.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,15 @@ VSCE_PAT=<token> npm run prepare:vscode -- <version> [options]
197197
| `<version>` | **必填**,要发布的 semver 版本号 |
198198
| `--dry-run` | 预演模式,不实际执行任何写操作 |
199199
| `--force` | 跳过 main 分支检查,允许从其他分支发布 |
200+
| `--pre-release` | 发布为预发布版本(如含 `-beta`/`-alpha` 会自动检测) |
200201

201202
### 执行流程(7 步)
202203

203204
| 步骤 | 操作 | 说明 |
204205
|------|------|------|
205206
| 1 | Git 检查 | 工作区必须 clean,必须在 main 分支 |
206207
| 2 | VSCE_PAT 检查 | 环境变量必须已设置 |
207-
| 3 | 更新版本号 | 同时更新 `packages/core``packages/cli``packages/vscode-ide-companion` 的 version |
208+
| 3 | 更新版本号 | 更新 `packages/vscode-ide-companion` 的 version |
208209
| 4 | 质量检查 | `npm run check`(typecheck + eslint + prettier) |
209210
| 5 | 测试 | `npm run test --workspaces` |
210211
| 6 | 构建 | `npm run build:vscode`(core tsc + esbuild 打包扩展 + 拷贝模板 + vsce package) |
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
.vscode/**
2+
.vscode-test/**
3+
node_modules/**
4+
src/**
5+
out/**
6+
*.vsix
7+
.gitignore
8+
tsconfig.json
9+
tsconfig.*.json
10+
esbuild.config.mjs
11+
eslint.config.mjs
12+
vite.config.*
13+
vitest.config.*
14+
scripts/**
15+
tests/**
16+
__tests__/**
17+
*.test.ts
18+
*.test.tsx
19+
*.spec.ts
20+
*.spec.tsx
21+
components.json
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
# Deep Code
2+
3+
[Deep Code](https://marketplace.visualstudio.com/items?itemName=vegamo.deepcode-vscode) is an AI coding assistant extension for Visual Studio Code, specifically optimized for the latest `deepseek-v4` model.
4+
5+
## Configuration
6+
7+
Create `~/.deepcode/settings.json` with:
8+
9+
```json
10+
{
11+
"env": {
12+
"MODEL": "deepseek-v4-pro",
13+
"BASE_URL": "https://api.deepseek.com",
14+
"API_KEY": "sk-..."
15+
},
16+
"thinkingEnabled": true,
17+
"reasoningEffort": "max"
18+
}
19+
```
20+
21+
## Key Features
22+
23+
### **Skills**
24+
Deep Code supports agent skills that allows you to extend the assistant's capabilities:
25+
26+
- **User-level Skills**: discovered and activated from `~/.agents/skills/`.
27+
- **Project-level Skills**: loaded from `./.agents/skills/` for project-specific workflows, with legacy `./.deepcode/skills/` compatibility.
28+
29+
### **Optimized for DeepSeek**
30+
- Specifically tuned for DeepSeek model performance.
31+
- Reduce costs by using [Context Caching](https://api-docs.deepseek.com/guides/kv_cache).
32+
- Natively supports [Thinking Mode](https://api-docs.deepseek.com/guides/thinking_mode) and Thinking Effort Control.
33+
34+
## Supported Models
35+
36+
- `deepseek-v4-pro` (Recommended)
37+
- `deepseek-v4-flash`
38+
- `deepseek-chat`
39+
- Any other OpenAI-compatible model
40+
41+
## Screenshot
42+
43+
![screenshot](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/deepcode_screenshot.png)
44+
45+
## Deep Code CLI
46+
47+
```bash
48+
npm install -g @vegamo/deepcode-cli
49+
```
50+
51+
![intro1](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/intro1.png)
52+
53+
> The VSCode plugin and CLI share configuration and data, but they have no dependencies at runtime.
54+
55+
- GitHub: https://github.com/lessweb/deepcode-cli
56+
57+
## FAQ
58+
59+
### How can I move Deep Code from the left sidebar to the right (Secondary Side Bar) in VS Code?
60+
61+
![faq1](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/faq1.gif)
62+
63+
### Does Deep Code support understanding images?
64+
65+
Deep Code supports multimodal, but `deepseek-v4` does not support multimodal yet. Some models have multimodal capabilities but impose strict limits on multi-turn dialogue requests. For multimodal input, we recommend using the Volcano Ark `Doubao-Seed-2.0-pro` model, which has the best integration.
66+
67+
### How to automatically send a Slack message after a task completes?
68+
69+
Write a shell notification script that calls a Slack webhook, then set the `notify` field in `~/.deepcode/settings.json` to the full path of the script. For detailed steps, refer to: https://binfer.net/share/jby5xnc-so6g
70+
71+
### Does it support Coding Plan?
72+
73+
Yes. Just set `env.BASE_URL` in `~/.deepcode/settings.json` to an OpenAI-compatible API endpoint. Take Volcano Ark's Coding Plan as an example, configure `~/.deepcode/settings.json` as follows:
74+
75+
```json
76+
{
77+
"env": {
78+
"MODEL": "ark-code-latest",
79+
"BASE_URL": "https://ark.cn-beijing.volces.com/api/coding/v3",
80+
"API_KEY": "**************"
81+
},
82+
"thinkingEnabled": true
83+
}
84+
```
85+
86+
## Getting Help
87+
- Report bugs or request features on GitHub Issues (https://github.com/lessweb/deepcode/issues)
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Deep Code
2+
3+
[Deep Code](https://marketplace.visualstudio.com/items?itemName=vegamo.deepcode-vscode) 是 Visual Studio Code 的 AI 编码助手扩展,专门为最新的 `deepseek-v4` 模型优化。
4+
5+
## 配置
6+
7+
创建 `~/.deepcode/settings.json` 文件,内容如下:
8+
9+
```json
10+
{
11+
"env": {
12+
"MODEL": "deepseek-v4-pro",
13+
"BASE_URL": "https://api.deepseek.com",
14+
"API_KEY": "sk-..."
15+
},
16+
"thinkingEnabled": true,
17+
"reasoningEffort": "max"
18+
}
19+
```
20+
21+
## 主要功能
22+
23+
### **Skills**
24+
Deep Code 支持 agent skills,允许您扩展助手的能力:
25+
26+
- **User-level Skills**:从 `~/.agents/skills/` 目录中发现并激活 skills。
27+
- **Project-level Skills**:从 `./.agents/skills/` 目录中加载项目专属 skills,并兼容旧的 `./.deepcode/skills/` 目录。
28+
29+
### **为 DeepSeek 优化**
30+
- 专门为 DeepSeek 模型性能调优。
31+
- 通过使用[上下文缓存](https://api-docs.deepseek.com/guides/kv_cache)来降低成本。
32+
- 原生支持[思考模式](https://api-docs.deepseek.com/guides/thinking_mode)和思考强度控制。
33+
34+
## 支持的模型
35+
36+
- `deepseek-v4-pro`(推荐使用)
37+
- `deepseek-v4-flash`
38+
- 任何其他 OpenAI 兼容模型
39+
40+
## 截图示例
41+
42+
![screenshot](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/deepcode_screenshot.png)
43+
44+
## Deep Code CLI
45+
46+
```bash
47+
npm install -g @vegamo/deepcode-cli
48+
```
49+
50+
![intro1](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/intro1.png)
51+
52+
> VSCode插件和CLI共享配置文件和数据,但运行时没有依赖。
53+
54+
- GitHub: https://github.com/lessweb/deepcode-cli
55+
56+
## 常见问题
57+
58+
### 如何将 Deep Code 从左侧边栏移动到右侧边栏(Secondary Side Bar)?
59+
60+
![faq1](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/faq1.gif)
61+
62+
### Deep Code是否支持理解图片?
63+
64+
Deep Code支持多模态,但目前deepseek-v4不支持多模态。有些模型虽然有多模态能力,但对多轮对话请求的限制太严。目前多模态输入推荐使用火山方舟的Doubao-Seed-2.0-pro模型,适配效果最好。
65+
66+
### 怎样在任务完成后自动给Slack发消息?
67+
68+
编写一个调用Slack webhook的Shell通知脚本,然后在`~/.deepcode/settings.json`中将`notify`字段设为该脚本的完整路径即可。详细步骤可参考:https://binfer.net/share/jby5xnc-so6g
69+
70+
### 是否支持Coding Plan?
71+
72+
支持。只要把`~/.deepcode/settings.json`的env.BASE_URL配置为OpenAI兼容的接口地址就行。以火山方舟的Coding Plan为例,`~/.deepcode/settings.json`这样配置:
73+
74+
```json
75+
{
76+
"env": {
77+
"MODEL": "ark-code-latest",
78+
"BASE_URL": "https://ark.cn-beijing.volces.com/api/coding/v3",
79+
"API_KEY": "**************"
80+
},
81+
"thinkingEnabled": true
82+
}
83+
```
84+
85+
## 获取帮助
86+
- 在 GitHub Issues 上报告错误或请求功能 (https://github.com/lessweb/deepcode/issues)
87+
88+
## 支持我们
89+
90+
如果你觉得这个插件对你有帮助,请考虑通过以下方式支持我们:
91+
92+
- 在 GitHub 上给我们一个 Star (https://github.com/lessweb/deepcode)
93+
- 向我们提交反馈和建议
94+
- 分享给你的朋友和同事
Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
# Deep Code
2+
3+
[Deep Code](https://marketplace.visualstudio.com/items?itemName=vegamo.deepcode-vscode) 是 Visual Studio Code 的 AI 编码助手扩展,专门为最新的 `deepseek-v4` 模型优化。
4+
5+
## 配置
6+
7+
创建 `~/.deepcode/settings.json` 文件,内容如下:
8+
9+
```json
10+
{
11+
"env": {
12+
"MODEL": "deepseek-v4-pro",
13+
"BASE_URL": "https://api.deepseek.com",
14+
"API_KEY": "sk-..."
15+
},
16+
"thinkingEnabled": true,
17+
"reasoningEffort": "max"
18+
}
19+
```
20+
21+
## 主要功能
22+
23+
### **Skills**
24+
Deep Code 支持 agent skills,允许您扩展助手的能力:
25+
26+
- **User-level Skills**:从 `~/.agents/skills/` 目录中发现并激活 skills。
27+
- **Project-level Skills**:从 `./.agents/skills/` 目录中加载项目专属 skills,并兼容旧的 `./.deepcode/skills/` 目录。
28+
29+
### **为 DeepSeek 优化**
30+
- 专门为 DeepSeek 模型性能调优。
31+
- 通过使用[上下文缓存](https://api-docs.deepseek.com/guides/kv_cache)来降低成本。
32+
- 原生支持[思考模式](https://api-docs.deepseek.com/guides/thinking_mode)和思考强度控制。
33+
34+
## 支持的模型
35+
36+
- `deepseek-v4-pro`(推荐使用)
37+
- `deepseek-v4-flash`
38+
- 任何其他 OpenAI 兼容模型
39+
40+
## 截图示例
41+
42+
![screenshot](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/deepcode_screenshot.png)
43+
44+
## Deep Code CLI
45+
46+
```bash
47+
npm install -g @vegamo/deepcode-cli
48+
```
49+
50+
![intro1](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/intro1.png)
51+
52+
> VSCode插件和CLI共享配置文件和数据,但运行时没有依赖。
53+
54+
- GitHub: https://github.com/lessweb/deepcode-cli
55+
56+
## 常见问题
57+
58+
### 如何将 Deep Code 从左侧边栏移动到右侧边栏(Secondary Side Bar)?
59+
60+
![faq1](https://raw.githubusercontent.com/lessweb/deepcode-cli/main/resources/faq1.gif)
61+
62+
### Deep Code是否支持理解图片?
63+
64+
Deep Code支持多模态,但目前deepseek-v4不支持多模态。有些模型虽然有多模态能力,但对多轮对话请求的限制太严。目前多模态输入推荐使用火山方舟的Doubao-Seed-2.0-pro模型,适配效果最好。
65+
66+
### 怎样在任务完成后自动给Slack发消息?
67+
68+
编写一个调用Slack webhook的Shell通知脚本,然后在`~/.deepcode/settings.json`中将`notify`字段设为该脚本的完整路径即可。详细步骤可参考:https://binfer.net/share/jby5xnc-so6g
69+
70+
### 是否支持Coding Plan?
71+
72+
支持。只要把`~/.deepcode/settings.json`的env.BASE_URL配置为OpenAI兼容的接口地址就行。以火山方舟的Coding Plan为例,`~/.deepcode/settings.json`这样配置:
73+
74+
```json
75+
{
76+
"env": {
77+
"MODEL": "ark-code-latest",
78+
"BASE_URL": "https://ark.cn-beijing.volces.com/api/coding/v3",
79+
"API_KEY": "**************"
80+
},
81+
"thinkingEnabled": true
82+
}
83+
```
84+
85+
## 获取帮助
86+
- 在 GitHub Issues 上报告错误或请求功能 (https://github.com/lessweb/deepcode/issues)
87+
88+
## 支持我们
89+
90+
如果你觉得这个插件对你有帮助,请考虑通过以下方式支持我们:
91+
92+
- 在 GitHub 上给我们一个 Star (https://github.com/lessweb/deepcode)
93+
- 向我们提交反馈和建议
94+
- 分享给你的朋友和同事

packages/vscode-ide-companion/package.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,6 @@
3434
"onStartupFinished",
3535
"onView:deepcode.chatView"
3636
],
37-
"files": [
38-
"dist/**",
39-
"assets/**",
40-
"templates/**",
41-
"LICENSE"
42-
],
4337
"contributes": {
4438
"commands": [
4539
{

resources/deepcode_screenshot.png

349 KB
Loading

resources/faq1.gif

182 KB
Loading

scripts/build-vscode-companion.js

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { spawnSync } from "node:child_process";
2-
import { cpSync, existsSync, rmSync } from "node:fs";
32
import { dirname, join } from "node:path";
43
import { fileURLToPath } from "node:url";
54

@@ -18,21 +17,14 @@ console.log(" Deep Code — Build VSCode Companion");
1817
console.log("=========================================");
1918

2019
run("npm", ["run", "build", "--workspace=@vegamo/deepcode-core"], "1/4 Build core");
21-
run("node", ["scripts/esbuild-vscode.config.js"], "2/4 Bundle extension");
2220

23-
// Copy templates from core so the extension can read them at runtime via fs
24-
const templatesSrc = join(root, "packages", "core", "templates");
25-
const templatesDest = join(root, "packages", "vscode-ide-companion", "templates");
21+
// Build webview first (Vite → dist/webview/)
22+
run("npm", ["run", "build:webview", "--workspace=deepcode-vscode"], "2/4 Build webview");
2623

27-
if (!existsSync(templatesSrc)) {
28-
console.error(`\n❌ Templates not found at ${templatesSrc}`);
29-
process.exit(1);
30-
}
31-
32-
rmSync(templatesDest, { recursive: true, force: true });
33-
cpSync(templatesSrc, templatesDest, { recursive: true, dereference: true });
34-
console.log("\n[3/4] Copied templates from core → vscode-ide-companion/templates/");
24+
// Build extension (esbuild bundle + copy templates → dist/extension.js)
25+
run("npm", ["run", "build", "--workspace=deepcode-vscode"], "3/4 Build extension");
3526

27+
// Package into .vsix for local verification
3628
run("npm", ["run", "package", "--workspace=deepcode-vscode"], "4/4 Package .vsix");
3729

3830
console.log("\n✅ VSCode companion build complete.\n\n");

scripts/clean.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ for (const pkgDir of packageDirs) {
3232

3333
// VSCode companion specific artifacts
3434
const vscodeDir = join(root, "packages", "vscode-ide-companion");
35-
rmSync(join(vscodeDir, "out"), RMRF);
36-
console.log(" rm packages/vscode-ide-companion/out/");
3735

3836
rmSync(join(vscodeDir, "templates"), RMRF);
3937
console.log(" rm packages/vscode-ide-companion/templates/");

0 commit comments

Comments
 (0)