flowchart LR
A[VS Code: Extension Host] -- 激活/命令 --> B[extension/index.ts]
B -- 创建/管理 --> C[Webview Panel]
C -- 加载 --> D[dist/webview/index.html + assets]
D -- 与扩展通信 --> B
开发/构建流水线
sequenceDiagram
participant Dev as Developer
participant VS as VS Code
participant Task as PreLaunch Tasks
participant Bun as Bun
participant Vite as Vite/Plugin
Dev->>VS: F5 (Debug Extension)
VS->>Task: preLaunchTask: check-and-install-dependencies
Task->>Bun: bun install (必要时)
Task->>Task: bun: dev / bun: build
Task->>Vite: 统一构建扩展与 Webview
Vite-->>VS: 输出 dist/webview & dist/extension
VS-->>Dev: Extension Host 启动成功
依赖检查脚本(scripts/checkAndInstall.cjs)
功能
检查 package.json 与 node_modules
缺失依赖时优先使用 Bun 安装;否则回退 pnpm/yarn/npm
输出带 [dep-check] 前缀的日志,并提供背景任务匹配标识
关键日志
[dep-check] 未发现 node_modules,需要安装依赖。
[dep-check] 检测到缺失依赖: react, ...
[dep-check] 依赖安装完成。
[dep-check] extension build start/success
常见问题排查
tsc: command not found
解决:确保 devDependencies 含 typescript;执行 bun install 后重试构建