mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-04-19 20:08:05 +00:00
refactor: JS to TS
Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/3677476 * chore: remove unnecessary code * refactor: react-render using TypeScript * chore: build-script * refactor: editor-skeleton * refactor: designer * refactor: material-parser * refactor: editor-setters * refactor: js to ts for rax-provider Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/3678180 * refactor: rax-provider * feat: add build command * chore: compilerOptions for rax-provider * refactor: JS to TS for Rax Renderer Link: https://code.aone.alibaba-inc.com/ali-lowcode/ali-lowcode-engine/codereview/3678935 * refactor: rax-renderer * Merge remote-tracking branch 'origin/refactor/js-to-ts' into refactor/js2ts-rax-renderer * Merge remote-tracking branch 'origin/refactor/js-to-ts' into refactor/js2ts-rax-renderer * refactor: ts-nocheck * chore: ts compile error * fix: ts rootDir * fix: compile error * chore: using same tsconfig for rax component * refactor: ts compile rax-renderer && rax-provider * Merge remote-tracking branch 'origin/release/1.0.0' into refactor/js-to-ts # Conflicts: # packages/rax-render/src/utils/appHelper.js # packages/rax-render/src/utils/appHelper.ts # packages/utils/src/appHelper.ts * refactor: no JS file
This commit is contained in:
parent
d41f481553
commit
9efa9ffa69
@ -1,242 +0,0 @@
|
|||||||
export default [
|
|
||||||
{
|
|
||||||
label: 'constants',
|
|
||||||
kind: 'Class',
|
|
||||||
insertText: 'constants',
|
|
||||||
detail: '应用全局常量',
|
|
||||||
documentation: '应用范围定义的通用常量'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'utils',
|
|
||||||
kind: 'Class',
|
|
||||||
insertText: 'utils',
|
|
||||||
detail: '应用全局公共函数',
|
|
||||||
documentation: '应用范围扩展的公共函数'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'state',
|
|
||||||
kind: 'Enum',
|
|
||||||
insertText: 'state',
|
|
||||||
detail: '当前所在容器组件内部状态',
|
|
||||||
documentation: 'React Class内部状态state'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'setState',
|
|
||||||
kind: 'Function',
|
|
||||||
insertText: 'setState({\n\t$0\n})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '设置当前所在容器组件的state数据',
|
|
||||||
documentation: '原生React方法,会自动更新组件视图'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'reloadDataSource',
|
|
||||||
kind: 'Function',
|
|
||||||
insertText: 'reloadDataSource(${1:${2:namespace}, ${3:false}, ${4:callback}})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '刷新当前所在的容器组件',
|
|
||||||
documentation: '触发当前所在的容器组件,重新发送异步请求,并用最新数据更新视图'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'location',
|
|
||||||
kind: 'Class',
|
|
||||||
insertText: 'location',
|
|
||||||
detail: '路由解析对象'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'location.query',
|
|
||||||
kind: 'Value',
|
|
||||||
insertText: 'location.query.${1:xxxx}',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '从路由解析对象中获取参数信息'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'history',
|
|
||||||
kind: 'Class',
|
|
||||||
insertText: 'history',
|
|
||||||
detail: '路由历史对象'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'React',
|
|
||||||
kind: 'Keyword',
|
|
||||||
insertText: 'React',
|
|
||||||
detail: 'React对象'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'ReactDOM',
|
|
||||||
kind: 'Keyword',
|
|
||||||
insertText: 'ReactDOM',
|
|
||||||
detail: 'ReactDom对象'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'ReactDOM.findDOMNode',
|
|
||||||
kind: 'Function',
|
|
||||||
insertText: 'ReactDOM.findDOMNode(${1:this.refs.xxxx})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: 'ReactDom查找真实dom node'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Dialog.alert',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Dialog.alert({',
|
|
||||||
"\tcontent: '${1:Alert content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: 'alert弹框 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Dialog.confirm',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Dialog.confirm({',
|
|
||||||
"\tcontent: '${1:Confirm content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t},',
|
|
||||||
'\tonCancel: () => {',
|
|
||||||
'\t\t$4',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '确认弹出框 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Message.success',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: 'Message.success(${1:content})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '成功反馈提示 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Message.error',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: 'Message.error(${1:content})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '错误反馈提示 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Message.help',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: 'Message.help(${1:content})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '帮助反馈提示 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Message.loading',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: 'Message.loading(${1:content})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: 'loading反馈提示 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Message.notice',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: 'Message.notice(${1:content})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '注意反馈提示 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Message.waining',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: 'Message.waining(${1:content})',
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '警告反馈提示 By Fusion'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Modal.confirm',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Modal.confirm({',
|
|
||||||
"\tcontent: '${1:Confirm content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t},',
|
|
||||||
'\tonCancel: () => {',
|
|
||||||
'\t\t$4',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '确认弹出框 By Antd'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Modal.info',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Modal.info({',
|
|
||||||
"\tcontent: '${1:Info content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t},',
|
|
||||||
'\tonCancel: () => {',
|
|
||||||
'\t\t$4',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '信息弹出框 By Antd'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Modal.success',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Modal.success({',
|
|
||||||
"\tcontent: '${1:Success content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t},',
|
|
||||||
'\tonCancel: () => {',
|
|
||||||
'\t\t$4',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '成功弹出框 By Antd'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Modal.error',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Modal.error({',
|
|
||||||
"\tcontent: '${1:Error content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t},',
|
|
||||||
'\tonCancel: () => {',
|
|
||||||
'\t\t$4',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '错误弹出框 By Antd'
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Modal.warning',
|
|
||||||
kind: 'Method',
|
|
||||||
insertText: [
|
|
||||||
'Modal.warning({',
|
|
||||||
"\tcontent: '${1:Warning content}',",
|
|
||||||
"\ttitle: '${2:Title}',",
|
|
||||||
'\tonOk: () => {',
|
|
||||||
'\t\t$3',
|
|
||||||
'\t},',
|
|
||||||
'\tonCancel: () => {',
|
|
||||||
'\t\t$4',
|
|
||||||
'\t}',
|
|
||||||
'})'
|
|
||||||
].join('\n'),
|
|
||||||
insertTextRules: 'InsertAsSnippet',
|
|
||||||
detail: '警告弹出框 By Antd'
|
|
||||||
}
|
|
||||||
];
|
|
||||||
@ -1,21 +0,0 @@
|
|||||||
import IntlMessageFormat from 'intl-messageformat';
|
|
||||||
|
|
||||||
export const isJSExpression = (obj = '') => {
|
|
||||||
if(obj && typeof obj === 'object' && obj.type === 'JSExpression') {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用于构造国际化字符串处理函数
|
|
||||||
* @param {*} locale 国际化标识,例如 zh-CN、en-US
|
|
||||||
* @param {*} messages 国际化语言包
|
|
||||||
*/
|
|
||||||
export const generateI18n = (locale = 'zh-CN', messages = {}) => {
|
|
||||||
return function (key, values = {}) {
|
|
||||||
if (!messages || !messages[key]) return '';
|
|
||||||
const formater = new IntlMessageFormat(messages[key], locale);
|
|
||||||
return formater.format(values);
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@ -1,36 +0,0 @@
|
|||||||
export default {
|
|
||||||
// function
|
|
||||||
setting: '点击设置',
|
|
||||||
edit: '编辑',
|
|
||||||
submitConfirm: '确认提交 cmd+s',
|
|
||||||
close: '关闭 esc',
|
|
||||||
fullScreen: '全屏',
|
|
||||||
cancelFullScreen: '取消全屏',
|
|
||||||
jsonIllegal: '非json格式',
|
|
||||||
functionIllegal: '非function格式',
|
|
||||||
objectIllegal: '非object格式',
|
|
||||||
circularRef: '对象中出现循环引用的对象',
|
|
||||||
formatError: '格式错误',
|
|
||||||
saved: '已保存',
|
|
||||||
// expression
|
|
||||||
valueIllegal: '值类型为对象类型,与当前组件属性设置的控件类型不匹配,请在属性“代码编辑模式”下进行编辑',
|
|
||||||
jsExpression: '请输入JS表达式',
|
|
||||||
// Mixin
|
|
||||||
input: '字符串Input',
|
|
||||||
textarea: '多行字符串Textarea',
|
|
||||||
expression: '变量控件Expression',
|
|
||||||
monacoEditor: '编辑器MonacoEditor',
|
|
||||||
numberPicker: '数字NumberPicker',
|
|
||||||
bool: '布尔Switch',
|
|
||||||
datePicker: '日期选择DatePicker',
|
|
||||||
select: '下拉选择Select',
|
|
||||||
radio: '单项选择RadioGroup',
|
|
||||||
date: '日期选择DatePicker',
|
|
||||||
dateYear: '年选择DatePicker',
|
|
||||||
dateMonth: '月选择DatePicker',
|
|
||||||
dateRange: '日期区间选择DatePicker',
|
|
||||||
list: '数组List',
|
|
||||||
object: '对象ObjectButton',
|
|
||||||
reactNode: '节点类型ReactNode',
|
|
||||||
typeError: 'Minix组件属性Types配置错误,存在不支持类型[{type}],请检查组件属性配置',
|
|
||||||
};
|
|
||||||
@ -11,6 +11,7 @@ export default function resolveTranspiledClass(path: any) {
|
|||||||
visitFunctionDeclaration(arg) {
|
visitFunctionDeclaration(arg) {
|
||||||
classPath = new NodePath(
|
classPath = new NodePath(
|
||||||
builders.functionDeclaration(
|
builders.functionDeclaration(
|
||||||
|
// @ts-ignore
|
||||||
arg.node.id || 'Default',
|
arg.node.id || 'Default',
|
||||||
[],
|
[],
|
||||||
builders.blockStatement([
|
builders.blockStatement([
|
||||||
|
|||||||
@ -115,6 +115,7 @@ function handleTSTypeLiteral(path, typeParams) {
|
|||||||
value: getTSTypeWithRequirements(param.get('typeAnnotation'), typeParams),
|
value: getTSTypeWithRequirements(param.get('typeAnnotation'), typeParams),
|
||||||
});
|
});
|
||||||
} else if (t.TSCallSignatureDeclaration.check(param.node)) {
|
} else if (t.TSCallSignatureDeclaration.check(param.node)) {
|
||||||
|
// @ts-ignore
|
||||||
type.signature.constructor = handleTSFunctionType(param, typeParams);
|
type.signature.constructor = handleTSFunctionType(param, typeParams);
|
||||||
} else if (t.TSIndexSignature.check(param.node)) {
|
} else if (t.TSIndexSignature.check(param.node)) {
|
||||||
type.signature.properties.push({
|
type.signature.properties.push({
|
||||||
@ -195,12 +196,14 @@ function handleTSFunctionType(path, typeParams) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
if (param.node.name === 'this') {
|
if (param.node.name === 'this') {
|
||||||
|
// @ts-ignore
|
||||||
type.signature.this = arg.type;
|
type.signature.this = arg.type;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param.node.type === 'RestElement') {
|
if (param.node.type === 'RestElement') {
|
||||||
arg.name = param.node.argument.name;
|
arg.name = param.node.argument.name;
|
||||||
|
// @ts-ignore
|
||||||
arg.rest = true;
|
arg.rest = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -288,7 +291,7 @@ function handleTSIndexedAccessType(path, typeParams) {
|
|||||||
|
|
||||||
let visitedTypes = {};
|
let visitedTypes = {};
|
||||||
|
|
||||||
function getTSTypeWithResolvedTypes(path, typeParams) {
|
function getTSTypeWithResolvedTypes(path, typeParams?) {
|
||||||
if (t.TSTypeAnnotation.check(path.node)) {
|
if (t.TSTypeAnnotation.check(path.node)) {
|
||||||
path = path.get('typeAnnotation');
|
path = path.get('typeAnnotation');
|
||||||
}
|
}
|
||||||
@ -343,7 +346,7 @@ function getTSTypeWithResolvedTypes(path, typeParams) {
|
|||||||
*
|
*
|
||||||
* If there is no match, "unknown" is returned.
|
* If there is no match, "unknown" is returned.
|
||||||
*/
|
*/
|
||||||
export default function getTSType(path, typeParamMap) {
|
export default function getTSType(path, typeParamMap?) {
|
||||||
// Empty visited types before an after run
|
// Empty visited types before an after run
|
||||||
// Before: in case the detection threw and we rerun again
|
// Before: in case the detection threw and we rerun again
|
||||||
// After: cleanup memory after we are done here
|
// After: cleanup memory after we are done here
|
||||||
@ -72,6 +72,7 @@ function getDocgenTypeHelper(
|
|||||||
}[] = symbolArr.map((prop) => {
|
}[] = symbolArr.map((prop) => {
|
||||||
const propType = checker.getTypeOfSymbolAtLocation(
|
const propType = checker.getTypeOfSymbolAtLocation(
|
||||||
prop,
|
prop,
|
||||||
|
// @ts-ignore
|
||||||
prop.valueDeclaration || (prop.declarations && prop.declarations[0]) || {},
|
prop.valueDeclaration || (prop.declarations && prop.declarations[0]) || {},
|
||||||
);
|
);
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -4,7 +4,8 @@
|
|||||||
"target": "es6",
|
"target": "es6",
|
||||||
"module": "commonjs",
|
"module": "commonjs",
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
"outDir": "lib"
|
"outDir": "lib",
|
||||||
|
"strict": false
|
||||||
},
|
},
|
||||||
"include": ["src/**/*"],
|
"include": ["src/**/*"],
|
||||||
"exclude": ["schemas"]
|
"exclude": ["schemas"]
|
||||||
|
|||||||
@ -9,7 +9,8 @@
|
|||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"module": "es/index.js",
|
"module": "es/index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "build-scripts start"
|
"start": "build-scripts start",
|
||||||
|
"build": "build-scripts build"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"prop-types": "^15.7.2",
|
"prop-types": "^15.7.2",
|
||||||
|
|||||||
25
packages/rax-provider/tsconfig.json
Normal file
25
packages/rax-provider/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["es2015", "dom"],
|
||||||
|
"target": "esnext",
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"strict": false,
|
||||||
|
"strictPropertyInitialization": false,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"importHelpers": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"outDir": "lib"
|
||||||
|
},
|
||||||
|
"exclude": ["test", "lib", "es", "node_modules"],
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -41,6 +41,7 @@
|
|||||||
"debug": "^4.1.1",
|
"debug": "^4.1.1",
|
||||||
"events": "^3.0.0",
|
"events": "^3.0.0",
|
||||||
"fetch-jsonp": "^1.1.3",
|
"fetch-jsonp": "^1.1.3",
|
||||||
|
"fs-extra": "^9.0.1",
|
||||||
"intl-messageformat": "^9.3.1",
|
"intl-messageformat": "^9.3.1",
|
||||||
"jsonuri": "^2.1.2",
|
"jsonuri": "^2.1.2",
|
||||||
"keymaster": "^1.6.2",
|
"keymaster": "^1.6.2",
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
import { Component } from 'rax';
|
import { Component } from 'rax';
|
||||||
import './index.css';
|
import './index.css';
|
||||||
|
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
import { Component, createElement } from 'rax';
|
import { Component, createElement } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
import { createElement } from 'rax';
|
import { createElement } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import { createElement } from 'rax';
|
import { createElement } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
@ -1,3 +1,4 @@
|
|||||||
|
// @ts-nocheck
|
||||||
/* eslint-disable */
|
/* eslint-disable */
|
||||||
import { Component, createElement } from 'rax';
|
import { Component, createElement } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import { createElement } from 'rax';
|
import { createElement } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import { createElement } from 'rax';
|
import { createElement } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import { Component, createElement, forwardRef } from 'rax';
|
import { Component, createElement, forwardRef } from 'rax';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import { AppHelper } from '@ali/lowcode-utils';
|
import { AppHelper } from '@ali/lowcode-utils';
|
||||||
@ -1,7 +1,9 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import { createElement, Component } from 'rax';
|
import { createElement, Component } from 'rax';
|
||||||
|
|
||||||
export default function (Comp) {
|
export default function (Comp) {
|
||||||
class compWrapper extends Component {
|
return class CompWrapper extends Component {
|
||||||
constructor(props, context) {
|
constructor(props, context) {
|
||||||
super(props, context);
|
super(props, context);
|
||||||
}
|
}
|
||||||
@ -12,6 +14,4 @@ export default function (Comp) {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return compWrapper;
|
|
||||||
}
|
}
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import { transformArrayToMap, isJSFunction, transformStringToFunction, clone } from './index';
|
import { transformArrayToMap, isJSFunction, transformStringToFunction, clone } from './index';
|
||||||
import { jsonp, mtop, request, get, post, bzb } from './request';
|
import { jsonp, mtop, request, get, post, bzb } from './request';
|
||||||
|
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import Debug from 'debug';
|
import Debug from 'debug';
|
||||||
import _keymaster from 'keymaster';
|
import _keymaster from 'keymaster';
|
||||||
import { forEach as _forEach, shallowEqual as _shallowEqual } from '@ali/b3-one/lib/obj';
|
import { forEach as _forEach, shallowEqual as _shallowEqual } from '@ali/b3-one/lib/obj';
|
||||||
@ -13,9 +15,10 @@ import _debounce from 'lodash/debounce';
|
|||||||
import _serialize from 'serialize-javascript';
|
import _serialize from 'serialize-javascript';
|
||||||
import * as _jsonuri from 'jsonuri';
|
import * as _jsonuri from 'jsonuri';
|
||||||
import IntlMessageFormat from 'intl-messageformat';
|
import IntlMessageFormat from 'intl-messageformat';
|
||||||
import pkg from '../../package.json';
|
import * as fs from 'fs-extra';
|
||||||
|
|
||||||
window.sdkVersion = pkg.version;
|
const sdkVersion = fs.readJSONSync(path.join(__dirname, '..', '..', 'package.json'));
|
||||||
|
window.sdkVersion = sdkVersion;
|
||||||
|
|
||||||
export const moment = _moment;
|
export const moment = _moment;
|
||||||
moment.locale('zh-cn');
|
moment.locale('zh-cn');
|
||||||
@ -281,7 +284,7 @@ export function goldlog(gmKey, params = {}, logKey = 'other') {
|
|||||||
// vscode 黄金令箭API
|
// vscode 黄金令箭API
|
||||||
const sendIDEMessage = window.sendIDEMessage || getParentWinValue('sendIDEMessage');
|
const sendIDEMessage = window.sendIDEMessage || getParentWinValue('sendIDEMessage');
|
||||||
const goKey = serializeParams({
|
const goKey = serializeParams({
|
||||||
sdkVersion: pkg.version,
|
sdkVersion,
|
||||||
env: getEnv(),
|
env: getEnv(),
|
||||||
...params,
|
...params,
|
||||||
});
|
});
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import 'whatwg-fetch';
|
import 'whatwg-fetch';
|
||||||
import fetchMtop from '@ali/lib-mtop';
|
import fetchMtop from '@ali/lib-mtop';
|
||||||
import fetchJsonp from 'fetch-jsonp';
|
import fetchJsonp from 'fetch-jsonp';
|
||||||
25
packages/rax-render/tsconfig.json
Normal file
25
packages/rax-render/tsconfig.json
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["es2015", "dom"],
|
||||||
|
"target": "esnext",
|
||||||
|
"module": "esnext",
|
||||||
|
"moduleResolution": "node",
|
||||||
|
"strict": false,
|
||||||
|
"strictPropertyInitialization": false,
|
||||||
|
"allowSyntheticDefaultImports": true,
|
||||||
|
"esModuleInterop": true,
|
||||||
|
"jsx": "preserve",
|
||||||
|
"importHelpers": true,
|
||||||
|
"experimentalDecorators": true,
|
||||||
|
"emitDecoratorMetadata": true,
|
||||||
|
"sourceMap": true,
|
||||||
|
"forceConsistentCasingInFileNames": true,
|
||||||
|
"resolveJsonModule": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"outDir": "lib"
|
||||||
|
},
|
||||||
|
"exclude": ["test", "lib", "es", "node_modules"],
|
||||||
|
"include": [
|
||||||
|
"src"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -10,8 +10,8 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||||
"start": "../../node_modules/.bin/build-scripts start",
|
"start": "build-scripts start",
|
||||||
"build": "../../node_modules/.bin/build-scripts build",
|
"build": "build-scripts build",
|
||||||
"prepublishOnly": "npm run build"
|
"prepublishOnly": "npm run build"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
9
packages/react-renderer/tsconfig.json
Normal file
9
packages/react-renderer/tsconfig.json
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
"extends": "../../tsconfig.json",
|
||||||
|
"compilerOptions": {
|
||||||
|
"outDir": "lib"
|
||||||
|
},
|
||||||
|
"include": [
|
||||||
|
"./src/"
|
||||||
|
]
|
||||||
|
}
|
||||||
@ -1,3 +1,5 @@
|
|||||||
|
// @ts-nocheck
|
||||||
|
|
||||||
import EventEmitter from 'events';
|
import EventEmitter from 'events';
|
||||||
|
|
||||||
let instance = null;
|
let instance = null;
|
||||||
|
|||||||
@ -8,12 +8,6 @@
|
|||||||
"module": "esnext",
|
"module": "esnext",
|
||||||
// Search under node_modules for non-relative imports.
|
// Search under node_modules for non-relative imports.
|
||||||
"moduleResolution": "node",
|
"moduleResolution": "node",
|
||||||
// Process & infer types from .js files.
|
|
||||||
"allowJs": true,
|
|
||||||
// Report errors in .js files.
|
|
||||||
"checkJs": false,
|
|
||||||
// Don't emit; allow Babel to transform files.
|
|
||||||
// "noEmit": true,
|
|
||||||
// Enable strictest settings like strictNullChecks & noImplicitAny.
|
// Enable strictest settings like strictNullChecks & noImplicitAny.
|
||||||
"strict": true,
|
"strict": true,
|
||||||
"strictPropertyInitialization": false,
|
"strictPropertyInitialization": false,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user