fusion-to-antd
v1.0.19
Published
fusion迁移到antd
Readme
fusion-to-antd 工具包使用说明
命令
plugin
npx fusion-to-antd plugin当前目录为ice+fusion脚手架时,fusion-to-antd 会为当前项目添加antd依赖及相关插件,并自动补全antd全局样式配置。 此命令适合基于ice.js的组件迁移。 如果该工程为ice-script,请手动添加antd依赖及相关插件,步骤如下:
tnpm i antd @ant-design/icons ice-plugin-antd --save-dev- 在ice.config.js中找到属性plugin,新增
['ice-plugin-antd', {
themeConfig: {
"primary-color": "#5050E6",
"border-radius-base": "4px",
"font-size-base": "12px",
"text-color": "#333",
"text-color-secondary": "#999",
},
}],replace
npx fusion-to-antd replace当前项目目录使用的是fusion时,fusion-to-antd 会做以下事情
- 检索当前项目路径下所有的ts,js,tsx,jsx文件,不包含node_module、.umi、.ice目录。
- 将文件内包含fusion组件的引入替换为antd组件引入,包含fusion物料。
- 将文件内含有fusion组件(含fusion物料)进行antd(版本4.9.1)替换,替换顺序如下:
- 替换 fusion及物料包引用 -> antd引用
- 过滤 fusion组件不被antd支持的api
- 替换 fusion组件api -> antd组件相关api
- 补全 基于步骤2补全antd关联的属性和键值(通常在fusion某个api对应antd多个api时触发)
- 销毁 原有fusion组件api(只销毁已完全被antd支持的api,保留尚未完全被支持的api)。
- 返回替换结果,差异及冲突输出在当前目录下的fta.log日志中。
你也可以指定路径深度,可以深度到指定某个文件,如
npx fusion-to-antd replace src/components
或
npx fusion-to-antd replace src/components/layout/layout.tsfusion-to-antd
支持替换的组件列表
- affix
- avatar
- badge
- breadcrumb
- button
- calendar
- card
- cascader
- checkbox
- collapse
- ~~datepicker~~
- divider
- drawer
- ~~dropdown~~
- form
- grid
- input
- list
- ~~menu~~
- message
- modal
- ~~notification~~
- ~~inputnumber~~
- ~~pagination~~
- progress
- popover
- radio
- row
- rate
- ~~slider~~
- steps
- switch
- Select
- spin
- tooltip
- typography
- tabs
- ~~table~~
- tag
- ~~timepicker~~
- timeline
- ~~transfer~~
- ~~tree~~
- ~~upload~~
其它

