@wot-ui/cli 0.0.1-beta.2
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.
- package/README.md +93 -0
- package/README.zh-CN.md +74 -0
- package/data/v2.json +19827 -0
- package/data/versions.json +10 -0
- package/dist/index.d.mts +1 -0
- package/dist/index.mjs +416 -0
- package/dist/scanner-BFHnD5iE.mjs +199 -0
- package/dist/server-HjZltXBO.mjs +248 -0
- package/package.json +49 -0
- package/skills/wot-ui/SKILL.md +18 -0
package/README.md
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
# @wot-ui/cli
|
|
2
|
+
|
|
3
|
+
`@wot-ui/cli` 是面向 wot-ui 的命令行工具包,提供组件知识查询、项目分析、MCP Server 与离线数据提取能力。
|
|
4
|
+
|
|
5
|
+
## 能力概览
|
|
6
|
+
|
|
7
|
+
- 组件查询:`list`、`info`、`doc`、`demo`、`token`、`changelog`
|
|
8
|
+
- 项目分析:`doctor`、`usage`、`lint`
|
|
9
|
+
- MCP 集成:`wot mcp`
|
|
10
|
+
- 数据提取:从 `wot-ui/wot-ui` 源码生成 `data/v2.json`
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g @wot-ui/cli
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 常用命令
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
wot list
|
|
22
|
+
wot info Button
|
|
23
|
+
wot doc Button
|
|
24
|
+
wot demo Button basic
|
|
25
|
+
wot token Button
|
|
26
|
+
wot changelog
|
|
27
|
+
wot doctor ./my-app
|
|
28
|
+
wot usage ./my-app
|
|
29
|
+
wot lint ./my-app
|
|
30
|
+
wot mcp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 命令说明
|
|
34
|
+
|
|
35
|
+
- `wot list`:列出所有可用组件
|
|
36
|
+
- `wot info <Component>`:查看组件基础信息
|
|
37
|
+
- `wot doc <Component>`:输出组件 markdown 文档
|
|
38
|
+
- `wot demo <Component> [name]`:查看示例列表或示例源码
|
|
39
|
+
- `wot token [Component]`:查看 CSS 变量与默认值
|
|
40
|
+
- `wot changelog [version] [component]`:查看版本更新记录
|
|
41
|
+
- `wot doctor [dir]`:检查工程环境与依赖
|
|
42
|
+
- `wot usage [dir]`:统计 `.vue` 中的 `wd-*` 使用情况
|
|
43
|
+
- `wot lint [dir]`:运行 wot-ui 相关规则检查
|
|
44
|
+
- `wot mcp`:启动 MCP stdio Server
|
|
45
|
+
|
|
46
|
+
## 输出格式
|
|
47
|
+
|
|
48
|
+
部分命令支持:
|
|
49
|
+
|
|
50
|
+
- `--format text`
|
|
51
|
+
- `--format json`
|
|
52
|
+
- `--lang zh`
|
|
53
|
+
- `--lang en`
|
|
54
|
+
- `--version v2`
|
|
55
|
+
|
|
56
|
+
## 提取数据
|
|
57
|
+
|
|
58
|
+
使用本地已有的 wot-ui 仓库:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
pnpm extract --wot-dir ../wot-ui --output ./data/v2.json
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
如果希望直接克隆上游仓库并提取,建议在仓库根目录执行:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
pnpm extract:clone
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
提取脚本会输出当前处理阶段,包括数据源路径、扫描到的组件文档数量、解析结果与文件写入位置。
|
|
71
|
+
|
|
72
|
+
## 开发调试
|
|
73
|
+
|
|
74
|
+
在 `packages/cli` 内开发时,最方便的方式是直接运行源码:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
pnpm --filter @wot-ui/cli exec tsx src/index.ts list
|
|
78
|
+
pnpm --filter @wot-ui/cli exec tsx src/index.ts mcp
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
构建与测试命令:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
pnpm --filter @wot-ui/cli build
|
|
85
|
+
pnpm --filter @wot-ui/cli test
|
|
86
|
+
pnpm --filter @wot-ui/cli typecheck
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
## 当前边界
|
|
90
|
+
|
|
91
|
+
- 当前仅支持 `wot-ui v2`
|
|
92
|
+
- `usage` 和 `lint` 当前聚焦 `.vue` 文件
|
|
93
|
+
- CSS 变量优先从组件 SCSS 源码提取
|
package/README.zh-CN.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# @wot-ui/cli
|
|
2
|
+
|
|
3
|
+
面向 wot-ui 的 CLI、MCP 与 Skills 工具集。
|
|
4
|
+
|
|
5
|
+
## 能力概览
|
|
6
|
+
|
|
7
|
+
- 组件知识查询:`list`、`info`、`doc`、`demo`、`token`、`changelog`
|
|
8
|
+
- 本地项目分析:`doctor`、`usage`、`lint`
|
|
9
|
+
- 通过 `wot mcp` 启动 MCP stdio 服务
|
|
10
|
+
- 通过提取脚本从 wot-ui 源码生成离线元数据
|
|
11
|
+
|
|
12
|
+
## 安装
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g @wot-ui/cli
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## 命令示例
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
wot list
|
|
22
|
+
wot info Button
|
|
23
|
+
wot doc Button
|
|
24
|
+
wot demo Button basic
|
|
25
|
+
wot token Button
|
|
26
|
+
wot changelog
|
|
27
|
+
wot doctor ./my-app
|
|
28
|
+
wot usage ./my-app
|
|
29
|
+
wot lint ./my-app
|
|
30
|
+
wot mcp
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## 命令说明
|
|
34
|
+
|
|
35
|
+
- `wot list`:列出可用组件
|
|
36
|
+
- `wot info <Component>`:查看组件详情
|
|
37
|
+
- `wot doc <Component>`:输出组件 markdown 文档
|
|
38
|
+
- `wot demo <Component> [name]`:查看 demo 列表或示例源码
|
|
39
|
+
- `wot token [Component]`:查看 CSS 变量与默认值
|
|
40
|
+
- `wot changelog [version] [component]`:查看更新记录
|
|
41
|
+
- `wot doctor [dir]`:检查工程依赖与环境
|
|
42
|
+
- `wot usage [dir]`:统计 `.vue` 中的 `wd-*` 使用情况
|
|
43
|
+
- `wot lint [dir]`:执行 wot-ui 相关规则检查
|
|
44
|
+
- `wot mcp`:启动 MCP stdio Server
|
|
45
|
+
|
|
46
|
+
## 提取命令
|
|
47
|
+
|
|
48
|
+
使用本地已有的 wot-ui 仓库:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
pnpm extract --wot-dir ../wot-ui --output ./data/v2.json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
直接克隆上游仓库并提取:
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pnpm extract:clone
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## 开发调试
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
pnpm --filter @wot-ui/cli exec tsx src/index.ts list
|
|
64
|
+
pnpm --filter @wot-ui/cli exec tsx src/index.ts mcp
|
|
65
|
+
pnpm --filter @wot-ui/cli build
|
|
66
|
+
pnpm --filter @wot-ui/cli test
|
|
67
|
+
pnpm --filter @wot-ui/cli typecheck
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## 当前边界
|
|
71
|
+
|
|
72
|
+
- 当前只支持 wot-ui v2
|
|
73
|
+
- `usage` 和 `lint` 当前只聚焦 `.vue` 文件
|
|
74
|
+
- CSS 变量优先从组件 SCSS 源码提取
|