create-tengits-app 1.1.10 → 1.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. package/package.json +1 -1
  2. package/packages/docs/DOCS_USAGE_RULES.md +100 -0
  3. package/packages/docs/node_modules/.bin/vite-pages +2 -2
  4. package/packages/docs/node_modules/.bin/vite-pages.CMD +2 -2
  5. package/packages/docs/node_modules/.bin/vite-pages.ps1 +2 -2
  6. package/packages/docs/package.json +38 -37
  7. package/packages/docs/pages/_theme.tsx +27 -4
  8. package/packages/docs/pages/dataModel/dataModel.md +6 -8
  9. package/packages/docs/CLAUDE.md +0 -179
  10. package/packages/docs/pages/requirements/miniApp//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//345/210/227/350/241/250//345/205/254/345/221/212/344/277/241/346/201/257_/345/205/254/345/221/212/345/210/227/350/241/250.md +0 -265
  11. package/packages/docs/pages/requirements/miniApp//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//345/210/227/350/241/250//345/205/254/345/221/212/344/277/241/346/201/257_/345/205/254/345/221/212/345/210/227/350/241/250_/345/216/237/345/236/213.jsx +0 -282
  12. package/packages/docs/pages/requirements/miniApp//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//346/226/260/345/242/236/343/200/201/347/274/226/350/276/221/343/200/201/350/257/246/346/203/205//345/205/254/345/221/212/344/277/241/346/201/257_/345/205/254/345/221/212/350/257/246/346/203/205.md +0 -262
  13. package/packages/docs/pages/requirements/miniApp//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//346/226/260/345/242/236/343/200/201/347/274/226/350/276/221/343/200/201/350/257/246/346/203/205//345/205/254/345/221/212/344/277/241/346/201/257_/345/205/254/345/221/212/350/257/246/346/203/205_/345/216/237/345/236/213.jsx +0 -292
  14. package/packages/docs/pages/requirements/web//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//345/210/227/350/241/250//345/205/254/345/221/212/344/277/241/346/201/257_/345/205/254/345/221/212/345/210/227/350/241/250.md +0 -198
  15. package/packages/docs/pages/requirements/web//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//345/210/227/350/241/250//345/205/254/345/221/212/344/277/241/346/201/257_/345/205/254/345/221/212/345/210/227/350/241/250_/345/216/237/345/236/213.jsx +0 -700
  16. package/packages/docs/pages/requirements/web//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//346/226/260/345/242/236/343/200/201/347/274/226/350/276/221/343/200/201/350/257/246/346/203/205//345/205/254/345/221/212/344/277/241/346/201/257_/346/226/260/345/242/236-/347/274/226/350/276/221-/350/257/246/346/203/205$.md +0 -277
  17. package/packages/docs/pages/requirements/web//345/205/254/345/205/261/344/277/241/346/201/257/347/256/241/347/220/206//346/226/260/345/242/236/343/200/201/347/274/226/350/276/221/343/200/201/350/257/246/346/203/205//345/205/254/345/221/212/344/277/241/346/201/257_/346/226/260/345/242/236-/347/274/226/350/276/221-/350/257/246/346/203/205_/345/216/237/345/236/213$.jsx +0 -781
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "create-tengits-app",
3
- "version": "1.1.10",
3
+ "version": "1.1.12",
4
4
  "description": "🚀 快速创建基于 React + Rsbuild + TypeScript + Tailwind CSS + Antd 的现代前端项目脚手架",
5
5
  "author": "",
6
6
  "license": "MIT",
@@ -0,0 +1,100 @@
1
+ ---
2
+ title: 文档框架使用规范
3
+ ---
4
+
5
+ # 文档框架使用规范
6
+
7
+ 本项目基于 **tengits-react-pages** 与 **tengits-theme-doc**,用于沉淀项目中的架构、需求、设计、数据建模、接口等文档。本文档说明如何正确在本仓库中维护文档。
8
+
9
+ ## 1. 目录结构约定
10
+
11
+ - 所有文档页面放在 `pages/` 目录下,根据类别分目录:
12
+ - `pages/home`:首页与业务共识类说明
13
+ - `pages/architectures`:架构文档
14
+ - `pages/breakdowns`:功能分解
15
+ - `pages/plans`:计划文档
16
+ - `pages/reports`:报告文档
17
+ - `pages/requirements`:需求文档
18
+ - `pages/designs`:设计文档
19
+ - `pages/dataModel`:数据建模
20
+ - `pages/api`:接口文档
21
+ - `pages/develop`:开发文档
22
+ - `pages/test`:测试文档
23
+ - `pages/meetingNotes`:会议记录
24
+ - 每个功能模块目录下**允许多层级子目录**,用于按业务线、子模块、场景进一步拆分。例如:
25
+ - `pages/requirements/miniApp/公共信息管理/列表/`
26
+ - `pages/requirements/web/公共信息管理/新增、编辑、详情/`
27
+ - 如需新增一级导航:
28
+ - 在 [`pages/_theme.tsx`](file:///d:/reactwork/TengitsCLI/packages/docs/pages/_theme.tsx) 的 `topNavs` 中新增对应配置;
29
+ - 在 `pages/` 下创建同名目录,并在其中新增入口文档。
30
+
31
+ ## 2. Markdown 文档基本规则
32
+
33
+ - 所有 `.md` / `.mdx` 文档 **必须** 在文件顶部包含 YAML 头(Front Matter)。
34
+ - 必须字段:
35
+ - `title`:文档标题,将显示在侧边导航中。
36
+ - 推荐字段:
37
+ - `order`:排序序号,数值越小越靠前,同一目录下多个文档时建议填写。
38
+
39
+ 示例:
40
+
41
+ ```yaml
42
+ ---
43
+ title: 解决方案架构说明
44
+ order: 1
45
+ ---
46
+ ```
47
+
48
+ 正文示例:
49
+
50
+ ```markdown
51
+ ---
52
+ title: 4、功能概述
53
+ ---
54
+
55
+ ## 功能概述
56
+ ...
57
+ ```
58
+
59
+ ## 3. 文件命名与组织
60
+
61
+ - 一般文档:
62
+ - 使用有含义的中文或拼音文件名,例如:`architectures.md`、`4功能概述.md`。
63
+ - 同一目录下可通过前缀数字(`1业务共识.md`、`2需求背景.md`...)配合 `order` 字段控制顺序。
64
+ - 需求文档:
65
+ - 统一遵循 [`pages/requirements/a_requirements.md`](file:///d:/reactwork/TengitsCLI/packages/docs/pages/requirements/a_requirements.md) 中定义的规范;
66
+ - 文件名要求、章节模板、术语规范等以该文档为准。
67
+ - 原型与交互稿:
68
+ - 交互原型页面可使用 `.tsx` / `.jsx` 文件,并以 `_原型` 等后缀区分,例如:`公告信息_公告列表_原型.jsx`;
69
+ - 原型文件应与对应需求文档放在相同目录下,便于关联维护。
70
+
71
+ ## 4. 新增文档的标准流程
72
+
73
+ - 确定文档归属类别(如架构、需求、设计等),在对应 `pages/` 子目录下创建文件;
74
+ - 在文件顶部添加 YAML 头,至少包含 `title` 字段,必要时增加 `order`;
75
+ - 根据该类别既有文档的结构和写法进行复制与修改,保证章节结构统一;
76
+ - 如果是需求文档,优先参考并遵循《需求文档规范》(`a_requirements.md`);
77
+ - 保存后通过 `npm run dev` 启动或刷新文档站点,校验导航展示和内容是否正确。
78
+
79
+ ## 5. 运行与构建
80
+
81
+ - 安装依赖:
82
+
83
+ ```bash
84
+ npm install
85
+ ```
86
+
87
+ - 本地开发预览文档站点:
88
+
89
+ ```bash
90
+ npm run dev
91
+ ```
92
+
93
+ - 产出构建产物:
94
+
95
+ ```bash
96
+ npm run build # 构建 SPA 应用
97
+ npm run ssr # 构建静态站点(SSG)
98
+ ```
99
+
100
+ 开发同学在新增或调整文档时,请务必遵守以上规则,保持文档结构统一、导航清晰,方便团队协同与长期维护。
@@ -6,9 +6,9 @@ case `uname` in
6
6
  esac
7
7
 
8
8
  if [ -z "$NODE_PATH" ]; then
9
- export NODE_PATH="/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules/tengits-react-pages/bin/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules/tengits-react-pages/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/node_modules"
9
+ export NODE_PATH="/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules/tengits-react-pages/bin/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules/tengits-react-pages/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/node_modules"
10
10
  else
11
- export NODE_PATH="/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules/tengits-react-pages/bin/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules/tengits-react-pages/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/node_modules:$NODE_PATH"
11
+ export NODE_PATH="/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules/tengits-react-pages/bin/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules/tengits-react-pages/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/node_modules:$NODE_PATH"
12
12
  fi
13
13
  if [ -x "$basedir/node" ]; then
14
14
  exec "$basedir/node" "$basedir/../tengits-react-pages/bin/vite-pages.js" "$@"
@@ -1,8 +1,8 @@
1
1
  @SETLOCAL
2
2
  @IF NOT DEFINED NODE_PATH (
3
- @SET "NODE_PATH=D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules\tengits-react-pages\bin\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules\tengits-react-pages\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\node_modules"
3
+ @SET "NODE_PATH=D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules\tengits-react-pages\bin\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules\tengits-react-pages\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\node_modules"
4
4
  ) ELSE (
5
- @SET "NODE_PATH=D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules\tengits-react-pages\bin\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules\tengits-react-pages\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\node_modules;%NODE_PATH%"
5
+ @SET "NODE_PATH=D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules\tengits-react-pages\bin\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules\tengits-react-pages\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\node_modules;%NODE_PATH%"
6
6
  )
7
7
  @IF EXIST "%~dp0\node.exe" (
8
8
  "%~dp0\node.exe" "%~dp0\..\tengits-react-pages\bin\vite-pages.js" %*
@@ -4,14 +4,14 @@ $basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
4
4
  $exe=""
5
5
  $pathsep=":"
6
6
  $env_node_path=$env:NODE_PATH
7
- $new_node_path="D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules\tengits-react-pages\bin\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules\tengits-react-pages\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\node_modules"
7
+ $new_node_path="D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules\tengits-react-pages\bin\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules\tengits-react-pages\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe\node_modules;D:\reactwork\TengitsCLI\node_modules\.pnpm\node_modules"
8
8
  if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
9
9
  # Fix case when both the Windows and Linux builds of Node
10
10
  # are installed in the same directory
11
11
  $exe=".exe"
12
12
  $pathsep=";"
13
13
  } else {
14
- $new_node_path="/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules/tengits-react-pages/bin/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules/tengits-react-pages/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.3_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_dxsk64ib23nvr6ox5tbuj4ul44/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/node_modules"
14
+ $new_node_path="/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules/tengits-react-pages/bin/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules/tengits-react-pages/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/tengits-react-pages@1.0.6_@babel+core@7.28.4_@babel+template@7.27.2_@types+react@18.3.18_reac_rioscrbvnnmj3kn5wf7ddlr6oe/node_modules:/mnt/d/reactwork/TengitsCLI/node_modules/.pnpm/node_modules"
15
15
  }
16
16
  if ([string]::IsNullOrEmpty($env_node_path)) {
17
17
  $env:NODE_PATH=$new_node_path
@@ -1,38 +1,39 @@
1
- {
2
- "name": "docs",
3
- "version": "1.0.2",
4
- "private": true,
5
- "type": "module",
6
- "scripts": {
7
- "start": "vite serve --host",
8
- "build": "rimraf dist && vite build --outDir dist && serve -s dist",
9
- "ssr": "rimraf dist && vite-pages ssr && serve dist"
10
- },
11
- "keywords": [],
12
- "author": "",
13
- "license": "ISC",
14
- "dependencies": {
15
- "@vitejs/plugin-react-swc": "^4.1.0",
16
- "react": "^18.2.0",
17
- "react-dom": "^18.2.0",
18
- "react-router-dom": "^6.21.3",
19
- "styled-components": "^6.1.8"
20
- },
21
- "devDependencies": {
22
- "@mdx-js/react": "^3.0.0",
23
- "@types/node": "^20.11.5",
24
- "@types/react": "^18.2.48",
25
- "@vitejs/plugin-react": "^4.2.1",
26
- "rimraf": "^5.0.5",
27
- "serve": "^14.2.1",
28
- "vite": "^5.0.12",
29
- "tengits-theme-doc": "1.0.4",
30
- "tengits-react-pages": "1.0.3",
31
- "vite-plugin-externals": "^0.6.2",
32
- "postcss": "^8.5.3",
33
- "tailwindcss": "^3.4.17",
34
- "@tailwindcss/forms": "0.5.7",
35
- "@tailwindcss/typography": "0.5.13",
36
- "tailwindcss-animate": "1.0.7"
37
- }
1
+ {
2
+ "name": "docs",
3
+ "version": "1.0.2",
4
+ "private": true,
5
+ "type": "module",
6
+ "scripts": {
7
+ "start": "vite serve --host",
8
+ "build": "rimraf dist && vite build --outDir dist && serve -s dist",
9
+ "ssr": "rimraf dist && vite-pages ssr && serve dist"
10
+ },
11
+ "keywords": [],
12
+ "author": "",
13
+ "license": "ISC",
14
+ "dependencies": {
15
+ "@ant-design/icons": "^6.1.1",
16
+ "@vitejs/plugin-react-swc": "^4.1.0",
17
+ "react": "^18.2.0",
18
+ "react-dom": "^18.2.0",
19
+ "react-router-dom": "^6.21.3",
20
+ "styled-components": "^6.1.8"
21
+ },
22
+ "devDependencies": {
23
+ "@mdx-js/react": "^3.0.0",
24
+ "@tailwindcss/forms": "0.5.7",
25
+ "@tailwindcss/typography": "0.5.13",
26
+ "@types/node": "^20.11.5",
27
+ "@types/react": "^18.2.48",
28
+ "@vitejs/plugin-react": "^4.2.1",
29
+ "postcss": "^8.5.3",
30
+ "rimraf": "^5.0.5",
31
+ "serve": "^14.2.1",
32
+ "tailwindcss": "^3.4.17",
33
+ "tailwindcss-animate": "1.0.7",
34
+ "tengits-react-pages": "1.0.6",
35
+ "tengits-theme-doc": "1.0.5",
36
+ "vite": "^5.0.12",
37
+ "vite-plugin-externals": "^0.6.2"
38
+ }
38
39
  }
@@ -8,8 +8,31 @@ export default createTheme({
8
8
  logo: <div style={{ fontSize: '20px' }}>{import.meta.env.VITE_PROJECT_NAME}</div>,
9
9
  topNavs: [
10
10
  { label: '首页', path: '/home', activeIfMatch: '/home' },
11
- { label: '产品文档', path: '/projectManage', activeIfMatch: '/projectManage' },
12
- { label: '需求文档', path: '/requirements', activeIfMatch: '/requirements' },
11
+ {
12
+ label: '架构文档',
13
+ path: '/architectures',
14
+ activeIfMatch: '/architectures',
15
+ },
16
+ {
17
+ label: '功能分解',
18
+ path: '/breakdowns',
19
+ activeIfMatch: '/breakdowns',
20
+ },
21
+ {
22
+ label: '计划文档',
23
+ path: '/plans',
24
+ activeIfMatch: '/plans',
25
+ },
26
+ {
27
+ label: '报告文档',
28
+ path: '/reports',
29
+ activeIfMatch: '/reports',
30
+ },
31
+ {
32
+ label: '需求文档',
33
+ path: '/requirements',
34
+ activeIfMatch: '/requirements'
35
+ },
13
36
  {
14
37
  label: '设计文档',
15
38
  path: '/designs',
@@ -39,12 +62,12 @@ export default createTheme({
39
62
  label: '会议记录',
40
63
  path: '/meetingNotes',
41
64
  activeIfMatch: '/meetingNotes',
42
- }
65
+ },
43
66
  ],
44
67
  sideNavs: (ctx) => {
45
68
  return defaultSideNavs(ctx, {
46
69
  groupConfig: {
47
-
70
+
48
71
  },
49
72
  })
50
73
  },
@@ -102,12 +102,12 @@ order: 2
102
102
  ### 关系与约束(Relations & Constraints)
103
103
  - 主键:`users(id)`、`user_tags(id)`
104
104
  - 唯一约束:`uniq_users_email(email)`
105
- - 外键:`fk_user_tag_relations(user_id -> users.id, tag_id -> user_tags.id)`
105
+ - 外键:`fk_user_tag_relations(user_id -) users.id, tag_id -) user_tags.id)`
106
106
  - 索引:`idx_users_created_at(created_at)`、`idx_users_email(email)`
107
107
  - 级联策略:删除用户时仅软删,不级联删除标签关系
108
108
 
109
109
  ## 索引与性能(Indexes & Performance)
110
- - 目标:用户列表查询 P95 < 300ms
110
+ - 目标:用户列表查询 P95 ( 300ms
111
111
  - 方案:覆盖索引 `idx_users_email`,添加时间维度索引 `idx_users_created_at`
112
112
  - 评估:Explain 结果与基数估算、热路径分析
113
113
 
@@ -156,13 +156,13 @@ order: 2
156
156
  ### 表与字段
157
157
  - 表名:`lower_snake_case`,示例:`user_profile`、`order_item`
158
158
  - 主键:统一为 `id`
159
- - 外键:`<ref>_id`,示例:`user_id`
159
+ - 外键:`(ref)_id`,示例:`user_id`
160
160
  - 时间:`created_at`、`updated_at`
161
161
 
162
162
  ### 约束与索引
163
- - 唯一约束:`uniq_<table>_<columns>`
164
- - 外键:`fk_<table>_<ref>`
165
- - 索引:`idx_<table>_<columns>`,覆盖/复合索引按查询设计
163
+ - 唯一约束:`uniq_(table)_(columns)`
164
+ - 外键:`fk_(table)_(ref)`
165
+ - 索引:`idx_(table)_(columns)`,覆盖/复合索引按查询设计
166
166
 
167
167
  ## 类型与字段规范
168
168
  - 文本:优先 `varchar(N)`,避免无界 `text`
@@ -221,6 +221,4 @@ order: 2
221
221
  - A:关键字段关系化,非关键/可变字段 JSON 存储
222
222
 
223
223
  ## 特殊约定
224
- - 规范、说明、索引类文档文件名以 `$` 结尾
225
- - 示例:`dataModel$.md`(目录规范/入口文档)
226
224
  - 目的:与具体领域模型说明区分,便于路由与检索
@@ -1,179 +0,0 @@
1
- # CLAUDE.md
2
-
3
- This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4
-
5
- ## 项目概述
6
-
7
- 这是一个基于 **Monorepo** 架构的 **React 文档站点项目**,专门用于"山西公众出行"项目管理文档。项目使用 `tengits-react-pages` 框架构建,支持 Markdown/MDX 文件自动生成文档页面。
8
-
9
- ## 项目结构
10
-
11
- ```
12
- /mnt/d/reactwork/shanxi/gongzhongchuxing/ # 根目录 (Monorepo)
13
- ├── packages/ # 包目录
14
- │ ├── docs/ # 文档站点 (当前项目)
15
- │ │ ├── pages/ # 页面内容 (基于文件的路由)
16
- │ │ │ ├── home/ # 首页相关文档
17
- │ │ │ ├── requirements/ # 需求文档
18
- │ │ │ ├── designs/ # 设计文档
19
- │ │ │ ├── dataModel/ # 数据建模文档
20
- │ │ │ ├── api/ # 接口文档
21
- │ │ │ ├── develop/ # 开发文档
22
- │ │ │ ├── test/ # 测试文档
23
- │ │ │ ├── meetingNotes/ # 会议记录
24
- │ │ │ ├── assets/ # 静态资源
25
- │ │ │ └── logs/ # 日志
26
- │ │ ├── styles/ # 样式文件
27
- │ │ └── ...
28
- │ ├── client/ # 客户端应用 (另一个包)
29
- │ └── server/ # 服务器端应用 (另一个包)
30
- ├── pnpm-workspace.yaml # pnpm workspace 配置
31
- └── package.json # 根项目配置
32
- ```
33
-
34
- ## 开发命令
35
-
36
- ### 在 docs 包中运行
37
- ```bash
38
- # 开发服务器 (等同于 npm run dev)
39
- npm start # 或 pnpm start (运行 vite serve)
40
-
41
- # 构建项目
42
- npm run build # 运行 vite build --outDir dist
43
-
44
- # SSR 构建
45
- npm run ssr # 运行 vite-pages ssr
46
- ```
47
-
48
- ### 使用 pnpm workspace (从根目录)
49
- ```bash
50
- # 安装所有依赖
51
- pnpm install
52
-
53
- # 启动 docs 开发服务器
54
- pnpm --filter docs start # 等同于 pnpm --filter docs dev
55
-
56
- # 构建 docs 项目
57
- pnpm --filter docs build
58
-
59
- # SSR 构建 docs 项目
60
- pnpm --filter docs ssr
61
- ```
62
-
63
- **注意**: 根目录 README.md 中提到 docs 项目使用 `pnpm dev` 命令,但在 `package.json` 中实际配置的是 `start` 脚本。两者都指向 `vite serve`。
64
-
65
- ## 架构说明
66
-
67
- ### 基于文件的页面路由
68
- - 使用 `tengits-react-pages` 框架
69
- - `pages/` 目录下的文件自动生成路由:
70
- - `文件名$.md` → `/文件名` 路由
71
- - 目录结构映射到 URL 路径
72
- - 支持 `.md`、`.mdx`、`.tsx` 文件混合使用
73
-
74
- ### 外部依赖 (CDN)
75
- - **React 18.2.0**、**React DOM 18.2.0**、**React Router DOM 6.23.1**、**antd 5.25.3**、**tengits-ui5 2.0.0** 通过 CDN 引入
76
- - CDN 链接在 `index.html` 中定义
77
- - Vite 配置在 `vite.config.ts` 的 `viteExternalsPlugin` 中声明外部依赖
78
- - 减小打包体积,提高加载速度
79
- - 还包含 `dayjs` 和本地化脚本
80
-
81
- ### 样式系统
82
- - **Tailwind CSS 3.4.17**:
83
- - 配置文件: `tailwind.config.js`
84
- - 扫描 `pages/**/*.{md,mdx,js,jsx,ts,tsx}` 文件中的类名
85
- - 包含 `tailwindcss-animate`、`@tailwindcss/forms`、`@tailwindcss/typography` 插件
86
- - 安全列表包含状态颜色和布局类名
87
- - **styled-components 6.1.8**: CSS-in-JS 解决方案
88
- - **PostCSS 8.5.3**: 配置在 `postcss.config.cjs` 中,包含 `tailwindcss` 和 `autoprefixer` 插件
89
-
90
- ### 类型声明
91
- - 外部 CDN 依赖的类型声明在 `global.d.ts` 中
92
- - 声明了 `antd` 和 `tengits-ui5` 模块
93
- - 提供基本的 TypeScript 支持,避免类型错误
94
-
95
- ### 主题和导航
96
- - 导航菜单在 `pages/_theme.tsx` 中配置
97
- - 顶部导航包含: 首页、需求文档、设计文档、数据建模、接口文档、开发文档、测试文档、会议记录
98
- - 侧边导航自动根据页面结构生成
99
-
100
- ## 重要配置文件
101
-
102
- 1. `package.json` - 项目依赖和脚本
103
- 2. `vite.config.ts` - Vite 构建配置,包含:
104
- - `tengits-react-pages` 插件配置
105
- - 外部依赖配置 (CDN)
106
- - 生产环境源映射启用
107
- 3. `pages/_theme.tsx` - 主题和导航配置
108
- 4. `tailwind.config.js` - Tailwind CSS 配置
109
- 5. `tsconfig.json` - TypeScript 配置
110
- 6. `pnpm-workspace.yaml` - Monorepo 工作区配置
111
-
112
- ## 导航结构
113
-
114
- 从 `_theme.tsx` 定义的顶部导航:
115
- - `/home` - 首页 (包含业务共识、需求背景、设计依据、功能概述等子页面)
116
- - `/requirements` - 需求文档
117
- - `/designs` - 设计文档
118
- - `/dataModel` - 数据建模
119
- - `/api` - 接口文档
120
- - `/develop` - 开发文档
121
- - `/test` - 测试文档
122
- - `/meetingNotes` - 会议记录
123
-
124
- ## 文档组织
125
-
126
- 文档按以下分类组织在 `pages/` 目录下:
127
-
128
- 1. **首页文档** (`pages/home/`): 业务共识、需求背景、设计依据、功能概述、系统用户、专业名词说明、系统流程设计
129
- 2. **需求文档** (`pages/requirements/`): 系统功能设计、PRD、需求文档
130
- 3. **设计文档** (`pages/designs/`): 设计文档、页面设计
131
- 4. **技术文档** (`pages/api/`, `pages/dataModel/`, `pages/develop/`, `pages/test/`): 接口、数据模型、开发、测试文档
132
- 5. **管理文档** (`pages/meetingNotes/`): 会议记录
133
-
134
- ## 构建优化
135
-
136
- - 生产环境生成源映射 (`sourcemap: true`)
137
- - 使用 SWC 进行 React 转换 (`@vitejs/plugin-react-swc`)
138
- - 外部依赖减少打包大小
139
- - 支持服务端渲染 (SSR) 构建
140
-
141
- ## 开发注意事项
142
-
143
- 1. **页面文件命名**: 使用 `文件名$.md` 格式生成路由
144
- - `pages/home/1业务共识$.md` → `/home/1业务共识` 路由
145
- - `pages/api/api$.md` → `/api` 路由
146
- - 目录索引文件使用 `$.mdx` 或 `$.tsx` 作为目录首页
147
-
148
- 2. **新页面添加**: 在 `pages/` 对应目录下创建 `.md` 或 `.mdx` 文件
149
- ```bash
150
- # 示例: 在 requirements 目录下添加新需求文档
151
- touch "pages/requirements/新需求$.md"
152
- ```
153
-
154
- 3. **导航更新**: 修改 `pages/_theme.tsx` 中的 `topNavs` 数组来更新顶部导航
155
-
156
- 4. **样式**: 使用 Tailwind CSS 类名或 styled-components
157
- - 全局样式在 `styles/tailwind.css` 中定义
158
- - Tailwind 配置在 `tailwind.config.js` 中
159
-
160
- 5. **内容更新**: 直接编辑对应的 Markdown 文件,开发服务器支持热重载
161
-
162
- 6. **MDX 支持**: 可以在 Markdown 中使用 React 组件
163
- ```mdx
164
- # 标题
165
-
166
- 这是 Markdown 内容
167
-
168
- <MyComponent prop="value" />
169
- ```
170
-
171
- 7. **类型定义**: TypeScript 类型定义在 `global.d.ts` 中
172
-
173
- ## Monorepo 上下文
174
-
175
- 当前项目是 `packages/docs`,位于更大的 Monorepo 中:
176
- - `packages/client` - TTOS 客户端应用
177
- - `packages/server` - 服务器端应用
178
-
179
- 使用 `pnpm --filter <包名>` 命令操作特定包。