@fjyueke/bify-mcp 1.0.5 → 1.0.7

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 (3) hide show
  1. package/README.md +46 -2
  2. package/dist/index.js +26 -12
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -14,7 +14,7 @@ Bify MCP 是一项独立的 MCP(模型上下文协议)服务,旨在将 Bif
14
14
  - 直接使用 npx 运行
15
15
  - 无需外部依赖,只需要 Node 环境
16
16
  - 支持 68+ 个组件文档查询
17
- - 支持 Arco Mobile 代码转换
17
+ - 支持 Arco Mobile 代码转换(40+ 组件映射)
18
18
 
19
19
  ## 配置方式
20
20
 
@@ -51,7 +51,7 @@ Bify MCP 是一项独立的 MCP(模型上下文协议)服务,旨在将 Bif
51
51
  | `get-component-docs` | 获取指定组件的详细文档 |
52
52
  | `get-component-props` | 获取指定组件的属性和 API 文档 |
53
53
  | `list-component-example` | 获取指定组件的所有示例代码 |
54
- | `convert-arco-to-bify` | 将 Arco Mobile React 代码转换为 Bify 代码 |
54
+ | `convert-arco-to-bify` | 将 Arco Mobile React 代码转换为 Bify 代码(含详细报告) |
55
55
  | `get-arco-conversion-help` | 获取 Arco Mobile → Bify 转换帮助信息 |
56
56
 
57
57
  ## 使用示例
@@ -82,10 +82,54 @@ get-arco-conversion-help
82
82
  convert-arco-to-bify "<Cell label='标题' desc='描述' showArrow>内容</Cell>"
83
83
  ```
84
84
 
85
+ ### 转换示例
86
+
87
+ **Arco Mobile 代码**:
88
+ ```tsx
89
+ import { Cell, CellGroup, Button, Tag, Badge } from '@arco-design/mobile-react';
90
+
91
+ <CellGroup>
92
+ <Cell label="标题" desc="描述" showArrow>内容</Cell>
93
+ </CellGroup>
94
+ <Button type="primary" ghost size="huge" block>按钮</Button>
95
+ <Tag type="success" closable>标签</Tag>
96
+ <Badge count={99} maxCount={99}>图标</Badge>
97
+ ```
98
+
99
+ **转换后 Bify 代码**:
100
+ ```tsx
101
+ import { Cell, CellGroup, Button, Tag, Badge } from '@fjyueke/bify-core';
102
+
103
+ <CellGroup>
104
+ <Cell title="标题" brief="描述" clickable="true">内容</Cell>
105
+ </CellGroup>
106
+ <Button color="primary" variant="outlined" size="large" block>按钮</Button>
107
+ <Tag color="success" closeable>标签</Tag>
108
+ <Badge content={99} max={99}>图标</Badge>
109
+ ```
110
+
111
+ ## 属性映射示例
112
+
113
+ | Arco 属性 | Bify 属性 | 说明 |
114
+ |-----------|-----------|------|
115
+ | `label` | `title` | 单元格标题 |
116
+ | `desc` | `brief` | 单元格描述 |
117
+ | `showArrow` | `clickable` | 是否显示箭头 |
118
+ | `visible` | `open` | 弹窗显示状态 |
119
+ | `value` | `modelValue` | 表单值绑定 |
120
+ | `type` (Button) | `color` | 按钮颜色 |
121
+ | `ghost` | `variant="outlined"` | 镂空按钮样式 |
122
+ | `type` (Tag) | `color` | 标签颜色 |
123
+ | `count` | `content` | Badge 内容 |
124
+ | `maxCount` | `max` | Badge 最大值 |
125
+
85
126
  ## 版本历史
86
127
 
87
128
  | 版本 | 日期 | 说明 |
88
129
  |------|------|------|
130
+ | 1.0.6 | 2026-07-13 | 根据实际组件定义更新属性映射(Button 使用 color/variant,Tag 使用 color) |
131
+ | 1.0.5 | 2026-07-13 | 优化转换工具,增加详细报告(警告、建议、映射列表) |
132
+ | 1.0.4 | 2026-07-13 | 修复构建配置 |
89
133
  | 1.0.3 | 2026-07-13 | 优化代码转换工具,增加 40+ 组件映射、值映射、布尔属性转换 |
90
134
  | 1.0.2 | 2026-07-13 | 添加 Arco Mobile → Bify 代码转换功能 |
91
135
  | 1.0.1 | 2026-07-13 | 更正包名为 bify-mcp |
package/dist/index.js CHANGED
@@ -195,20 +195,22 @@ var componentMappings = [
195
195
  arcoImport: "@arco-design/mobile-react",
196
196
  bifyImport: "@fjyueke/bify-core",
197
197
  propMappings: [
198
- { arcoProp: "type", bifyProp: "type" },
198
+ { arcoProp: "type", bifyProp: "color" },
199
+ { arcoProp: "ghost", bifyProp: "variant", transform: () => "outlined" },
199
200
  { arcoProp: "size", bifyProp: "size" },
200
201
  { arcoProp: "disabled", bifyProp: "disabled" },
201
202
  { arcoProp: "loading", bifyProp: "loading" },
202
203
  { arcoProp: "icon", bifyProp: "icon" },
203
204
  { arcoProp: "onClick", bifyProp: "onClick" },
204
205
  { arcoProp: "className", bifyProp: "className" },
205
- { arcoProp: "style", bifyProp: "style" }
206
+ { arcoProp: "style", bifyProp: "style" },
207
+ { arcoProp: "block", bifyProp: "block" }
206
208
  ],
207
209
  valueMappings: {
208
- type: {
209
- ghost: "outlined",
210
+ color: {
210
211
  default: "default",
211
- primary: "primary"
212
+ primary: "primary",
213
+ ghost: "default"
212
214
  },
213
215
  size: {
214
216
  mini: "mini",
@@ -238,7 +240,9 @@ var componentMappings = [
238
240
  propMappings: [
239
241
  { arcoProp: "dot", bifyProp: "dot" },
240
242
  { arcoProp: "count", bifyProp: "content" },
241
- { arcoProp: "maxCount", bifyProp: "max" }
243
+ { arcoProp: "maxCount", bifyProp: "max" },
244
+ { arcoProp: "position", bifyProp: "position" },
245
+ { arcoProp: "fixed", bifyProp: "fixed" }
242
246
  ]
243
247
  },
244
248
  {
@@ -247,18 +251,24 @@ var componentMappings = [
247
251
  arcoImport: "@arco-design/mobile-react",
248
252
  bifyImport: "@fjyueke/bify-core",
249
253
  propMappings: [
250
- { arcoProp: "type", bifyProp: "type" },
254
+ { arcoProp: "type", bifyProp: "color" },
251
255
  { arcoProp: "size", bifyProp: "size" },
252
- { arcoProp: "closable", bifyProp: "closable" },
253
- { arcoProp: "onClose", bifyProp: "onClose" }
256
+ { arcoProp: "closable", bifyProp: "closeable" },
257
+ { arcoProp: "onClose", bifyProp: "onClose" },
258
+ { arcoProp: "shape", bifyProp: "shape" }
254
259
  ],
255
260
  valueMappings: {
256
- type: {
261
+ color: {
257
262
  default: "default",
258
263
  primary: "primary",
259
264
  success: "success",
260
265
  warning: "warning",
261
266
  danger: "danger"
267
+ },
268
+ size: {
269
+ small: "small",
270
+ medium: "medium",
271
+ large: "large"
262
272
  }
263
273
  }
264
274
  },
@@ -325,8 +335,12 @@ var componentMappings = [
325
335
  propMappings: [
326
336
  { arcoProp: "visible", bifyProp: "open" },
327
337
  { arcoProp: "title", bifyProp: "title" },
328
- { arcoProp: "content", bifyProp: "children" },
329
- { arcoProp: "onClose", bifyProp: "onClose" }
338
+ { arcoProp: "content", bifyProp: "message" },
339
+ { arcoProp: "onClose", bifyProp: "onClose" },
340
+ { arcoProp: "confirmText", bifyProp: "confirm" },
341
+ { arcoProp: "cancelText", bifyProp: "cancel" },
342
+ { arcoProp: "onConfirm", bifyProp: "onConfirm" },
343
+ { arcoProp: "onCancel", bifyProp: "onCancel" }
330
344
  ]
331
345
  },
332
346
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fjyueke/bify-mcp",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "type": "module",
5
5
  "description": "MCP UI builder by Bify",
6
6
  "license": "MIT",