mirror of
https://github.com/lobehub/lobe-chat.git
synced 2026-06-14 03:30:19 +00:00
🐛 fix(desktop): macos26 small icon (#9421)
* 🐛 fix(desktop): macos26 icon small
* Revert "🐛 fix(desktop): macos26 icon small"
This reverts commit 4a4b7b230c.
* ✨ 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
This commit is contained in:
@@ -6,18 +6,16 @@ alwaysApply: true
|
||||
|
||||
You are developing an open-source, modern-design AI chat framework: lobehub(previous lobe-chat).
|
||||
|
||||
support platforms:
|
||||
Supported platforms:
|
||||
|
||||
- web desktop/mobile
|
||||
- desktop(electron)
|
||||
- mobile app(react native). coming soon
|
||||
- mobile app(react native), coming soon
|
||||
|
||||
logo emoji: 🤯
|
||||
|
||||
## Project Technologies Stack
|
||||
|
||||
read [package.json](mdc:package.json) to know all npm packages you can use.
|
||||
|
||||
- Next.js 15
|
||||
- react 19
|
||||
- TypeScript
|
||||
@@ -33,6 +31,6 @@ read [package.json](mdc:package.json) to know all npm packages you can use.
|
||||
- dayjs for time library
|
||||
- lodash-es for utility library
|
||||
- TRPC for type safe backend
|
||||
- PGLite for client DB and PostgreSQL for backend DB
|
||||
- PGLite for client DB and Neon PostgreSQL for backend DB
|
||||
- Drizzle ORM
|
||||
- Vitest for testing
|
||||
|
||||
@@ -5,11 +5,11 @@ alwaysApply: false
|
||||
|
||||
# LobeChat Project Structure
|
||||
|
||||
note: some not very important files are not shown for simplicity.
|
||||
|
||||
## Complete Project Structure
|
||||
|
||||
this project use common monorepo structure. The workspace packages name use `@lobechat/` namespace.
|
||||
This project uses common monorepo structure. The workspace packages name use `@lobechat/` namespace.
|
||||
|
||||
**note**: some not very important files are not shown for simplicity.
|
||||
|
||||
```plaintext
|
||||
lobe-chat/
|
||||
@@ -28,10 +28,12 @@ lobe-chat/
|
||||
│ │ │ ├── schemas/
|
||||
│ │ │ └── repositories/
|
||||
│ ├── model-bank/
|
||||
│ │ └── src/
|
||||
│ │ └── aiModels/
|
||||
│ ├── model-runtime/
|
||||
│ │ └── src/
|
||||
│ │ ├── openai/
|
||||
│ │ └── anthropic/
|
||||
│ │ ├── core/
|
||||
│ │ └── providers/
|
||||
│ ├── types/
|
||||
│ │ └── src/
|
||||
│ │ ├── message/
|
||||
@@ -96,14 +98,14 @@ lobe-chat/
|
||||
- UI Components: `src/components`, `src/features`
|
||||
- Global providers: `src/layout`
|
||||
- Zustand stores: `src/store`
|
||||
- Client Services: `src/services/`
|
||||
- Client Services: `src/services/` cross-platform services
|
||||
- clientDB: `src/services/<domain>/client.ts`
|
||||
- serverDB: `src/services/<domain>/server.ts`
|
||||
- API Routers:
|
||||
- `src/app/(backend)/webapi` (REST)
|
||||
- `src/server/routers/{edge|lambda|async|desktop|tools}` (tRPC)
|
||||
- Server:
|
||||
- Services(can access serverDB): `src/server/services`
|
||||
- Services(can access serverDB): `src/server/services` server-used-only services
|
||||
- Modules(can't access db): `src/server/modules` (Server only Third-party Service Module)
|
||||
- Database:
|
||||
- Schema (Drizzle): `packages/database/src/schemas`
|
||||
@@ -113,8 +115,8 @@ lobe-chat/
|
||||
|
||||
## Data Flow Architecture
|
||||
|
||||
- **Browser/PWA**: React UI → Client Service → Direct Model Access → PGLite (Web WASM)
|
||||
- **Server**: React UI → Client Service → tRPC Lambda → Server Services → PostgreSQL (Remote)
|
||||
- **Web with ClientDB**: React UI → Client Service → Direct Model Access → PGLite (Web WASM)
|
||||
- **Web with ServerDB**: React UI → Client Service → tRPC Lambda → Server Services → PostgreSQL (Remote)
|
||||
- **Desktop**:
|
||||
- Cloud sync disabled: Electron UI → Client Service → tRPC Lambda → Local Server Services → PGLite (Node WASM)
|
||||
- Cloud sync enabled: Electron UI → Client Service → tRPC Lambda → Cloud Server Services → PostgreSQL (Remote)
|
||||
|
||||
@@ -29,16 +29,11 @@ alwaysApply: false
|
||||
|
||||
## Code Structure and Readability
|
||||
|
||||
- Refactor repeated logic into reusable functions.
|
||||
- Prefer object destructuring when accessing and using properties.
|
||||
- Use consistent, descriptive naming; avoid obscure abbreviations.
|
||||
- Use semantically meaningful variable, function, and class names.
|
||||
- Replace magic numbers or strings with well-named constants.
|
||||
- Keep meaningful code comments; do not remove them when applying edits. Update comments when behavior changes.
|
||||
- Ensure JSDoc comments accurately reflect the implementation.
|
||||
- Look for opportunities to simplify or modernize code with the latest JavaScript/TypeScript features where it improves clarity.
|
||||
- Defer formatting to tooling; ignore purely formatting-only issues and autofixable lint problems.
|
||||
- Respect project Prettier settings.
|
||||
|
||||
## UI and Theming
|
||||
|
||||
@@ -50,15 +45,14 @@ alwaysApply: false
|
||||
## Performance
|
||||
|
||||
- Prefer `for…of` loops to index-based `for` loops when feasible.
|
||||
- Decide whether callbacks should be debounced or throttled based on UX and performance needs.
|
||||
- Reuse existing npm packages rather than reinventing the wheel (e.g., `lodash-es/omit`).
|
||||
- Reuse existing utils inside `packages/utils` or installed npm packages rather than reinventing the wheel.
|
||||
- Query only the required columns from a database rather than selecting entire rows.
|
||||
|
||||
## Time and Consistency
|
||||
|
||||
- Instead of calling `Date.now()` multiple times, assign it to a constant once and reuse it to ensure consistency and improve readability.
|
||||
|
||||
## Some logging rules
|
||||
## Logging
|
||||
|
||||
- Never log user private information like api key, etc
|
||||
- Don't use `import { log } from 'debug'` to log messages, because it will directly log the message to the console.
|
||||
|
||||
Reference in New Issue
Block a user