Skip to content

Commit 7bbc69a

Browse files
authored
Merge pull request #17 from BernardXiong/dev
AI programming
2 parents 093c008 + 2af5f2e commit 7bbc69a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+3998
-1272
lines changed

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,10 @@ node_modules
44
.vscode-test/
55
*.vsix
66
package-lock.json
7+
8+
# Reference code (not included in build)
9+
ref/
10+
11+
# Auto-generated type declaration files
12+
src/vue/auto-imports.d.ts
13+
src/vue/components.d.ts

.gitlab-ci.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
image: node:22
2+
stages:
3+
- deploy
4+
5+
deploy-job: # This job runs in the deploy stage.
6+
stage: deploy # It only runs when *both* jobs in the test stage complete successfully.
7+
script:
8+
- npm config set registry https://registry.npmmirror.com
9+
- npm install -g @vscode/vsce
10+
- npm install
11+
- npm run compile
12+
- npm run package:vs
13+
- ls ./
14+
artifacts:
15+
paths:
16+
- "*.vsix" # 所有 .vsix 文件(如 dist/extension.vsix)
17+
expire_in: 1 week # 产物保留 1 周(可选,默认 30 天)
18+
environment: production
19+
when: manual # 标记为手动作业

.vscodeignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.vscode/**
22
.vscode-test/**
33
src/**
4+
ref/**
45
.gitignore
56
.yarnrc
67
vsc-extension-quickstart.md
@@ -9,7 +10,9 @@ vsc-extension-quickstart.md
910
**/*.map
1011
**/*.ts
1112
**/.vscode-test.*
13+
# Exclude all node_modules except marked
1214
**/node_modules/**
15+
!node_modules/marked/**
1316
**/.git/**
1417
**/package-lock.json
1518
**/.DS_Store

CLAUDE.md

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# CLAUDE.md
2+
3+
此文件为 Claude Code (claude.ai/code) 在本仓库中工作时提供指导。
4+
5+
## 项目概述
6+
7+
这是一个用于 RT-Thread 和 RT-Thread Smart 开发的 VS Code 扩展。该扩展遵循最小化干预 VS Code 的原则,同时允许用户使用 RT-Thread 的脚本功能进行个性化定制。
8+
9+
## 常用命令
10+
11+
### 开发相关
12+
```bash
13+
# Install dependencies
14+
npm install
15+
16+
# Build Vue frontend (required before extension build)
17+
npm run build:vue
18+
19+
# Compile TypeScript extension
20+
npm run compile
21+
22+
# Watch mode for development
23+
npm run watch
24+
25+
# Lint the code
26+
npm run lint
27+
28+
# Run tests
29+
npm run test
30+
31+
# Build extension package
32+
npm run vscode:prepublish
33+
```
34+
35+
### Vue 前端开发(在 src/vue 工作区中)
36+
```bash
37+
cd src/vue
38+
npm install
39+
npm run dev # Development server
40+
npm run build # Production build
41+
```
42+
43+
## 架构说明
44+
45+
### 扩展结构
46+
- **主入口**: `src/extension.ts` - 基于 `rtconfig.h``.vscode/workspace.json` 的存在来激活
47+
- **两种运行模式**:
48+
- **项目模式** (`isRTThread`): 包含 `rtconfig.h` 的单个 RT-Thread 项目
49+
- **工作区模式** (`isRTThreadWorksapce`): 通过 `.vscode/workspace.json` 管理的多个 BSP 项目
50+
51+
### 核心组件
52+
1. **Webviews** (`src/webviews/`): 管理基于 Vue 的 UI 面板
53+
- 设置、关于、创建项目、项目视图
54+
- 每个 webview 在 `src/vue/` 中都有对应的 Vue 应用
55+
56+
2. **项目管理** (`src/project/`):
57+
- 文件资源管理器的树形提供器
58+
- 用于视觉指示的文件装饰提供器
59+
- BSP 项目的命令执行
60+
61+
3. **终端集成** (`src/terminal.ts`):
62+
- 管理 RT-Thread 终端会话
63+
- 执行构建命令和自定义菜单命令
64+
65+
4. **虚拟环境** (`src/venv.ts`):
66+
- Windows 特定的 Python 虚拟环境设置
67+
- 管理 env 脚本安装
68+
69+
### 配置文件
70+
- **`.vscode/workspace.json`**: 多 BSP 工作区配置
71+
- **`.vscode/project.json`**: 单个项目文件结构(由 scons 生成)
72+
- **`~/.env/cfg.json`**: RT-Thread 源码路径配置
73+
- **`~/.env/tools/scripts/sdk_cfg.json`**: 工具链配置
74+
75+
### 构建系统
76+
- TypeScript 编译为 CommonJS 用于 VS Code 扩展
77+
- Vue 3 + Element Plus 前端使用 Vite 构建
78+
- 多页面 Vue 应用构建到 `out/` 目录
79+
- 通过 `smart.parallelBuidNumber` 设置支持并行构建
80+
81+
### 关键设置
82+
- `smart.menuCommands`: 自定义终端命令数组
83+
- `smart.parallelBuidNumber`: 并行构建的 CPU 核心数
84+
85+
## 重要说明
86+
87+
1. 扩展仅在 RT-Thread 项目中激活(包含 `rtconfig.h` 或工作区配置)
88+
2. Windows 系统在首次运行时需要设置 Python 虚拟环境
89+
3. 必须先构建 Vue 前端再编译扩展
90+
4. 扩展集成了 Python 扩展(`ms-python.python`
91+
5. 文件装饰器在工作区模式下标记当前活动的 BSP

0 commit comments

Comments
 (0)