chore(deps): 将包管理器从 npm 迁移到 pnpm
- docs: 更新 README 和 README_CN 中的安装说明 - build: 添加 pnpm-lock.yaml 和 .npmrc 配置 - build: 删除 package-lock.json 锁文件 - fix: 解决 peer dependency 冲突(legacy-peer-deps) - perf: pnpm 提供更快的安装速度和更小的磁盘占用 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
17
README.md
17
README.md
@@ -218,20 +218,23 @@ Build and run from source code for development or customization.
|
|||||||
git clone https://github.com/Wei-Shaw/sub2api.git
|
git clone https://github.com/Wei-Shaw/sub2api.git
|
||||||
cd sub2api
|
cd sub2api
|
||||||
|
|
||||||
# 2. Build frontend
|
# 2. Install pnpm (if not already installed)
|
||||||
|
npm install -g pnpm
|
||||||
|
|
||||||
|
# 3. Build frontend
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
pnpm install
|
||||||
npm run build
|
pnpm run build
|
||||||
# Output will be in ../backend/internal/web/dist/
|
# Output will be in ../backend/internal/web/dist/
|
||||||
|
|
||||||
# 3. Build backend with embedded frontend
|
# 4. Build backend with embedded frontend
|
||||||
cd ../backend
|
cd ../backend
|
||||||
go build -tags embed -o sub2api ./cmd/server
|
go build -tags embed -o sub2api ./cmd/server
|
||||||
|
|
||||||
# 4. Create configuration file
|
# 5. Create configuration file
|
||||||
cp ../deploy/config.example.yaml ./config.yaml
|
cp ../deploy/config.example.yaml ./config.yaml
|
||||||
|
|
||||||
# 5. Edit configuration
|
# 6. Edit configuration
|
||||||
nano config.yaml
|
nano config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -291,7 +294,7 @@ go run ./cmd/server
|
|||||||
|
|
||||||
# Frontend (with hot reload)
|
# Frontend (with hot reload)
|
||||||
cd frontend
|
cd frontend
|
||||||
npm run dev
|
pnpm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Code Generation
|
#### Code Generation
|
||||||
|
|||||||
17
README_CN.md
17
README_CN.md
@@ -218,20 +218,23 @@ docker-compose logs -f
|
|||||||
git clone https://github.com/Wei-Shaw/sub2api.git
|
git clone https://github.com/Wei-Shaw/sub2api.git
|
||||||
cd sub2api
|
cd sub2api
|
||||||
|
|
||||||
# 2. 编译前端
|
# 2. 安装 pnpm(如果还没有安装)
|
||||||
|
npm install -g pnpm
|
||||||
|
|
||||||
|
# 3. 编译前端
|
||||||
cd frontend
|
cd frontend
|
||||||
npm install
|
pnpm install
|
||||||
npm run build
|
pnpm run build
|
||||||
# 构建产物输出到 ../backend/internal/web/dist/
|
# 构建产物输出到 ../backend/internal/web/dist/
|
||||||
|
|
||||||
# 3. 编译后端(嵌入前端)
|
# 4. 编译后端(嵌入前端)
|
||||||
cd ../backend
|
cd ../backend
|
||||||
go build -tags embed -o sub2api ./cmd/server
|
go build -tags embed -o sub2api ./cmd/server
|
||||||
|
|
||||||
# 4. 创建配置文件
|
# 5. 创建配置文件
|
||||||
cp ../deploy/config.example.yaml ./config.yaml
|
cp ../deploy/config.example.yaml ./config.yaml
|
||||||
|
|
||||||
# 5. 编辑配置
|
# 6. 编辑配置
|
||||||
nano config.yaml
|
nano config.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
@@ -291,7 +294,7 @@ go run ./cmd/server
|
|||||||
|
|
||||||
# 前端(支持热重载)
|
# 前端(支持热重载)
|
||||||
cd frontend
|
cd frontend
|
||||||
npm run dev
|
pnpm run dev
|
||||||
```
|
```
|
||||||
|
|
||||||
#### 代码生成
|
#### 代码生成
|
||||||
|
|||||||
4
frontend/.npmrc
Normal file
4
frontend/.npmrc
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
legacy-peer-deps=true
|
||||||
|
# 允许运行所有包的构建脚本
|
||||||
|
# esbuild 和 vue-demi 是已知安全的包,需要 postinstall 脚本才能正常工作
|
||||||
|
ignore-scripts=false
|
||||||
10784
frontend/package-lock.json
generated
10784
frontend/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
5533
frontend/pnpm-lock.yaml
generated
5533
frontend/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user