Skip to content

Commit 1bea460

Browse files
author
Brian Genisio
committed
merge upstream v0.8.4
2 parents 8c0550d + 0736ff2 commit 1bea460

File tree

2,353 files changed

+337718
-89938
lines changed

Some content is hidden

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

2,353 files changed

+337718
-89938
lines changed

.devcontainer/docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ services:
2020
environment:
2121
- HOST=0.0.0.0
2222
- MONGO_URI=mongodb://mongodb:27017/LibreChat
23-
# - CHATGPT_REVERSE_PROXY=http://host.docker.internal:8080/api/conversation # if you are hosting your own chatgpt reverse proxy with docker
24-
# - OPENAI_REVERSE_PROXY=http://host.docker.internal:8070/v1/chat/completions # if you are hosting your own chatgpt reverse proxy with docker
23+
# - OPENAI_REVERSE_PROXY=http://host.docker.internal:8070/v1
2524
- MEILI_HOST=http://meilisearch:7700
2625

2726
# Runs app on the same network as the service container, allows "forwardPorts" in devcontainer.json function.

.env.example

Lines changed: 248 additions & 32 deletions
Large diffs are not rendered by default.

.github/CONTRIBUTING.md

Lines changed: 41 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,14 @@ Project maintainers have the right and responsibility to remove, edit, or reject
2626

2727
## 1. Development Setup
2828

29-
1. Use Node.JS 20.x.
30-
2. Install typescript globally: `npm i -g typescript`.
31-
3. Run `npm ci` to install dependencies.
32-
4. Build the data provider: `npm run build:data-provider`.
33-
5. Build data schemas: `npm run build:data-schemas`.
34-
6. Build API methods: `npm run build:api`.
35-
7. Setup and run unit tests:
29+
1. Use Node.js v20.19.0+ or ^22.12.0 or >= 23.0.0.
30+
2. Run `npm run smart-reinstall` to install dependencies (uses Turborepo). Use `npm run reinstall` for a clean install, or `npm ci` for a fresh lockfile-based install.
31+
3. Build all compiled code: `npm run build`.
32+
4. Setup and run unit tests:
3633
- Copy `.env.test`: `cp api/test/.env.test.example api/test/.env.test`.
3734
- Run backend unit tests: `npm run test:api`.
3835
- Run frontend unit tests: `npm run test:client`.
39-
8. Setup and run integration tests:
40-
- Build client: `cd client && npm run build`.
36+
5. Setup and run integration tests:
4137
- Create `.env`: `cp .env.example .env`.
4238
- Install [MongoDB Community Edition](https://www.mongodb.com/docs/manual/administration/install-community/), ensure that `mongosh` connects to your local instance.
4339
- Run: `npx install playwright`, then `npx playwright install`.
@@ -48,11 +44,11 @@ Project maintainers have the right and responsibility to remove, edit, or reject
4844
## 2. Development Notes
4945

5046
1. Before starting work, make sure your main branch has the latest commits with `npm run update`.
51-
3. Run linting command to find errors: `npm run lint`. Alternatively, ensure husky pre-commit checks are functioning.
47+
2. Run linting command to find errors: `npm run lint`. Alternatively, ensure husky pre-commit checks are functioning.
5248
3. After your changes, reinstall packages in your current branch using `npm run reinstall` and ensure everything still works.
5349
- Restart the ESLint server ("ESLint: Restart ESLint Server" in VS Code command bar) and your IDE after reinstalling or updating.
5450
4. Clear web app localStorage and cookies before and after changes.
55-
5. For frontend changes, compile typescript before and after changes to check for introduced errors: `cd client && npm run build`.
51+
5. To check for introduced errors, build all compiled code: `npm run build`.
5652
6. Run backend unit tests: `npm run test:api`.
5753
7. Run frontend unit tests: `npm run test:client`.
5854
8. Run integration tests: `npm run e2e`.
@@ -118,48 +114,45 @@ Apply the following naming conventions to branches, labels, and other Git-relate
118114
- **JS/TS:** Directories and file names: Descriptive and camelCase. First letter uppercased for React files (e.g., `helperFunction.ts, ReactComponent.tsx`).
119115
- **Docs:** Directories and file names: Descriptive and snake_case (e.g., `config_files.md`).
120116

121-
## 7. TypeScript Conversion
117+
## 7. Coding Standards
118+
119+
For detailed coding conventions, workspace boundaries, and architecture guidance, refer to the [`AGENTS.md`](../AGENTS.md) file at the project root. It covers code style, type safety, import ordering, iteration/performance expectations, frontend rules, testing, and development commands.
120+
121+
## 8. TypeScript Conversion
122122

123123
1. **Original State**: The project was initially developed entirely in JavaScript (JS).
124124

125-
2. **Frontend Transition**:
126-
- We are in the process of transitioning the frontend from JS to TypeScript (TS).
127-
- The transition is nearing completion.
128-
- This conversion is feasible due to React's capability to intermix JS and TS prior to code compilation. It's standard practice to compile/bundle the code in such scenarios.
129-
130-
3. **Backend Considerations**:
131-
- Transitioning the backend to TypeScript would be a more intricate process, especially for an established Express.js server.
132-
133-
- **Options for Transition**:
134-
- **Single Phase Overhaul**: This involves converting the entire backend to TypeScript in one go. It's the most straightforward approach but can be disruptive, especially for larger codebases.
135-
136-
- **Incremental Transition**: Convert parts of the backend progressively. This can be done by:
137-
- Maintaining a separate directory for TypeScript files.
138-
- Gradually migrating and testing individual modules or routes.
139-
- Using a build tool like `tsc` to compile TypeScript files independently until the entire transition is complete.
140-
141-
- **Compilation Considerations**:
142-
- Introducing a compilation step for the server is an option. This would involve using tools like `ts-node` for development and `tsc` for production builds.
143-
- However, this is not a conventional approach for Express.js servers and could introduce added complexity, especially in terms of build and deployment processes.
144-
145-
- **Current Stance**: At present, this backend transition is of lower priority and might not be pursued.
146-
147-
## 8. Module Import Conventions
148-
149-
- `npm` packages first,
150-
- from shortest line (top) to longest (bottom)
151-
152-
- Followed by typescript types (pertains to data-provider and client workspaces)
153-
- longest line (top) to shortest (bottom)
154-
- types from package come first
155-
156-
- Lastly, local imports
157-
- longest line (top) to shortest (bottom)
158-
- imports with alias `~` treated the same as relative import with respect to line length
125+
2. **Frontend**: Fully transitioned to TypeScript.
159126

160-
---
127+
3. **Backend**:
128+
- The legacy Express.js server remains in `/api` as JavaScript.
129+
- All new backend code is written in TypeScript under `/packages/api`, which is compiled and consumed by `/api`.
130+
- Shared database logic lives in `/packages/data-schemas` (TypeScript).
131+
- Shared frontend/backend API types and services live in `/packages/data-provider` (TypeScript).
132+
- Minimize direct changes to `/api`; prefer adding TypeScript code to `/packages/api` and importing it.
133+
134+
## 9. Module Import Conventions
135+
136+
Imports are organized into three sections (in order):
137+
138+
1. **Package imports** — sorted from shortest to longest line length.
139+
- `react` is always the first import.
140+
- Multi-line (stacked) imports count their total character length across all lines for sorting.
141+
142+
2. **`import type` imports** — sorted from longest to shortest line length.
143+
- Package type imports come first, then local type imports.
144+
- Line length sorting resets between the package and local sub-groups.
145+
146+
3. **Local/project imports** — sorted from longest to shortest line length.
147+
- Multi-line (stacked) imports count their total character length across all lines for sorting.
148+
- Imports with alias `~` are treated the same as relative imports with respect to line length.
149+
150+
- Consolidate value imports from the same module as much as possible.
151+
- Always use standalone `import type { ... }` for type imports; never use inline `type` keyword inside value imports (e.g., `import { Foo, type Bar }` is wrong).
152+
153+
**Note:** ESLint will automatically enforce these import conventions when you run `npm run lint --fix` or through pre-commit hooks.
161154

162-
Please ensure that you adapt this summary to fit the specific context and nuances of your project.
155+
For the full set of coding standards, see [`AGENTS.md`](../AGENTS.md).
163156

164157
---
165158

0 commit comments

Comments
 (0)