chore: add Zed editor settings example, clean up configs, and improve dev guides (#13457)

### What this PR does

Before this PR:
- No Zed editor configuration example existed for contributors using Zed
- Several config files had inconsistent JSON array formatting
- `biome.jsonc` had redundant exclude rules
- Contributing guides did not reference the development guide
- `development.md` (zh) was not translated to Chinese
- Node.js and pnpm versions were hardcoded in the development guide

After this PR:
- Added `.zed/settings.json.example` with Biome formatter,
oxc/eslint/biome fixAll, and import organization
- Cleaned up redundant Biome exclude rules and unified JSON array
formatting
- Added "Setting Up Your Development Environment" section to
`CONTRIBUTING.md` (en/zh) linking to the development guide
- Added Zed editor setup guide to `development.md` (en/zh)
- Translated `docs/zh/guides/development.md` to Chinese
- Node.js version now references `.node-version`; pnpm version
references `packageManager` in `package.json`
- VSCode extensions now reference `.vscode/extensions.json`

### Why we need it and why it was done in this way

The following tradeoffs were made:
- The Zed settings file is provided as an `.example` rather than a
direct `.zed/settings.json` to avoid overriding individual contributor
preferences.
- Versions reference their source of truth files rather than being
hardcoded, so docs stay in sync automatically.

The following alternatives were considered:
- N/A

### Breaking changes

None

### Special notes for your reviewer

- The JSON formatting changes are purely cosmetic — no behavior changes.
They align with Biome's default formatting rules.
- The `.zed/settings.json.example` includes `source.fixAll.eslint` and
`source.fixAll.oxc` alongside Biome, matching the project's
triple-linter setup.

### Checklist

- [x] PR: The PR description is expressive enough and will help future
contributors
- [x] Code: [Write code that humans can
understand](https://en.wikiquote.org/wiki/Martin_Fowler#code-for-humans)
and [Keep it simple](https://en.wikipedia.org/wiki/KISS_principle)
- [x] Refactor: You have [left the code cleaner than you found it (Boy
Scout
Rule)](https://learning.oreilly.com/library/view/97-things-every/9780596809515/ch08.html)
- [x] Upgrade: Impact of this change on upgrade flows was considered and
addressed if required
- [x] Documentation: A [user-guide update](https://docs.cherry-ai.com)
was considered and is present (link) or not required. Check this only
when the PR introduces or changes a user-facing feature or behavior.
- [x] Self-review: I have reviewed my own code (e.g., via
[`/gh-pr-review`](/.claude/skills/gh-pr-review/SKILL.md), `gh pr diff`,
or GitHub UI) before requesting review from others

### Release note

```release-note
NONE
```

---------

Signed-off-by: icarus <eurfelux@gmail.com>
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Phantom
2026-03-14 18:03:54 +08:00
committed by GitHub
parent aeae3be69c
commit d676b3b39a
13 changed files with 146 additions and 75 deletions

1
.gitignore vendored
View File

@@ -58,6 +58,7 @@ local
.claude-code-router/*
.codebuddy/*
.zed/*
!.zed/settings.json.example
CLAUDE.local.md
# vitest

View File

@@ -33,11 +33,7 @@
"env": {
"browser": true
},
"files": [
"src/renderer/**/*.{ts,tsx}",
"packages/aiCore/**",
"packages/extension-table-plus/**"
]
"files": ["src/renderer/**/*.{ts,tsx}", "packages/aiCore/**", "packages/extension-table-plus/**"]
},
{
"env": {

View File

@@ -0,0 +1,70 @@
// Cherry Studio Zed Settings Example
//
// NOTE: Please install extensions: biome, oxc
//
// Folder-specific settings
//
// For a full list of overridable settings, and general information on folder-specific settings,
// see the documentation: https://zed.dev/docs/configuring-zed#settings-files
{
"languages": {
"JSON": {
"code_actions_on_format": {
"source.fixAll.biome": true
},
"format_on_save": "on",
"formatter": {
"language_server": {
"name": "biome"
}
}
},
"JSONC": {
"code_actions_on_format": {
"source.fixAll.biome": true
},
"format_on_save": "on",
"formatter": {
"language_server": {
"name": "biome"
}
}
},
"TSX": {
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.fixAll.eslint": true,
"source.fixAll.oxc": true,
"source.organizeImports.biome": true
},
"format_on_save": "on",
"formatter": {
"language_server": {
"name": "biome"
}
}
},
"TypeScript": {
"code_actions_on_format": {
"source.fixAll.biome": true,
"source.fixAll.eslint": true,
"source.fixAll.oxc": true,
"source.organizeImports.biome": true
},
"format_on_save": "on",
"formatter": {
"language_server": {
"name": "biome"
}
}
}
},
"lsp": {
"biome": {
"settings": {
"config_path": "biome.jsonc",
"require_config_file": true
}
}
}
}

View File

@@ -26,6 +26,12 @@ Here are several ways you can participate:
Please make sure you have read the [Code of Conduct](CODE_OF_CONDUCT.md) and the [LICENSE](LICENSE).
## Setting Up Your Development Environment
Please refer to the [Developer Guide](docs/en/guides/development.md) for instructions on setting up your local development environment, including prerequisites, installation steps, and available commands.
For a comprehensive overview of the project architecture, tech stack, conventions, and available commands, see [`CLAUDE.md`](CLAUDE.md).
## Getting Started
To help you get familiar with the codebase, we recommend tackling issues tagged with one or more of the following labels: [good-first-issue](https://github.com/CherryHQ/cherry-studio/labels/good%20first%20issue), [help-wanted](https://github.com/CherryHQ/cherry-studio/labels/help%20wanted), or [kind/bug](https://github.com/CherryHQ/cherry-studio/labels/kind%2Fbug). Any help is welcome.

View File

@@ -14,7 +14,7 @@
}
},
"enabled": true,
"includes": ["**/*.json", "!*.json", "!**/package.json", "!coverage/**"]
"includes": ["**/*.json", "!**/package.json", "!coverage/**"]
},
"css": {
"formatter": {
@@ -47,11 +47,8 @@
"!*.mjs",
"!*.cjs",
"!*.md",
"!*.json",
"!src/main/integration/**",
"!**/tailwind.css",
"!**/package.json",
"!.zed/**"
"!**/tailwind.css"
],
"indentStyle": "space",
"indentWidth": 2,

View File

@@ -2,9 +2,19 @@
## IDE Setup
### VSCode like
- Editor: [Cursor](https://www.cursor.com/), etc. Any VS Code compatible editor.
- Linter: [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- Formatter: [Biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome)
- Recommended extensions are listed in [`.vscode/extensions.json`](/.vscode/extensions.json).
### Zed
1. Install extensions: [Biome](https://github.com/biomejs/biome-zed), [oxc](https://github.com/oxc-project/zed-oxc)
2. Copy the example settings file to your local Zed config:
```bash
cp .zed/settings.json.example .zed/settings.json
```
3. Customize `.zed/settings.json` as needed (it is git-ignored).
## Project Setup
@@ -18,13 +28,18 @@ pnpm install
### Setup Node.js
Download and install [Node.js v22.x.x](https://nodejs.org/en/download)
The required Node.js version is defined in `.node-version`. Use a version manager like [nvm](https://github.com/nvm-sh/nvm) or [fnm](https://github.com/Schniz/fnm) to install it automatically:
```bash
nvm install
```
### Setup pnpm
The pnpm version is locked in the `packageManager` field of `package.json`. Just enable corepack and it will use the correct version automatically:
```bash
corepack enable
corepack prepare pnpm@10.27.0 --activate
```
### Install Dependencies

View File

@@ -26,6 +26,12 @@
请确保阅读了[行为准则](../../../CODE_OF_CONDUCT.md)和[LICENSE](../../../LICENSE)。
## 搭建开发环境
请参阅[开发者指南](./development.md)了解如何搭建本地开发环境,包括前置条件、安装步骤和可用命令。
关于项目架构、技术栈、代码规范和可用命令的全面概览,请参阅 [`CLAUDE.md`](../../../CLAUDE.md)。
## 开始贡献
为了让您更熟悉代码,建议您处理一些标记有以下标签之一或多个的问题:[good-first-issue](https://github.com/CherryHQ/cherry-studio/labels/good%20first%20issue)、[help-wanted](https://github.com/CherryHQ/cherry-studio/labels/help%20wanted) 或 [kind/bug](https://github.com/CherryHQ/cherry-studio/labels/kind%2Fbug)。任何帮助都会收到欢迎。

View File

@@ -1,73 +1,80 @@
# 🖥️ Develop
# 🖥️ 开发指南
## IDE Setup
## IDE 配置
- Editor: [Cursor](https://www.cursor.com/), etc. Any VS Code compatible editor.
- Linter: [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint)
- Formatter: [Biome](https://marketplace.visualstudio.com/items?itemName=biomejs.biome)
### VSCode like
## Project Setup
- 编辑器:[Cursor](https://www.cursor.com/) 等,任何 VS Code 兼容编辑器均可。
- 推荐扩展见 [`.vscode/extensions.json`](/.vscode/extensions.json)。
### Install
### Zed
1. 安装扩展:[Biome](https://github.com/biomejs/biome-zed)、[oxc](https://github.com/oxc-project/zed-oxc)
2. 复制示例配置文件到本地 Zed 配置目录:
```bash
cp .zed/settings.json.example .zed/settings.json
```
3. 按需自定义 `.zed/settings.json`(该文件已被 git 忽略)。
## 项目配置
### 安装 Node.js
项目所需的 Node.js 版本定义在 `.node-version` 文件中。推荐使用 [nvm](https://github.com/nvm-sh/nvm)、[fnm](https://github.com/Schniz/fnm) 等版本管理工具自动切换:
```bash
pnpm install
nvm install
```
### Development
### 安装 pnpm
### Setup Node.js
Download and install [Node.js v22.x.x](https://nodejs.org/en/download)
### Setup pnpm
pnpm 版本已锁定在 `package.json` 的 `packageManager` 字段中,通过 corepack 即可自动安装对应版本:
```bash
corepack enable
corepack prepare pnpm@10.27.0 --activate
```
### Install Dependencies
### 安装依赖
```bash
pnpm install
```
### ENV
### 环境变量
```bash
cp .env.example .env
```
### Start
### 启动开发
```bash
pnpm dev
```
### Debug
### 调试
```bash
pnpm debug
```
Then input chrome://inspect in browser
然后在浏览器中访问 chrome://inspect
### Test
### 测试
```bash
pnpm test
```
### Build
### 构建
```bash
# For windows
# Windows
$ pnpm build:win
# For macOS
# macOS
$ pnpm build:mac
# For Linux
# Linux
$ pnpm build:linux
```

View File

@@ -2,13 +2,7 @@
"name": "@cherrystudio/ai-sdk-provider",
"version": "0.1.5",
"description": "Cherry Studio AI SDK provider bundle with CherryIN routing.",
"keywords": [
"ai-sdk",
"provider",
"cherryin",
"vercel-ai-sdk",
"cherry-studio"
],
"keywords": ["ai-sdk", "provider", "cherryin", "vercel-ai-sdk", "cherry-studio"],
"author": "Cherry Studio",
"license": "MIT",
"homepage": "https://github.com/CherryHQ/cherry-studio",
@@ -24,9 +18,7 @@
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"dist"
],
"files": ["dist"],
"scripts": {
"build": "tsdown",
"dev": "tsc -w",

View File

@@ -14,15 +14,7 @@
"test": "vitest run",
"test:watch": "vitest"
},
"keywords": [
"ai",
"sdk",
"openai",
"anthropic",
"google",
"cherry-studio",
"vercel-ai-sdk"
],
"keywords": ["ai", "sdk", "openai", "anthropic", "google", "cherry-studio", "vercel-ai-sdk"],
"author": "Cherry Studio",
"license": "MIT",
"repository": {
@@ -58,9 +50,7 @@
"engines": {
"node": ">=18.0.0"
},
"files": [
"dist"
],
"files": ["dist"],
"exports": {
".": {
"types": "./dist/index.d.ts",

View File

@@ -3,10 +3,7 @@
"description": "table extension for tiptap forked from tiptap/extension-table",
"version": "3.0.11",
"homepage": "https://cherry-ai.com",
"keywords": [
"tiptap",
"tiptap extension"
],
"keywords": ["tiptap", "tiptap extension"],
"license": "MIT",
"type": "module",
"exports": {
@@ -62,10 +59,7 @@
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
"src",
"dist"
],
"files": ["src", "dist"],
"devDependencies": {
"@biomejs/biome": "2.2.4",
"@tiptap/core": "3.2.0",

View File

@@ -9,17 +9,14 @@
"src/renderer/src/services/traceApi.ts",
"src/renderer/src/types/*",
"packages/mcp-trace/**/*",
"packages/shared/**/*",
"packages/shared/**/*"
],
"compilerOptions": {
"composite": true,
"incremental": true,
"moduleResolution": "bundler",
"tsBuildInfoFile": ".tsbuildinfo/tsconfig.node.tsbuildinfo",
"types": [
"electron-vite/node",
"vitest/globals"
],
"types": ["electron-vite/node", "vitest/globals"],
"paths": {
"@logger": ["./src/main/services/LoggerService"],
"@main/*": ["./src/main/*"],

View File

@@ -10,7 +10,7 @@
"packages/ai-sdk-provider/**/*",
"packages/extension-table-plus/**/*",
"packages/mcp-trace/**/*",
"packages/shared/**/*",
"packages/shared/**/*"
],
"compilerOptions": {
"composite": true,