@cloudbase/lowcode-builder 1.8.106 → 1.8.108
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/dependencies.d.ts +10 -0
- package/lib/builder/config/dependencies.js +46 -0
- package/lib/builder/config/index.d.ts +1 -0
- package/lib/builder/config/index.js +5 -3
- package/lib/builder/core/index.d.ts +1 -1
- package/lib/builder/core/index.js +13 -13
- package/lib/builder/h5/generate.js +1 -0
- package/lib/builder/mp/BuildContext.d.ts +1 -0
- package/lib/builder/mp/index.d.ts +1 -2
- package/lib/builder/mp/index.js +13 -38
- package/lib/builder/mp/lowcode.js +5 -1
- package/lib/builder/mp/materials.d.ts +2 -3
- package/lib/builder/mp/materials.js +28 -26
- package/lib/builder/mp/mp_config.js +2 -1
- package/lib/builder/mp/util.d.ts +5 -2
- package/lib/builder/mp/util.js +14 -6
- package/lib/builder/mp/wxml.d.ts +3 -1
- package/lib/builder/mp/wxml.js +20 -7
- package/lib/builder.web.js +8 -8
- package/package.json +4 -4
- package/template/html/index.html.ejs +4 -2
- package/template/mp/app/common.js +0 -2
- package/template/mp/app/weapps-api.js +1 -20
- package/template/mp/common/info/index.js +4 -2
- package/template/mp/common/util.js +33 -774
- package/template/mp/common/weapp-page.js +12 -514
- package/template/mp/component/index.js +52 -19
- package/template/mp/component/index.json +1 -1
- package/template/mp/datasources/index.js.tpl +3 -99
- package/template/mp/package.json +4 -15
- package/template/mp/packages/$wd_system/pages/login/index.json +1 -1
- package/template/mp/packages/$wd_system/pages/login/methods/loginByWXPhone.js +6 -3
- package/template/mp/page/index.js +1 -2
- package/template/mp/common/constant.js +0 -1
- package/template/mp/common/data-patch-test.js +0 -60
- package/template/mp/common/data-patch.js +0 -66
- package/template/mp/common/event-emitter.js +0 -124
- package/template/mp/common/flow.js +0 -65
- package/template/mp/common/merge-renderer.js +0 -75
- package/template/mp/common/placeholder/index.js +0 -1
- package/template/mp/common/placeholder/index.json +0 -4
- package/template/mp/common/placeholder/index.wxml +0 -1
- package/template/mp/common/placeholder/index.wxss +0 -1
- package/template/mp/common/query.js +0 -300
- package/template/mp/common/style.js +0 -34
- package/template/mp/common/watch.js +0 -70
- package/template/mp/common/weapp-component.js +0 -289
- package/template/mp/common/widget.js +0 -872
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare function generatePackageDependencies({ importJSSDK, mode, officialLibVersion, }: {
|
|
2
|
+
importJSSDK: boolean;
|
|
3
|
+
mode: 'lib' | string;
|
|
4
|
+
officialLibVersion?: string;
|
|
5
|
+
}): {
|
|
6
|
+
'miniprogram-gesture': string;
|
|
7
|
+
mobx: string;
|
|
8
|
+
'lodash.get': string;
|
|
9
|
+
'lodash.set': string;
|
|
10
|
+
};
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generatePackageDependencies = void 0;
|
|
4
|
+
const cals_1 = require("@cloudbase/cals");
|
|
5
|
+
const BASE_DEPS = {
|
|
6
|
+
'miniprogram-gesture': '^1.0.6',
|
|
7
|
+
mobx: '^5',
|
|
8
|
+
'lodash.get': '^4',
|
|
9
|
+
'lodash.set': '^4',
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* 注意锁版本
|
|
13
|
+
*/
|
|
14
|
+
const CLOUDBASE_DEPS = {
|
|
15
|
+
'@cloudbase/oauth': '0.1.1-alpha.11',
|
|
16
|
+
'@cloudbase/weda-client': '1.1.1',
|
|
17
|
+
'@cloudbase/weda-cloud-sdk': '1.0.64',
|
|
18
|
+
};
|
|
19
|
+
function generatePackageDependencies({ importJSSDK, mode, officialLibVersion, }) {
|
|
20
|
+
const deps = {};
|
|
21
|
+
if (importJSSDK) {
|
|
22
|
+
deps['@cloudbase/js-sdk'] = '2.5.45-beta.0';
|
|
23
|
+
}
|
|
24
|
+
if (mode === 'lib') {
|
|
25
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
26
|
+
for (const key in CLOUDBASE_DEPS) {
|
|
27
|
+
/**
|
|
28
|
+
* lib 模式下采用松散的引用
|
|
29
|
+
*/
|
|
30
|
+
deps[key] = /^\d/.test(CLOUDBASE_DEPS[key]) ? CLOUDBASE_DEPS[key] : `^${CLOUDBASE_DEPS[key]}`;
|
|
31
|
+
}
|
|
32
|
+
if (officialLibVersion) {
|
|
33
|
+
deps[cals_1.OFFICIAL_LIB_MP_NPM_PACKAGENAME] = officialLibVersion;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
for (const key in CLOUDBASE_DEPS) {
|
|
38
|
+
deps[key] = CLOUDBASE_DEPS[key];
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return {
|
|
42
|
+
...deps,
|
|
43
|
+
...BASE_DEPS,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
exports.generatePackageDependencies = generatePackageDependencies;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { REPLACE_SIGN, MP_CONFIG_MODULE_NAME, KBONE_PAGE_KEYS, npmRegistry, remConfig, rpxConfig, OFFICIAL_LIB_KEY, } from '@cloudbase/lowcode-generator/lib/generator/config/index';
|
|
2
|
+
export { generatePackageDependencies } from './dependencies';
|
|
2
3
|
export declare const sharedMaterialsDir: string;
|
|
3
4
|
export declare const appTemplateDir: string;
|
|
4
5
|
export declare const materialsDirName = "materials";
|
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.getPrivatelinkJsUrl = exports.REPEATER = exports.generateCdnEndpoints = exports.CDN_ENDPONTS_CONFIG = exports.systemSubpackageMiniprogramDir = exports.cloudbaseMiniprogramDir = exports.miniprogramDir = exports.RUNTIME_CONFIG_URL = exports.systemSubpackageMiniprogramURL = exports.cloudbaseMiniprogramURL = exports.miniprogramURL = exports.materialsDirName = exports.appTemplateDir = exports.sharedMaterialsDir = exports.OFFICIAL_LIB_KEY = exports.rpxConfig = exports.remConfig = exports.npmRegistry = exports.KBONE_PAGE_KEYS = exports.MP_CONFIG_MODULE_NAME = exports.REPLACE_SIGN = void 0;
|
|
29
|
+
exports.getPrivatelinkJsUrl = exports.REPEATER = exports.generateCdnEndpoints = exports.CDN_ENDPONTS_CONFIG = exports.systemSubpackageMiniprogramDir = exports.cloudbaseMiniprogramDir = exports.miniprogramDir = exports.RUNTIME_CONFIG_URL = exports.systemSubpackageMiniprogramURL = exports.cloudbaseMiniprogramURL = exports.miniprogramURL = exports.materialsDirName = exports.appTemplateDir = exports.sharedMaterialsDir = exports.generatePackageDependencies = exports.OFFICIAL_LIB_KEY = exports.rpxConfig = exports.remConfig = exports.npmRegistry = exports.KBONE_PAGE_KEYS = exports.MP_CONFIG_MODULE_NAME = exports.REPLACE_SIGN = void 0;
|
|
30
30
|
const path = __importStar(require("path"));
|
|
31
31
|
const os_1 = __importDefault(require("os"));
|
|
32
32
|
const index_1 = require("@cloudbase/lowcode-generator/lib/generator/config/index");
|
|
@@ -38,6 +38,8 @@ Object.defineProperty(exports, "npmRegistry", { enumerable: true, get: function
|
|
|
38
38
|
Object.defineProperty(exports, "remConfig", { enumerable: true, get: function () { return index_2.remConfig; } });
|
|
39
39
|
Object.defineProperty(exports, "rpxConfig", { enumerable: true, get: function () { return index_2.rpxConfig; } });
|
|
40
40
|
Object.defineProperty(exports, "OFFICIAL_LIB_KEY", { enumerable: true, get: function () { return index_2.OFFICIAL_LIB_KEY; } });
|
|
41
|
+
var dependencies_1 = require("./dependencies");
|
|
42
|
+
Object.defineProperty(exports, "generatePackageDependencies", { enumerable: true, get: function () { return dependencies_1.generatePackageDependencies; } });
|
|
41
43
|
exports.sharedMaterialsDir = path.join(os_1.default.homedir(), '.weapps-materials');
|
|
42
44
|
exports.appTemplateDir = path.resolve(__dirname, '../../../template');
|
|
43
45
|
exports.materialsDirName = 'materials'; // materials diretory of current project
|
|
@@ -46,8 +48,8 @@ exports.materialsDirName = 'materials'; // materials diretory of current project
|
|
|
46
48
|
* 存放在大账号:100015939275。访问地址:https://console.cloud.tencent.com/cos/bucket?bucket=comp-public-replace-1303824488®ion=ap-shanghai&path=%252Flcap-builder%252F
|
|
47
49
|
*/
|
|
48
50
|
const COMP_PUBLIC_DOMAIN = 'comp-public-replace-1303824488-cos.weda.tencent.com';
|
|
49
|
-
exports.miniprogramURL = `https://${COMP_PUBLIC_DOMAIN}/lcap-builder/miniprogram_npm.1.8.
|
|
50
|
-
exports.cloudbaseMiniprogramURL = `https://${COMP_PUBLIC_DOMAIN}/lcap-builder/cloudbase_miniprogram_npm.1.8.
|
|
51
|
+
exports.miniprogramURL = `https://${COMP_PUBLIC_DOMAIN}/lcap-builder/miniprogram_npm.1.8.107.zip`;
|
|
52
|
+
exports.cloudbaseMiniprogramURL = `https://${COMP_PUBLIC_DOMAIN}/lcap-builder/cloudbase_miniprogram_npm.1.8.107.zip`;
|
|
51
53
|
exports.systemSubpackageMiniprogramURL = `https://${COMP_PUBLIC_DOMAIN}/lcap-builder/wd_system_miniprogram_npm.zip`;
|
|
52
54
|
exports.RUNTIME_CONFIG_URL = `https://${COMP_PUBLIC_DOMAIN}/release_config/runtime/exp_runtime.json`;
|
|
53
55
|
/**
|
|
@@ -170,7 +170,7 @@ async function buildWedaApp({ cals, subAppCalsList: _subAppCalsList = [], depend
|
|
|
170
170
|
// 尽早下载物料
|
|
171
171
|
await (0, net_1.downloadBrowserMaterial)({ runtimeEndpointType: endpointType });
|
|
172
172
|
}
|
|
173
|
-
const { enablePageRoot } = (0, cals_1.parseVersion)(cals === null || cals === void 0 ? void 0 : cals.schemaVersion, dependencies);
|
|
173
|
+
const { enablePageRoot, disablePageComponentInvoke } = (0, cals_1.parseVersion)(cals === null || cals === void 0 ? void 0 : cals.schemaVersion, dependencies);
|
|
174
174
|
const mpBuildContext = {
|
|
175
175
|
...buildContext,
|
|
176
176
|
privatelinkConfig: buildContext.privatelinkConfig
|
|
@@ -187,6 +187,7 @@ async function buildWedaApp({ cals, subAppCalsList: _subAppCalsList = [], depend
|
|
|
187
187
|
enablePageRoot,
|
|
188
188
|
enableLoading: (_e = cals === null || cals === void 0 ? void 0 : cals.extra) === null || _e === void 0 ? void 0 : _e.enableLoading,
|
|
189
189
|
enableAsyncMaterials: (_f = cals.extra) === null || _f === void 0 ? void 0 : _f.enableAsyncMaterials,
|
|
190
|
+
disablePageComponentInvoke,
|
|
190
191
|
// enableAsyncMaterials: true,
|
|
191
192
|
};
|
|
192
193
|
const result = await (0, index_1.generateWxMp)({
|
|
@@ -393,6 +394,7 @@ async function buildComposite({ dependencies, output, isBrowserMpBuilder, }) {
|
|
|
393
394
|
var _a, _b;
|
|
394
395
|
const packageMiniprogramEntry = 'dist';
|
|
395
396
|
const localWedaRoot = path_1.default.join(output.path, packageMiniprogramEntry);
|
|
397
|
+
const { disablePageComponentInvoke } = (0, cals_1.parseVersion)('', dependencies);
|
|
396
398
|
const buildContext = {
|
|
397
399
|
materialLibs: dependencies.map((lib) => {
|
|
398
400
|
(0, materials_1.normalizeCompositeDependienciesForBuild)(lib);
|
|
@@ -405,12 +407,16 @@ async function buildComposite({ dependencies, output, isBrowserMpBuilder, }) {
|
|
|
405
407
|
*/
|
|
406
408
|
processCssUnit: 'px',
|
|
407
409
|
isBrowserMpBuilder,
|
|
410
|
+
disablePageComponentInvoke,
|
|
408
411
|
};
|
|
412
|
+
if (isBrowserMpBuilder) {
|
|
413
|
+
// 尽早下载物料
|
|
414
|
+
await (0, net_1.downloadBrowserMaterial)({ runtimeEndpointType: undefined });
|
|
415
|
+
}
|
|
409
416
|
await (0, index_1.generateWedaRootCommonFile)({
|
|
410
417
|
buildContext,
|
|
411
418
|
buildTypeList: [common_1.BuildType.MP],
|
|
412
419
|
localWedaRoot,
|
|
413
|
-
nativeMode: true,
|
|
414
420
|
// 组件无需生成,节省空间
|
|
415
421
|
filter: (src) => {
|
|
416
422
|
return !/common\/weapp-page/.test(src);
|
|
@@ -443,32 +449,26 @@ async function buildComposite({ dependencies, output, isBrowserMpBuilder, }) {
|
|
|
443
449
|
await Promise.all(buildContext.materialLibs.map((lib) => {
|
|
444
450
|
return fs_extra_1.default.remove(path_1.default.join(localWedaRoot, config_1.materialsDirName, lib.name, 'meta.json'));
|
|
445
451
|
}));
|
|
452
|
+
const officialLib = buildContext.materialLibs.find((item) => item.name === cals_1.OFFICIAL_LIB_KEY);
|
|
446
453
|
await patchMpComponentNPM({
|
|
447
454
|
packageDir: output.path,
|
|
448
455
|
name: composite === null || composite === void 0 ? void 0 : composite.name,
|
|
449
456
|
version: composite === null || composite === void 0 ? void 0 : composite.version,
|
|
450
457
|
packageMiniprogramEntry,
|
|
458
|
+
officialLibVersion: officialLib === null || officialLib === void 0 ? void 0 : officialLib.version,
|
|
451
459
|
});
|
|
460
|
+
return output.path;
|
|
452
461
|
// await generateCompLibs(dependencies, rpxCalcRoot);
|
|
453
462
|
}
|
|
454
463
|
exports.buildComposite = buildComposite;
|
|
455
|
-
async function patchMpComponentNPM({ packageDir, name, version, packageMiniprogramEntry = '', }) {
|
|
464
|
+
async function patchMpComponentNPM({ packageDir, name, version, packageMiniprogramEntry = '', officialLibVersion, }) {
|
|
456
465
|
await fs_extra_1.default.mkdirSync(path_1.default.join(packageDir, 'scripts'));
|
|
457
466
|
const packageJsonPath = path_1.default.join(packageDir, 'package.json');
|
|
458
467
|
let packageJSON = {};
|
|
459
468
|
if (fs_extra_1.default.existsSync(packageJsonPath)) {
|
|
460
469
|
packageJSON = await fs_extra_1.default.readJSON(packageJsonPath);
|
|
461
470
|
}
|
|
462
|
-
const BASE_DEPS = {
|
|
463
|
-
mobx: '^5.15.4',
|
|
464
|
-
'lodash.get': '^4.4.2',
|
|
465
|
-
'lodash.set': '^4.3.2',
|
|
466
|
-
'miniprogram-gesture': '^1.0.6',
|
|
467
|
-
'miniprogram-api-promise': '^1.0.4',
|
|
468
|
-
'@cloudbase/oauth': '^0.1.1-alpha.5',
|
|
469
|
-
'@cloudbase/weda-client': '^1.0.31',
|
|
470
|
-
'@cloudbase/weda-cloud-sdk': '^1.0.59',
|
|
471
|
-
};
|
|
471
|
+
const BASE_DEPS = (0, config_1.generatePackageDependencies)({ mode: 'lib', importJSSDK: false, officialLibVersion });
|
|
472
472
|
if (packageJSON.dependencies) {
|
|
473
473
|
for (const key in BASE_DEPS) {
|
|
474
474
|
delete packageJSON.dependencies[key];
|
|
@@ -69,6 +69,7 @@ enableLoading = undefined, publicPath = '/', }) {
|
|
|
69
69
|
await fs_extra_1.default.writeFile(dstFilePath, (0, lodash_1.template)(packageTpl)({
|
|
70
70
|
appId,
|
|
71
71
|
title: '',
|
|
72
|
+
envId,
|
|
72
73
|
desc: description,
|
|
73
74
|
canUseVite: (0, util_1.canUseVite)(mode, devTool),
|
|
74
75
|
jsApis: Array.from(new Set(jsApis.filter((item) => !!item))),
|
|
@@ -89,6 +89,7 @@ export interface IMpCommonBuildContext extends ICommonBuildContext {
|
|
|
89
89
|
*/
|
|
90
90
|
enableAsyncMaterials?: boolean;
|
|
91
91
|
miniprogramPlugins?: IMiniprogramPlugin[];
|
|
92
|
+
disablePageComponentInvoke?: boolean;
|
|
92
93
|
}
|
|
93
94
|
export interface IBuildContext extends IAppCommonBuildContext, IMpCommonBuildContext {
|
|
94
95
|
/**
|
|
@@ -4,14 +4,13 @@ import { IBuildContext, IMpCommonBuildContext } from './BuildContext';
|
|
|
4
4
|
import { BuildType } from '../types/common';
|
|
5
5
|
import { IPlatformApp } from '@cloudbase/cals';
|
|
6
6
|
import { IBuildWedaApp } from '../core';
|
|
7
|
-
export declare function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId,
|
|
7
|
+
export declare function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId, filter, }: {
|
|
8
8
|
buildContext: IMpCommonBuildContext & Partial<Pick<IBuildContext, 'enableExpiredTag' | 'domain' | 'runtimeDynamicConfig'>>;
|
|
9
9
|
buildTypeList: BuildType[];
|
|
10
10
|
localWedaRoot: string;
|
|
11
11
|
appId?: string;
|
|
12
12
|
loginConfigVersion?: string;
|
|
13
13
|
cssVarMap?: Object;
|
|
14
|
-
nativeMode?: boolean;
|
|
15
14
|
filter?: (src: string) => boolean;
|
|
16
15
|
}): Promise<void>;
|
|
17
16
|
export declare function generateWxMp({ buildContext: _buildContext, weapps, calses, deployOptions, options, buildTypeList, ignoreInstall, cdnEndpoints, mpConfig, }: {
|
package/lib/builder/mp/index.js
CHANGED
|
@@ -66,8 +66,7 @@ function patchBuildContext(ctx, calses) {
|
|
|
66
66
|
ctx.miniprogramPlugins = (mainAppData.miniprogramPlugins || []).filter((plugin) => used.component[plugin.name] || used.action[plugin.name]);
|
|
67
67
|
return { used };
|
|
68
68
|
}
|
|
69
|
-
async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId,
|
|
70
|
-
const wxmlDataPrefix = (0, mp_1.getWxmlDataPrefix)(!buildContext.isProduction);
|
|
69
|
+
async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWedaRoot, loginConfigVersion, cssVarMap, appId, filter = () => true, }) {
|
|
71
70
|
const expirationStartTimesnap = buildContext.enableExpiredTag ? Date.now() : 0;
|
|
72
71
|
let customLoginConfig;
|
|
73
72
|
let loginConfigPathname = loginConfigVersion
|
|
@@ -86,7 +85,6 @@ async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWe
|
|
|
86
85
|
}
|
|
87
86
|
}
|
|
88
87
|
const wedaRootFileData = {
|
|
89
|
-
'common/style.js': {},
|
|
90
88
|
'common/util.js': {
|
|
91
89
|
skipCheckAuth: process.env.SKIP_CHECK_AUTH,
|
|
92
90
|
isAdminPortal: (0, common_1.buildAsAdminPortalByBuildType)(buildTypeList),
|
|
@@ -97,38 +95,17 @@ async function generateWedaRootCommonFile({ buildContext, buildTypeList, localWe
|
|
|
97
95
|
customLoginConfig: customLoginConfig ? JSON.stringify(customLoginConfig, undefined, 2) : 'null',
|
|
98
96
|
},
|
|
99
97
|
'common/cloud-sdk.js': {},
|
|
100
|
-
'common/widget.js': {},
|
|
101
98
|
'common/weapp-page.js': {
|
|
102
99
|
expirationStartTimesnap,
|
|
103
100
|
pageStyle: JSON.stringify(cssVarMap || {}, undefined, 2),
|
|
104
101
|
},
|
|
105
|
-
'common/weapp-component.js': {
|
|
106
|
-
nativeMode,
|
|
107
|
-
},
|
|
108
|
-
'common/merge-renderer.js': {
|
|
109
|
-
dataPropNames: wxmlDataPrefix,
|
|
110
|
-
debug: buildContext.debugMode,
|
|
111
|
-
},
|
|
112
|
-
'common/data-patch.js': {},
|
|
113
|
-
'common/event-emitter.js': {},
|
|
114
|
-
'common/watch.js': {},
|
|
115
|
-
'common/constant.js': {
|
|
116
|
-
REPEATER: JSON.stringify(config_1.REPEATER, undefined, 2),
|
|
117
|
-
},
|
|
118
|
-
'common/query.js': {},
|
|
119
|
-
'common/flow.js': {},
|
|
120
102
|
'common/info': {},
|
|
121
|
-
'common/placeholder': {},
|
|
122
103
|
/**
|
|
123
104
|
* 使用微信的 modal
|
|
124
105
|
* 暂时保留内部实现待之后使用
|
|
125
106
|
*/
|
|
126
107
|
// 'common/privacyModal': {},
|
|
127
108
|
// 'common/modal': {},
|
|
128
|
-
/**
|
|
129
|
-
* 调试用
|
|
130
|
-
*/
|
|
131
|
-
// 'common/behaviors.js': {},
|
|
132
109
|
};
|
|
133
110
|
console.log(`Generating ${em('weda root')} files`);
|
|
134
111
|
await (0, generateFiles_1.default)(wedaRootFileData, templateDir, localWedaRoot, filter);
|
|
@@ -234,8 +211,10 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
|
|
|
234
211
|
await (0, generateFiles_1.default)({
|
|
235
212
|
'package.json': {
|
|
236
213
|
appId,
|
|
237
|
-
|
|
238
|
-
|
|
214
|
+
extraDeps: {
|
|
215
|
+
...(0, index_1.generatePackageDependencies)({ importJSSDK: endpointType === 'tcb-api', mode: 'app' }),
|
|
216
|
+
...resolveNpmDeps(weapps, materials),
|
|
217
|
+
},
|
|
239
218
|
},
|
|
240
219
|
}, templateDir, localWedaRoot);
|
|
241
220
|
// 生成数据源
|
|
@@ -402,8 +381,10 @@ async function generateWxMp({ buildContext: _buildContext, weapps, calses, deplo
|
|
|
402
381
|
await (0, generateFiles_1.default)({
|
|
403
382
|
'package.json': {
|
|
404
383
|
appId,
|
|
405
|
-
|
|
406
|
-
|
|
384
|
+
extraDeps: {
|
|
385
|
+
...(0, index_1.generatePackageDependencies)({ importJSSDK: endpointType === 'tcb-api', mode: 'app' }),
|
|
386
|
+
...resolveNpmDeps(weapps, materials),
|
|
387
|
+
},
|
|
407
388
|
cdnEndpoints,
|
|
408
389
|
},
|
|
409
390
|
}, templateDir, subpackageRootPath);
|
|
@@ -556,15 +537,7 @@ async function generatePkg(ctx, { cals, weapp }, appRoot, pageConfigs, cssVarMap
|
|
|
556
537
|
/**
|
|
557
538
|
* 使用最终的 usingComponents 生成一份 componentPlaceholder
|
|
558
539
|
*/
|
|
559
|
-
let componentPlaceholder;
|
|
560
|
-
if (usingComponents[wxml_1.WD_EMPTY_PLACEHOLDER] && ctx.enableAsyncMaterials) {
|
|
561
|
-
componentPlaceholder = Object.keys(usingComponents).reduce((map, key) => {
|
|
562
|
-
if (!wxml_1.WD_RUNTIME_TAG.includes(key)) {
|
|
563
|
-
map[key] = wxml_1.WD_EMPTY_PLACEHOLDER;
|
|
564
|
-
}
|
|
565
|
-
return map;
|
|
566
|
-
}, {});
|
|
567
|
-
}
|
|
540
|
+
let componentPlaceholder = ctx.enableAsyncMaterials ? (0, wxml_1.generateComponentPlaceholder)(usingComponents) : undefined;
|
|
568
541
|
const pageFileData = {
|
|
569
542
|
[`api.js|api.js`]: {
|
|
570
543
|
subLevelPath,
|
|
@@ -610,7 +583,9 @@ async function generatePkg(ctx, { cals, weapp }, appRoot, pageConfigs, cssVarMap
|
|
|
610
583
|
usingComponents,
|
|
611
584
|
componentGenerics,
|
|
612
585
|
componentPlaceholder,
|
|
613
|
-
extra: getAppendableJson(
|
|
586
|
+
extra: getAppendableJson(ctx.isBrowserMpBuilder
|
|
587
|
+
? pageConfigs[page.id]
|
|
588
|
+
: (0, util_2.cleanWindowDefultConfig)(pageConfigs[page.id], defaultAppWindowConfig)),
|
|
614
589
|
},
|
|
615
590
|
[`index.wxml|${pageFileName}.wxml`]: {
|
|
616
591
|
content: wxml,
|
|
@@ -38,7 +38,11 @@ async function writeCode2file(ctx, mod, lowcodeRootDir, opts = {}, themeCode, ex
|
|
|
38
38
|
// Generate component lowcode
|
|
39
39
|
code = `${externalAPIImport
|
|
40
40
|
? importFromClientSDK(true).join('\n')
|
|
41
|
-
: `import { app, $app, $w } from '${mod.type === 'handler-fn' ? '../' : ''}../../../../app/weapps-api';`}\n${
|
|
41
|
+
: `import { app, $app, $w } from '${mod.type === 'handler-fn' ? '../' : ''}../../../../app/weapps-api';`}\n${(0, cals_1.replaceGloalIdentifier)((0, cals_1.replaceGloalIdentifier)(code, '$comp', (match, p1, p2) => {
|
|
42
|
+
return `${weapps_core_1.COMPONENT_API_PREFIX}.${p2}`;
|
|
43
|
+
}), '$w', (match, p1, p2) => {
|
|
44
|
+
return `${weapps_core_1.COMPONENT_API_PREFIX}.__internal__?.$w?.${p2}`;
|
|
45
|
+
})}`;
|
|
42
46
|
}
|
|
43
47
|
}
|
|
44
48
|
else {
|
|
@@ -3,7 +3,7 @@ import { IBuildContext, IMpCommonBuildContext } from './BuildContext';
|
|
|
3
3
|
import NameMangler from '@cloudbase/lowcode-generator/lib/generator/util/name-mangler';
|
|
4
4
|
import { IUsedComps } from '../types/common';
|
|
5
5
|
export declare function normalizeCompositeDependienciesForBuild(lib: any): any;
|
|
6
|
-
declare type TInstallMaterialsType = 'lib' | 'inline';
|
|
6
|
+
export declare type TInstallMaterialsType = 'lib' | 'inline';
|
|
7
7
|
export declare function installMaterials(ctx: IMpCommonBuildContext, outDir: string, usedMeta?: {
|
|
8
8
|
component: IUsedComps;
|
|
9
9
|
action: IUsedComps;
|
|
@@ -17,11 +17,10 @@ export declare function installMaterials(ctx: IMpCommonBuildContext, outDir: str
|
|
|
17
17
|
export declare function filterMaterial(src: any, dest: any): boolean;
|
|
18
18
|
export declare function getWxmlTag(ctx: IMpCommonBuildContext & {
|
|
19
19
|
wedaRoot?: IBuildContext['wedaRoot'];
|
|
20
|
-
}, cmp: Required<IWeAppComponentInstance>['xComponent'], nameMangler?: NameMangler): {
|
|
20
|
+
}, cmp: Required<IWeAppComponentInstance>['xComponent'], nameMangler?: NameMangler, mode?: TInstallMaterialsType): {
|
|
21
21
|
tagName: string;
|
|
22
22
|
path?: undefined;
|
|
23
23
|
} | {
|
|
24
24
|
tagName: string;
|
|
25
25
|
path: any;
|
|
26
26
|
};
|
|
27
|
-
export {};
|
|
@@ -41,6 +41,7 @@ const net_1 = require("../util/net");
|
|
|
41
41
|
const name_mangler_1 = __importDefault(require("@cloudbase/lowcode-generator/lib/generator/util/name-mangler"));
|
|
42
42
|
const junk = __importStar(require("../util/junk"));
|
|
43
43
|
const cals_1 = require("@cloudbase/cals");
|
|
44
|
+
const lowcode_generator_1 = require("@cloudbase/lowcode-generator");
|
|
44
45
|
const templateDir = `${config_1.appTemplateDir}/mp/`;
|
|
45
46
|
function normalizeCompositeDependienciesForBuild(lib) {
|
|
46
47
|
lib.dependencies = lib.dependencies || {};
|
|
@@ -89,7 +90,7 @@ async function generateCompLibs(ctx, outDir, mode) {
|
|
|
89
90
|
}));
|
|
90
91
|
}));
|
|
91
92
|
}
|
|
92
|
-
async function installMaterials(ctx, outDir, usedMeta, mode) {
|
|
93
|
+
async function installMaterials(ctx, outDir, usedMeta, mode = 'inline') {
|
|
93
94
|
let { materialLibs: _materialLibs, isBrowserMpBuilder } = ctx;
|
|
94
95
|
let materialLibs = _materialLibs.filter((lib) => {
|
|
95
96
|
if (!usedMeta) {
|
|
@@ -126,9 +127,10 @@ async function installMaterials(ctx, outDir, usedMeta, mode) {
|
|
|
126
127
|
}
|
|
127
128
|
const targetDir = path.join(outDir, config_1.materialsDirName, name);
|
|
128
129
|
if (libUpdated(targetDir, version)) {
|
|
130
|
+
let sourceDir = materialsSrcDir;
|
|
129
131
|
const materialsSrcDirPath = path.join(materialsSrcDir, 'src');
|
|
130
132
|
if (fs.existsSync(materialsSrcDirPath)) {
|
|
131
|
-
|
|
133
|
+
sourceDir = materialsSrcDirPath;
|
|
132
134
|
// #2 从根目录 copy meta 文件
|
|
133
135
|
const metaJosnPath = path.join(materialsSrcDir, 'meta.json');
|
|
134
136
|
if (fs.existsSync(metaJosnPath)) {
|
|
@@ -136,26 +138,15 @@ async function installMaterials(ctx, outDir, usedMeta, mode) {
|
|
|
136
138
|
? await fs.copy(metaJosnPath, path.join(targetDir, 'meta.json'))
|
|
137
139
|
: (0, generateFiles_1.copyRecursiveSync)(metaJosnPath, path.join(targetDir, 'meta.json'));
|
|
138
140
|
}
|
|
141
|
+
}
|
|
142
|
+
if (!(name === cals_1.OFFICIAL_LIB_KEY && mode === 'lib')) {
|
|
143
|
+
console.log(`Copying material ${materialId} from ${sourceDir} to ${targetDir}`);
|
|
139
144
|
// #3 copy 组件库代码文件到项目目录
|
|
140
145
|
!isBrowserMpBuilder
|
|
141
|
-
? await fs.copy(
|
|
146
|
+
? await fs.copy(sourceDir, targetDir, {
|
|
142
147
|
filter: filterMaterial,
|
|
143
148
|
})
|
|
144
|
-
: (0, generateFiles_1.copyRecursiveSync)(
|
|
145
|
-
filter: filterMaterial,
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
else {
|
|
149
|
-
console.log(`Copying material ${materialId} from ${materialsSrcDir} to ${targetDir}`);
|
|
150
|
-
// #2 link material to current project
|
|
151
|
-
!isBrowserMpBuilder
|
|
152
|
-
? await fs.copy(materialsSrcDir, targetDir, {
|
|
153
|
-
filter(src, dest) {
|
|
154
|
-
const path = src.split('/');
|
|
155
|
-
return !junk.is(path[path.length - 1]);
|
|
156
|
-
},
|
|
157
|
-
})
|
|
158
|
-
: (0, generateFiles_1.copyRecursiveSync)(materialsSrcDir, targetDir, {
|
|
149
|
+
: (0, generateFiles_1.copyRecursiveSync)(sourceDir, targetDir, {
|
|
159
150
|
filter: filterMaterial,
|
|
160
151
|
});
|
|
161
152
|
}
|
|
@@ -205,6 +196,7 @@ async function downloadMaterial(zipUrl, dstFolder, isBrowser = false, noCache =
|
|
|
205
196
|
await (0, net_1.downloadZip)(zipUrl, dstFolder, isBrowser, noCache);
|
|
206
197
|
}
|
|
207
198
|
async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWedaRoot, componentLibRoot, compLibCommonResource, mode = 'inline') {
|
|
199
|
+
var _a;
|
|
208
200
|
const { materialName } = compositedComp;
|
|
209
201
|
const componentRelativeDir = path.posix.join(componentLibRoot, compositedComp.name);
|
|
210
202
|
const componentDir = path.join(lowcalWedaRoot, componentLibRoot, compositedComp.name);
|
|
@@ -225,7 +217,7 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
|
|
|
225
217
|
attributes[classAttrName] = `${(0, weapps_core_1.getCompositedComponentClass)(compositedComp)} ${oldClass} {{className}}`;
|
|
226
218
|
attributes.style += ';{{style}}';
|
|
227
219
|
}
|
|
228
|
-
});
|
|
220
|
+
}, mode);
|
|
229
221
|
// prepare form field change events
|
|
230
222
|
const { syncProps = {} } = compositedComp.meta;
|
|
231
223
|
const formEvents = {};
|
|
@@ -254,18 +246,25 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
|
|
|
254
246
|
handlers: compositedComp.lowCodes
|
|
255
247
|
.filter((m) => m.type === cals_1.ECodeType.HANDLER_FN && m.name !== cals_1.ECodeName.PLACEHOLDER)
|
|
256
248
|
.map((m) => m.name),
|
|
257
|
-
eventHandlers: (0, util_2.createEventHandlers)(compositeCtx, componentInstances, weapps_core_1.COMPONENT_API_PREFIX
|
|
249
|
+
eventHandlers: (0, util_2.createEventHandlers)(compositeCtx, componentInstances, weapps_core_1.COMPONENT_API_PREFIX, {
|
|
250
|
+
listeners: compositedComp.listeners,
|
|
251
|
+
id: '__comp__',
|
|
252
|
+
}),
|
|
258
253
|
emitEvents: (compositedComp.emitEvents || []).map((evt) => evt.eventName),
|
|
259
254
|
widgetProps: (0, util_2.createWidgetProps)(compositeCtx, componentInstances),
|
|
260
|
-
compApi: weapps_core_1.COMPONENT_API_PREFIX,
|
|
261
255
|
jsonSchemaType2jsClass: mp_1.jsonSchemaType2jsClass,
|
|
262
256
|
key: `${materialName}:${compositedComp.name}`,
|
|
263
257
|
dataBinds: (0, util_2.createDataBinds)(compositeCtx, componentInstances),
|
|
264
258
|
debug: !compositeCtx.isProduction,
|
|
265
|
-
// dataPropNames: wxmlDataPrefix,
|
|
266
259
|
formEvents: Object.keys(formEvents).length > 0 ? formEvents : null,
|
|
267
260
|
config: compositedComp.compConfig,
|
|
268
261
|
importor,
|
|
262
|
+
datasetProfile: (0, util_1.JsonToStringWithVariableName)((0, lowcode_generator_1.generateDynamicDataset)(compositedComp.dataset || {}), {
|
|
263
|
+
EOL: true,
|
|
264
|
+
}),
|
|
265
|
+
query: (0, util_2.createTemplateQuery)(compositeCtx, (_a = compositedComp.dataset) === null || _a === void 0 ? void 0 : _a.query) || {},
|
|
266
|
+
eventFlows: (0, util_2.createTemplateEventFlows)(compositeCtx, compositedComp.eventFlows) || [],
|
|
267
|
+
nativeMode: mode === 'lib' ? 1 : 0,
|
|
269
268
|
},
|
|
270
269
|
'index.json': {
|
|
271
270
|
usingComponents: Object.entries(usingComponents).reduce((map, [key, value]) => {
|
|
@@ -277,6 +276,7 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
|
|
|
277
276
|
}
|
|
278
277
|
return map;
|
|
279
278
|
}, {}),
|
|
279
|
+
componentPlaceholder: mode === 'lib' ? (0, wxml_1.generateComponentPlaceholder)(usingComponents) : undefined,
|
|
280
280
|
componentGenerics,
|
|
281
281
|
},
|
|
282
282
|
'index.wxml': {
|
|
@@ -329,7 +329,7 @@ async function generateCompositeComponent(compositeCtx, compositedComp, lowcalWe
|
|
|
329
329
|
* }
|
|
330
330
|
*/
|
|
331
331
|
const NAME_MANAGER = new name_mangler_1.default({ blackList: mp_1.builtinMpTags });
|
|
332
|
-
function getWxmlTag(ctx, cmp, nameMangler) {
|
|
332
|
+
function getWxmlTag(ctx, cmp, nameMangler, mode = 'inline') {
|
|
333
333
|
var _a, _b, _c, _d, _e, _f;
|
|
334
334
|
const { moduleName, name } = cmp;
|
|
335
335
|
const materialLib = ctx.materialLibs.find((lib) => lib.name === moduleName);
|
|
@@ -342,9 +342,11 @@ function getWxmlTag(ctx, cmp, nameMangler) {
|
|
|
342
342
|
return { tagName };
|
|
343
343
|
}
|
|
344
344
|
if (materialLib) {
|
|
345
|
-
const libRootInMiniprogram =
|
|
346
|
-
?
|
|
347
|
-
: path.posix.join(
|
|
345
|
+
const libRootInMiniprogram = materialLib.name === cals_1.OFFICIAL_LIB_KEY && mode === 'lib'
|
|
346
|
+
? cals_1.OFFICIAL_LIB_MP_NPM_PACKAGENAME
|
|
347
|
+
: path.posix.join('/', ctx.wedaRoot || '', (materialLib === null || materialLib === void 0 ? void 0 : materialLib.rootPath)
|
|
348
|
+
? materialLib === null || materialLib === void 0 ? void 0 : materialLib.rootPath
|
|
349
|
+
: path.posix.join(`${config_1.materialsDirName}/${cmp.moduleName}`));
|
|
348
350
|
let cmpMeta = (findComponent === null || findComponent === void 0 ? void 0 : findComponent.meta) || { platforms: undefined };
|
|
349
351
|
if (!cmpMeta.platforms) {
|
|
350
352
|
return { tagName };
|
|
@@ -163,7 +163,7 @@ async function generateMpConfig(ctx, weapps, calses, options) {
|
|
|
163
163
|
});
|
|
164
164
|
}
|
|
165
165
|
});
|
|
166
|
-
if (appConfig === null || appConfig === void 0 ? void 0 : appConfig.window) {
|
|
166
|
+
if ((appConfig === null || appConfig === void 0 ? void 0 : appConfig.window) && !ctx.isBrowserMpBuilder) {
|
|
167
167
|
appConfig.window = (0, util_2.cleanWindowDefultConfig)(appConfig);
|
|
168
168
|
}
|
|
169
169
|
if (!projConfig.setting) {
|
|
@@ -172,6 +172,7 @@ async function generateMpConfig(ctx, weapps, calses, options) {
|
|
|
172
172
|
// projConfig.setting.compileHotReLoad = false;
|
|
173
173
|
projConfig.setting.bigPackageSizeSupport = true;
|
|
174
174
|
projConfig.setting.packNpmManually = true;
|
|
175
|
+
projConfig.setting.ignoreDevUnusedFiles = true;
|
|
175
176
|
if (!projConfig.setting.packNpmRelationList) {
|
|
176
177
|
projConfig.setting.packNpmRelationList = [];
|
|
177
178
|
}
|
package/lib/builder/mp/util.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IDynamicValue, IWeAppComponentInstance, ActionType, ICompositedComponent,
|
|
1
|
+
import { IDynamicValue, IWeAppComponentInstance, ActionType, ICompositedComponent, IEventListener, IQueryData } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { IMpCommonBuildContext, IDefaultAppWindowConfig } from './BuildContext';
|
|
3
3
|
export declare function generatedDynamicData(data: {
|
|
4
4
|
[key: string]: IDynamicValue;
|
|
@@ -11,7 +11,10 @@ export declare function createWidgetProps(ctx: IMpCommonBuildContext, widgets: {
|
|
|
11
11
|
}): {};
|
|
12
12
|
export declare function createEventHandlers(ctx: IMpCommonBuildContext, widgets: {
|
|
13
13
|
[key: string]: IWeAppComponentInstance;
|
|
14
|
-
}, componentApi: string,
|
|
14
|
+
}, componentApi: string, instance?: {
|
|
15
|
+
listeners?: IEventListener[];
|
|
16
|
+
id?: string;
|
|
17
|
+
}): {};
|
|
15
18
|
export declare function generateSyncListeners(syncConfigs: any): IEventListener[];
|
|
16
19
|
export declare function generateDataContainerListeners(): {
|
|
17
20
|
trigger: string;
|
package/lib/builder/mp/util.js
CHANGED
|
@@ -139,9 +139,9 @@ function createWidgetProps(ctx, widgets) {
|
|
|
139
139
|
return widgetProps;
|
|
140
140
|
}
|
|
141
141
|
exports.createWidgetProps = createWidgetProps;
|
|
142
|
-
function createEventHandlers(ctx, widgets, componentApi,
|
|
142
|
+
function createEventHandlers(ctx, widgets, componentApi, instance) {
|
|
143
143
|
let eventHandlers = {};
|
|
144
|
-
const { listeners: pageListeners = [], id:
|
|
144
|
+
const { listeners: pageListeners = [], id: instanceId = '' } = instance || {};
|
|
145
145
|
(0, weapp_1.walkThroughWidgets)(widgets, (id, widget, parentId) => {
|
|
146
146
|
var _a;
|
|
147
147
|
const { xComponent } = widget;
|
|
@@ -174,7 +174,7 @@ function createEventHandlers(ctx, widgets, componentApi, page) {
|
|
|
174
174
|
eventHandlers = Object.assign(eventHandlers, getListenersHandlers(ctx, listeners, id, componentApi));
|
|
175
175
|
});
|
|
176
176
|
// 增加页面事件节点 handlers
|
|
177
|
-
eventHandlers = Object.assign(eventHandlers, getListenersHandlers(ctx, pageListeners,
|
|
177
|
+
eventHandlers = Object.assign(eventHandlers, getListenersHandlers(ctx, pageListeners, instanceId, componentApi));
|
|
178
178
|
return eventHandlers;
|
|
179
179
|
}
|
|
180
180
|
exports.createEventHandlers = createEventHandlers;
|
|
@@ -261,15 +261,23 @@ function getListenersHandlers(ctx, listeners = [], id, componentApi) {
|
|
|
261
261
|
handler = '';
|
|
262
262
|
switch (sourceKey) {
|
|
263
263
|
case `${weapps_core_1.ActionType.Platform}:callNanoFlow`: {
|
|
264
|
-
handler = `function({data}){ return $w[data.id]?.trigger?.(data.data)}`;
|
|
264
|
+
handler = `function({data, $w}){ return $w[data.id]?.trigger?.(data.data)}`;
|
|
265
265
|
break;
|
|
266
266
|
}
|
|
267
267
|
case `${weapps_core_1.ActionType.Platform}:callQuery`: {
|
|
268
|
-
handler = `function({data}){ return $w[data.id]?.[data.method](data.data)}`;
|
|
268
|
+
handler = `function({data, $w}){ return $w[data.id]?.[data.method](data.data)}`;
|
|
269
269
|
break;
|
|
270
270
|
}
|
|
271
271
|
case `${weapps_core_1.ActionType.Platform}:invoke`: {
|
|
272
|
-
handler =
|
|
272
|
+
handler = ctx.disablePageComponentInvoke
|
|
273
|
+
? `function({data, $w}){
|
|
274
|
+
const func = $w[data?.component]?.[data.method];
|
|
275
|
+
if (typeof func !== 'function') {
|
|
276
|
+
throw new Error(\`调用方法失败:未找到id为\${data.component}下的方法\${data.method}\`);
|
|
277
|
+
}
|
|
278
|
+
return func(data.params);
|
|
279
|
+
}`
|
|
280
|
+
: `function({data, $w}){ return $app.invoke({...data, component: $w[data?.component]?._widget});}`;
|
|
273
281
|
break;
|
|
274
282
|
}
|
|
275
283
|
case `${weapps_core_1.ActionType.Platform}:setCurrentPageParams`: {
|
package/lib/builder/mp/wxml.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IWeAppComponentInstance, IEventModifiers } from '@cloudbase/lowcode-generator/lib/weapps-core';
|
|
2
2
|
import { IBuildContext, IMpCommonBuildContext } from './BuildContext';
|
|
3
|
+
import { TInstallMaterialsType } from './materials';
|
|
3
4
|
export declare const WD_EMPTY_PLACEHOLDER = "wd-ph";
|
|
4
5
|
export declare const WD_RUNTIME_TAG: string[];
|
|
5
6
|
export declare function generateWxml(ctx: (IBuildContext & {
|
|
@@ -8,5 +9,6 @@ export declare function generateWxml(ctx: (IBuildContext & {
|
|
|
8
9
|
pageUUID?: undefined;
|
|
9
10
|
}), widgets: {
|
|
10
11
|
[key: string]: IWeAppComponentInstance;
|
|
11
|
-
}, docTag: string, wxmlDataPrefix: any, usingComponents: any, componentGenerics: any, nodeTransform?: (cmp: IWeAppComponentInstance, node: any) => void): string;
|
|
12
|
+
}, docTag: string, wxmlDataPrefix: any, usingComponents: any, componentGenerics: any, nodeTransform?: (cmp: IWeAppComponentInstance, node: any) => void, mode?: TInstallMaterialsType): string;
|
|
12
13
|
export declare function getMpEventHandlerName(widgetId: string, evtName: string, modifier?: IEventModifiers): string;
|
|
14
|
+
export declare function generateComponentPlaceholder(usingComponents: any): any;
|