Fork
0
代码
介绍
代码
Issues
Pull Requests
流水线
Actions
讨论
Wiki
项目成员
分析
项目设置
Fork
0
bde9bde17c3edbb75d35dd1f1907e2bc9033344c
lobe-chat
/
.cursor
/
rules
下载当前目录
G
GitHub
✨ feat: email provider support resend (
#10557
)
7449b291
创建于
2025年12月2日
历史提交
文件
最后提交记录
最后更新时间
packages
📝 docs: add some cursor rules (#8338)
10 个月前
testing-guide
🐛 fix: fix duplicate tools id issue and fix link dialog issue (#9731) * add * baseline * ✅ test(store): add tests for discover store plugin and mcp slices - Add comprehensive tests for discover/slices/plugin/action.ts (15 tests) - Add comprehensive tests for discover/slices/mcp/action.ts (11 tests) - Update test-coverage.md with new metrics and completed work - Coverage: 74.24% overall (+26 tests, 2 new test files) - Action files coverage: 29/40 tested (72.5%, +2 files) Features tested: - Plugin/MCP categories, detail, identifiers, and list fetching - SWR key generation with locale and parameters - SWR configuration verification - Service integration with discoverService 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 📝 docs(testing): add SWR hooks testing guide and subagent workflow Testing Guide Updates: - Add comprehensive SWR hooks testing section with examples - Document key differences from regular action tests - Add examples for testing SWR key generation and configuration - Add examples for testing conditional fetching - Update references to include SWR hook test examples Test Coverage Guide Updates: - Add detailed subagent workflow for parallel testing - Document when and how to use subagents for testing - Add complete workflow example using subagents - Add benefits and best practices for subagent usage - Clarify that subagents should NOT commit or update docs - Add step-by-step guide for launching parallel subagents Key improvements: - Better documentation for testing SWR-based store actions - Clear workflow for efficient parallel testing using subagents - Single atomic commit strategy after all subagents complete - Improved testing efficiency and organization 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ♻️ refactor(test): fix SWR mock strategy to properly test fetcher Previously, tests were hardcoding return values instead of calling the fetcher function. This bypassed the actual service call logic. Changes: - Fix useSWR mock to call fetcher and return its Promise - Update assertions to await Promise results - Update testing guide with correct mock pattern - Add explanation of why this approach is correct Before (incorrect): ```typescript useSWRMock.mockImplementation(((key, fetcher) => { fetcher?.(); // Call but ignore result return { data: mockData }; // Hardcoded }) as any); expect(result.current.data).toEqual(mockData); ``` After (correct): ```typescript useSWRMock.mockImplementation(((key, fetcher) => { const data = fetcher?.(); // Get Promise from fetcher return { data }; // Return Promise }) as any); const resolvedData = await result.current.data; expect(resolvedData).toEqual(mockData); ``` Benefits: - ✅ Actually tests the fetcher function - ✅ Mirrors real SWR behavior (data is Promise) - ✅ Service calls are properly verified - ✅ Tests are more accurate and maintainable Updated files: - .cursor/rules/testing-guide/zustand-store-action-test.mdc - src/store/discover/slices/plugin/action.test.ts - src/store/discover/slices/mcp/action.test.ts 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * 🐛 fix(test): correct SWR mock strategy to match project standards - Remove useSWR mocking, use real SWR implementation instead - Only mock service methods (fetchers) with vi.spyOn - Use waitFor for async assertions - Update testing guide with correct SWR pattern - Add reference to src/store/chat/slices/message/action.test.ts This fixes the incorrect mocking approach from previous commits. All 13 tests pass with the corrected strategy. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ✅ test(store): add comprehensive tests for high priority action files - Add mcpStore action tests (41 tests, 624 LOC covered) - MCP plugin installation flow (normal, resume, dependencies, config) - Connection testing (HTTP and STDIO) - Plugin lifecycle management - Error handling and cancellation flows - Add fileManager action tests (35 tests, 205 LOC covered) - File upload and processing workflows - Chunk embedding and parsing - File list management and refresh - SWR data fetching Testing approach: - Used parallel subagents for efficient development - Followed zustand testing patterns from guide - Proper test layering and per-test mocking - All tests pass type-check and lint Coverage improvement: 74.24% → ~76% (+76 tests, 2 files) Action files: 29/40 → 31/40 tested (77.5%) 🏆 Milestone: All high priority files (>200 LOC) now have tests! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * ✅ test(store): complete 100% action file coverage with 160 new tests Added comprehensive tests for all remaining 9 medium-priority action files: Discovery Store (33 tests): - assistant/action.ts: 10 tests (SWR hooks, categories, detail, identifiers, list) - provider/action.ts: 11 tests (SWR hooks, detail with readme, identifiers, list with filters) - model/action.ts: 12 tests (SWR hooks, categories, detail, identifiers, list with params) Knowledge Base Store (29 tests): - crud/action.ts: 19 tests (create, update, remove, refresh, loading states, SWR hooks) - content/action.ts: 10 tests (add files, remove files, error handling) File Store (36 tests): - upload/action.ts: 18 tests (base64 upload, file upload with progress, type detection, KB integration) - chunk/action.ts: 18 tests (drawer management, highlight, semantic search) AI Infrastructure Store (23 tests): - aiModel/action.ts: 23 tests (CRUD, batch operations, remote sync, toggle enabled, SWR hooks) Chat Store (39 tests): - thread/action.ts: 39 tests (CRUD, messaging, AI title generation, validation, loading states) Testing approach: - Used 9 parallel subagents for efficient development - Followed zustand testing patterns from guide - SWR hook testing for discovery slices - Complex async flows with proper error handling - File operations with progress callbacks - Semantic search and RAG integration Coverage improvement: ~76% → ~80% (+160 tests, 9 files) Action files: 31/40 → 40/40 tested (100%) 🎉 MILESTONE: All 40 action files now have comprehensive test coverage! 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> * fix test * fix test * fix context-engine * add tests * remove * remove tools bar * pin bun version * fix --------- Co-authored-by: Claude <noreply@anthropic.com>
7 个月前
add-provider-doc.mdc
📝 docs(workflow): optimize documentation structure and development setup (#8934)
8 个月前
add-setting-env.mdc
✨ feat: add new setting for default image num (#9618)
7 个月前
cursor-rules.mdc
📝 docs: add some cursor rules (#8338)
10 个月前
db-migrations.mdc
✨ feat: support better-auth (#10215)
5 个月前
debug-usage.mdc
🔨 chore: add agent-runtime (#9206) * add agent runtime * add agent runtime * support finish reason * update workflow * 支持中断 * 支持 token usage 统计 * refactor * add example * add docs * update
8 个月前
desktop-controller-tests.mdc
⚡️ perf: refactor Typography to Text (#8250)
10 个月前
desktop-feature-implementation.mdc
⚡️ perf: refactor Typography to Text (#8250)
10 个月前
desktop-local-tools-implement.mdc
🔨 chore: pre-merge desktop implement (#7516) * update locale * update code
1 年前
desktop-menu-configuration.mdc
🐛 fix: auto sync theme mode in desktop (#7970) * auto sync theme * improve style * improve code
11 个月前
desktop-window-management.mdc
🐛 fix: auto sync theme mode in desktop (#7970) * auto sync theme * improve style * improve code
11 个月前
drizzle-schema-style-guide.mdc
📝 docs: add more cursor rules (#8047) * 📝 docs: add some more cursor rules * 📝 docs: fix greptile reported issue
11 个月前
group-chat.mdc
🔨 chore: pre-merge group chat relative implement (#9432) * pre-merge code * fix tests * fix circular * remove redirectUri * fix types * improve sql * fix docs * fix lint * update model runtime
7 个月前
i18n.mdc
🐛 fix: fix open chat page with float link modal (#9235) * refactor @lobechat/database * move config/file and llm to envs * move config/auth to envs * refactor * fix tests * fix tests * upgrade
8 个月前
project-introduce.mdc
✨ feat: email provider support resend (#10557)
5 个月前
project-structure.mdc
✨ feat: support better-auth (#10215)
5 个月前
react-component.mdc
♻️ chore: refactor router runtime (#9306)
8 个月前
rules-index.mdc
📝 docs(rules): optimize agent rules and documentation structure (#9486)
7 个月前
typescript.mdc
🐛 fix(desktop): macos26 small icon (#9421) * 🐛 fix(desktop): macos26 icon small * Revert "🐛 fix(desktop): macos26 icon small" This reverts commit 4a4b7b230cb0a471c98127417f1029dfade8bf9f. * ✨ feat(desktop): support Liquid Glass icons for macOS 26 - Add pre-generated Assets.car files for all build variants - Configure afterPack hook to copy Assets.car during build - Maintain backward compatibility with .icns fallback for older macOS Reference: https://github.com/electron-userland/electron-builder/issues/9254 * docs: optimize comments * fix: update deprecated macos-13 to macos-15-intel * docs: optimize ai rules
7 个月前
zustand-action-patterns.mdc
📝 docs: add some cursor rules (#8338)
10 个月前
zustand-slice-organization.mdc
📝 docs: add some cursor rules (#8338)
10 个月前