@cloudbase/framework-plugin-low-code 1.7.0 → 1.7.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/package.json +3 -3
- package/lib/builder/config/common.d.ts +0 -2
- package/lib/builder/config/common.d.ts.map +0 -1
- package/lib/builder/config/common.js +0 -13
- package/lib/builder/config/index.d.ts +0 -3
- package/lib/builder/config/index.d.ts.map +0 -1
- package/lib/builder/config/index.js +0 -29
- package/lib/builder/config/mp.d.ts +0 -2
- package/lib/builder/config/mp.d.ts.map +0 -1
- package/lib/builder/config/mp.js +0 -13
- package/lib/builder/core/copy.d.ts +0 -5
- package/lib/builder/core/copy.d.ts.map +0 -1
- package/lib/builder/core/copy.js +0 -62
- package/lib/builder/core/generate.d.ts +0 -9
- package/lib/builder/core/generate.d.ts.map +0 -1
- package/lib/builder/core/generate.js +0 -128
- package/lib/builder/core/index.d.ts +0 -32
- package/lib/builder/core/index.d.ts.map +0 -1
- package/lib/builder/core/index.js +0 -149
- package/lib/builder/core/material.d.ts +0 -4
- package/lib/builder/core/material.d.ts.map +0 -1
- package/lib/builder/core/material.js +0 -80
- package/lib/builder/core/plugin.d.ts +0 -4
- package/lib/builder/core/plugin.d.ts.map +0 -1
- package/lib/builder/core/plugin.js +0 -30
- package/lib/builder/core/prepare.d.ts +0 -8
- package/lib/builder/core/prepare.d.ts.map +0 -1
- package/lib/builder/core/prepare.js +0 -108
- package/lib/builder/core/webpack.d.ts +0 -15
- package/lib/builder/core/webpack.d.ts.map +0 -1
- package/lib/builder/core/webpack.js +0 -58
- package/lib/builder/mp/BuildContext.d.ts +0 -13
- package/lib/builder/mp/BuildContext.d.ts.map +0 -1
- package/lib/builder/mp/BuildContext.js +0 -2
- package/lib/builder/mp/index.d.ts +0 -33
- package/lib/builder/mp/index.d.ts.map +0 -1
- package/lib/builder/mp/index.js +0 -450
- package/lib/builder/mp/lowcode.d.ts +0 -8
- package/lib/builder/mp/lowcode.d.ts.map +0 -1
- package/lib/builder/mp/lowcode.js +0 -54
- package/lib/builder/mp/materials.d.ts +0 -15
- package/lib/builder/mp/materials.d.ts.map +0 -1
- package/lib/builder/mp/materials.js +0 -338
- package/lib/builder/mp/mixMode.d.ts +0 -10
- package/lib/builder/mp/mixMode.d.ts.map +0 -1
- package/lib/builder/mp/mixMode.js +0 -215
- package/lib/builder/mp/mp_config.d.ts +0 -18
- package/lib/builder/mp/mp_config.d.ts.map +0 -1
- package/lib/builder/mp/mp_config.js +0 -206
- package/lib/builder/mp/util.d.ts +0 -20
- package/lib/builder/mp/util.d.ts.map +0 -1
- package/lib/builder/mp/util.js +0 -243
- package/lib/builder/mp/wxml.d.ts +0 -16
- package/lib/builder/mp/wxml.d.ts.map +0 -1
- package/lib/builder/mp/wxml.js +0 -300
- package/lib/builder/service/builder/copy.d.ts +0 -14
- package/lib/builder/service/builder/copy.d.ts.map +0 -1
- package/lib/builder/service/builder/copy.js +0 -189
- package/lib/builder/service/builder/generate.d.ts +0 -52
- package/lib/builder/service/builder/generate.d.ts.map +0 -1
- package/lib/builder/service/builder/generate.js +0 -792
- package/lib/builder/service/builder/index.d.ts +0 -16
- package/lib/builder/service/builder/index.d.ts.map +0 -1
- package/lib/builder/service/builder/index.js +0 -69
- package/lib/builder/service/builder/plugin.d.ts +0 -8
- package/lib/builder/service/builder/plugin.d.ts.map +0 -1
- package/lib/builder/service/builder/plugin.js +0 -149
- package/lib/builder/service/builder/webpack.d.ts +0 -91
- package/lib/builder/service/builder/webpack.d.ts.map +0 -1
- package/lib/builder/service/builder/webpack.js +0 -589
- package/lib/builder/types/common.d.ts +0 -12
- package/lib/builder/types/common.d.ts.map +0 -1
- package/lib/builder/types/common.js +0 -7
- package/lib/builder/util/common.d.ts +0 -36
- package/lib/builder/util/common.d.ts.map +0 -1
- package/lib/builder/util/common.js +0 -257
- package/lib/builder/util/console.d.ts +0 -2
- package/lib/builder/util/console.d.ts.map +0 -1
- package/lib/builder/util/console.js +0 -13
- package/lib/builder/util/generateFiles.d.ts +0 -6
- package/lib/builder/util/generateFiles.d.ts.map +0 -1
- package/lib/builder/util/generateFiles.js +0 -94
- package/lib/builder/util/index.d.ts +0 -2
- package/lib/builder/util/index.d.ts.map +0 -1
- package/lib/builder/util/index.js +0 -13
- package/lib/builder/util/junk.d.ts +0 -3
- package/lib/builder/util/junk.d.ts.map +0 -1
- package/lib/builder/util/junk.js +0 -25
- package/lib/builder/util/mp.d.ts +0 -5
- package/lib/builder/util/mp.d.ts.map +0 -1
- package/lib/builder/util/mp.js +0 -99
- package/lib/builder/util/name-mangler.d.ts +0 -3
- package/lib/builder/util/name-mangler.d.ts.map +0 -1
- package/lib/builder/util/name-mangler.js +0 -7
- package/lib/builder/util/net.d.ts +0 -3
- package/lib/builder/util/net.d.ts.map +0 -1
- package/lib/builder/util/net.js +0 -54
- package/lib/builder/util/process.d.ts +0 -9
- package/lib/builder/util/process.d.ts.map +0 -1
- package/lib/builder/util/process.js +0 -28
- package/lib/builder/util/style.d.ts +0 -2
- package/lib/builder/util/style.d.ts.map +0 -1
- package/lib/builder/util/style.js +0 -13
- package/lib/builder/util/weapp.d.ts +0 -2
- package/lib/builder/util/weapp.d.ts.map +0 -1
- package/lib/builder/util/weapp.js +0 -13
- package/lib/config/private.d.ts +0 -3
- package/lib/config/private.d.ts.map +0 -1
- package/lib/config/private.js +0 -14
- package/lib/generate.d.ts +0 -2
- package/lib/generate.d.ts.map +0 -1
- package/lib/generate.js +0 -49
- package/lib/generator/config/common.d.ts +0 -6
- package/lib/generator/config/common.d.ts.map +0 -1
- package/lib/generator/config/common.js +0 -25
- package/lib/generator/config/index.d.ts +0 -18
- package/lib/generator/config/index.d.ts.map +0 -1
- package/lib/generator/config/index.js +0 -43
- package/lib/generator/config/mp.d.ts +0 -56
- package/lib/generator/config/mp.d.ts.map +0 -1
- package/lib/generator/config/mp.js +0 -104
- package/lib/generator/core/generate.d.ts +0 -59
- package/lib/generator/core/generate.d.ts.map +0 -1
- package/lib/generator/core/generate.js +0 -663
- package/lib/generator/core/index.d.ts +0 -25
- package/lib/generator/core/index.d.ts.map +0 -1
- package/lib/generator/core/index.js +0 -102
- package/lib/generator/core/material.d.ts +0 -14
- package/lib/generator/core/material.d.ts.map +0 -1
- package/lib/generator/core/material.js +0 -230
- package/lib/generator/template.d.ts +0 -3
- package/lib/generator/template.d.ts.map +0 -1
- package/lib/generator/template.js +0 -3
- package/lib/generator/types/common.d.ts +0 -69
- package/lib/generator/types/common.d.ts.map +0 -1
- package/lib/generator/types/common.js +0 -21
- package/lib/generator/util/common.d.ts +0 -36
- package/lib/generator/util/common.d.ts.map +0 -1
- package/lib/generator/util/common.js +0 -238
- package/lib/generator/util/console.d.ts +0 -3
- package/lib/generator/util/console.d.ts.map +0 -1
- package/lib/generator/util/console.js +0 -17
- package/lib/generator/util/index.d.ts +0 -2
- package/lib/generator/util/index.d.ts.map +0 -1
- package/lib/generator/util/index.js +0 -13
- package/lib/generator/util/name-mangler.d.ts +0 -17
- package/lib/generator/util/name-mangler.d.ts.map +0 -1
- package/lib/generator/util/name-mangler.js +0 -63
- package/lib/generator/util/postcss-rpx.d.ts +0 -11
- package/lib/generator/util/postcss-rpx.d.ts.map +0 -1
- package/lib/generator/util/postcss-rpx.js +0 -16
- package/lib/generator/util/style.d.ts +0 -6
- package/lib/generator/util/style.d.ts.map +0 -1
- package/lib/generator/util/style.js +0 -92
- package/lib/generator/util/weapp.d.ts +0 -5
- package/lib/generator/util/weapp.d.ts.map +0 -1
- package/lib/generator/util/weapp.js +0 -17
- package/lib/types.d.ts +0 -14
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -19
- package/lib/utils/dataSource.d.ts +0 -28
- package/lib/utils/dataSource.d.ts.map +0 -1
- package/lib/utils/dataSource.js +0 -171
- package/lib/utils/postProcess.d.ts +0 -3
- package/lib/utils/postProcess.d.ts.map +0 -1
- package/lib/utils/postProcess.js +0 -48
- package/lib/weapps-core/config/index.d.ts +0 -2
- package/lib/weapps-core/config/index.d.ts.map +0 -1
- package/lib/weapps-core/config/index.js +0 -13
- package/lib/weapps-core/config/style.d.ts +0 -7
- package/lib/weapps-core/config/style.d.ts.map +0 -1
- package/lib/weapps-core/config/style.js +0 -70
- package/lib/weapps-core/index.d.ts +0 -6
- package/lib/weapps-core/index.d.ts.map +0 -1
- package/lib/weapps-core/index.js +0 -31
- package/lib/weapps-core/types/action.d.ts +0 -25
- package/lib/weapps-core/types/action.d.ts.map +0 -1
- package/lib/weapps-core/types/action.js +0 -28
- package/lib/weapps-core/types/app.d.ts +0 -142
- package/lib/weapps-core/types/app.d.ts.map +0 -1
- package/lib/weapps-core/types/app.js +0 -21
- package/lib/weapps-core/types/appbuild.d.ts +0 -63
- package/lib/weapps-core/types/appbuild.d.ts.map +0 -1
- package/lib/weapps-core/types/appbuild.js +0 -78
- package/lib/weapps-core/types/code_types.d.ts +0 -26
- package/lib/weapps-core/types/code_types.d.ts.map +0 -1
- package/lib/weapps-core/types/code_types.js +0 -2
- package/lib/weapps-core/types/git.d.ts +0 -7
- package/lib/weapps-core/types/git.d.ts.map +0 -1
- package/lib/weapps-core/types/git.js +0 -2
- package/lib/weapps-core/types/index.d.ts +0 -11
- package/lib/weapps-core/types/index.d.ts.map +0 -1
- package/lib/weapps-core/types/index.js +0 -22
- package/lib/weapps-core/types/lowcode.d.ts +0 -26
- package/lib/weapps-core/types/lowcode.d.ts.map +0 -1
- package/lib/weapps-core/types/lowcode.js +0 -25
- package/lib/weapps-core/types/material.d.ts +0 -90
- package/lib/weapps-core/types/material.d.ts.map +0 -1
- package/lib/weapps-core/types/material.js +0 -9
- package/lib/weapps-core/types/plugins.d.ts +0 -17
- package/lib/weapps-core/types/plugins.d.ts.map +0 -1
- package/lib/weapps-core/types/plugins.js +0 -2
- package/lib/weapps-core/types/style.d.ts +0 -93
- package/lib/weapps-core/types/style.d.ts.map +0 -1
- package/lib/weapps-core/types/style.js +0 -2
- package/lib/weapps-core/types/web.d.ts +0 -120
- package/lib/weapps-core/types/web.d.ts.map +0 -1
- package/lib/weapps-core/types/web.js +0 -2
- package/lib/weapps-core/utils/appbuild.d.ts +0 -6
- package/lib/weapps-core/utils/appbuild.d.ts.map +0 -1
- package/lib/weapps-core/utils/appbuild.js +0 -40
- package/lib/weapps-core/utils/common.d.ts +0 -16
- package/lib/weapps-core/utils/common.d.ts.map +0 -1
- package/lib/weapps-core/utils/common.js +0 -90
- package/lib/weapps-core/utils/file.d.ts +0 -12
- package/lib/weapps-core/utils/file.d.ts.map +0 -1
- package/lib/weapps-core/utils/file.js +0 -142
- package/lib/weapps-core/utils/formily.d.ts +0 -5
- package/lib/weapps-core/utils/formily.d.ts.map +0 -1
- package/lib/weapps-core/utils/formily.js +0 -416
- package/lib/weapps-core/utils/index.d.ts +0 -7
- package/lib/weapps-core/utils/index.d.ts.map +0 -1
- package/lib/weapps-core/utils/index.js +0 -18
- package/lib/weapps-core/utils/lowcdoe.d.ts +0 -4
- package/lib/weapps-core/utils/lowcdoe.d.ts.map +0 -1
- package/lib/weapps-core/utils/lowcdoe.js +0 -69
- package/lib/weapps-core/utils/style.d.ts +0 -17
- package/lib/weapps-core/utils/style.d.ts.map +0 -1
- package/lib/weapps-core/utils/style.js +0 -330
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { IDataBind } from '../types';
|
|
2
|
-
export declare function loopDealWithFn<Node extends {
|
|
3
|
-
children?: Node[];
|
|
4
|
-
}, R>(data: Node[], runFn: (a: Node) => R, result?: R[]): R[];
|
|
5
|
-
export declare function kebabCase(str: string): string;
|
|
6
|
-
export declare function camelcase(str: string, firstUpperCase?: boolean): string;
|
|
7
|
-
export declare function isArray(src: any): boolean;
|
|
8
|
-
export declare function isPlainObject(src: any): boolean;
|
|
9
|
-
export declare const isEmptyObj: (obj: object) => boolean;
|
|
10
|
-
export declare function setValidValue(target: any, key: any, value: any): void;
|
|
11
|
-
export declare function isValidStyleBind(styleBind: IDataBind): boolean;
|
|
12
|
-
export declare function isValidClassNameListBind(classNameListBind: IDataBind): boolean;
|
|
13
|
-
export declare function checkVisible({ _visible }: {
|
|
14
|
-
_visible: unknown;
|
|
15
|
-
}): boolean;
|
|
16
|
-
//# sourceMappingURL=common.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/weapps-core/utils/common.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,SAAS,EAAE,MAAM,UAAU,CAAA;AAEtD,wBAAgB,cAAc,CAAC,IAAI,SAAS;IAAE,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAA;CAAE,EAAE,CAAC,EAClE,IAAI,EAAE,IAAI,EAAE,EACZ,KAAK,EAAE,CAAC,CAAC,EAAE,IAAI,KAAK,CAAC,EACrB,MAAM,GAAE,CAAC,EAAO,OASjB;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,UAIpC;AAED,wBAAgB,SAAS,CAAC,GAAG,EAAE,MAAM,EAAE,cAAc,UAAQ,UAQ5D;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,GAAG,WAE/B;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,GAAG,WAErC;AAED,eAAO,MAAM,UAAU,QAAS,MAAM,YAUrC,CAAA;AAED,wBAAgB,aAAa,CAAC,MAAM,KAAA,EAAE,GAAG,KAAA,EAAE,KAAK,KAAA,QAc/C;AAED,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,SAAS,WAQpD;AAED,wBAAgB,wBAAwB,CAAC,iBAAiB,EAAE,SAAS,WAQpE;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE;IAAE,QAAQ,EAAE,OAAO,CAAA;CAAE,WAE/D"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkVisible = exports.isValidClassNameListBind = exports.isValidStyleBind = exports.setValidValue = exports.isEmptyObj = exports.isPlainObject = exports.isArray = exports.camelcase = exports.kebabCase = exports.loopDealWithFn = void 0;
|
|
4
|
-
const config_1 = require("../config");
|
|
5
|
-
const types_1 = require("../types");
|
|
6
|
-
function loopDealWithFn(data, runFn, result = []) {
|
|
7
|
-
data.map(item => {
|
|
8
|
-
if (item.children) {
|
|
9
|
-
loopDealWithFn(item.children, runFn, result);
|
|
10
|
-
}
|
|
11
|
-
result.push(runFn(item));
|
|
12
|
-
});
|
|
13
|
-
return result;
|
|
14
|
-
}
|
|
15
|
-
exports.loopDealWithFn = loopDealWithFn;
|
|
16
|
-
function kebabCase(str) {
|
|
17
|
-
return str.replace(config_1.KEBAB_REGEX, function (match) {
|
|
18
|
-
return '-' + match.toLowerCase();
|
|
19
|
-
});
|
|
20
|
-
}
|
|
21
|
-
exports.kebabCase = kebabCase;
|
|
22
|
-
function camelcase(str, firstUpperCase = false) {
|
|
23
|
-
str = str.replace(/[_-]([a-z])/g, function (l) {
|
|
24
|
-
return l[1].toUpperCase();
|
|
25
|
-
});
|
|
26
|
-
if (firstUpperCase)
|
|
27
|
-
str = str.charAt(0).toUpperCase() + str.slice(1);
|
|
28
|
-
return str;
|
|
29
|
-
}
|
|
30
|
-
exports.camelcase = camelcase;
|
|
31
|
-
function isArray(src) {
|
|
32
|
-
return Object.prototype.toString.call(src) === '[object Array]';
|
|
33
|
-
}
|
|
34
|
-
exports.isArray = isArray;
|
|
35
|
-
function isPlainObject(src) {
|
|
36
|
-
return Object.prototype.toString.call(src) === '[object Object]';
|
|
37
|
-
}
|
|
38
|
-
exports.isPlainObject = isPlainObject;
|
|
39
|
-
const isEmptyObj = (obj) => {
|
|
40
|
-
if (!isPlainObject(obj)) {
|
|
41
|
-
return false;
|
|
42
|
-
}
|
|
43
|
-
for (const i in obj) {
|
|
44
|
-
if (Object.prototype.hasOwnProperty.call(obj, i)) {
|
|
45
|
-
return false;
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
return true;
|
|
49
|
-
};
|
|
50
|
-
exports.isEmptyObj = isEmptyObj;
|
|
51
|
-
function setValidValue(target, key, value) {
|
|
52
|
-
if (value === undefined || value === null) {
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
if (isArray(value) && value.length === 0) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
if (isPlainObject(value) && (0, exports.isEmptyObj)(value)) {
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (!target) {
|
|
62
|
-
return;
|
|
63
|
-
}
|
|
64
|
-
target[key] = value;
|
|
65
|
-
}
|
|
66
|
-
exports.setValidValue = setValidValue;
|
|
67
|
-
function isValidStyleBind(styleBind) {
|
|
68
|
-
if (!styleBind) {
|
|
69
|
-
return false;
|
|
70
|
-
}
|
|
71
|
-
if (styleBind.propertyPath === types_1.BindPropertyPath.style && styleBind.bindDataPath) {
|
|
72
|
-
return true;
|
|
73
|
-
}
|
|
74
|
-
return false;
|
|
75
|
-
}
|
|
76
|
-
exports.isValidStyleBind = isValidStyleBind;
|
|
77
|
-
function isValidClassNameListBind(classNameListBind) {
|
|
78
|
-
if (!classNameListBind) {
|
|
79
|
-
return false;
|
|
80
|
-
}
|
|
81
|
-
if (classNameListBind.propertyPath === types_1.BindPropertyPath.classNameList) {
|
|
82
|
-
return true;
|
|
83
|
-
}
|
|
84
|
-
return false;
|
|
85
|
-
}
|
|
86
|
-
exports.isValidClassNameListBind = isValidClassNameListBind;
|
|
87
|
-
function checkVisible({ _visible }) {
|
|
88
|
-
return _visible !== false && _visible !== '';
|
|
89
|
-
}
|
|
90
|
-
exports.checkVisible = checkVisible;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { IWeAppData, CodeType } from '../types';
|
|
2
|
-
export declare function originJsonToFileList(appData: IWeAppData): (import("../types").IWeAppCode | {
|
|
3
|
-
path: string;
|
|
4
|
-
name: string;
|
|
5
|
-
type: string;
|
|
6
|
-
code: string;
|
|
7
|
-
pageId: string;
|
|
8
|
-
})[];
|
|
9
|
-
export declare function getExtByType(type: CodeType): ".less" | ".js" | ".json";
|
|
10
|
-
export declare function HACK_FIX_LOWCODE_IN(code?: string): string;
|
|
11
|
-
export declare function HACK_FIX_LOWCODE_OUT(code?: string): string;
|
|
12
|
-
//# sourceMappingURL=file.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"file.d.ts","sourceRoot":"","sources":["../../../src/weapps-core/utils/file.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAA;AAa3D,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,UAAU;;;;;;KAKvD;AA2HD,wBAAgB,YAAY,CAAC,IAAI,EAAE,QAAQ,6BAc1C;AAID,wBAAgB,mBAAmB,CAAC,IAAI,SAAK,UAE5C;AACD,wBAAgB,oBAAoB,CAAC,IAAI,SAAK,UAE7C"}
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.HACK_FIX_LOWCODE_OUT = exports.HACK_FIX_LOWCODE_IN = exports.getExtByType = exports.originJsonToFileList = void 0;
|
|
4
|
-
function originJsonToFileList(appData) {
|
|
5
|
-
const configFiles = handleConfigJson(appData);
|
|
6
|
-
const pageFiles = handlePageJson(appData);
|
|
7
|
-
const lowCodeFiles = handleLowCodeFile(appData);
|
|
8
|
-
return [...configFiles, ...pageFiles, ...lowCodeFiles];
|
|
9
|
-
}
|
|
10
|
-
exports.originJsonToFileList = originJsonToFileList;
|
|
11
|
-
function handleConfigJson(appData) {
|
|
12
|
-
const homePageItem = appData.pageInstanceList.find((page) => !!page.isHome);
|
|
13
|
-
const globalConfig = {
|
|
14
|
-
appConfig: appData.appConfig,
|
|
15
|
-
selectedPageId: appData.selectedPageId,
|
|
16
|
-
npmDependencies: appData.npmDependencies,
|
|
17
|
-
homePage: homePageItem && homePageItem.id,
|
|
18
|
-
themeVars: appData.themeVars,
|
|
19
|
-
presetColors: appData.presetColors,
|
|
20
|
-
};
|
|
21
|
-
const globalFile = {
|
|
22
|
-
path: 'global/app-config',
|
|
23
|
-
name: 'app-config',
|
|
24
|
-
type: 'json',
|
|
25
|
-
code: JSON.stringify(globalConfig, null, 2),
|
|
26
|
-
pageId: 'global',
|
|
27
|
-
};
|
|
28
|
-
const pagesConfig = appData.pageInstanceList.map((page) => {
|
|
29
|
-
const pageConfig = {
|
|
30
|
-
data: page.data,
|
|
31
|
-
commonStyle: page.commonStyle,
|
|
32
|
-
};
|
|
33
|
-
return {
|
|
34
|
-
path: `${page.id}/page-config`,
|
|
35
|
-
name: 'page-config',
|
|
36
|
-
type: 'json',
|
|
37
|
-
code: JSON.stringify(pageConfig, null, 2),
|
|
38
|
-
pageId: page.id,
|
|
39
|
-
};
|
|
40
|
-
});
|
|
41
|
-
return [globalFile].concat(pagesConfig);
|
|
42
|
-
}
|
|
43
|
-
function handlePageJson(appData) {
|
|
44
|
-
return appData.pageInstanceList.map((page) => {
|
|
45
|
-
const pageJsonFile = {
|
|
46
|
-
name: 'page',
|
|
47
|
-
pageId: page.id,
|
|
48
|
-
path: `${page.id}/page`,
|
|
49
|
-
type: 'json',
|
|
50
|
-
code: JSON.stringify(page.componentInstances || {}, null, 2),
|
|
51
|
-
};
|
|
52
|
-
return pageJsonFile;
|
|
53
|
-
});
|
|
54
|
-
}
|
|
55
|
-
function handleLowCodeFile(appData) {
|
|
56
|
-
const globalLowCodes = appData.lowCodes;
|
|
57
|
-
const pagesLowCodes = appData.pageInstanceList.reduce((pageLowcode, page) => {
|
|
58
|
-
return pageLowcode.concat(page.lowCodes);
|
|
59
|
-
}, []);
|
|
60
|
-
return [...globalLowCodes, ...pagesLowCodes];
|
|
61
|
-
}
|
|
62
|
-
function initOriginJson(fileList) {
|
|
63
|
-
const data = {
|
|
64
|
-
pageInstanceList: [],
|
|
65
|
-
appConfig: {},
|
|
66
|
-
lowCodes: getCommonLowCodes('global'),
|
|
67
|
-
npmDependencies: {},
|
|
68
|
-
plugins: [],
|
|
69
|
-
};
|
|
70
|
-
fileList
|
|
71
|
-
.filter(({ pageId }) => pageId !== 'global')
|
|
72
|
-
.forEach(({ pageId }) => {
|
|
73
|
-
const pageInstance = data.pageInstanceList.find((page) => page.id === pageId);
|
|
74
|
-
if (!pageInstance) {
|
|
75
|
-
data.pageInstanceList.push({
|
|
76
|
-
id: pageId,
|
|
77
|
-
data: {},
|
|
78
|
-
componentInstances: {},
|
|
79
|
-
lowCodes: getCommonLowCodes(pageId),
|
|
80
|
-
isHome: false,
|
|
81
|
-
listeners: [],
|
|
82
|
-
commonStyle: {},
|
|
83
|
-
pluginInstances: [],
|
|
84
|
-
styleBindPath: '',
|
|
85
|
-
});
|
|
86
|
-
}
|
|
87
|
-
});
|
|
88
|
-
return data;
|
|
89
|
-
}
|
|
90
|
-
function getCommonLowCodes(pageId) {
|
|
91
|
-
const isGlobal = pageId === 'global';
|
|
92
|
-
const commonLowCodes = [];
|
|
93
|
-
if (isGlobal) {
|
|
94
|
-
commonLowCodes.concat([
|
|
95
|
-
{
|
|
96
|
-
code: 'export default {}',
|
|
97
|
-
name: '____index____',
|
|
98
|
-
pageId: 'global',
|
|
99
|
-
type: 'normal-module',
|
|
100
|
-
path: 'global/common/____index____',
|
|
101
|
-
system: false,
|
|
102
|
-
},
|
|
103
|
-
]);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
commonLowCodes.concat([
|
|
107
|
-
{
|
|
108
|
-
code: 'export default {}',
|
|
109
|
-
name: '____index____',
|
|
110
|
-
pageId,
|
|
111
|
-
path: `${pageId}/handler/____index____`,
|
|
112
|
-
type: 'handler-fn',
|
|
113
|
-
system: false,
|
|
114
|
-
},
|
|
115
|
-
]);
|
|
116
|
-
}
|
|
117
|
-
return commonLowCodes;
|
|
118
|
-
}
|
|
119
|
-
function getExtByType(type) {
|
|
120
|
-
switch (type) {
|
|
121
|
-
case 'app-style':
|
|
122
|
-
case 'style':
|
|
123
|
-
case 'theme':
|
|
124
|
-
return '.less';
|
|
125
|
-
case 'config':
|
|
126
|
-
case 'json':
|
|
127
|
-
case 'app-config':
|
|
128
|
-
case 'page-config':
|
|
129
|
-
return '.json';
|
|
130
|
-
default:
|
|
131
|
-
return '.js';
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
exports.getExtByType = getExtByType;
|
|
135
|
-
function HACK_FIX_LOWCODE_IN(code = '') {
|
|
136
|
-
return code.replace('../../common/', '../../../common/');
|
|
137
|
-
}
|
|
138
|
-
exports.HACK_FIX_LOWCODE_IN = HACK_FIX_LOWCODE_IN;
|
|
139
|
-
function HACK_FIX_LOWCODE_OUT(code = '') {
|
|
140
|
-
return code.replace('../../../common/', '../../common/');
|
|
141
|
-
}
|
|
142
|
-
exports.HACK_FIX_LOWCODE_OUT = HACK_FIX_LOWCODE_OUT;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { IWeAppPage, IWeAppData, IWebRuntimeAppData } from '../types';
|
|
2
|
-
export declare function serialize(webRuntimeAppData: IWebRuntimeAppData): IWeAppData;
|
|
3
|
-
export declare function deserialize(weAppData: IWeAppData): IWebRuntimeAppData;
|
|
4
|
-
export declare function readCmpInstances(cmps: IWeAppPage['componentInstances']): {};
|
|
5
|
-
//# sourceMappingURL=formily.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"formily.d.ts","sourceRoot":"","sources":["../../../src/weapps-core/utils/formily.ts"],"names":[],"mappings":"AASA,OAAO,EACL,UAAU,EAEV,UAAU,EAQV,kBAAkB,EACnB,MAAM,UAAU,CAAC;AAUlB,wBAAgB,SAAS,CAAC,iBAAiB,EAAE,kBAAkB,GAAG,UAAU,CAwM3E;AAMD,wBAAgB,WAAW,CAAC,SAAS,EAAE,UAAU,GAAG,kBAAkB,CA+DrE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,CAAC,oBAAoB,CAAC,MA2GtE"}
|