u
This commit is contained in:
1 parent
f572dce2f6
commit
e99a9fb274
356 files changed
+28877
-1055
No files matched your search
@@ -14,11 +14,9 @@ g3soft-libs/
|
||||
│ └── tokens/ # 设计变量,组件库与文档站共用
|
||||
├── docs/ # 文档站(private,不发布)
|
||||
│ ├── nuxt.config.ts # Docus Layer + alias 直连 packages 源码
|
||||
│ ├── content/ # Markdown 内容(路由与导航自动生成)
|
||||
│ ├── examples/ # 可运行示例,按组件分目录
|
||||
│ ├── data/api/ # gen:api 生成的 API 数据(不要手改)
|
||||
│ └── app/components/content # Demo.vue / ApiTable.vue(可在 md 中直接使用)
|
||||
└── scripts/gen-api.mjs # 从组件源码生成 API 表格数据
|
||||
│ ├── content/ # Markdown 内容:组件正文 + 手写 API 表格
|
||||
│ ├── examples/ # 可运行示例,一个功能一个文件,按组件分目录
|
||||
│ └── app/components/content # Demo.vue(可在 md 中直接使用)
|
||||
```
|
||||
|
||||
## 环境要求
|
||||
@@ -43,7 +41,6 @@ pnpm dev
|
||||
## 构建
|
||||
|
||||
```bash
|
||||
pnpm gen:api # 从组件源码重新生成 API 数据(改了 props/events/slots 后必跑)
|
||||
pnpm build # 构建 packages/*(组件库产出 dist)
|
||||
pnpm build:docs # 构建文档站静态文件
|
||||
```
|
||||
@@ -85,5 +82,5 @@ pnpm release # 构建并发布到私库
|
||||
## 约定
|
||||
|
||||
- 组件样式**不写 `scoped`**,用 `g3-` 前缀 + BEM,颜色尺寸一律引用 `--g3-*` 变量。
|
||||
- API 表格由源码生成,**禁止手写**;改了组件记得跑 `pnpm gen:api`。
|
||||
- 示例放 `docs/examples/<组件名>/<示例名>.vue`,在 md 中用 `::demo{name="<组件名>/<示例名>"}` 引用。
|
||||
- 组件 API 文档**手写在 md 里**(Props / Events / Slots / 类型定义 / 样式变量 / 实现说明);改了 props/events/slots 记得同步改文档。
|
||||
- 示例放 `docs/examples/<组件名>/<示例名>.vue`,在 md 中用 `::demo{name="<组件名>/<示例名>"}` 引用;**一个功能一个示例**,示例里不要在 setup 顶层用 `window` / `document`(文档站是 SSR 预渲染)。
|
||||
Reference in new issue
Block a user