|
| 1 | +项目结构总览 |
| 2 | +这是一个 VSCode 扩展项目,主要用于 AI 辅助的代码提交信息生成、周报生成和代码审查。项目采用 TypeScript + React 技术栈开发。 |
| 3 | + |
| 4 | + |
| 5 | +. |
| 6 | +├── CHANGELOG.md |
| 7 | +├── CHANGELOG.zh-CN.md |
| 8 | +├── commitlint.config.mjs |
| 9 | +├── dish-ai-commit-0.6.1.vsix |
| 10 | +├── dish-ai-commit-0.6.2.vsix |
| 11 | +├── eslint.config.mjs |
| 12 | +├── i18n |
| 13 | +│ ├── en.json |
| 14 | +│ └── zh-cn.json |
| 15 | +├── images |
| 16 | +│ ├── icon.svg |
| 17 | +│ └── logo.png |
| 18 | +├── license |
| 19 | +├── package.json |
| 20 | +├── package-lock.json |
| 21 | +├── pnpm-lock.yaml |
| 22 | +├── README.cursor.md |
| 23 | +├── README.md |
| 24 | +├── README.zh-CN.md |
| 25 | +├── src |
| 26 | +│ ├── ai |
| 27 | +│ │ ├── AIProviderFactory.ts |
| 28 | +│ │ ├── providers |
| 29 | +│ │ │ ├── BaseOpenAIProvider.ts |
| 30 | +│ │ │ ├── DashScopeProvider.ts |
| 31 | +│ │ │ ├── DeepseekAIProvider.ts |
| 32 | +│ │ │ ├── DoubaoProvider.ts |
| 33 | +│ │ │ ├── GeminiAIProvider.ts |
| 34 | +│ │ │ ├── OllamaProvider.ts |
| 35 | +│ │ │ ├── OpenAIProvider.ts |
| 36 | +│ │ │ ├── VscodeProvider.ts |
| 37 | +│ │ │ └── ZhipuAIProvider.ts |
| 38 | +│ │ ├── types.ts |
| 39 | +│ │ └── utils |
| 40 | +│ │ └── generateHelper.ts |
| 41 | +│ ├── commands |
| 42 | +│ │ ├── BaseCommand.ts |
| 43 | +│ │ ├── GenerateCommitCommand.ts |
| 44 | +│ │ ├── GenerateWeeklyReportCommand.ts |
| 45 | +│ │ ├── ReviewCodeCommand.ts |
| 46 | +│ │ └── SelectModelCommand.ts |
| 47 | +│ ├── commands.ts |
| 48 | +│ ├── config |
| 49 | +│ │ ├── ConfigGenerator.ts |
| 50 | +│ │ ├── ConfigSchema.ts |
| 51 | +│ │ ├── ConfigurationManager.ts |
| 52 | +│ │ ├── DefaultConfig.ts |
| 53 | +│ │ ├── generated |
| 54 | +│ │ │ └── configKeys.ts |
| 55 | +│ │ └── types.ts |
| 56 | +│ ├── constants.ts |
| 57 | +│ ├── extension.ts |
| 58 | +│ ├── prompt |
| 59 | +│ │ ├── codeReview.ts |
| 60 | +│ │ ├── prompt.ts |
| 61 | +│ │ └── weeklyReport.ts |
| 62 | +│ ├── scm |
| 63 | +│ │ ├── AuthorService.ts |
| 64 | +│ │ ├── CommitLogStrategy.ts |
| 65 | +│ │ ├── GitProvider.ts |
| 66 | +│ │ ├── SCMProvider.ts |
| 67 | +│ │ ├── SvnProvider.ts |
| 68 | +│ │ └── SvnUtils.ts |
| 69 | +│ ├── scripts |
| 70 | +│ │ └── updateConfig.ts |
| 71 | +│ ├── services |
| 72 | +│ │ ├── ModelPickerService.ts |
| 73 | +│ │ └── weeklyReport.ts |
| 74 | +│ ├── types |
| 75 | +│ │ └── weeklyReport.ts |
| 76 | +│ ├── utils |
| 77 | +│ │ ├── date |
| 78 | +│ │ │ ├── date.md |
| 79 | +│ │ │ ├── DateUtils.ts |
| 80 | +│ │ │ └── index.ts |
| 81 | +│ │ ├── diff |
| 82 | +│ │ │ ├── DiffFormatter.ts |
| 83 | +│ │ │ ├── diff.md |
| 84 | +│ │ │ ├── DiffSimplifier.ts |
| 85 | +│ │ │ ├── DiffSplitter.ts |
| 86 | +│ │ │ ├── index.ts |
| 87 | +│ │ │ └── types.ts |
| 88 | +│ │ ├── i18n |
| 89 | +│ │ │ ├── i18n.md |
| 90 | +│ │ │ ├── index.ts |
| 91 | +│ │ │ └── LocalizationManager.ts |
| 92 | +│ │ ├── index.ts |
| 93 | +│ │ ├── notification |
| 94 | +│ │ │ ├── index.ts |
| 95 | +│ │ │ ├── NotificationManager.ts |
| 96 | +│ │ │ ├── notification.md |
| 97 | +│ │ │ ├── NotificationTypes.ts |
| 98 | +│ │ │ └── ProgressHandler.ts |
| 99 | +│ │ ├── review |
| 100 | +│ │ │ ├── CodeReviewReportGenerator.ts |
| 101 | +│ │ │ ├── index.ts |
| 102 | +│ │ │ └── review.md |
| 103 | +│ │ └── webview |
| 104 | +│ │ ├── index.ts |
| 105 | +│ │ ├── webview.md |
| 106 | +│ │ └── webview.ts |
| 107 | +│ ├── webview |
| 108 | +│ │ ├── config |
| 109 | +│ │ │ └── ModelConfigurationManager.ts |
| 110 | +│ │ ├── handlers |
| 111 | +│ │ │ └── WeeklyReportMessageHandler.ts |
| 112 | +│ │ ├── providers |
| 113 | +│ │ │ └── WeeklyReportViewProvider.ts |
| 114 | +│ │ ├── services |
| 115 | +│ │ │ └── WeeklyReportGenerator.ts |
| 116 | +│ │ └── WeeklyReportPanel.ts |
| 117 | +│ └── webview-ui |
| 118 | +│ ├── components.json |
| 119 | +│ ├── eslint.config.js |
| 120 | +│ ├── index.html |
| 121 | +│ ├── package.json |
| 122 | +│ ├── pnpm-lock.yaml |
| 123 | +│ ├── postcss.config.js |
| 124 | +│ ├── src |
| 125 | +│ │ ├── App.css |
| 126 | +│ │ ├── App.tsx |
| 127 | +│ │ ├── components |
| 128 | +│ │ │ ├── DateRangeSelector.tsx |
| 129 | +│ │ │ ├── Editor.tsx |
| 130 | +│ │ │ └── ui |
| 131 | +│ │ │ ├── accordion.tsx |
| 132 | +│ │ │ ├── alert-dialog.tsx |
| 133 | +│ │ │ ├── alert.tsx |
| 134 | +│ │ │ ├── aspect-ratio.tsx |
| 135 | +│ │ │ ├── avatar.tsx |
| 136 | +│ │ │ ├── badge.tsx |
| 137 | +│ │ │ ├── breadcrumb.tsx |
| 138 | +│ │ │ ├── button.tsx |
| 139 | +│ │ │ ├── calendar.tsx |
| 140 | +│ │ │ ├── card.tsx |
| 141 | +│ │ │ ├── carousel.tsx |
| 142 | +│ │ │ ├── chart.tsx |
| 143 | +│ │ │ ├── checkbox.tsx |
| 144 | +│ │ │ ├── collapsible.tsx |
| 145 | +│ │ │ ├── command.tsx |
| 146 | +│ │ │ ├── context-menu.tsx |
| 147 | +│ │ │ ├── dialog.tsx |
| 148 | +│ │ │ ├── drawer.tsx |
| 149 | +│ │ │ ├── dropdown-menu.tsx |
| 150 | +│ │ │ ├── form.tsx |
| 151 | +│ │ │ ├── hover-card.tsx |
| 152 | +│ │ │ ├── input-otp.tsx |
| 153 | +│ │ │ ├── input.tsx |
| 154 | +│ │ │ ├── label.tsx |
| 155 | +│ │ │ ├── menubar.tsx |
| 156 | +│ │ │ ├── navigation-menu.tsx |
| 157 | +│ │ │ ├── pagination.tsx |
| 158 | +│ │ │ ├── popover.tsx |
| 159 | +│ │ │ ├── progress.tsx |
| 160 | +│ │ │ ├── radio-group.tsx |
| 161 | +│ │ │ ├── resizable.tsx |
| 162 | +│ │ │ ├── scroll-area.tsx |
| 163 | +│ │ │ ├── select.tsx |
| 164 | +│ │ │ ├── separator.tsx |
| 165 | +│ │ │ ├── sheet.tsx |
| 166 | +│ │ │ ├── skeleton.tsx |
| 167 | +│ │ │ ├── slider.tsx |
| 168 | +│ │ │ ├── sonner.tsx |
| 169 | +│ │ │ ├── switch.tsx |
| 170 | +│ │ │ ├── table.tsx |
| 171 | +│ │ │ ├── tabs.tsx |
| 172 | +│ │ │ ├── textarea.tsx |
| 173 | +│ │ │ ├── toaster.tsx |
| 174 | +│ │ │ ├── toast.tsx |
| 175 | +│ │ │ ├── toggle-group.tsx |
| 176 | +│ │ │ ├── toggle.tsx |
| 177 | +│ │ │ └── tooltip.tsx |
| 178 | +│ │ ├── constants.ts |
| 179 | +│ │ ├── contexts |
| 180 | +│ │ │ └── ExtensionContext.tsx |
| 181 | +│ │ ├── hooks |
| 182 | +│ │ │ └── use-toast.ts |
| 183 | +│ │ ├── index.css |
| 184 | +│ │ ├── lib |
| 185 | +│ │ │ ├── constants.ts |
| 186 | +│ │ │ ├── utils.ts |
| 187 | +│ │ │ └── vscode.ts |
| 188 | +│ │ ├── main.tsx |
| 189 | +│ │ ├── types |
| 190 | +│ │ │ └── vscode.d.ts |
| 191 | +│ │ └── vite-env.d.ts |
| 192 | +│ ├── tailwind.config.js |
| 193 | +│ ├── tsconfig.app.json |
| 194 | +│ ├── tsconfig.app.tsbuildinfo |
| 195 | +│ ├── tsconfig.json |
| 196 | +│ ├── tsconfig.node.json |
| 197 | +│ ├── tsconfig.node.tsbuildinfo |
| 198 | +│ └── vite.config.ts |
| 199 | +├── tsconfig.json |
| 200 | +├── vsc-extension-quickstart.md |
| 201 | +└── webview-ui-dist |
| 202 | + ├── index.css |
| 203 | + ├── index.html |
| 204 | + └── index.js |
| 205 | + |
| 206 | +36 directories, 164 files |
| 207 | +首先看顶层目录的组织方式: |
| 208 | +1. 基础配置文件 - package.json, tsconfig.json 等用于项目配置 |
| 209 | +2. 文档文件 - README.md 及其国际化版本 |
| 210 | +3. src/ - 主要源代码目录 |
| 211 | +4. webview-ui-dist/ - 编译后的 WebView UI 文件 |
| 212 | +5. i18n/ - 国际化资源文件 |
| 213 | + |
| 214 | +项目采用 TypeScript 开发,使用了现代前端工具链。从目录结构可以看出这是一个功能完整的 VS Code 扩展,包含: |
| 215 | +- AI 辅助功能 (src/ai/) |
| 216 | +- 命令系统 (src/commands/) |
| 217 | +- 配置管理 (src/config/) |
| 218 | +- 源代码管理集成 (src/scm/) |
| 219 | +- WebView UI (src/webview-ui/) |
| 220 | +顶级目录重要文件: |
| 221 | +package.json: 项目的 NPM 配置文件,定义了项目依赖和 VS Code 扩展配置 |
| 222 | +tsconfig.json: TypeScript 编译配置 |
| 223 | +README.md/README.zh-CN.md: 项目文档及其中文版本 |
| 224 | +CHANGELOG.md/CHANGELOG.zh-CN.md: 版本变更记录 |
| 225 | +i18n: 国际化资源文件目录 |
| 226 | +src 目录 - 主要源代码: |
| 227 | +ai/: AI 相关实现 |
| 228 | + |
| 229 | +providers/: 不同 AI 服务提供商的实现 |
| 230 | +AIProviderFactory.ts: AI 提供商工厂类 |
| 231 | +types.ts: AI 相关类型定义 |
| 232 | +commands/: VS Code 命令实现 |
| 233 | + |
| 234 | +BaseCommand.ts: 基础命令类 |
| 235 | +GenerateCommitCommand.ts: 生成提交信息命令 |
| 236 | +GenerateWeeklyReportCommand.ts: 生成周报命令 |
| 237 | +ReviewCodeCommand.ts: 代码审查命令 |
| 238 | +SelectModelCommand.ts: 选择 AI 模型命令 |
| 239 | +config/: 配置管理 |
| 240 | + |
| 241 | +ConfigSchema.ts: 配置模式定义 |
| 242 | +ConfigurationManager.ts: 配置管理器 |
| 243 | +generated/configKeys.ts: 生成的配置键常量 |
| 244 | +scm/: 源代码管理集成 |
| 245 | + |
| 246 | +GitProvider.ts: Git 集成 |
| 247 | +SvnProvider.ts: SVN 集成 |
| 248 | +SCMProvider.ts: SCM 提供商接口 |
| 249 | +utils/: 工具函数 |
| 250 | + |
| 251 | +date/: 日期处理 |
| 252 | +diff/: 差异比较 |
| 253 | +i18n: 国际化 |
| 254 | +notification/: 通知管理 |
| 255 | +review/: 代码审查 |
| 256 | +webview/: WebView 相关 |
| 257 | +webview-ui/ 目录 - WebView UI 实现: |
| 258 | +使用 React + TypeScript 构建 |
| 259 | +包含多个UI组件 |
| 260 | +使用 Tailwind CSS 进行样式管理 |
| 261 | +完整的构建配置 |
| 262 | +项目特点: |
| 263 | +完善的国际化支持 |
| 264 | +模块化的架构设计 |
| 265 | +丰富的工具函数支持 |
| 266 | +规范的代码组织 |
| 267 | +完整的构建和发布流程 |
| 268 | + |
| 269 | +3. 主要功能模块 |
| 270 | +3.1 AI 集成模块 (src/ai/) |
| 271 | +支持多种 AI 提供商:OpenAI、Gemini、DashScope、DeepSeek、ZhipuAI 等 |
| 272 | +使用工厂模式管理不同 AI 提供商 |
| 273 | +统一的接口定义和类型系统 |
| 274 | +3.2 命令模块 (src/commands/) |
| 275 | +生成代码提交信息 |
| 276 | +生成周报 |
| 277 | +代码审查 |
| 278 | +AI 模型选择 |
| 279 | +3.3 源代码管理模块 (src/scm/) |
| 280 | +支持 Git 和 SVN 两种版本控制系统 |
| 281 | +统一的 SCM 提供商接口 |
| 282 | +版本控制相关操作封装 |
| 283 | +3.4 配置管理 (src/config/) |
| 284 | +扩展配置管理 |
| 285 | +默认配置提供 |
| 286 | +配置模式定义 |
| 287 | +3.5 WebView UI (src/webview-ui/) |
| 288 | +基于 React + TypeScript |
| 289 | +使用 Vite 作为构建工具 |
| 290 | +现代化 UI 组件库 |
| 291 | +支持主题切换 |
| 292 | +响应式设计 |
| 293 | +4. 技术特点 |
| 294 | +架构设计 |
| 295 | +模块化架构 |
| 296 | +工厂模式 |
| 297 | +依赖注入 |
| 298 | +面向接口编程 |
| 299 | +技术栈 |
| 300 | +TypeScript |
| 301 | +React |
| 302 | +Vite |
| 303 | +Tailwind CSS |
| 304 | +VSCode Extension API |
| 305 | +代码质量 |
| 306 | +ESLint 代码检查 |
| 307 | +TypeScript 类型检查 |
| 308 | +统一的代码风格 |
| 309 | +国际化 |
| 310 | +支持多语言(中英文文档) |
| 311 | +本地化管理器 |
0 commit comments