@cloudbase/framework-plugin-low-code 1.7.2 → 1.7.3
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/lib/builder/config/common.d.ts +2 -0
- package/lib/builder/config/common.d.ts.map +1 -0
- package/lib/builder/config/common.js +13 -0
- package/lib/builder/config/index.d.ts +3 -0
- package/lib/builder/config/index.d.ts.map +1 -0
- package/lib/builder/config/index.js +29 -0
- package/lib/builder/config/mp.d.ts +2 -0
- package/lib/builder/config/mp.d.ts.map +1 -0
- package/lib/builder/config/mp.js +13 -0
- package/lib/builder/core/copy.d.ts +5 -0
- package/lib/builder/core/copy.d.ts.map +1 -0
- package/lib/builder/core/copy.js +62 -0
- package/lib/builder/core/generate.d.ts +9 -0
- package/lib/builder/core/generate.d.ts.map +1 -0
- package/lib/builder/core/generate.js +128 -0
- package/lib/builder/core/index.d.ts +32 -0
- package/lib/builder/core/index.d.ts.map +1 -0
- package/lib/builder/core/index.js +149 -0
- package/lib/builder/core/material.d.ts +4 -0
- package/lib/builder/core/material.d.ts.map +1 -0
- package/lib/builder/core/material.js +80 -0
- package/lib/builder/core/plugin.d.ts +4 -0
- package/lib/builder/core/plugin.d.ts.map +1 -0
- package/lib/builder/core/plugin.js +30 -0
- package/lib/builder/core/prepare.d.ts +8 -0
- package/lib/builder/core/prepare.d.ts.map +1 -0
- package/lib/builder/core/prepare.js +108 -0
- package/lib/builder/core/webpack.d.ts +15 -0
- package/lib/builder/core/webpack.d.ts.map +1 -0
- package/lib/builder/core/webpack.js +58 -0
- package/lib/builder/mp/BuildContext.d.ts +13 -0
- package/lib/builder/mp/BuildContext.d.ts.map +1 -0
- package/lib/builder/mp/BuildContext.js +2 -0
- package/lib/builder/mp/index.d.ts +33 -0
- package/lib/builder/mp/index.d.ts.map +1 -0
- package/lib/builder/mp/index.js +450 -0
- package/lib/builder/mp/lowcode.d.ts +8 -0
- package/lib/builder/mp/lowcode.d.ts.map +1 -0
- package/lib/builder/mp/lowcode.js +54 -0
- package/lib/builder/mp/materials.d.ts +15 -0
- package/lib/builder/mp/materials.d.ts.map +1 -0
- package/lib/builder/mp/materials.js +338 -0
- package/lib/builder/mp/mixMode.d.ts +10 -0
- package/lib/builder/mp/mixMode.d.ts.map +1 -0
- package/lib/builder/mp/mixMode.js +215 -0
- package/lib/builder/mp/mp_config.d.ts +18 -0
- package/lib/builder/mp/mp_config.d.ts.map +1 -0
- package/lib/builder/mp/mp_config.js +206 -0
- package/lib/builder/mp/util.d.ts +20 -0
- package/lib/builder/mp/util.d.ts.map +1 -0
- package/lib/builder/mp/util.js +243 -0
- package/lib/builder/mp/wxml.d.ts +16 -0
- package/lib/builder/mp/wxml.d.ts.map +1 -0
- package/lib/builder/mp/wxml.js +300 -0
- package/lib/builder/service/builder/copy.d.ts +14 -0
- package/lib/builder/service/builder/copy.d.ts.map +1 -0
- package/lib/builder/service/builder/copy.js +189 -0
- package/lib/builder/service/builder/generate.d.ts +52 -0
- package/lib/builder/service/builder/generate.d.ts.map +1 -0
- package/lib/builder/service/builder/generate.js +792 -0
- package/lib/builder/service/builder/index.d.ts +16 -0
- package/lib/builder/service/builder/index.d.ts.map +1 -0
- package/lib/builder/service/builder/index.js +69 -0
- package/lib/builder/service/builder/plugin.d.ts +8 -0
- package/lib/builder/service/builder/plugin.d.ts.map +1 -0
- package/lib/builder/service/builder/plugin.js +149 -0
- package/lib/builder/service/builder/webpack.d.ts +91 -0
- package/lib/builder/service/builder/webpack.d.ts.map +1 -0
- package/lib/builder/service/builder/webpack.js +589 -0
- package/lib/builder/types/common.d.ts +12 -0
- package/lib/builder/types/common.d.ts.map +1 -0
- package/lib/builder/types/common.js +7 -0
- package/lib/builder/util/common.d.ts +36 -0
- package/lib/builder/util/common.d.ts.map +1 -0
- package/lib/builder/util/common.js +257 -0
- package/lib/builder/util/console.d.ts +2 -0
- package/lib/builder/util/console.d.ts.map +1 -0
- package/lib/builder/util/console.js +13 -0
- package/lib/builder/util/generateFiles.d.ts +6 -0
- package/lib/builder/util/generateFiles.d.ts.map +1 -0
- package/lib/builder/util/generateFiles.js +94 -0
- package/lib/builder/util/index.d.ts +2 -0
- package/lib/builder/util/index.d.ts.map +1 -0
- package/lib/builder/util/index.js +13 -0
- package/lib/builder/util/junk.d.ts +3 -0
- package/lib/builder/util/junk.d.ts.map +1 -0
- package/lib/builder/util/junk.js +25 -0
- package/lib/builder/util/mp.d.ts +5 -0
- package/lib/builder/util/mp.d.ts.map +1 -0
- package/lib/builder/util/mp.js +99 -0
- package/lib/builder/util/name-mangler.d.ts +3 -0
- package/lib/builder/util/name-mangler.d.ts.map +1 -0
- package/lib/builder/util/name-mangler.js +7 -0
- package/lib/builder/util/net.d.ts +3 -0
- package/lib/builder/util/net.d.ts.map +1 -0
- package/lib/builder/util/net.js +54 -0
- package/lib/builder/util/process.d.ts +9 -0
- package/lib/builder/util/process.d.ts.map +1 -0
- package/lib/builder/util/process.js +28 -0
- package/lib/builder/util/style.d.ts +2 -0
- package/lib/builder/util/style.d.ts.map +1 -0
- package/lib/builder/util/style.js +13 -0
- package/lib/builder/util/weapp.d.ts +2 -0
- package/lib/builder/util/weapp.d.ts.map +1 -0
- package/lib/builder/util/weapp.js +13 -0
- package/lib/config/private.d.ts +3 -0
- package/lib/config/private.d.ts.map +1 -0
- package/lib/config/private.js +14 -0
- package/lib/generate.d.ts +2 -0
- package/lib/generate.d.ts.map +1 -0
- package/lib/generate.js +49 -0
- package/lib/generator/config/common.d.ts +6 -0
- package/lib/generator/config/common.d.ts.map +1 -0
- package/lib/generator/config/common.js +25 -0
- package/lib/generator/config/index.d.ts +18 -0
- package/lib/generator/config/index.d.ts.map +1 -0
- package/lib/generator/config/index.js +43 -0
- package/lib/generator/config/mp.d.ts +56 -0
- package/lib/generator/config/mp.d.ts.map +1 -0
- package/lib/generator/config/mp.js +104 -0
- package/lib/generator/core/generate.d.ts +59 -0
- package/lib/generator/core/generate.d.ts.map +1 -0
- package/lib/generator/core/generate.js +663 -0
- package/lib/generator/core/index.d.ts +25 -0
- package/lib/generator/core/index.d.ts.map +1 -0
- package/lib/generator/core/index.js +102 -0
- package/lib/generator/core/material.d.ts +14 -0
- package/lib/generator/core/material.d.ts.map +1 -0
- package/lib/generator/core/material.js +230 -0
- package/lib/generator/template.d.ts +3 -0
- package/lib/generator/template.d.ts.map +1 -0
- package/lib/generator/template.js +3 -0
- package/lib/generator/types/common.d.ts +69 -0
- package/lib/generator/types/common.d.ts.map +1 -0
- package/lib/generator/types/common.js +21 -0
- package/lib/generator/util/common.d.ts +36 -0
- package/lib/generator/util/common.d.ts.map +1 -0
- package/lib/generator/util/common.js +238 -0
- package/lib/generator/util/console.d.ts +3 -0
- package/lib/generator/util/console.d.ts.map +1 -0
- package/lib/generator/util/console.js +17 -0
- package/lib/generator/util/index.d.ts +2 -0
- package/lib/generator/util/index.d.ts.map +1 -0
- package/lib/generator/util/index.js +13 -0
- package/lib/generator/util/name-mangler.d.ts +17 -0
- package/lib/generator/util/name-mangler.d.ts.map +1 -0
- package/lib/generator/util/name-mangler.js +63 -0
- package/lib/generator/util/postcss-rpx.d.ts +11 -0
- package/lib/generator/util/postcss-rpx.d.ts.map +1 -0
- package/lib/generator/util/postcss-rpx.js +16 -0
- package/lib/generator/util/style.d.ts +6 -0
- package/lib/generator/util/style.d.ts.map +1 -0
- package/lib/generator/util/style.js +92 -0
- package/lib/generator/util/weapp.d.ts +5 -0
- package/lib/generator/util/weapp.d.ts.map +1 -0
- package/lib/generator/util/weapp.js +17 -0
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +0 -0
- package/lib/types.d.ts +14 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +19 -0
- package/lib/utils/common.d.ts +0 -0
- package/lib/utils/common.d.ts.map +0 -0
- package/lib/utils/common.js +0 -0
- package/lib/utils/dataSource.d.ts +28 -0
- package/lib/utils/dataSource.d.ts.map +1 -0
- package/lib/utils/dataSource.js +171 -0
- package/lib/utils/index.d.ts +0 -0
- package/lib/utils/index.d.ts.map +0 -0
- package/lib/utils/index.js +0 -0
- package/lib/utils/postProcess.d.ts +3 -0
- package/lib/utils/postProcess.d.ts.map +1 -0
- package/lib/utils/postProcess.js +48 -0
- package/lib/weapps-core/config/index.d.ts +2 -0
- package/lib/weapps-core/config/index.d.ts.map +1 -0
- package/lib/weapps-core/config/index.js +13 -0
- package/lib/weapps-core/config/style.d.ts +7 -0
- package/lib/weapps-core/config/style.d.ts.map +1 -0
- package/lib/weapps-core/config/style.js +70 -0
- package/lib/weapps-core/index.d.ts +6 -0
- package/lib/weapps-core/index.d.ts.map +1 -0
- package/lib/weapps-core/index.js +31 -0
- package/lib/weapps-core/types/action.d.ts +25 -0
- package/lib/weapps-core/types/action.d.ts.map +1 -0
- package/lib/weapps-core/types/action.js +28 -0
- package/lib/weapps-core/types/app.d.ts +142 -0
- package/lib/weapps-core/types/app.d.ts.map +1 -0
- package/lib/weapps-core/types/app.js +21 -0
- package/lib/weapps-core/types/appbuild.d.ts +63 -0
- package/lib/weapps-core/types/appbuild.d.ts.map +1 -0
- package/lib/weapps-core/types/appbuild.js +78 -0
- package/lib/weapps-core/types/code_types.d.ts +26 -0
- package/lib/weapps-core/types/code_types.d.ts.map +1 -0
- package/lib/weapps-core/types/code_types.js +2 -0
- package/lib/weapps-core/types/git.d.ts +7 -0
- package/lib/weapps-core/types/git.d.ts.map +1 -0
- package/lib/weapps-core/types/git.js +2 -0
- package/lib/weapps-core/types/index.d.ts +11 -0
- package/lib/weapps-core/types/index.d.ts.map +1 -0
- package/lib/weapps-core/types/index.js +22 -0
- package/lib/weapps-core/types/lowcode.d.ts +26 -0
- package/lib/weapps-core/types/lowcode.d.ts.map +1 -0
- package/lib/weapps-core/types/lowcode.js +25 -0
- package/lib/weapps-core/types/material.d.ts +90 -0
- package/lib/weapps-core/types/material.d.ts.map +1 -0
- package/lib/weapps-core/types/material.js +9 -0
- package/lib/weapps-core/types/plugins.d.ts +17 -0
- package/lib/weapps-core/types/plugins.d.ts.map +1 -0
- package/lib/weapps-core/types/plugins.js +2 -0
- package/lib/weapps-core/types/style.d.ts +93 -0
- package/lib/weapps-core/types/style.d.ts.map +1 -0
- package/lib/weapps-core/types/style.js +2 -0
- package/lib/weapps-core/types/web.d.ts +120 -0
- package/lib/weapps-core/types/web.d.ts.map +1 -0
- package/lib/weapps-core/types/web.js +2 -0
- package/lib/weapps-core/utils/appbuild.d.ts +6 -0
- package/lib/weapps-core/utils/appbuild.d.ts.map +1 -0
- package/lib/weapps-core/utils/appbuild.js +40 -0
- package/lib/weapps-core/utils/common.d.ts +16 -0
- package/lib/weapps-core/utils/common.d.ts.map +1 -0
- package/lib/weapps-core/utils/common.js +90 -0
- package/lib/weapps-core/utils/file.d.ts +12 -0
- package/lib/weapps-core/utils/file.d.ts.map +1 -0
- package/lib/weapps-core/utils/file.js +142 -0
- package/lib/weapps-core/utils/formily.d.ts +5 -0
- package/lib/weapps-core/utils/formily.d.ts.map +1 -0
- package/lib/weapps-core/utils/formily.js +416 -0
- package/lib/weapps-core/utils/index.d.ts +7 -0
- package/lib/weapps-core/utils/index.d.ts.map +1 -0
- package/lib/weapps-core/utils/index.js +18 -0
- package/lib/weapps-core/utils/lowcdoe.d.ts +4 -0
- package/lib/weapps-core/utils/lowcdoe.d.ts.map +1 -0
- package/lib/weapps-core/utils/lowcdoe.js +69 -0
- package/lib/weapps-core/utils/style.d.ts +17 -0
- package/lib/weapps-core/utils/style.d.ts.map +1 -0
- package/lib/weapps-core/utils/style.js +330 -0
- package/package.json +3 -3
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CodingPublishType, IOutputs } from '../types/appbuild';
|
|
2
|
+
export declare const INIT_VERSION = "0.0.0";
|
|
3
|
+
export declare const checkVersion: (value: string) => boolean;
|
|
4
|
+
export declare const biggerThanVersion: (value?: string, lastVersion?: string) => boolean;
|
|
5
|
+
export declare const getPublishAppId: (codingPublishType: CodingPublishType, outputs: IOutputs) => string | undefined;
|
|
6
|
+
//# sourceMappingURL=appbuild.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appbuild.d.ts","sourceRoot":"","sources":["../../../src/weapps-core/utils/appbuild.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGhE,eAAO,MAAM,YAAY,UAAU,CAAC;AAGpC,eAAO,MAAM,YAAY,UAAW,MAAM,YAEzC,CAAC;AAEF,eAAO,MAAM,iBAAiB,mDAqB7B,CAAC;AAEF,eAAO,MAAM,eAAe,sBACP,iBAAiB,WAC3B,QAAQ,uBAOlB,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPublishAppId = exports.biggerThanVersion = exports.checkVersion = exports.INIT_VERSION = void 0;
|
|
4
|
+
const appbuild_1 = require("../types/appbuild");
|
|
5
|
+
exports.INIT_VERSION = '0.0.0';
|
|
6
|
+
const checkVersion = (value) => {
|
|
7
|
+
return /^\d+\.\d+(\.\d+){0,2}$/.test(value);
|
|
8
|
+
};
|
|
9
|
+
exports.checkVersion = checkVersion;
|
|
10
|
+
const biggerThanVersion = (value = '', lastVersion = '') => {
|
|
11
|
+
const nowVersions = value
|
|
12
|
+
.split('.')
|
|
13
|
+
.map((item) => (Number.isNaN(parseInt(item)) ? 0 : parseInt(item)));
|
|
14
|
+
const lastVersions = lastVersion
|
|
15
|
+
.split('.')
|
|
16
|
+
.map((item) => (Number.isNaN(parseInt(item)) ? 0 : parseInt(item)));
|
|
17
|
+
const maxLen = nowVersions.length > lastVersion.length
|
|
18
|
+
? nowVersions.length
|
|
19
|
+
: lastVersion.length;
|
|
20
|
+
for (let i = 0; i < maxLen; i++) {
|
|
21
|
+
const now = nowVersions[i] || 0;
|
|
22
|
+
const last = lastVersions[i] || 0;
|
|
23
|
+
if (now > last) {
|
|
24
|
+
return true;
|
|
25
|
+
}
|
|
26
|
+
else if (now < last) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return false;
|
|
31
|
+
};
|
|
32
|
+
exports.biggerThanVersion = biggerThanVersion;
|
|
33
|
+
const getPublishAppId = (codingPublishType, outputs) => {
|
|
34
|
+
return codingPublishType === appbuild_1.CodingPublishType.Android
|
|
35
|
+
? outputs.appid
|
|
36
|
+
: codingPublishType === appbuild_1.CodingPublishType.iOS
|
|
37
|
+
? outputs.iOSappId
|
|
38
|
+
: 'main';
|
|
39
|
+
};
|
|
40
|
+
exports.getPublishAppId = getPublishAppId;
|
|
@@ -0,0 +1,16 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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;
|
|
@@ -0,0 +1,12 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|
|
@@ -0,0 +1,142 @@
|
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"}
|