Files
bun-app-template/docs/user/usage.md
lanyuanxiaoyao 763d814543 docs: 引入分层文档体系,删除 DEVELOPMENT.md
建立 docs/user/ 和 docs/development/ 分层文档结构:
- docs/README.md 文档总路由、归属矩阵、影响分析规则
- docs/user/ 模板使用、配置、部署、故障排查
- docs/development/ 架构、后端、前端、构建发布开发规范
- README.md 轻量化为项目入口和索引
- 删除 DEVELOPMENT.md,内容拆分至专题文档
- 更新 openspec/config.yaml 首读入口和文档影响分析规则
- 修正 docs/prompts/README.md 过时引用和边界说明
2026-05-25 19:09:08 +08:00

66 lines
1.5 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 使用模板
本文档说明如何使用本模板创建新项目。
## 1. 克隆模板
```bash
git clone <template-repo-url> my-project
cd my-project
rm -rf .git && git init
```
## 2. 配置应用信息
编辑 `src/shared/app.ts`,修改应用元信息:
```typescript
export const APP = {
name: "your-app", // 机器标识kebab-case
title: "Your App", // 人类可读标题
subtitle: "你的副标题", // 副标题
description: "应用描述", // SEO meta 描述
} as const;
```
同时修改 `package.json``name` 字段保持一致,`version` 字段管理应用版本号。
## 3. 准备配置文件
```bash
cp config.example.yaml config.yaml
```
按需编辑 `config.yaml` 中的监听地址、日志、存储路径等配置。配置文件为启动时的必传参数。
## 4. 清理 OpenSpec 历史
删除模板自带的 OpenSpec 变更历史,保留框架配置:
```bash
rm -rf openspec/specs/*
rm -rf openspec/changes/*
```
`openspec/config.yaml``openspec/schemas/fast-drive/` 需要保留,其中包含项目开发规范配置与自定义 OpenSpec workflow schema。
## 5. 安装依赖
```bash
bun install
```
## 6. 开始开发
```bash
bun run dev config.yaml
```
访问 http://127.0.0.1:5173 查看应用。
## 下一步
- [配置文件](config.md) — 了解 YAML 结构、变量语法和配置字段
- [部署文档](deploy.md) — 生产构建和运行方式
- [开发文档](../development/README.md) — 开发规范、架构和质量门禁