Merge branch 'components-panel' of gitlab.alibaba-inc.com:ali-lowcode/ali-lowcode-engine into components-panel

This commit is contained in:
shop_admin 2020-07-15 16:41:06 +08:00
commit a245c9925e
9 changed files with 25708 additions and 2410 deletions

File diff suppressed because it is too large Load Diff

View File

@ -68,6 +68,7 @@
<body>
<!-- lowcode engine globals -->
<div id="lce-container"></div>
<script src="/js/editor-preset-vision.js"></script>
<script src="https://dev.g.alicdn.com/vision/visualengine-utils/5.0.0/engine-utils.js"></script>
</body>

View File

@ -1,6 +1,12 @@
{
"componentName": "Page",
"id": "node_1",
"fileName": "test",
"dataSource": {
"list": []
},
"state": {
"text": "outter"
},
"props": {
"ref": "outterView",
"autoLoading": true,
@ -8,884 +14,97 @@
"padding": 20
}
},
"fileName": "test",
"dataSource": {
"list": []
},
"state": {
"text": "outter",
"abc": [
1,
2,
3
]
},
"children": [
{
"componentName": "Steps",
"id": "node_1i",
"props": {
"dataSource": [
{
"title": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": "报名"
},
"status": "",
"content": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": "Open the refrigerator door"
},
"customSwitcher": false
},
{
"title": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": "信息收集"
},
"status": "",
"content": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": "Put the elephant in the refrigerator"
},
"customSwitcher": false
},
{
"title": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": "审核"
},
"status": "",
"content": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": "Close the refrigerator door"
},
"customSwitcher": false
}
],
"current": 1,
"shape": "circle",
"direction": "horizontal",
"labelPlacement": "vertical",
"readOnly": false,
"animation": true,
"__style__": {},
"fieldId": "steps_kadcb0ov"
}
"children": [{
"componentName": "Form",
"props": {
"labelCol": 3,
"style": {},
"ref": "testForm"
},
{
"componentName": "Title",
"id": "node_b",
"children": [{
"componentName": "Form.Item",
"props": {
"text": "请填写以下人员信息表单",
"type": "primary",
"noDecoration": false,
"__style__": {},
"fieldId": "title_kadcb0nw"
}
},
{
"componentName": "Paragraph",
"id": "node_e",
"props": {
"content": "人最宝贵的是生命。它给予我们只有一次。人的一生应当这样度过:当他回首往事时不因虚度年华而悔恨,也不因碌碌无为而羞耻。这样在他临死的时侯就能够说:我已把我整个的生命和全部精力都献给最壮丽的事业——为人类的解放而斗争。",
"size": "medium",
"type": "long",
"__style__": {},
"fieldId": "paragraph_kadcb0nz"
}
},
{
"componentName": "ColumnsLayout",
"id": "node_r",
"props": {
"layout": "6:6",
"columnGap": "16px",
"rowGap": "16px",
"__style__": {
"marginTop": "24px"
},
"fieldId": "columnsLayout_kadcb0ob"
"label": "姓名:",
"name": "name",
"initValue": "李雷"
},
"children": [
{
"componentName": "Column",
"id": "node_s",
"props": {
"fieldId": "column_kadcb0o9",
"__style__": {}
},
"children": [
{
"componentName": "Card",
"id": "node_n",
"props": {
"title": "基本信息",
"subTitle": {
"type": "i18n",
"zh_CN": "",
"en_US": ""
},
"extra": {
"type": "JSSlot",
"params": null,
"value": [
{
"componentName": "Icon",
"id": "node_q",
"props": {
"type": {
"useType": true,
"baseType": "smile",
"otherType": "smile"
},
"size": "medium",
"__style__": {},
"fieldId": "icon_kadcb0o8"
}
}
]
},
"showTitleBullet": true,
"showHeadDivider": true,
"dividerNoInset": false,
"contentHeight": "",
"__style__": {},
"fieldId": "card_kadcb0o7"
},
"children": [
{
"componentName": "CardContent",
"id": "node_o",
"props": {},
"children": [
{
"componentName": "Form",
"id": "node_f",
"props": {
"labelAlign": "top",
"size": "medium",
"behavior": "NORMAL",
"autoValidate": true,
"scrollToFirstError": true,
"autoUnmount": true,
"fieldOptions": {},
"__style__": {
"marginTop": "24px"
},
"fieldId": "form_kadcb0o5"
},
"children": [
{
"componentName": "TextField",
"id": "node_g",
"props": {
"__category__": "form",
"__useMediator": "value",
"label": "姓名",
"value": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"labelAlign": "top",
"labelColSpan": 4,
"labelColOffset": 0,
"wrapperColSpan": 0,
"wrapperColOffset": 0,
"labelTextAlign": "right",
"placeholder": {
"type": "i18n",
"use": "zh_CN",
"en_US": "Please enter",
"zh_CN": "请输入"
},
"tips": {
"zh_CN": "",
"en_US": "",
"type": "i18n"
},
"size": "medium",
"behavior": "NORMAL",
"labelTipsTypes": "none",
"labelTipsIcon": "",
"labelTipsText": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"htmlType": "input",
"state": "",
"rows": 4,
"autoHeight": false,
"hasClear": false,
"trim": false,
"autoFocus": false,
"addonBefore": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"addonAfter": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"validation": [],
"hasLimitHint": false,
"cutString": false,
"__style__": {},
"fieldId": "textField_kadcb0o0"
}
},
{
"componentName": "RadioField",
"id": "node_14",
"props": {
"__category__": "form",
"__useMediator": "value",
"label": "性别",
"value": "",
"labelAlign": "top",
"labelColSpan": 4,
"labelColOffset": 0,
"wrapperColSpan": 0,
"wrapperColOffset": 0,
"labelTextAlign": "right",
"tips": {
"zh_CN": "",
"en_US": "",
"type": "i18n"
},
"size": "medium",
"behavior": "NORMAL",
"labelTipsTypes": "none",
"labelTipsIcon": "",
"labelTipsText": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"shape": "default",
"itemDirection": "hoz",
"dataSource": [
{
"text": {
"zh_CN": "选项一",
"en_US": "Option 1",
"type": "i18n",
"use": "zh_CN"
},
"value": "1",
"disable": false
},
{
"text": {
"zh_CN": "选项二",
"en_US": "Option 2",
"type": "i18n",
"use": "zh_CN"
},
"value": "2",
"disable": false
},
{
"text": {
"zh_CN": "选项三",
"en_US": "Option 3",
"type": "i18n",
"use": "zh_CN"
},
"value": "3",
"disable": true
}
],
"validation": [],
"__style__": {},
"fieldId": "radioField_kadcb0ok"
}
},
{
"componentName": "SelectField",
"id": "node_h",
"props": {
"__category__": "form",
"__useMediator": "value",
"label": "学校",
"value": "",
"labelAlign": "top",
"labelColSpan": 4,
"labelColOffset": 0,
"wrapperColSpan": 0,
"wrapperColOffset": 0,
"labelTextAlign": "right",
"placeholder": {
"type": "i18n",
"use": "zh_CN",
"en_US": "please select",
"zh_CN": "请选择"
},
"tips": {
"zh_CN": "",
"en_US": "",
"type": "i18n"
},
"size": "medium",
"behavior": "NORMAL",
"labelTipsTypes": "none",
"labelTipsIcon": "",
"labelTipsText": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"mode": "single",
"hasClear": false,
"hasSelectAll": false,
"showSearch": false,
"filterLocal": true,
"dataSource": [
{
"text": {
"zh_CN": "选项一",
"en_US": "Option 1",
"type": "i18n"
},
"value": "1"
},
{
"text": {
"zh_CN": "选项二",
"en_US": "Option 2",
"type": "i18n"
},
"value": "2"
},
{
"text": {
"zh_CN": "选项三",
"en_US": "Option 3",
"type": "i18n"
},
"value": "3"
}
],
"validation": [],
"notFoundContent": {
"type": "i18n",
"use": "zh_CN",
"en_US": null
},
"hasArrow": true,
"hasBorder": true,
"autoWidth": true,
"searchDelay": 300,
"__style__": {},
"fieldId": "select_kadcb0o1"
}
},
{
"componentName": "Div",
"id": "node_i",
"props": {
"behavior": "NORMAL",
"__style__": {},
"fieldId": "div_kadcb0o4"
},
"children": [
{
"componentName": "Button",
"id": "node_j",
"props": {
"content": {
"type": "i18n",
"en_US": "Ok",
"zh_CN": "提交"
},
"type": "primary",
"size": "medium",
"behavior": "NORMAL",
"baseIcon": "",
"otherIcon": "",
"loading": false,
"triggerEventsWhenLoading": false,
"__style__": ":root {\n margin-right: 15px;\n}",
"fieldId": "button_kadcb0o2",
"onClick": {
"type": "JSExpression",
"value": "function onSubmit(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').submit(function(data, error) {\n if (data) {\n console.log(data);\n // 往后端提交数据,一般写法如下\n // this.dataSourceMap['xxx'].load(data).then(() => {\n // this.utils.toast({\n // type: 'success',\n // title: '提交成功'\n // });\n // });\n }\n });\n}",
"extType": "function",
"events": [
{
"name": "onClick",
"params": {},
"func": {
"type": "js",
"source": "function onSubmit(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').submit(function(data, error) {\n if (data) {\n console.log(data);\n // 往后端提交数据,一般写法如下\n // this.dataSourceMap['xxx'].load(data).then(() => {\n // this.utils.toast({\n // type: 'success',\n // title: '提交成功'\n // });\n // });\n }\n });\n}",
"compiled": "function onSubmit(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').submit(function(data, error) {\n if (data) {\n console.log(data);\n // 往后端提交数据,一般写法如下\n // this.dataSourceMap['xxx'].load(data).then(() => {\n // this.utils.toast({\n // type: 'success',\n // title: '提交成功'\n // });\n // });\n }\n });\n}"
}
}
]
}
}
},
{
"componentName": "Button",
"id": "node_k",
"props": {
"content": {
"type": "i18n",
"en_US": "Reset",
"zh_CN": "重置"
},
"type": "secondary",
"size": "medium",
"behavior": "NORMAL",
"baseIcon": "",
"otherIcon": "",
"loading": false,
"triggerEventsWhenLoading": false,
"__style__": {},
"fieldId": "button_kadcb0o3",
"onClick": {
"type": "JSExpression",
"value": "function onReset(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').reset();\n}",
"extType": "function",
"events": [
{
"name": "onClick",
"params": {},
"func": {
"type": "js",
"source": "function onReset(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').reset();\n}",
"compiled": "function onReset(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').reset();\n}"
}
}
]
}
}
}
]
}
]
}
]
}
]
}
]
},
{
"componentName": "Column",
"id": "node_t",
"props": {
"fieldId": "column_kadcb0oa",
"__style__": {}
},
"children": [
{
"componentName": "Card",
"id": "node_u",
"props": {
"title": {
"type": "JSSlot",
"params": null,
"value": [
{
"componentName": "Icon",
"id": "node_18",
"props": {
"type": {
"useType": true,
"baseType": "smile",
"otherType": "smile"
},
"size": "medium",
"__style__": {},
"fieldId": "icon_kadcb0on"
}
},
{
"componentName": "Link",
"id": "node_19",
"props": {
"content": {
"type": "i18n",
"use": "zh_CN",
"en_US": "link text",
"zh_CN": "扩展信息"
},
"textOverflow": false,
"link": {
"type": "page",
"page": null,
"router": {
"type": "JSExpression",
"value": "this.utils.router"
}
},
"__style__": {},
"fieldId": "link_kadcb0oo"
}
}
]
},
"subTitle": {
"type": "i18n",
"zh_CN": "",
"en_US": ""
},
"extra": {
"type": "JSSlot",
"params": null,
"value": [
{
"componentName": "Icon",
"id": "node_1a",
"props": {
"type": {
"useType": true,
"baseType": "smile",
"otherType": "smile"
},
"size": "xl",
"__style__": {},
"fieldId": "icon_kadcb0op"
}
}
]
},
"showTitleBullet": true,
"showHeadDivider": true,
"dividerNoInset": false,
"contentHeight": "",
"__style__": {},
"fieldId": "card_kadcb0oc"
},
"children": [
{
"componentName": "CardContent",
"id": "node_v",
"props": {},
"children": [
{
"componentName": "Form",
"id": "node_x",
"props": {
"labelAlign": "top",
"size": "medium",
"behavior": "NORMAL",
"autoValidate": true,
"scrollToFirstError": true,
"autoUnmount": true,
"fieldOptions": {},
"__style__": {
"marginTop": "24px"
},
"fieldId": "form_kadcb0oi"
},
"children": [
{
"componentName": "TextField",
"id": "node_y",
"props": {
"__category__": "form",
"__useMediator": "value",
"label": "职位",
"value": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"labelAlign": "top",
"labelColSpan": 4,
"labelColOffset": 0,
"wrapperColSpan": 0,
"wrapperColOffset": 0,
"labelTextAlign": "right",
"placeholder": {
"type": "i18n",
"use": "zh_CN",
"en_US": "Please enter",
"zh_CN": "请输入"
},
"tips": {
"zh_CN": "",
"en_US": "",
"type": "i18n"
},
"size": "medium",
"behavior": "NORMAL",
"labelTipsTypes": "none",
"labelTipsIcon": "",
"labelTipsText": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"htmlType": "input",
"state": "",
"rows": 4,
"autoHeight": false,
"hasClear": false,
"trim": false,
"autoFocus": false,
"addonBefore": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"addonAfter": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"validation": [],
"hasLimitHint": false,
"cutString": false,
"__style__": {},
"fieldId": "textField_kadcb0od"
}
},
{
"componentName": "DateField",
"id": "node_15",
"props": {
"__category__": "form",
"__useMediator": "value",
"label": "入职时间",
"value": "",
"labelAlign": "top",
"labelColSpan": 4,
"labelColOffset": 0,
"wrapperColSpan": 0,
"wrapperColOffset": 0,
"labelTextAlign": "right",
"placeholder": {
"type": "i18n",
"use": "zh_CN",
"en_US": "please select",
"zh_CN": "请选择"
},
"tips": {
"zh_CN": "",
"en_US": "",
"type": "i18n"
},
"size": "medium",
"behavior": "NORMAL",
"format": "YYYY-MM-DD",
"returnType": "timestamp",
"labelTipsTypes": "none",
"labelTipsIcon": "",
"labelTipsText": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"hasClear": true,
"resetTime": false,
"disabledDate": false,
"validation": [],
"__style__": {},
"fieldId": "dateField_kadcb0ol"
}
},
{
"componentName": "SelectField",
"id": "node_z",
"props": {
"__category__": "form",
"__useMediator": "value",
"label": "下拉选择",
"value": "",
"labelAlign": "top",
"labelColSpan": 4,
"labelColOffset": 0,
"wrapperColSpan": 0,
"wrapperColOffset": 0,
"labelTextAlign": "right",
"placeholder": {
"type": "i18n",
"use": "zh_CN",
"en_US": "please select",
"zh_CN": "请选择"
},
"tips": {
"zh_CN": "",
"en_US": "",
"type": "i18n"
},
"size": "medium",
"behavior": "NORMAL",
"labelTipsTypes": "none",
"labelTipsIcon": "",
"labelTipsText": {
"type": "i18n",
"use": "zh_CN",
"en_US": null,
"zh_CN": ""
},
"mode": "single",
"hasClear": false,
"hasSelectAll": false,
"showSearch": false,
"filterLocal": true,
"dataSource": [
{
"text": {
"zh_CN": "选项一",
"en_US": "Option 1",
"type": "i18n"
},
"value": "1"
},
{
"text": {
"zh_CN": "选项二",
"en_US": "Option 2",
"type": "i18n"
},
"value": "2"
},
{
"text": {
"zh_CN": "选项三",
"en_US": "Option 3",
"type": "i18n"
},
"value": "3"
}
],
"validation": [],
"notFoundContent": {
"type": "i18n",
"use": "zh_CN",
"en_US": null
},
"hasArrow": true,
"hasBorder": true,
"autoWidth": true,
"searchDelay": 300,
"__style__": {},
"fieldId": "select_kadcb0oe"
}
},
{
"componentName": "Div",
"id": "node_10",
"props": {
"behavior": "NORMAL",
"__style__": {},
"fieldId": "div_kadcb0oh"
},
"children": [
{
"componentName": "Button",
"id": "node_11",
"props": {
"content": {
"type": "i18n",
"en_US": "Ok",
"zh_CN": "提交"
},
"type": "primary",
"size": "medium",
"behavior": "NORMAL",
"baseIcon": "",
"otherIcon": "",
"loading": false,
"triggerEventsWhenLoading": false,
"__style__": ":root {\n margin-right: 15px;\n}",
"fieldId": "button_kadcb0of",
"onClick": {
"type": "JSExpression",
"value": "function onSubmit(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').submit(function(data, error) {\n if (data) {\n console.log(data);\n // 往后端提交数据,一般写法如下\n // this.dataSourceMap['xxx'].load(data).then(() => {\n // this.utils.toast({\n // type: 'success',\n // title: '提交成功'\n // });\n // });\n }\n });\n}",
"extType": "function",
"events": [
{
"name": "onClick",
"params": {},
"func": {
"type": "js",
"source": "function onSubmit(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').submit(function(data, error) {\n if (data) {\n console.log(data);\n // 往后端提交数据,一般写法如下\n // this.dataSourceMap['xxx'].load(data).then(() => {\n // this.utils.toast({\n // type: 'success',\n // title: '提交成功'\n // });\n // });\n }\n });\n}",
"compiled": "function onSubmit(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').submit(function(data, error) {\n if (data) {\n console.log(data);\n // 往后端提交数据,一般写法如下\n // this.dataSourceMap['xxx'].load(data).then(() => {\n // this.utils.toast({\n // type: 'success',\n // title: '提交成功'\n // });\n // });\n }\n });\n}"
}
}
]
}
}
},
{
"componentName": "Button",
"id": "node_12",
"props": {
"content": {
"type": "i18n",
"en_US": "Reset",
"zh_CN": "重置"
},
"type": "secondary",
"size": "medium",
"behavior": "NORMAL",
"baseIcon": "",
"otherIcon": "",
"loading": false,
"triggerEventsWhenLoading": false,
"__style__": {},
"fieldId": "button_kadcb0og",
"onClick": {
"type": "JSExpression",
"value": "function onReset(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').reset();\n}",
"extType": "function",
"events": [
{
"name": "onClick",
"params": {},
"func": {
"type": "js",
"source": "function onReset(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').reset();\n}",
"compiled": "function onReset(){\n // 请将 fieldId 替换为表单容器的 fieldId\n this.$('fieldId').reset();\n}"
}
}
]
}
}
}
]
}
]
}
]
}
]
}
]
"children": [{
"componentName": "From.Input",
"props": {
"placeholder": "请输入",
"size": "medium",
"style": {
"width": 320
}
}
]
}
]
}]
}, {
"componentName": "Form.Item",
"props": {
"label": "年龄:",
"name": "age",
"initValue": "22"
},
"children": [{
"componentName": "NumberPicker",
"props": {
"size": "medium",
"type": "normal"
}
}]
}, {
"componentName": "Form.Item",
"props": {
"label": "职业:",
"name": "profession"
},
"children": [{
"componentName": "Select",
"props": {
"dataSource": [{
"label": "教师",
"value": "t"
}, {
"label": "医生",
"value": "d"
}, {
"label": "歌手",
"value": "s"
}]
}
}]
}, {
"componentName": "Div",
"props": {
"style": {
"textAlign": "center"
}
},
"children": [{
"componentName": "Button.Group",
"props": {},
"children": [{
"componentName": "Button",
"props": {
"type": "primary",
"style": {
"margin": "0 5px 0 5px"
},
"htmlType": "submit"
},
"children": "提交"
}, {
"componentName": "Button",
"props": {
"type": "normal",
"style": {
"margin": "0 5px 0 5px"
},
"htmlType": "reset"
},
"children": "重置"
}]
}]
}]
}]
}

View File

@ -1 +1 @@
import './vision';
import './editor';

View File

@ -826,13 +826,13 @@ export class BuiltinSimulatorHost implements ISimulatorHost<BuiltinSimulatorProp
event: e,
};
if (e.dragObject.nodes[0].getPrototype().isModal()) {
if (e.dragObject && e.dragObject.nodes && e.dragObject.nodes.length && e.dragObject.nodes[0].getPrototype().isModal()) {
return this.designer.createLocation({
target: this.document.rootNode,
detail,
source: 'simulator' + this.document.id,
event: e,
});
});
}
if (!children || children.size < 1 || !edge) {

View File

@ -39,7 +39,7 @@ export class Transducer {
} else if (isValidElement(setter) && setter.type.displayName === 'MixedSetter') {
setter = setter.props.setters[0];
} else if (typeof setter === 'object' && setter.componentName === 'MixedSetter') {
setter = setter.props.setters?.[0];
setter = setter && setter.props && setter.props.setters && Array.isArray(setter.props.setters) && setter.props.setters[0];
}
if (isSetterConfig(setter)) {

View File

@ -32,9 +32,11 @@ function propTypeToSetter(propType: PropType): SetterType {
let isRequired: boolean | undefined = false;
if (typeof propType === 'string') {
typeName = propType;
} else {
} else if (typeof propType === 'object'){
typeName = propType.type;
isRequired = propType.isRequired;
} else {
typeName = 'string';
}
// TODO: use mixinSetter wrapper
switch (typeName) {

File diff suppressed because it is too large Load Diff

View File

@ -1,89 +1,19 @@
import test from 'ava';
import parse from '../src';
import fs from 'fs';
import { IMaterializeOptions } from '../src/types';
import { getFromFixtures } from './helpers';
const multiExportedComptPath = getFromFixtures('multiple-exported-component');
const singleExportedComptPath = getFromFixtures('single-exported-component');
const fusionComptPath = getFromFixtures('fusion-next-component');
const antdComptPath = getFromFixtures('antd-component');
const singleExportedComponent = '@ali/demo-biz-test090702@0.0.2';
const multipleExportedComponent = '@ali/aimake-basic@0.1.0';
const tsComponent = getFromFixtures('ts-component');
test('materialize single exported component by local', async t => {
const options: IMaterializeOptions = {
entry: singleExportedComptPath,
accesser: 'local',
};
const actual = await parse(options);
t.snapshot(actual);
});
test('materialize multiple exported component by local', async t => {
const options: IMaterializeOptions = {
entry: multiExportedComptPath,
accesser: 'local',
};
const actual = await parse(options);
t.snapshot(actual);
});
test.skip('materialize single exported component by online', async t => {
const options: IMaterializeOptions = {
entry: singleExportedComponent,
accesser: 'online',
};
const actual = await parse(options);
t.snapshot(actual);
});
test.skip('materialize multiple exported component by online', async t => {
const options: IMaterializeOptions = {
entry: multipleExportedComponent,
accesser: 'online',
};
const actual = await parse(options);
t.snapshot(actual);
});
test('ts component by local', async t => {
const options: IMaterializeOptions = {
entry: tsComponent,
accesser: 'local',
};
const actual = await parse(options);
t.snapshot(actual);
});
test('fusion next component by local', async t => {
async function generate() {
const options: IMaterializeOptions = {
entry: fusionComptPath,
accesser: 'local',
};
const actual = await parse(options);
fs.writeFileSync('configure.json', JSON.stringify(actual, null, 2));
console.log(actual);
}
t.snapshot(actual);
});
test('antd component by local', async t => {
const options: IMaterializeOptions = {
entry: antdComptPath,
accesser: 'local',
};
const actual = await parse(options);
t.snapshot(actual);
});
generate();