Skip to content

Commit 6856910

Browse files
authored
Merge pull request #549 from ThinkInAIXYZ/dev
0.2.4 release
2 parents af98026 + 2306f3a commit 6856910

File tree

129 files changed

+6410
-1211
lines changed

Some content is hidden

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

129 files changed

+6410
-1211
lines changed

.cursor/rules/build-deploy.mdc

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 16 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,26 @@
11
---
22
description:
33
globs:
4-
alwaysApply: false
4+
alwaysApply: true
55
---
66
# 开发环境设置指南
7+
- 使用 OxLint 进行代码检查
8+
- 使用 pnpm 包管理
9+
- Log和注释使用英文书写
10+
- Node.js >= 22
11+
- pnpm >= 9
712

8-
## 环境要求
9-
- Node.js 16+
10-
- npm 7+
11-
- Git
13+
# install
14+
`pnpm install`
1215

13-
## 开发工具
14-
- VS Code(推荐)
15-
- Vue DevTools
16-
- Electron DevTools
16+
# lint
17+
`pnpm run lint`
1718

18-
## 开发环境设置步骤
19+
# format
20+
`pnpm run format`
1921

20-
1. 安装依赖:
21-
```bash
22-
npm install
23-
```
22+
# dev
23+
`pnpm run dev`
2424

25-
2. 开发模式启动:
26-
```bash
27-
npm run dev
28-
```
29-
30-
3. 构建应用:
31-
```bash
32-
npm run build
33-
```
34-
35-
## 开发规范
36-
37-
1. 代码风格
38-
- 使用 ESLint 进行代码检查
39-
- 使用 Prettier 进行代码格式化
40-
- 遵循 [.eslintrc.cjs](mdc:.eslintrc.cjs) 中的规则
41-
- 遵循 [.prettierrc.yaml](mdc:.prettierrc.yaml) 中的格式化规则
42-
43-
2. Git 提交规范
44-
- 遵循 [CONTRIBUTING.md](mdc:CONTRIBUTING.md) 中的提交规范
45-
- 使用语义化提交信息
46-
47-
3. 测试规范
48-
- 编写单元测试
49-
- 运行测试:`npm run test`
50-
51-
4. 文档规范
52-
- 更新相关文档
53-
- 保持 README 文件的最新状态
25+
# build
26+
`pnpm run build`

.github/workflows/build.yml

Lines changed: 69 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -28,25 +28,43 @@ jobs:
2828
platform: win-arm64
2929
steps:
3030
- uses: actions/checkout@v4
31+
3132
- name: Setup Node.js
3233
uses: actions/setup-node@v4
3334
with:
34-
node-version: '22'
35+
node-version: '22.13.1'
36+
37+
- name: Setup pnpm
38+
uses: pnpm/action-setup@v2
39+
with:
40+
version: 10.12.1
41+
3542
- name: Install dependencies
36-
run: npm install
43+
run: pnpm install
44+
45+
- name: Configure pnpm workspace for Windows ${{ matrix.arch }}
46+
run: pnpm run install:sharp
3747
env:
48+
TARGET_OS: win32
49+
TARGET_ARCH: ${{ matrix.arch }}
50+
51+
- name: Install dependencies
52+
run: pnpm install
53+
env:
54+
npm_config_build_from_source: true
3855
npm_config_platform: win32
3956
npm_config_arch: ${{ matrix.arch }}
57+
4058
- name: Install Node Runtime
41-
run: npm run installRuntime:win:${{ matrix.arch }}
42-
- name: Install Sharp
43-
run: npm install sharp --build-from-source
59+
run: pnpm run installRuntime:win:${{ matrix.arch }}
60+
4461
- name: Build Windows
45-
run: npm run build:win:${{ matrix.arch }}
62+
run: pnpm run build:win:${{ matrix.arch }}
4663
env:
4764
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
4865
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
4966
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
67+
5068
- name: Upload artifacts
5169
uses: actions/upload-artifact@v4
5270
with:
@@ -67,25 +85,39 @@ jobs:
6785
platform: linux-x64
6886
steps:
6987
- uses: actions/checkout@v4
88+
7089
- name: Setup Node.js
7190
uses: actions/setup-node@v4
7291
with:
73-
node-version: '22'
92+
node-version: '22.13.1'
93+
94+
- name: Setup pnpm
95+
uses: pnpm/action-setup@v2
96+
with:
97+
version: 10.12.1
98+
7499
- name: Install dependencies
75-
run: npm install
100+
run: pnpm install
101+
102+
- name: Configure pnpm workspace for Linux ${{ matrix.arch }}
103+
run: pnpm run install:sharp
76104
env:
77-
npm_config_platform: linux
78-
npm_config_arch: ${{ matrix.arch }}
105+
TARGET_OS: linux
106+
TARGET_ARCH: ${{ matrix.arch }}
107+
108+
- name: Install dependencies
109+
run: pnpm install
110+
79111
- name: Install Node Runtime
80-
run: npm run installRuntime:linux:${{ matrix.arch }}
81-
- name: Install Sharp
82-
run: npm install --cpu=wasm32 sharp
112+
run: pnpm run installRuntime:linux:${{ matrix.arch }}
113+
83114
- name: Build Linux
84-
run: npm run build:linux:${{ matrix.arch }}
115+
run: pnpm run build:linux:${{ matrix.arch }}
85116
env:
86117
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
87118
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
88119
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
120+
89121
- name: Upload artifacts
90122
uses: actions/upload-artifact@v4
91123
with:
@@ -107,21 +139,34 @@ jobs:
107139
platform: mac-arm64
108140
steps:
109141
- uses: actions/checkout@v4
142+
110143
- name: Setup Node.js
111144
uses: actions/setup-node@v4
112145
with:
113-
node-version: '22'
146+
node-version: '22.13.1'
147+
148+
- name: Setup pnpm
149+
uses: pnpm/action-setup@v2
150+
with:
151+
version: 10.12.1
152+
114153
- name: Install dependencies
115-
run: npm install
154+
run: pnpm install
155+
156+
- name: Configure pnpm workspace for macOS ${{ matrix.arch }}
157+
run: pnpm run install:sharp
116158
env:
117-
npm_config_platform: darwin
118-
npm_config_arch: ${{ matrix.arch }}
159+
TARGET_OS: darwin
160+
TARGET_ARCH: ${{ matrix.arch }}
161+
162+
- name: Install dependencies
163+
run: pnpm install
164+
119165
- name: Install Node Runtime
120-
run: npm run installRuntime:mac:${{ matrix.arch }}
121-
- name: Install Sharp
122-
run: npm i --cpu=${{ matrix.arch }} --os=darwin sharp
166+
run: pnpm run installRuntime:mac:${{ matrix.arch }}
167+
123168
- name: Build Mac
124-
run: npm run build:mac:${{ matrix.arch }}
169+
run: pnpm run build:mac:${{ matrix.arch }}
125170
env:
126171
CSC_LINK: ${{ secrets.DEEPCHAT_CSC_LINK }}
127172
CSC_KEY_PASSWORD: ${{ secrets.DEEPCHAT_CSC_KEY_PASS }}
@@ -132,6 +177,8 @@ jobs:
132177
VITE_GITHUB_CLIENT_ID: ${{ secrets.DC_GITHUB_CLIENT_ID }}
133178
VITE_GITHUB_CLIENT_SECRET: ${{ secrets.DC_GITHUB_CLIENT_SECRET }}
134179
VITE_GITHUB_REDIRECT_URI: ${{ secrets.DC_GITHUB_REDIRECT_URI }}
180+
NODE_OPTIONS: '--max-old-space-size=4096'
181+
135182
- name: Upload artifacts
136183
uses: actions/upload-artifact@v4
137184
with:

.github/workflows/prcheck.yml

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,36 @@ jobs:
1414
arch: [x64]
1515
include:
1616
- arch: x64
17-
platform: win-x64
1817
steps:
1918
- uses: actions/checkout@v4
19+
2020
- name: Setup Node.js
2121
uses: actions/setup-node@v4
2222
with:
23-
node-version: '22'
23+
node-version: '22.13.1'
24+
25+
- name: Setup pnpm
26+
uses: pnpm/action-setup@v2
27+
with:
28+
version: 10.12.1
29+
2430
- name: Install dependencies
25-
run: npm install
31+
run: pnpm install
32+
33+
- name: Configure pnpm workspace for Linux ${{ matrix.arch }}
34+
run: pnpm run install:sharp
2635
env:
27-
npm_config_platform: linux
28-
npm_config_arch: ${{ matrix.arch }}
29-
- name: Install Sharp
30-
run: npm install --cpu=wasm32 sharp
31-
- name: Build
32-
run: npm run build
36+
TARGET_OS: linux
37+
TARGET_ARCH: ${{ matrix.arch }}
38+
39+
- name: Install dependencies
40+
run: pnpm install
41+
42+
- name: Check Lint
43+
run: pnpm run lint
3344

3445
- name: Check translations
35-
run: npm run i18n && npm run i18n:en
46+
run: pnpm run i18n
47+
48+
- name: Build
49+
run: pnpm run build

.oxlintrc.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"ignorePatterns": [
3+
"**/node_modules",
4+
"**/dist",
5+
"**/out",
6+
".gitignore",
7+
".github",
8+
".cursor",
9+
".vscode",
10+
"build",
11+
"resources",
12+
"scripts",
13+
"runtime",
14+
"docs",
15+
"test"
16+
]
17+
}

.prettierignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,18 @@ tsconfig.json
66
tsconfig.*.json
77
CONTRIBUTING*.md
88
README*.md
9+
docs
10+
resources
11+
runtime
12+
scripts
13+
build
14+
*.yaml
15+
tailwind.config.js
16+
vitest.config.*
17+
Dockerfile*
18+
.env*
19+
src/renderer/src/components/ui/*
20+
.github
21+
.cursor
22+
.vscode
23+
electron.vite.config.ts

CONTRIBUTING.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
2020
- Code submitted to the `dev` branch must ensure:
2121
- Basic functionality works
2222
- No compilation errors
23-
- Project can start normally with `npm run dev`
23+
- Project can start normally with `pnpm run dev`
2424

2525
#### Major Features or Refactoring
2626

@@ -84,12 +84,13 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
8484
4. Install project dependencies:
8585

8686
```bash
87-
npm install
87+
pnpm install
88+
pnpm run installRuntime
8889
```
8990

9091
5. Start the development server:
9192
```bash
92-
npm run dev
93+
pnpm run dev
9394
```
9495

9596
## Project Structure
@@ -109,8 +110,9 @@ We use GitHub to host code, to track issues and feature requests, as well as acc
109110
Please ensure your code follows our style guidelines by running:
110111

111112
```bash
112-
npm run build
113-
npm run i18n
113+
pnpm run lint
114+
pnpm run build
115+
pnpm run i18n
114116
```
115117

116118
## Pull Request Process

CONTRIBUTING.zh.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
- 提交到 `dev` 分支的代码必须确保:
2121
- 功能基本正常
2222
- 无编译错误
23-
- 至少能够 `npm run dev` 正常启动
23+
- 至少能够 `pnpm run dev` 正常启动
2424

2525
#### 大型功能新增或重构
2626

@@ -84,13 +84,13 @@
8484
4. 安装项目依赖:
8585

8686
```bash
87-
npm install
88-
npm run installRuntime
87+
pnpm install
88+
pnpm run installRuntime
8989
```
9090

9191
5. 启动开发服务器:
9292
```bash
93-
npm run dev
93+
pnpm run dev
9494
```
9595

9696
## 项目结构
@@ -110,8 +110,9 @@ npm run dev
110110
请确保您的代码符合我们的代码风格指南,可以运行以下命令:
111111

112112
```bash
113-
npm run build
114-
npm run i18n
113+
pnpm run lint
114+
pnpm run i18n
115+
pnpm run build
115116
```
116117

117118
## Pull Request 流程

0 commit comments

Comments
 (0)