@cuipengyu5/build-plugin-lowcode 0.0.1 → 0.0.2
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/README.md +47 -0
- package/package.json +2 -2
- package/src/compile/babel.js +198 -0
- package/src/compile/meta.js +87 -0
- package/src/config/user-config.js +71 -0
- package/src/constants.js +135 -0
- package/src/public/designer.html +302 -0
- package/src/public/index.html +308 -0
- package/src/public/preview.html +38 -0
- package/src/templates/assets.json +31 -0
- package/src/templates/component-meta.js +11 -0
- package/src/templates/index.jsx +273 -0
- package/src/templates/meta.js +168 -0
- package/src/templates/preview.jsx +93 -0
- package/src/templates/view.js +24 -0
- package/src/utils/getDemoDir.js +16 -0
- package/src/utils/index.js +252 -0
- package/src/utils/npm.js +41 -0
- package/src/utils/parse-props.js +261 -0
- package/demo/antd-setter-map/src/index.tsx +0 -5
- package/demo/component/src/index.tsx +0 -6
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
## 概述
|
|
2
|
+
|
|
3
|
+
## 使用文档
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
export interface LowcodeOptions {
|
|
7
|
+
builtinAssets?: Array<string|Assets>; // 会作为内置资产保存到构建产物中
|
|
8
|
+
extraAssets?: Array<string|Assets>; // 只在调试环境加载到资产包中
|
|
9
|
+
noParse?: boolean; // 关闭自动解析生成 lowcode meta
|
|
10
|
+
categories?: string[]; // 组件在组件面板中的分类
|
|
11
|
+
groups?: string[]; // 组件在组件面板中的 tab 分组
|
|
12
|
+
baseLibrary?: 'react'|'rax';
|
|
13
|
+
setterMap?: SetterMap; // 注入 setter
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface SetterMap {
|
|
17
|
+
[SetterName: string]: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export type Assets = {
|
|
21
|
+
package: string;
|
|
22
|
+
version: string;
|
|
23
|
+
urls: string[];
|
|
24
|
+
library: string;
|
|
25
|
+
};
|
|
26
|
+
// 示例
|
|
27
|
+
// {
|
|
28
|
+
// package: 'antd',
|
|
29
|
+
// version: '4.17.3',
|
|
30
|
+
// urls: [
|
|
31
|
+
// 'https://g.alicdn.com/code/lib/antd/4.17.3/antd.min.js',
|
|
32
|
+
// 'https://g.alicdn.com/code/lib/antd/4.17.3/antd.min.css',
|
|
33
|
+
// ],
|
|
34
|
+
// library: 'antd',
|
|
35
|
+
// }
|
|
36
|
+
```
|
|
37
|
+
## 开发调试
|
|
38
|
+
### 组件开发
|
|
39
|
+
|
|
40
|
+
`demo/component`目录下是测试组件的项目,改项目引用了 build-plugin-lowcode,相关配置在在 `demo/component/build.lowcode.js` 中;
|
|
41
|
+
|
|
42
|
+
可以修改 build-plugin-lowcode 的代码、修改 demo/component/build.lowcode.js 的配置进行调试;
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
# 在 build-plugin-lowcode 根目录下执行启动调试环境
|
|
46
|
+
npm run component:dev
|
|
47
|
+
```
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cuipengyu5/build-plugin-lowcode",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "build plugin for component-to-lowcode",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://
|
|
18
|
+
"url": "https://github.com/cuipy2004/lowcode-tools.git",
|
|
19
19
|
"directory": "packages/build-plugin-lowcode"
|
|
20
20
|
},
|
|
21
21
|
"author": "",
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
const glob = require("glob");
|
|
2
|
+
const babel = require("@babel/core");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const fs = require("fs-extra");
|
|
5
|
+
const getRaxBabelConfig = require("rax-babel-config");
|
|
6
|
+
const getCompileBabel = require("build-plugin-component/src/utils/getCompileBabel");
|
|
7
|
+
const dts = require('build-plugin-component/src/compiler/dts');
|
|
8
|
+
|
|
9
|
+
const defaultDynamicImportLibraries = [
|
|
10
|
+
"antd",
|
|
11
|
+
"@alifd/next",
|
|
12
|
+
"@alife/next",
|
|
13
|
+
"@icedesign/base",
|
|
14
|
+
];
|
|
15
|
+
|
|
16
|
+
const getBabelConfig = ({
|
|
17
|
+
target,
|
|
18
|
+
componentLibs = defaultDynamicImportLibraries,
|
|
19
|
+
rootDir,
|
|
20
|
+
babelPlugins,
|
|
21
|
+
babelOptions,
|
|
22
|
+
type,
|
|
23
|
+
alias,
|
|
24
|
+
root = 'lowcode',
|
|
25
|
+
}) => {
|
|
26
|
+
const params = target === "es" ? { modules: false } : {};
|
|
27
|
+
let babelConfig;
|
|
28
|
+
if (type === "react") {
|
|
29
|
+
babelConfig = getCompileBabel(params, {
|
|
30
|
+
babelPlugins,
|
|
31
|
+
babelOptions,
|
|
32
|
+
rootDir,
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
babelConfig = getRaxBabelConfig({
|
|
36
|
+
// Be careful~ change it's value by inlineStyle may cause break-change
|
|
37
|
+
styleSheet: true,
|
|
38
|
+
custom: {
|
|
39
|
+
ignore: ["**/**/*.d.ts"],
|
|
40
|
+
},
|
|
41
|
+
...params,
|
|
42
|
+
});
|
|
43
|
+
babelConfig.presets.push([
|
|
44
|
+
require.resolve("@babel/preset-typescript"),
|
|
45
|
+
{ jsxPragma: "createElement" },
|
|
46
|
+
]);
|
|
47
|
+
|
|
48
|
+
babelConfig.plugins = [...babelConfig.plugins, ...(babelPlugins || [])];
|
|
49
|
+
}
|
|
50
|
+
// generate babel-plugin-import config
|
|
51
|
+
const plugins = [];
|
|
52
|
+
componentLibs.forEach((libraryName) => {
|
|
53
|
+
// check es folder if target is es
|
|
54
|
+
const pluginOption = {
|
|
55
|
+
libraryName,
|
|
56
|
+
style: false, // style file will be require in style.js
|
|
57
|
+
};
|
|
58
|
+
if (target === "es") {
|
|
59
|
+
["es", "esm"].some((item) => {
|
|
60
|
+
const dirPath = path.join(rootDir, "node_modules", libraryName, item);
|
|
61
|
+
const dirExist = fs.existsSync(dirPath);
|
|
62
|
+
|
|
63
|
+
if (dirExist) {
|
|
64
|
+
pluginOption.libraryDirectory = item;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
return dirExist;
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
plugins.push([
|
|
71
|
+
require.resolve("babel-plugin-import"),
|
|
72
|
+
pluginOption,
|
|
73
|
+
libraryName,
|
|
74
|
+
]);
|
|
75
|
+
});
|
|
76
|
+
babelConfig.plugins = babelConfig.plugins.concat(plugins);
|
|
77
|
+
if (alias) {
|
|
78
|
+
const aliasRelative = {};
|
|
79
|
+
Object.keys(alias).forEach((aliasKey) => {
|
|
80
|
+
let aliasValue = alias[aliasKey];
|
|
81
|
+
aliasValue = aliasValue.replace('src', target);
|
|
82
|
+
aliasRelative[aliasKey] = aliasValue.startsWith("./")
|
|
83
|
+
? aliasValue
|
|
84
|
+
: `./${aliasValue}`;
|
|
85
|
+
});
|
|
86
|
+
babelConfig.plugins = babelConfig.plugins.concat([
|
|
87
|
+
[
|
|
88
|
+
require.resolve("babel-plugin-module-resolver"),
|
|
89
|
+
{
|
|
90
|
+
root: [root, target],
|
|
91
|
+
alias: aliasRelative,
|
|
92
|
+
},
|
|
93
|
+
],
|
|
94
|
+
]);
|
|
95
|
+
}
|
|
96
|
+
return babelConfig;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
const findGitIgnorePath = (rootDir) => {
|
|
100
|
+
let dir = rootDir;
|
|
101
|
+
let gitignorePath;
|
|
102
|
+
while (dir !== '/') {
|
|
103
|
+
const tempPath = path.join(dir, ".gitignore")
|
|
104
|
+
const fileExists = fs.pathExistsSync(tempPath);
|
|
105
|
+
if (fileExists) {
|
|
106
|
+
gitignorePath = tempPath;
|
|
107
|
+
break;
|
|
108
|
+
} else {
|
|
109
|
+
dir = path.dirname(dir);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return gitignorePath;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
const reg = {
|
|
116
|
+
REG_TS: /\.(tsx?)$/,
|
|
117
|
+
REG_D_TS: /\.d\.ts$/,
|
|
118
|
+
|
|
119
|
+
REG_JS: /\.(jsx?|tsx?)$/,
|
|
120
|
+
REG_SASS: /\.(sa|sc|c)ss$/,
|
|
121
|
+
REG_LESS: /\.(le|c)ss$/,
|
|
122
|
+
|
|
123
|
+
REG_JS_INDEX: /index\.(jsx?|tsx?)$/,
|
|
124
|
+
REG_SASS_INDEX: /index\.(sa|sc|c)ss$/,
|
|
125
|
+
REG_LESS_INDEX: /index\.(le|c)ss$/,
|
|
126
|
+
};
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
const babelCompile = async ({
|
|
130
|
+
source,
|
|
131
|
+
target,
|
|
132
|
+
rootDir,
|
|
133
|
+
userOptions,
|
|
134
|
+
type = "react",
|
|
135
|
+
}) => {
|
|
136
|
+
const { REG_SASS, REG_LESS, REG_JS, REG_D_TS } = reg;
|
|
137
|
+
const filesPath = glob.sync("**/*.*", {
|
|
138
|
+
cwd: source,
|
|
139
|
+
ignore: ["node_modules/**"],
|
|
140
|
+
});
|
|
141
|
+
const compileInfo = [];
|
|
142
|
+
['lib', 'es'].forEach((target) => {
|
|
143
|
+
const targetPath = `${source}_${target}`;
|
|
144
|
+
const distDirPath = path.join(rootDir, targetPath);
|
|
145
|
+
const { babelPlugins = [], babelOptions = [], alias } = userOptions;
|
|
146
|
+
fs.removeSync(distDirPath);
|
|
147
|
+
fs.ensureDirSync(distDirPath);
|
|
148
|
+
filesPath.forEach((filePath) => {
|
|
149
|
+
const sourceFile = path.join(rootDir, source, filePath);
|
|
150
|
+
if (!REG_JS.test(filePath) || REG_D_TS.test(filePath)) {
|
|
151
|
+
// copy file if it does not match REG_JS
|
|
152
|
+
try {
|
|
153
|
+
fs.copySync(sourceFile, path.join(distDirPath, filePath));
|
|
154
|
+
console.log(`file ${filePath} copied`);
|
|
155
|
+
} catch (err) {
|
|
156
|
+
throw new Error(err);
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
const distFile = path.join(distDirPath, filePath.replace(REG_JS, ".js"));
|
|
160
|
+
const babelConfig = getBabelConfig({
|
|
161
|
+
target,
|
|
162
|
+
rootDir,
|
|
163
|
+
babelOptions,
|
|
164
|
+
babelPlugins,
|
|
165
|
+
type,
|
|
166
|
+
alias,
|
|
167
|
+
});
|
|
168
|
+
const { code } = babel.transformFileSync(sourceFile, {
|
|
169
|
+
filename: distFile,
|
|
170
|
+
...babelConfig,
|
|
171
|
+
});
|
|
172
|
+
fs.ensureDirSync(path.dirname(distFile));
|
|
173
|
+
fs.writeFileSync(distFile, code, "utf-8");
|
|
174
|
+
compileInfo.push({
|
|
175
|
+
filePath,
|
|
176
|
+
sourceFile,
|
|
177
|
+
destPath: distDirPath,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
// 检查 .gitignore 如果没有产出路径,则增加该配置
|
|
182
|
+
const gitignorePath = findGitIgnorePath(rootDir);
|
|
183
|
+
if (gitignorePath) {
|
|
184
|
+
const gitignoreFile = fs.readFileSync(gitignorePath, "utf-8");
|
|
185
|
+
if (!(new RegExp(`${targetPath}/`)).test(gitignoreFile)) {
|
|
186
|
+
const newGitignoreFile = `${targetPath}/\r\n${gitignoreFile}`;
|
|
187
|
+
fs.writeFileSync(gitignorePath, newGitignoreFile);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
// 生成声明文件
|
|
192
|
+
dts(compileInfo, {
|
|
193
|
+
log: console,
|
|
194
|
+
})
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
babelCompile.getBabelConfig = getBabelConfig;
|
|
198
|
+
module.exports = babelCompile;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
/** 生成 lowcode 的入口文件(meta.js, view.js) */
|
|
2
|
+
const fs = require("fs-extra");
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const babel = require("@babel/core");
|
|
5
|
+
const { getBabelConfig } = require("./babel");
|
|
6
|
+
const { glob } = require("glob");
|
|
7
|
+
|
|
8
|
+
const getAvailableFileName = ({ fileName, lowcodeDir, rootDir }) => {
|
|
9
|
+
let finalName = fileName;
|
|
10
|
+
|
|
11
|
+
while (true) {
|
|
12
|
+
const files = glob.sync(`${finalName}.*`, {
|
|
13
|
+
cwd: lowcodeDir,
|
|
14
|
+
ignore: ["node_modules/**"],
|
|
15
|
+
});
|
|
16
|
+
const fileHasExists = files.some((f) => {
|
|
17
|
+
return /\.j|tsx?$/.test(f);
|
|
18
|
+
});
|
|
19
|
+
if (fileHasExists) {
|
|
20
|
+
finalName = `${finalName}_entry`
|
|
21
|
+
} else {
|
|
22
|
+
break;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return finalName;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
module.exports = async ({
|
|
29
|
+
rootDir,
|
|
30
|
+
tmpDir = ".tmp",
|
|
31
|
+
lowcodeDir = "lowcode",
|
|
32
|
+
userOptions,
|
|
33
|
+
type = "react",
|
|
34
|
+
package,
|
|
35
|
+
}) => {
|
|
36
|
+
const { babelPlugins = [], babelOptions = [], alias } = userOptions;
|
|
37
|
+
const exportsData = {
|
|
38
|
+
"./prototype": {},
|
|
39
|
+
"./prototypeView": {},
|
|
40
|
+
"./*": './*',
|
|
41
|
+
};
|
|
42
|
+
const targetExportsMap = {
|
|
43
|
+
'lib': 'require',
|
|
44
|
+
'es': 'import',
|
|
45
|
+
};
|
|
46
|
+
const fileNameEntryMap = {
|
|
47
|
+
meta: './prototype',
|
|
48
|
+
view: './prototypeView',
|
|
49
|
+
};
|
|
50
|
+
['lib', 'es'].forEach((target) => {
|
|
51
|
+
const babelConfigOptions = {
|
|
52
|
+
target,
|
|
53
|
+
babelOptions,
|
|
54
|
+
babelPlugins,
|
|
55
|
+
type,
|
|
56
|
+
alias,
|
|
57
|
+
rootDir,
|
|
58
|
+
};
|
|
59
|
+
const babelConfig = getBabelConfig(babelConfigOptions);
|
|
60
|
+
["meta", "view"].forEach((fileName) => {
|
|
61
|
+
const filePath = path.join(rootDir, tmpDir, `${fileName}.js`);
|
|
62
|
+
let fileContent = fs.readFileSync(filePath, "utf-8");
|
|
63
|
+
fileContent = fileContent
|
|
64
|
+
.replace(new RegExp(path.join(rootDir, "lowcode"), "g"), ".")
|
|
65
|
+
.replace(new RegExp(path.join(rootDir, "src"), "g"), `../${target}`)
|
|
66
|
+
.replace(/\.ts(x)?('|")/g, "$2")
|
|
67
|
+
.replace(/\\\\/g, "/");
|
|
68
|
+
const targetPath = `${lowcodeDir}_${target}`;
|
|
69
|
+
if (!package.files.includes(`${targetPath}/`)) {
|
|
70
|
+
package.files.push(`${targetPath}/`);
|
|
71
|
+
}
|
|
72
|
+
const entryName = getAvailableFileName({ fileName, lowcodeDir, rootDir });
|
|
73
|
+
exportsData[fileNameEntryMap[fileName]][targetExportsMap[target]] = `./${targetPath}/${entryName}.js`;
|
|
74
|
+
const distFilePath = path.join(rootDir, targetPath, `${entryName}.js`);
|
|
75
|
+
const { code } = babel.transformSync(fileContent, {
|
|
76
|
+
filename: distFilePath,
|
|
77
|
+
...babelConfig,
|
|
78
|
+
});
|
|
79
|
+
fs.ensureDirSync(path.dirname(distFilePath));
|
|
80
|
+
fs.writeFileSync(distFilePath, code, "utf-8");
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
package.exports = {
|
|
84
|
+
...package.exports,
|
|
85
|
+
...exportsData,
|
|
86
|
+
};
|
|
87
|
+
};
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = [
|
|
4
|
+
{
|
|
5
|
+
name: 'alias',
|
|
6
|
+
validation: 'object',
|
|
7
|
+
configWebpack: (config, alias, context) => {
|
|
8
|
+
const { rootDir } = context;
|
|
9
|
+
const aliasWithRoot = {};
|
|
10
|
+
Object.keys(alias).forEach((key) => {
|
|
11
|
+
if (path.isAbsolute(alias[key])) {
|
|
12
|
+
aliasWithRoot[key] = alias[key];
|
|
13
|
+
} else {
|
|
14
|
+
aliasWithRoot[key] = path.resolve(rootDir, alias[key]);
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
config.merge({
|
|
18
|
+
resolve: {
|
|
19
|
+
alias: aliasWithRoot,
|
|
20
|
+
},
|
|
21
|
+
});
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'library',
|
|
26
|
+
validation: 'string',
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: 'libraryExport',
|
|
30
|
+
validation: 'string',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'libraryTarget',
|
|
34
|
+
validation: 'string',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'filename',
|
|
38
|
+
validation: 'string',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'sourceMap',
|
|
42
|
+
validation: 'boolean',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'minify',
|
|
46
|
+
validation: 'boolean',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'type',
|
|
50
|
+
validation: 'string',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'devServer',
|
|
54
|
+
validation: 'object',
|
|
55
|
+
defaultValue: {
|
|
56
|
+
logLevel: 'silent',
|
|
57
|
+
compress: true,
|
|
58
|
+
disableHostCheck: true,
|
|
59
|
+
clientLogLevel: 'error',
|
|
60
|
+
hot: true,
|
|
61
|
+
quiet: true,
|
|
62
|
+
overlay: false,
|
|
63
|
+
},
|
|
64
|
+
configWebpack: (config, devServer, context) => {
|
|
65
|
+
const { command } = context;
|
|
66
|
+
if (command === 'start' && devServer) {
|
|
67
|
+
config.merge({ devServer });
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
];
|
package/src/constants.js
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
const SUPPORTED_COMMAND = ['start', 'build'];
|
|
2
|
+
|
|
3
|
+
const COMMON_EXTERNALS = {
|
|
4
|
+
react: 'var window.React',
|
|
5
|
+
'react-dom': 'var window.ReactDOM',
|
|
6
|
+
'prop-types': 'var window.PropTypes',
|
|
7
|
+
'@alifd/next': 'var window.Next',
|
|
8
|
+
'@alifd/meet': 'var window.Meet',
|
|
9
|
+
'@ali/visualengine': 'var window.VisualEngine',
|
|
10
|
+
'@ali/visualengine-utils': 'var window.VisualEngineUtils',
|
|
11
|
+
'@ali/lowcode-engine': 'var window.AliLowCodeEngine',
|
|
12
|
+
'@alilc/lowcode-engine': 'var window.AliLowCodeEngine',
|
|
13
|
+
'@ali/lowcode-rax-renderer': 'var window.alilcLowcodeRaxRenderer',
|
|
14
|
+
rax: 'var window.Rax',
|
|
15
|
+
antd: 'var window.antd',
|
|
16
|
+
'@alifd/lowcode-preset-plugin': 'var window.PluginLowcodeEditor',
|
|
17
|
+
'monaco-editor/esm/vs/editor/editor.api': 'var window.monaco',
|
|
18
|
+
'monaco-editor/esm/vs/editor/editor.main.js': 'var window.monaco',
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const ALILC_COMMON_EXTERNALS = {
|
|
22
|
+
...COMMON_EXTERNALS,
|
|
23
|
+
'@alifd/lowcode-preset-plugin': 'var window.LowcodePresetPlugin',
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const DEFAULT_GROUPS = ['精选组件', '原子组件'];
|
|
27
|
+
const DEFAULT_CATEGORIES = [
|
|
28
|
+
'基础元素',
|
|
29
|
+
'布局容器类',
|
|
30
|
+
'表格类',
|
|
31
|
+
'表单详情类',
|
|
32
|
+
'帮助类',
|
|
33
|
+
'对话框类',
|
|
34
|
+
'业务类',
|
|
35
|
+
'通用',
|
|
36
|
+
'引导',
|
|
37
|
+
'信息输入',
|
|
38
|
+
'信息展示',
|
|
39
|
+
'信息反馈',
|
|
40
|
+
];
|
|
41
|
+
|
|
42
|
+
const STATIC_RESOURCES = {
|
|
43
|
+
themeVariableUrl: 'https://alifd.alicdn.com/npm/@alifd/theme-lowcode-dark@0.6.1/variables.css',
|
|
44
|
+
themeStyleUrl:
|
|
45
|
+
'https://alifd.alicdn.com/npm/@alifd/theme-lowcode-dark@0.6.1/dist/next.var.min.css',
|
|
46
|
+
engineCoreCssUrl:
|
|
47
|
+
'https://dev.g.alicdn.com/ali-lowcode/ali-lowcode-engine/0.16.6/engine-core.css',
|
|
48
|
+
enginePresetCssUrl:
|
|
49
|
+
'https://alifd.alicdn.com/npm/@alifd/lowcode-preset-plugin@1.1.8/dist/editor-preset-plugin.css',
|
|
50
|
+
engineExtCssUrl: 'https://g.alicdn.com/ali-lowcode/lowcode-engine-ext/1.0.20/engine-ext.css',
|
|
51
|
+
engineCoreJsUrl: 'https://dev.g.alicdn.com/ali-lowcode/ali-lowcode-engine/0.16.6/engine-core.js',
|
|
52
|
+
engineExtJsUrl: 'https://g.alicdn.com/ali-lowcode/lowcode-engine-ext/1.0.20/engine-ext.js',
|
|
53
|
+
enginePresetJsUrl:
|
|
54
|
+
'https://alifd.alicdn.com/npm/@alifd/lowcode-preset-plugin@1.1.8/dist/editor-preset-plugin.js',
|
|
55
|
+
raxRenderJsUrl: 'https://alifd.alicdn.com/npm/@alilc/lowcode-rax-renderer@1.0.18/dist/index.umd.js',
|
|
56
|
+
raxRenderCssUrl: 'https://alifd.alicdn.com/npm/@alilc/lowcode-rax-renderer@1.0.18/dist/index.css',
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
const ALILC_STATIC_RESOURCES = {
|
|
60
|
+
themeVariableUrl: 'https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/variables.css',
|
|
61
|
+
themeStyleUrl:
|
|
62
|
+
'https://alifd.alicdn.com/npm/@alifd/theme-lowcode-light@0.2.1/dist/next.var.min.css',
|
|
63
|
+
engineCoreCssUrl:
|
|
64
|
+
'https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.1.7-beta.11/dist/css/engine-core.css',
|
|
65
|
+
engineExtCssUrl:
|
|
66
|
+
'https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6-beta.25/dist/css/engine-ext.css',
|
|
67
|
+
enginePresetCssUrl:
|
|
68
|
+
'https://alifd.alicdn.com/npm/@alilc/lowcode-preset-plugin@0.1.2/dist/lowcode-preset-plugin.css',
|
|
69
|
+
engineCoreJsUrl:
|
|
70
|
+
'https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine/1.1.7-beta.11/dist/js/engine-core.js',
|
|
71
|
+
engineExtJsUrl:
|
|
72
|
+
'https://uipaas-assets.com/prod/npm/@alilc/lowcode-engine-ext/1.0.6-beta.25/dist/js/engine-ext.js',
|
|
73
|
+
enginePresetJsUrl:
|
|
74
|
+
'https://alifd.alicdn.com/npm/@alilc/lowcode-preset-plugin@0.1.2/dist/lowcode-preset-plugin.js',
|
|
75
|
+
raxRenderJsUrl: 'https://alifd.alicdn.com/npm/@alilc/lowcode-rax-renderer@1.0.18/dist/index.umd.js',
|
|
76
|
+
raxRenderCssUrl: 'https://alifd.alicdn.com/npm/@alilc/lowcode-rax-renderer@1.0.18/dist/index.css',
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const STATIC_RESOURCES_MAP = {
|
|
80
|
+
'@ali': STATIC_RESOURCES,
|
|
81
|
+
'@alilc': ALILC_STATIC_RESOURCES,
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
const COMMON_EXTERNALS_MAP = {
|
|
85
|
+
'@ali': COMMON_EXTERNALS,
|
|
86
|
+
'@alilc': ALILC_COMMON_EXTERNALS,
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const BASIC_LIBRARY_VERSION = {
|
|
90
|
+
'@alifd/next': '1.25.23',
|
|
91
|
+
'@alifd/meet': '2.6.3',
|
|
92
|
+
antd: '4.17.3',
|
|
93
|
+
};
|
|
94
|
+
const COMPONENT_PROPS = [
|
|
95
|
+
'componentName',
|
|
96
|
+
'title',
|
|
97
|
+
'description',
|
|
98
|
+
'docUrl',
|
|
99
|
+
'screenshot',
|
|
100
|
+
'icon',
|
|
101
|
+
'tags',
|
|
102
|
+
'keywards',
|
|
103
|
+
'devMode',
|
|
104
|
+
'npm',
|
|
105
|
+
|
|
106
|
+
'props',
|
|
107
|
+
'configure',
|
|
108
|
+
'snippets',
|
|
109
|
+
'group',
|
|
110
|
+
'category',
|
|
111
|
+
'priority',
|
|
112
|
+
];
|
|
113
|
+
|
|
114
|
+
const UNPKG_BASE_URL_MAP = {
|
|
115
|
+
'@ali': 'https://unpkg.alibaba-inc.com',
|
|
116
|
+
'@alilc': 'https://unpkg.com',
|
|
117
|
+
};
|
|
118
|
+
|
|
119
|
+
const META_TYPES = ['', 'dev', 'web', 'mobile', 'design', 'sketch'];
|
|
120
|
+
|
|
121
|
+
module.exports = {
|
|
122
|
+
SUPPORTED_COMMAND,
|
|
123
|
+
COMMON_EXTERNALS,
|
|
124
|
+
ALILC_COMMON_EXTERNALS,
|
|
125
|
+
COMMON_EXTERNALS_MAP,
|
|
126
|
+
DEFAULT_GROUPS,
|
|
127
|
+
DEFAULT_CATEGORIES,
|
|
128
|
+
STATIC_RESOURCES,
|
|
129
|
+
ALILC_STATIC_RESOURCES,
|
|
130
|
+
STATIC_RESOURCES_MAP,
|
|
131
|
+
BASIC_LIBRARY_VERSION,
|
|
132
|
+
COMPONENT_PROPS,
|
|
133
|
+
UNPKG_BASE_URL_MAP,
|
|
134
|
+
META_TYPES,
|
|
135
|
+
};
|