🔧 修复: 修复文档死链,改为 pnpm 进行文档管理

This commit is contained in:
2025-08-03 17:01:50 +08:00
parent 56bdf5388d
commit cd24bca29e
6 changed files with 2097 additions and 2928 deletions

View File

@@ -8,7 +8,7 @@ on:
- 'docs/**'
- 'openapi.json'
- 'package.json'
- 'yarn.lock'
- 'pnpm-lock.yaml'
- '.github/workflows/deploy-docs.yml'
workflow_dispatch:
@@ -36,20 +36,22 @@ jobs:
- name: 设置Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
node-version: 22
cache: 'pnpm'
- name: 启用Yarn
run: corepack enable
- name: 设置pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: 安装依赖
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: 验证OpenAPI规范
run: yarn swagger:validate
run: pnpm swagger:validate
- name: 检查Markdown文档
run: yarn lint:docs
run: pnpm lint:docs
continue-on-error: true
# 构建作业
@@ -68,13 +70,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: 20
cache: 'yarn'
cache: 'pnpm'
- name: 启用Yarn
run: corepack enable
- name: 设置pnpm
uses: pnpm/action-setup@v2
with:
version: 9
- name: 安装依赖
run: yarn install --frozen-lockfile
run: pnpm install --frozen-lockfile
- name: 复制OpenAPI文件到public目录
run: |
@@ -82,7 +86,7 @@ jobs:
cp openapi.json docs/public/
- name: 构建文档
run: yarn docs:build
run: pnpm docs:build
env:
NODE_ENV: production

14
.gitignore vendored
View File

@@ -277,17 +277,11 @@ vulnerability_report.*
# npm
node_modules/
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Yarn v2+
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*
# pnpm
.pnpm-store/
# Runtime data
pids
@@ -341,8 +335,8 @@ jspm_packages/
# Output of 'npm pack'
*.tgz
# Yarn Integrity file
.yarn-integrity
# package-lock files
package-lock.json
# parcel-bundler cache
.cache

View File

@@ -56,34 +56,7 @@ python main.py
### 5. 启动服务
```bash
python main.py --reload
```
服务启动后,您可以访问:
- **API服务**: http://localhost:8000
- **API文档**: http://localhost:8000/docs
- **Redoc文档**: http://localhost:8000/redoc
## 验证安装
访问健康检查接口验证服务是否正常运行:
```bash
curl http://localhost:8000/health
```
如果一切正常,您应该看到类似以下的响应:
```json
{
"code": 200,
"message": "服务运行正常",
"data": {
"status": "healthy",
"timestamp": "2024-01-01T12:00:00Z"
}
}
python main.py
```
## 下一步

View File

@@ -1,5 +1,5 @@
{
"packageManager": "yarn@4.6.0",
"packageManager": "pnpm@9.0.0",
"name": "loveac-docs",
"version": "1.0.0",
"description": "LoveAC项目文档",

2074
pnpm-lock.yaml generated Normal file

File diff suppressed because it is too large Load Diff

2876
yarn.lock generated

File diff suppressed because it is too large Load Diff