@xihan-ui/cli 0.0.0-stage → 4.2.0
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/CHANGELOG.md +7 -0
- package/LICENSE +21 -0
- package/README.md +58 -2
- package/bin/xihan-ui.mjs +4 -0
- package/data/changelog.md +669 -0
- package/data/components.json +1 -0
- package/data/demos.json +1 -0
- package/data/design.md +251 -0
- package/data/meta.json +4 -0
- package/data/pages.json +1 -0
- package/data/tokens.json +1 -0
- package/dist/index.d.ts +213 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1540 -0
- package/dist/index.js.map +1 -0
- package/package.json +67 -3
- package/skills/xihan-ui/SKILL.md +48 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @xihan-ui/cli
|
|
2
|
+
|
|
3
|
+
## 4.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d7374f4: 新增 `@xihan-ui/cli`:XiHan.UI 的命令行与 MCP 服务端。组件 API(产物、部件、Props、条目数据、事件、插槽、React 专有属性、状态、connect API、键盘)、全部文档页、三种写法的示例源码、设计令牌、design.md 与更新日志随包离线发布,与同号的组件库版本一致。命令 `list` / `info` / `doc` / `demo` / `token` / `parts` / `design.md` / `changelog` 支持 markdown 与 json 输出;`mcp` 以 stdio 启动 MCP 服务端,提供 `xihan_ui_list`、`xihan_ui_info`、`xihan_ui_doc`、`xihan_ui_demo`、`xihan_ui_token`、`xihan_ui_parts`、`xihan_ui_design_md`、`xihan_ui_changelog` 八个工具与 `xihan-ui-expert`、`xihan-ui-page-generator` 两个提示词;`setup --client claude|cursor|vscode|codex` 把钉住版本的 MCP 配置与 XiHan.UI 使用技能写进项目。在装了 XiHan.UI 的项目里运行时按项目的适配器选示例写法,项目版本与 CLI 版本不一致时给出提示。
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2021-Present XiHanFun and contributors.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,59 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @xihan-ui/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
XiHan.UI 的命令行与 MCP 服务端:把组件 API、文档、示例源码、设计令牌、design.md 与更新日志打包成随版本发布的离线数据,供 AI 编程工具与开发者查询。不联网,查到的内容与 CLI 的版本一致。
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
npx -y @xihan-ui/cli info select
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
## 版本对齐
|
|
10
|
+
|
|
11
|
+
`@xihan-ui/cli` 与其余 `@xihan-ui/*` 包同属一个版本组、始终同号。项目装的是哪一版,就用同号的 CLI:
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx -y @xihan-ui/cli@<版本> info select
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
在装了 XiHan.UI 的项目里运行时,CLI 会读取 `node_modules` 里的版本,与自身数据版本不一致时在 stderr 提示。
|
|
18
|
+
|
|
19
|
+
## 命令
|
|
20
|
+
|
|
21
|
+
| 命令 | 说明 |
|
|
22
|
+
| --- | --- |
|
|
23
|
+
| `list [--category <分类>] [--query <关键字>]` | 按分类列出组件 |
|
|
24
|
+
| `info <组件>` | 组件 API:产物、部件、Props、事件、插槽、状态、键盘 |
|
|
25
|
+
| `doc [<组件\|页面>]` | 完整文档,示例按写法内联;不带参数列出指南页 |
|
|
26
|
+
| `demo <组件> [<示例>]` | 列出示例或输出示例源码 |
|
|
27
|
+
| `token [<关键字>] [--component <组件>]` | 设计令牌与组件覆盖槽 |
|
|
28
|
+
| `parts <组件>` | 部件选择器、数据属性与覆盖槽 |
|
|
29
|
+
| `design.md` | 设计语言文档 |
|
|
30
|
+
| `changelog [<版本> [<版本>]] [--keyword <词>]` | 更新日志,两个版本时取区间 |
|
|
31
|
+
| `mcp` | 以 stdio 启动 MCP 服务端 |
|
|
32
|
+
| `setup --client <claude\|cursor\|vscode\|codex>` | 写入 MCP 配置与技能,可加 `--mode <mcp\|skill\|both>`、`--pin <版本>`、`--dry-run`、`--check` |
|
|
33
|
+
|
|
34
|
+
组件名可写标识(`date-picker`)、PascalCase(`DatePicker`)、导出名(`XhDatePickerRoot`)、标签(`xh-date-picker`)或中文名。全局选项:`--framework <vue|react|web-components>` 选示例写法(缺省取项目里装的适配器),`--format <markdown|json>` 选输出格式。
|
|
35
|
+
|
|
36
|
+
## MCP
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"mcpServers": {
|
|
41
|
+
"xihan-ui": {
|
|
42
|
+
"command": "npx",
|
|
43
|
+
"args": ["-y", "@xihan-ui/cli@<版本>", "mcp"]
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
工具:`xihan_ui_list`、`xihan_ui_info`、`xihan_ui_doc`、`xihan_ui_demo`、`xihan_ui_token`、`xihan_ui_parts`、`xihan_ui_design_md`、`xihan_ui_changelog`。提示词:`xihan-ui-expert`、`xihan-ui-page-generator`。
|
|
50
|
+
|
|
51
|
+
各客户端的配置写法与 `setup` 命令见 [MCP Server](https://ui.docs.xihanfun.com/ai/mcp)。
|
|
52
|
+
|
|
53
|
+
## 技能
|
|
54
|
+
|
|
55
|
+
包内 `skills/xihan-ui/SKILL.md` 是给 AI 编程工具的使用规范,`xihan-ui setup --mode skill` 把它写进项目。
|
|
56
|
+
|
|
57
|
+
## 许可
|
|
58
|
+
|
|
59
|
+
MIT
|
package/bin/xihan-ui.mjs
ADDED