@cloudbase/framework-plugin-low-code 0.7.23 → 1.0.1
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/generate.d.ts +1 -2
- package/lib/generate.d.ts.map +1 -1
- package/lib/generate.js +4 -5
- package/lib/index.d.ts +4 -7
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +94 -136
- package/lib/utils/dataSource.d.ts +0 -4
- package/lib/utils/dataSource.d.ts.map +1 -1
- package/lib/utils/dataSource.js +12 -27
- package/lib/utils/postProcess.d.ts.map +1 -1
- package/package.json +4 -3
- package/template/html/index.html.ejs +1 -1
- package/template/mp/app/app-global.js +0 -4
- package/template/mp/app/common.js +0 -26
- package/template/mp/app/handlers.js +0 -15
- package/template/mp/app/weapps-api.js +0 -89
- package/template/mp/app.js +0 -114
- package/template/mp/app.json +0 -1
- package/template/mp/app.wxss +0 -15
- package/template/mp/common/data-patch-test.js +0 -60
- package/template/mp/common/data-patch.js +0 -44
- package/template/mp/common/merge-renderer.js +0 -67
- package/template/mp/common/process.js +0 -1
- package/template/mp/common/style.js +0 -34
- package/template/mp/common/url.js +0 -21
- package/template/mp/common/util.js +0 -395
- package/template/mp/common/utils.wxs +0 -11
- package/template/mp/common/weapp-component.js +0 -250
- package/template/mp/common/weapp-page.js +0 -204
- package/template/mp/common/weapp-sdk.js +0 -76
- package/template/mp/common/widget.js +0 -381
- package/template/mp/common/wx_yypt_report_v2.js +0 -460
- package/template/mp/component/index.js +0 -66
- package/template/mp/component/index.json +0 -4
- package/template/mp/component/index.wxml +0 -1
- package/template/mp/component/index.wxss +0 -1
- package/template/mp/datasources/config.js.tpl +0 -25
- package/template/mp/datasources/dataset-profiles.js.tpl +0 -5
- package/template/mp/datasources/datasource-profiles.js.tpl +0 -4
- package/template/mp/datasources/index.js +0 -31
- package/template/mp/package.json +0 -17
- package/template/mp/page/api.js +0 -1
- package/template/mp/page/index.js +0 -42
- package/template/mp/page/index.json +0 -3
- package/template/mp/page/index.wxml +0 -1
- package/template/mp/page/index.wxss +0 -3
- package/template/mp/project.config.json +0 -1
package/lib/generate.d.ts
CHANGED
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export declare function handleMpPlugins(plugins: IPlugin[] | undefined, appBuildDir: string): Promise<void>;
|
|
1
|
+
export declare function handleMpPlugins(plugins: any[] | undefined, appBuildDir: string): Promise<void>;
|
|
3
2
|
//# sourceMappingURL=generate.d.ts.map
|
package/lib/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAMA,wBAAsB,eAAe,CAAC,OAAO,mBAAwB,EAAE,WAAW,EAAE,MAAM,iBAuBzF"}
|
package/lib/generate.js
CHANGED
|
@@ -15,8 +15,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
15
15
|
exports.handleMpPlugins = void 0;
|
|
16
16
|
const path_1 = __importDefault(require("path"));
|
|
17
17
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
18
|
-
const webpack_1 = require("
|
|
19
|
-
const
|
|
18
|
+
const webpack_1 = require("@cloudbase/lowcode-builder/lib/builder/service/webpack");
|
|
19
|
+
const mp_1 = require("@cloudbase/lowcode-builder/lib/builder/util/mp");
|
|
20
20
|
function handleMpPlugins(plugins = [], appBuildDir) {
|
|
21
21
|
return __awaiter(this, void 0, void 0, function* () {
|
|
22
22
|
const appBuildMpDir = path_1.default.resolve(appBuildDir, 'dist/mp');
|
|
@@ -30,8 +30,7 @@ function handleMpPlugins(plugins = [], appBuildDir) {
|
|
|
30
30
|
const mpBuildAppJsonPath = path_1.default.resolve(appBuildMpDir, 'app.json');
|
|
31
31
|
const pluginAppJsonPath = path_1.default.resolve(appBuildNodeModulesDir, plugin.module, 'app.json');
|
|
32
32
|
mergeSubPackagesApp(mpBuildAppJsonPath, pluginAppJsonPath);
|
|
33
|
-
buildPkgJson.dependencies[plugin.module] =
|
|
34
|
-
sourcePkgJson.dependencies[plugin.module];
|
|
33
|
+
buildPkgJson.dependencies[plugin.module] = sourcePkgJson.dependencies[plugin.module];
|
|
35
34
|
});
|
|
36
35
|
fs_extra_1.default.writeJsonSync(mpBuildPkgJsonPath, buildPkgJson, { spaces: 2 });
|
|
37
36
|
console.log('小程序安装依赖', appBuildMpDir);
|
|
@@ -45,6 +44,6 @@ function mergeSubPackagesApp(baseAppJsonPath, mergeAppJsonPath) {
|
|
|
45
44
|
if (!mergeJson.subpackages)
|
|
46
45
|
return;
|
|
47
46
|
const newJson = Object.assign({}, baseJson);
|
|
48
|
-
newJson.subpackages = (0,
|
|
47
|
+
newJson.subpackages = (0, mp_1.mergeSubPackages)(baseJson.subpackages, mergeJson.subpackages);
|
|
49
48
|
fs_extra_1.default.writeJSONSync(baseAppJsonPath, newJson, { spaces: 2 });
|
|
50
49
|
}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { PathLike } from 'fs-extra';
|
|
3
3
|
import { Plugin, PluginServiceApi } from '@cloudbase/framework-core';
|
|
4
|
-
import { BuildType, GenerateMpType } from '
|
|
5
|
-
import { IMaterialItem, IPlugin } from './weapps-core';
|
|
6
|
-
import { DEPLOY_MODE, RUNTIME } from './types';
|
|
7
|
-
export * as generator from './generator/core/index';
|
|
4
|
+
import { BuildType, GenerateMpType, DEPLOY_MODE, RUNTIME } from '@cloudbase/lowcode-builder';
|
|
8
5
|
export declare const DIST_PATH = "./dist";
|
|
9
|
-
export declare const PERSISTENT_DEPENDIENCES_MAP: {};
|
|
10
6
|
declare const DEFAULT_INPUTS: {
|
|
11
7
|
_inputFile: string;
|
|
12
8
|
debug: boolean;
|
|
@@ -38,12 +34,12 @@ export interface IFrameworkPluginLowCodeInputs {
|
|
|
38
34
|
appId: string;
|
|
39
35
|
mainAppSerializeData: any;
|
|
40
36
|
subAppSerializeDataList?: any[];
|
|
41
|
-
dependencies?:
|
|
37
|
+
dependencies?: any[];
|
|
42
38
|
buildTypeList?: BuildType[];
|
|
43
39
|
generateMpType?: GenerateMpType;
|
|
44
40
|
mpAppId?: string;
|
|
45
41
|
generateMpPath?: string;
|
|
46
|
-
plugins?:
|
|
42
|
+
plugins?: any[];
|
|
47
43
|
mpDeployPrivateKey?: string;
|
|
48
44
|
deployOptions: {
|
|
49
45
|
mode: DEPLOY_MODE;
|
|
@@ -119,4 +115,5 @@ declare class LowCodePlugin extends Plugin {
|
|
|
119
115
|
_checkBroswerHisroty(): boolean;
|
|
120
116
|
}
|
|
121
117
|
export declare const plugin: typeof LowCodePlugin;
|
|
118
|
+
export {};
|
|
122
119
|
//# sourceMappingURL=index.d.ts.map
|
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAOA,OAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/lib/index.js
CHANGED
|
@@ -42,17 +42,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
42
42
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
43
43
|
};
|
|
44
44
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
exports.plugin = exports.
|
|
45
|
+
exports.plugin = exports.DIST_PATH = void 0;
|
|
46
46
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
47
47
|
const path_1 = __importDefault(require("path"));
|
|
48
48
|
const framework_core_1 = require("@cloudbase/framework-core");
|
|
49
49
|
const framework_plugin_mp_1 = require("@cloudbase/framework-plugin-mp");
|
|
50
50
|
const framework_plugin_website_1 = require("@cloudbase/framework-plugin-website");
|
|
51
51
|
const framework_plugin_auth_1 = require("@cloudbase/framework-plugin-auth");
|
|
52
|
-
const
|
|
53
|
-
const common_1 = require("./utils/common");
|
|
54
|
-
const core_1 = __importDefault(require("./builder/core"));
|
|
55
|
-
const common_2 = require("./builder/types/common");
|
|
52
|
+
const lowcode_builder_1 = require("@cloudbase/lowcode-builder");
|
|
56
53
|
const generate_1 = require("./generate");
|
|
57
54
|
const postProcess_1 = require("./utils/postProcess");
|
|
58
55
|
const lodash_1 = require("lodash");
|
|
@@ -61,11 +58,8 @@ const cos_nodejs_sdk_v5_1 = __importDefault(require("cos-nodejs-sdk-v5"));
|
|
|
61
58
|
const mpci = __importStar(require("miniprogram-ci"));
|
|
62
59
|
const qrcode_1 = __importDefault(require("qrcode"));
|
|
63
60
|
const url_1 = __importDefault(require("url"));
|
|
64
|
-
const
|
|
65
|
-
const config_1 = require("./generator/config");
|
|
66
|
-
exports.generator = __importStar(require("./generator/core/index"));
|
|
61
|
+
const private_1 = require("./config/private");
|
|
67
62
|
exports.DIST_PATH = './dist';
|
|
68
|
-
exports.PERSISTENT_DEPENDIENCES_MAP = {};
|
|
69
63
|
const DEBUG_PATH = './debug';
|
|
70
64
|
const QRCODE_PATH = './qrcode.jpg';
|
|
71
65
|
const LOG_FILE = 'build.log';
|
|
@@ -74,10 +68,10 @@ const DEFAULT_CLOUDFUNCTION_ROOT_PATH = path_1.default.join(DEFAULT_CLOUDFUNCTIO
|
|
|
74
68
|
const DEFAULT_INPUTS = {
|
|
75
69
|
_inputFile: 'input.json',
|
|
76
70
|
debug: false,
|
|
77
|
-
runtime: process.env.CLOUDBASE_CIID ?
|
|
71
|
+
runtime: process.env.CLOUDBASE_CIID ? lowcode_builder_1.RUNTIME.CI : lowcode_builder_1.RUNTIME.NONE,
|
|
78
72
|
appId: 'test',
|
|
79
|
-
buildTypeList: [
|
|
80
|
-
generateMpType:
|
|
73
|
+
buildTypeList: [lowcode_builder_1.BuildType.MP],
|
|
74
|
+
generateMpType: lowcode_builder_1.GenerateMpType.APP,
|
|
81
75
|
generateMpPath: '',
|
|
82
76
|
subAppSerializeDataList: [],
|
|
83
77
|
dependencies: [],
|
|
@@ -87,7 +81,7 @@ const DEFAULT_INPUTS = {
|
|
|
87
81
|
mpAppId: '',
|
|
88
82
|
mpDeployPrivateKey: process.env.mpDeployPrivateKey || '',
|
|
89
83
|
deployOptions: {
|
|
90
|
-
mode: process.env.deployMode ||
|
|
84
|
+
mode: process.env.deployMode || lowcode_builder_1.DEPLOY_MODE.PREVIEW,
|
|
91
85
|
},
|
|
92
86
|
calsVersion: 'latest',
|
|
93
87
|
ignoreInstall: false,
|
|
@@ -118,62 +112,35 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
118
112
|
}
|
|
119
113
|
return list;
|
|
120
114
|
}, []);
|
|
121
|
-
if (this.
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
var _a;
|
|
130
|
-
return (Object.assign(Object.assign({}, plugin), { componentConfigs: ((_a = plugin.componentConfigs) === null || _a === void 0 ? void 0 : _a.map((component) => {
|
|
131
|
-
const { data, events, meta = {} } = component, restComponent = __rest(component, ["data", "events", "meta"]);
|
|
132
|
-
const processedCompoennt = Object.assign(Object.assign({}, restComponent), { meta: {
|
|
133
|
-
desc: (meta === null || meta === void 0 ? void 0 : meta.desc) || (meta === null || meta === void 0 ? void 0 : meta.description),
|
|
134
|
-
} });
|
|
135
|
-
if (data) {
|
|
136
|
-
processedCompoennt.dataForm = data.properties;
|
|
137
|
-
}
|
|
138
|
-
if (events) {
|
|
139
|
-
processedCompoennt.emitEvents = events === null || events === void 0 ? void 0 : events.map((event) => ({
|
|
140
|
-
eventName: event.name,
|
|
141
|
-
name: event.title,
|
|
142
|
-
}));
|
|
143
|
-
}
|
|
144
|
-
return processedCompoennt;
|
|
145
|
-
})) || [] }));
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
if (this._resolvedInputs.buildTypeList.includes("app") ||
|
|
149
|
-
this._resolvedInputs.buildTypeList.includes("xPagePC") ||
|
|
150
|
-
this._resolvedInputs.buildTypeList.includes("adminPortal")) {
|
|
151
|
-
this._resolvedInputs.mainAppSerializeData.historyType = types_1.HISTORY_TYPE.HASH;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
else {
|
|
155
|
-
this._resolvedInputs.mainAppSerializeData = (0, common_1.processPkgUrlCals2WeappData)(cals);
|
|
115
|
+
if (!this._resolvedInputs.mainAppSerializeData.extra) {
|
|
116
|
+
this._resolvedInputs.mainAppSerializeData.extra = {};
|
|
117
|
+
}
|
|
118
|
+
if (!this._resolvedInputs.mainAppSerializeData.mpPkgUrl) {
|
|
119
|
+
if (this._resolvedInputs.buildTypeList.includes(lowcode_builder_1.BuildType.APP) ||
|
|
120
|
+
this._resolvedInputs.buildTypeList.includes(lowcode_builder_1.BuildType.XPAGE_PC) ||
|
|
121
|
+
this._resolvedInputs.buildTypeList.includes(lowcode_builder_1.BuildType.ADMIN_PORTAL)) {
|
|
122
|
+
this._resolvedInputs.mainAppSerializeData.extra.historyType = lowcode_builder_1.HISTORY_TYPE.HASH;
|
|
156
123
|
}
|
|
157
124
|
}
|
|
158
|
-
if (!((_b = this._resolvedInputs.mainAppSerializeData) === null || _b === void 0 ? void 0 : _b.envId)) {
|
|
159
|
-
this._resolvedInputs.mainAppSerializeData.envId = envId;
|
|
125
|
+
if (!((_b = (_a = this._resolvedInputs.mainAppSerializeData) === null || _a === void 0 ? void 0 : _a.extra) === null || _b === void 0 ? void 0 : _b.envId)) {
|
|
126
|
+
this._resolvedInputs.mainAppSerializeData.extra.envId = envId;
|
|
160
127
|
}
|
|
161
|
-
if ((0,
|
|
128
|
+
if ((0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList)) {
|
|
162
129
|
const { appId, mainAppSerializeData } = this._resolvedInputs;
|
|
163
|
-
let { appConfig = {} } = mainAppSerializeData;
|
|
130
|
+
let { appConfig = {} } = mainAppSerializeData.extra;
|
|
164
131
|
let { window = {} } = appConfig;
|
|
165
132
|
let path = this._getWebRootPath();
|
|
166
133
|
window.publicPath = path;
|
|
167
|
-
window.basename = (0,
|
|
168
|
-
? `app/${appId}${((_c = this._resolvedInputs.deployOptions) === null || _c === void 0 ? void 0 : _c.mode) !==
|
|
169
|
-
: (0,
|
|
134
|
+
window.basename = (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)
|
|
135
|
+
? `app/${appId}${((_c = this._resolvedInputs.deployOptions) === null || _c === void 0 ? void 0 : _c.mode) !== lowcode_builder_1.DEPLOY_MODE.UPLOAD ? '-preview' : ''}`
|
|
136
|
+
: (0, lowcode_builder_1.buildAsXPageByBuildType)(this._resolvedInputs.buildTypeList)
|
|
170
137
|
? '/'
|
|
171
138
|
: path;
|
|
172
139
|
appConfig.window = window;
|
|
173
|
-
this._resolvedInputs.mainAppSerializeData.appConfig = appConfig;
|
|
140
|
+
this._resolvedInputs.mainAppSerializeData.extra.appConfig = appConfig;
|
|
174
141
|
this._resolvedInputs.subAppSerializeDataList = [];
|
|
175
|
-
if (this._resolvedInputs.mainAppSerializeData.miniprogramPlugins) {
|
|
176
|
-
this._resolvedInputs.mainAppSerializeData.miniprogramPlugins = [];
|
|
142
|
+
if (this._resolvedInputs.mainAppSerializeData.extra.miniprogramPlugins) {
|
|
143
|
+
this._resolvedInputs.mainAppSerializeData.extra.miniprogramPlugins = [];
|
|
177
144
|
}
|
|
178
145
|
}
|
|
179
146
|
else {
|
|
@@ -198,7 +165,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
198
165
|
}
|
|
199
166
|
_subPluginConstructor(resolveInputs) {
|
|
200
167
|
var _a, _b;
|
|
201
|
-
if (resolveInputs.runtime ===
|
|
168
|
+
if (resolveInputs.runtime === lowcode_builder_1.RUNTIME.CLI) {
|
|
202
169
|
return;
|
|
203
170
|
}
|
|
204
171
|
let { buildTypeList, deployOptions } = resolveInputs;
|
|
@@ -218,7 +185,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
218
185
|
},
|
|
219
186
|
],
|
|
220
187
|
});
|
|
221
|
-
if (buildTypeList.includes(
|
|
188
|
+
if (buildTypeList.includes(lowcode_builder_1.BuildType.MP)) {
|
|
222
189
|
if (deployOptions.mpDeployPrivateKey) {
|
|
223
190
|
fs_extra_1.default.writeFileSync(path_1.default.join(this.api.projectPath, `./private.${deployOptions.mpAppId}.key`), deployOptions.mpDeployPrivateKey, 'base64');
|
|
224
191
|
}
|
|
@@ -235,7 +202,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
235
202
|
privateKeyPath: `./private.${deployOptions.mpAppId}.key`,
|
|
236
203
|
localPath: exports.DIST_PATH,
|
|
237
204
|
ignores: ['node_modules/**/*', LOG_FILE].concat(cloudfunctionRoot ? [path_1.default.join(cloudfunctionRoot, '**/*')] : []),
|
|
238
|
-
deployMode: deployOptions.mpAppId === deployOptions.targetMpAppId ? deployOptions.mode :
|
|
205
|
+
deployMode: deployOptions.mpAppId === deployOptions.targetMpAppId ? deployOptions.mode : lowcode_builder_1.DEPLOY_MODE.UPLOAD,
|
|
239
206
|
uploadOptions: {
|
|
240
207
|
version: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.version) || '1.0.0',
|
|
241
208
|
desc: (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.description) || '',
|
|
@@ -248,7 +215,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
248
215
|
},
|
|
249
216
|
});
|
|
250
217
|
}
|
|
251
|
-
else if ((0,
|
|
218
|
+
else if ((0, lowcode_builder_1.buildAsWebByBuildType)(buildTypeList)) {
|
|
252
219
|
this._webPlugin = new framework_plugin_website_1.plugin('web', this.api, {
|
|
253
220
|
outputPath: exports.DIST_PATH,
|
|
254
221
|
cloudPath: this._getWebRootPath(),
|
|
@@ -258,7 +225,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
258
225
|
}
|
|
259
226
|
_getWebRootPath() {
|
|
260
227
|
let { appId, deployOptions } = this._resolvedInputs;
|
|
261
|
-
return (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) ===
|
|
228
|
+
return (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === lowcode_builder_1.DEPLOY_MODE.PREVIEW ? `/${appId}/preview/` : `/${appId}/production/`;
|
|
262
229
|
}
|
|
263
230
|
_time(label) {
|
|
264
231
|
if (!this._timeMap[label]) {
|
|
@@ -289,17 +256,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
289
256
|
return __awaiter(this, void 0, void 0, function* () {
|
|
290
257
|
let { logger } = this.api;
|
|
291
258
|
const staticDir = path_1.default.resolve(__dirname, '../../../static');
|
|
292
|
-
let { debug, mainAppSerializeData, subAppSerializeDataList, dependencies, appId, buildTypeList, generateMpType,
|
|
293
|
-
const webpackMode = ((_a = this._resolvedInputs.deployOptions) === null || _a === void 0 ? void 0 : _a.mode) ===
|
|
294
|
-
?
|
|
295
|
-
:
|
|
296
|
-
subAppSerializeDataList = subAppSerializeDataList === null || subAppSerializeDataList === void 0 ? void 0 : subAppSerializeDataList.map((item) => {
|
|
297
|
-
if (this._checkIsVersion(calsVersion)) {
|
|
298
|
-
return item.mpPkgUrl ? (0, common_1.processPkgUrlCals2WeappData)(item) : (0, cals_1.deserializePlatformApp)(item, { dependencies });
|
|
299
|
-
}
|
|
300
|
-
return item;
|
|
301
|
-
});
|
|
302
|
-
const nodeModulesPath = (0, common_1.getValidNodeModulesPath)();
|
|
259
|
+
let { debug, mainAppSerializeData, subAppSerializeDataList, dependencies, appId, buildTypeList, generateMpType, plugins, extraData = { isComposite: false, compProps: {} }, } = this._resolvedInputs;
|
|
260
|
+
const webpackMode = ((_a = this._resolvedInputs.deployOptions) === null || _a === void 0 ? void 0 : _a.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD
|
|
261
|
+
? lowcode_builder_1.WebpackModeType.PRODUCTION
|
|
262
|
+
: lowcode_builder_1.WebpackModeType.NONE;
|
|
303
263
|
let miniAppDir = '';
|
|
304
264
|
let webAppDir = '';
|
|
305
265
|
const h5url = `./${appId}/index.html`;
|
|
@@ -318,14 +278,14 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
318
278
|
throw e;
|
|
319
279
|
}
|
|
320
280
|
const domain = ((_b = this._website) === null || _b === void 0 ? void 0 : _b.cdnDomain) || ((_c = mainAppSerializeData.extra) === null || _c === void 0 ? void 0 : _c.domain);
|
|
321
|
-
if ((0,
|
|
322
|
-
let { appConfig = {} } = mainAppSerializeData;
|
|
281
|
+
if ((0, lowcode_builder_1.buildAsWebByBuildType)(buildTypeList)) {
|
|
282
|
+
let { appConfig = {} } = mainAppSerializeData.extra;
|
|
323
283
|
let { window = {} } = appConfig;
|
|
324
|
-
if ((0,
|
|
284
|
+
if ((0, lowcode_builder_1.buildAsXPageByBuildType)(buildTypeList)) {
|
|
325
285
|
window.publicPath =
|
|
326
286
|
((_d = this._resolvedInputs.deployOptions) === null || _d === void 0 ? void 0 : _d.publicPath) || `https://${domain}${this._getWebRootPath()}`;
|
|
327
287
|
}
|
|
328
|
-
else if (this._resolvedInputs.deployOptions.mode ===
|
|
288
|
+
else if (this._resolvedInputs.deployOptions.mode === lowcode_builder_1.DEPLOY_MODE.UPLOAD) {
|
|
329
289
|
try {
|
|
330
290
|
const { Data = {} } = yield this.api.cloudbaseManager.commonService('lowcode', '2021-01-08').call({
|
|
331
291
|
Action: 'DescribeAppCustomUrls',
|
|
@@ -340,7 +300,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
340
300
|
if (this._gatewayConfig) {
|
|
341
301
|
const path = this._gatewayConfig.Path;
|
|
342
302
|
window.publicPath = `https://${domain}${this._getWebRootPath()}`;
|
|
343
|
-
if (!(0,
|
|
303
|
+
if (!(0, lowcode_builder_1.buildAsAdminPortalByBuildType)(buildTypeList)) {
|
|
344
304
|
window.basename = path;
|
|
345
305
|
}
|
|
346
306
|
}
|
|
@@ -354,7 +314,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
354
314
|
}
|
|
355
315
|
}
|
|
356
316
|
appConfig.window = window;
|
|
357
|
-
this._resolvedInputs.mainAppSerializeData.appConfig = appConfig;
|
|
317
|
+
this._resolvedInputs.mainAppSerializeData.extra.appConfig = appConfig;
|
|
358
318
|
}
|
|
359
319
|
try {
|
|
360
320
|
if (!debug) {
|
|
@@ -362,50 +322,44 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
362
322
|
}
|
|
363
323
|
this._time("build process");
|
|
364
324
|
this._appPath = yield new Promise((resolve, reject) => {
|
|
365
|
-
var _a, _b;
|
|
366
325
|
try {
|
|
367
|
-
(0,
|
|
368
|
-
mainAppSerializeData,
|
|
369
|
-
subAppSerializeDataList,
|
|
326
|
+
(0, lowcode_builder_1.buildWedaApp)({
|
|
327
|
+
cals: mainAppSerializeData,
|
|
328
|
+
subAppCalsList: subAppSerializeDataList,
|
|
370
329
|
dependencies,
|
|
371
330
|
appKey: appId,
|
|
372
|
-
nodeModulesPath,
|
|
373
|
-
buildTypeList,
|
|
374
331
|
runtime: this._resolvedInputs.runtime,
|
|
375
332
|
ignoreInstall: this._resolvedInputs.ignoreInstall,
|
|
333
|
+
buildTypeList,
|
|
376
334
|
mode: webpackMode,
|
|
377
|
-
|
|
378
|
-
watch: false,
|
|
335
|
+
deployOptions: this._resolvedInputs.deployOptions,
|
|
379
336
|
generateMpType,
|
|
380
|
-
generateMpPath,
|
|
381
|
-
isCleanDistDir: false,
|
|
382
337
|
plugins,
|
|
383
338
|
extraData,
|
|
384
|
-
|
|
385
|
-
resourceAppid: this._resolvedInputs.mpAppId,
|
|
339
|
+
resourceAppId: this._resolvedInputs.mpAppId,
|
|
386
340
|
domain,
|
|
387
341
|
}, (err, result) => __awaiter(this, void 0, void 0, function* () {
|
|
388
|
-
var
|
|
342
|
+
var _a;
|
|
389
343
|
if (!err) {
|
|
390
344
|
try {
|
|
391
|
-
const { appConfig = {} } = mainAppSerializeData;
|
|
345
|
+
const { appConfig = {} } = mainAppSerializeData.extra;
|
|
392
346
|
const { publicPath = '' } = (appConfig === null || appConfig === void 0 ? void 0 : appConfig.window) || {};
|
|
393
347
|
const { outDir = '', timeElapsed = 0, plugins } = result || {};
|
|
394
|
-
if (buildTypeList.includes(
|
|
348
|
+
if (buildTypeList.includes(lowcode_builder_1.BuildType.MP)) {
|
|
395
349
|
miniAppDir = outDir;
|
|
396
350
|
}
|
|
397
|
-
if ((0,
|
|
351
|
+
if ((0, lowcode_builder_1.buildAsWebByBuildType)(buildTypeList)) {
|
|
398
352
|
webAppDir = path_1.default.resolve(outDir, 'preview');
|
|
399
353
|
}
|
|
400
354
|
logger.debug(`=== Compilation finished at ${outDir}, elapsed time: ${timeElapsed / 1000}s.===\n`);
|
|
401
|
-
if (buildTypeList.includes(
|
|
355
|
+
if (buildTypeList.includes(lowcode_builder_1.BuildType.MP) && miniAppDir) {
|
|
402
356
|
let projectJsonPath = path_1.default.resolve(miniAppDir, 'project.config.json');
|
|
403
357
|
yield (0, postProcess_1.postprocessProjectConfig)(projectJsonPath, {
|
|
404
358
|
appid: this._resolvedInputs.deployOptions.mpAppId,
|
|
405
359
|
cloudfunctionRoot: undefined,
|
|
406
360
|
});
|
|
407
361
|
yield (0, postProcess_1.postprocessDeployExtraJson)(miniAppDir, this._resolvedInputs.deployOptions);
|
|
408
|
-
if (generateMpType ===
|
|
362
|
+
if (generateMpType === lowcode_builder_1.GenerateMpType.APP) {
|
|
409
363
|
fs_extra_1.default.removeSync(path_1.default.resolve(miniAppDir, 'miniprogram_npm'));
|
|
410
364
|
}
|
|
411
365
|
if (outDir) {
|
|
@@ -414,7 +368,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
414
368
|
}
|
|
415
369
|
}
|
|
416
370
|
}
|
|
417
|
-
else if ((0,
|
|
371
|
+
else if ((0, lowcode_builder_1.buildAsWebByBuildType)(buildTypeList) && webAppDir) {
|
|
418
372
|
const staticAppDir = path_1.default.join(staticDir, publicPath);
|
|
419
373
|
fs_extra_1.default.ensureDirSync(staticAppDir);
|
|
420
374
|
}
|
|
@@ -424,10 +378,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
424
378
|
}
|
|
425
379
|
else if (webAppDir) {
|
|
426
380
|
fs_extra_1.default.copySync(webAppDir, distPath);
|
|
427
|
-
if ((0,
|
|
428
|
-
!(0,
|
|
381
|
+
if ((0, lowcode_builder_1.buildAsWebByBuildType)(buildTypeList) &&
|
|
382
|
+
!(0, lowcode_builder_1.buildAsAdminPortalByBuildType)(buildTypeList) &&
|
|
429
383
|
this._checkBroswerHisroty()) {
|
|
430
|
-
yield Promise.all((((
|
|
384
|
+
yield Promise.all((((_a = this._resolvedInputs.mainAppSerializeData) === null || _a === void 0 ? void 0 : _a.items) || []).map((page) => fs_extra_1.default.copy(path_1.default.join(distPath, 'index.html'), path_1.default.join(distPath, page.id, 'index.html'))));
|
|
431
385
|
}
|
|
432
386
|
}
|
|
433
387
|
resolve(distPath);
|
|
@@ -441,7 +395,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
441
395
|
if (err.length) {
|
|
442
396
|
let messageList = (err[0] || '').split('\n');
|
|
443
397
|
let lineIndex = 0;
|
|
444
|
-
let reg = /node_modules
|
|
398
|
+
let reg = /node_modules\/@babel/;
|
|
445
399
|
messageList.find((str, index) => {
|
|
446
400
|
if (reg.test(str)) {
|
|
447
401
|
lineIndex = index;
|
|
@@ -495,7 +449,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
495
449
|
if (debug) {
|
|
496
450
|
yield this._debugInfo();
|
|
497
451
|
}
|
|
498
|
-
if (this._resolvedInputs.runtime ===
|
|
452
|
+
if (this._resolvedInputs.runtime === lowcode_builder_1.RUNTIME.CI) {
|
|
499
453
|
yield this._handleCIProduct();
|
|
500
454
|
}
|
|
501
455
|
logger.info(`low-code build fail: ${e}`);
|
|
@@ -524,7 +478,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
524
478
|
if (this._miniprogramePlugin) {
|
|
525
479
|
res = (0, lodash_1.merge)(res, yield this._miniprogramePlugin.compile());
|
|
526
480
|
}
|
|
527
|
-
else if ((0,
|
|
481
|
+
else if ((0, lowcode_builder_1.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList) && this._webPlugin) {
|
|
528
482
|
try {
|
|
529
483
|
const HostingProvider = (_a = this.api.resourceProviders) === null || _a === void 0 ? void 0 : _a.hosting;
|
|
530
484
|
const { envId } = this.api;
|
|
@@ -544,10 +498,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
544
498
|
this.api.logger.error('获取静态托管失败: ', e);
|
|
545
499
|
throw e;
|
|
546
500
|
}
|
|
547
|
-
const privateJsPath = path_1.default.join('/', 'tmp',
|
|
501
|
+
const privateJsPath = path_1.default.join('/', 'tmp', private_1.PRIVATE_JS_NAME);
|
|
548
502
|
try {
|
|
549
503
|
yield fs_extra_1.default.ensureFile(privateJsPath);
|
|
550
|
-
yield fs_extra_1.default.writeFile(privateJsPath,
|
|
504
|
+
yield fs_extra_1.default.writeFile(privateJsPath, private_1.PRIVATE_JS_CODE, {
|
|
551
505
|
encoding: 'utf8',
|
|
552
506
|
flag: 'w',
|
|
553
507
|
});
|
|
@@ -556,19 +510,24 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
556
510
|
this.api.logger.error('创建私有化JS文件失败:', e);
|
|
557
511
|
throw e;
|
|
558
512
|
}
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
513
|
+
if (!(0, lowcode_builder_1.buildAsXPageByBuildType)(this._resolvedInputs.buildTypeList)) {
|
|
514
|
+
const deployContent = [
|
|
515
|
+
...(this._webPlugin.buildOutput.static || []),
|
|
516
|
+
...(this._webPlugin.buildOutput.staticConfig || []),
|
|
517
|
+
{
|
|
518
|
+
src: privateJsPath,
|
|
519
|
+
cloudPath: `/weda-config/${private_1.PRIVATE_JS_NAME}`,
|
|
520
|
+
},
|
|
521
|
+
];
|
|
522
|
+
yield Promise.all(deployContent.map((options) => this.api.cloudbaseManager.hosting.uploadFiles({
|
|
523
|
+
localPath: options.src,
|
|
524
|
+
cloudPath: options.cloudPath,
|
|
525
|
+
ignore: this._webPlugin.resolvedInputs.ignore,
|
|
526
|
+
})));
|
|
527
|
+
}
|
|
528
|
+
else {
|
|
529
|
+
this.api.logger.info('xpage 跳过部署流程');
|
|
530
|
+
}
|
|
572
531
|
}
|
|
573
532
|
if (!Object.keys(res.Resources || {}).length && !Object.keys(res.Config || {}).length) {
|
|
574
533
|
this._skipInstallExt = true;
|
|
@@ -580,7 +539,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
580
539
|
if (this._resolvedInputs.debug) {
|
|
581
540
|
yield this._debugInfo();
|
|
582
541
|
}
|
|
583
|
-
if (this._resolvedInputs.runtime ===
|
|
542
|
+
if (this._resolvedInputs.runtime === lowcode_builder_1.RUNTIME.CI) {
|
|
584
543
|
yield this._handleCIProduct();
|
|
585
544
|
}
|
|
586
545
|
throw e;
|
|
@@ -597,7 +556,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
597
556
|
}
|
|
598
557
|
else if (this._webPlugin) {
|
|
599
558
|
yield this._webPlugin.deploy();
|
|
600
|
-
if ((0,
|
|
559
|
+
if ((0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)) {
|
|
601
560
|
yield this._postProcessAdminPortal();
|
|
602
561
|
}
|
|
603
562
|
else {
|
|
@@ -609,7 +568,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
609
568
|
Param: {
|
|
610
569
|
WeAppId: this._resolvedInputs.appId,
|
|
611
570
|
EnvId: this.api.envId,
|
|
612
|
-
PublishType: this._resolvedInputs.deployOptions.mode ===
|
|
571
|
+
PublishType: this._resolvedInputs.deployOptions.mode === lowcode_builder_1.DEPLOY_MODE.UPLOAD ? 'product' : 'preview',
|
|
613
572
|
},
|
|
614
573
|
});
|
|
615
574
|
this.api.logger.info(`${this.api.emoji('🚀')} custom publish success: ${JSON.stringify(publishAppCustomNavRes)}`);
|
|
@@ -622,8 +581,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
622
581
|
}
|
|
623
582
|
try {
|
|
624
583
|
const { deployOptions, appId } = this._resolvedInputs;
|
|
625
|
-
const isPreview = (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) ===
|
|
626
|
-
const link = (0,
|
|
584
|
+
const isPreview = (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === lowcode_builder_1.DEPLOY_MODE.PREVIEW;
|
|
585
|
+
const link = (0, lowcode_builder_1.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)
|
|
627
586
|
? `https://${this._website.cdnDomain}/adminportal/#/app/${isPreview ? `${appId}-preview` : appId}?envType=${isPreview ? 'preview' : 'prod'}`
|
|
628
587
|
: this._gatewayConfig
|
|
629
588
|
? `https://${this._gatewayConfig.Domain + this._gatewayConfig.Path}`
|
|
@@ -669,7 +628,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
669
628
|
if (this._resolvedInputs.debug) {
|
|
670
629
|
yield this._debugInfo();
|
|
671
630
|
}
|
|
672
|
-
if (this._resolvedInputs.runtime ===
|
|
631
|
+
if (this._resolvedInputs.runtime === lowcode_builder_1.RUNTIME.CI) {
|
|
673
632
|
yield this._handleCIProduct();
|
|
674
633
|
yield this._postPersistentDependiences();
|
|
675
634
|
}
|
|
@@ -871,8 +830,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
871
830
|
SecretId: credential === null || credential === void 0 ? void 0 : credential.secretId,
|
|
872
831
|
SecretKey: credential === null || credential === void 0 ? void 0 : credential.secretKey,
|
|
873
832
|
});
|
|
874
|
-
promises = Object.keys(
|
|
875
|
-
let meta =
|
|
833
|
+
promises = Object.keys(lowcode_builder_1.PERSISTENT_DEPENDIENCES_MAP).map((key) => __awaiter(this, void 0, void 0, function* () {
|
|
834
|
+
let meta = lowcode_builder_1.PERSISTENT_DEPENDIENCES_MAP[key];
|
|
876
835
|
const zipPath = path_1.default.join(this.api.projectPath, `${meta.name}@${meta.version}.zip`);
|
|
877
836
|
try {
|
|
878
837
|
yield this._zipDir(meta.source, zipPath);
|
|
@@ -935,10 +894,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
935
894
|
_postProcessAdminPortal() {
|
|
936
895
|
var _a, _b;
|
|
937
896
|
return __awaiter(this, void 0, void 0, function* () {
|
|
938
|
-
const {
|
|
939
|
-
if ((0,
|
|
897
|
+
const { buildTypeList } = this._resolvedInputs;
|
|
898
|
+
if ((0, lowcode_builder_1.buildAsAdminPortalByBuildType)(buildTypeList)) {
|
|
940
899
|
try {
|
|
941
|
-
if (((_b = (_a = this._resolvedInputs) === null || _a === void 0 ? void 0 : _a.deployOptions) === null || _b === void 0 ? void 0 : _b.mode) ===
|
|
900
|
+
if (((_b = (_a = this._resolvedInputs) === null || _a === void 0 ? void 0 : _a.deployOptions) === null || _b === void 0 ? void 0 : _b.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD) {
|
|
942
901
|
yield this.api.cloudbaseManager.commonService('lowcode', '2021-01-08').call({
|
|
943
902
|
Action: 'PublishAppCustomUrl',
|
|
944
903
|
Param: {
|
|
@@ -994,7 +953,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
994
953
|
return arr;
|
|
995
954
|
}, []);
|
|
996
955
|
if (this._gatewayConfig) {
|
|
997
|
-
(_a = this._resolvedInputs.mainAppSerializeData.
|
|
956
|
+
(_a = this._resolvedInputs.mainAppSerializeData.items) === null || _a === void 0 ? void 0 : _a.forEach((page) => {
|
|
998
957
|
rules.push({
|
|
999
958
|
keyPrefixEquals: `${path.slice(1)}${page.id}`,
|
|
1000
959
|
replaceKeyWith: path,
|
|
@@ -1012,7 +971,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
1012
971
|
}));
|
|
1013
972
|
yield Promise.all(modifyDomainConfigPromises);
|
|
1014
973
|
yield Promise.all([
|
|
1015
|
-
((_c = (_b = this._resolvedInputs) === null || _b === void 0 ? void 0 : _b.deployOptions) === null || _c === void 0 ? void 0 : _c.mode) ===
|
|
974
|
+
((_c = (_b = this._resolvedInputs) === null || _b === void 0 ? void 0 : _b.deployOptions) === null || _c === void 0 ? void 0 : _c.mode) === lowcode_builder_1.DEPLOY_MODE.UPLOAD
|
|
1016
975
|
? this.api.cloudbaseManager
|
|
1017
976
|
.commonService('lowcode', '2021-01-08')
|
|
1018
977
|
.call({
|
|
@@ -1043,9 +1002,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
1043
1002
|
});
|
|
1044
1003
|
}
|
|
1045
1004
|
_checkBroswerHisroty() {
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
return !historyType || historyType === types_1.HISTORY_TYPE.BROWSER;
|
|
1005
|
+
let historyType = this._resolvedInputs.mainAppSerializeData.extra.historyType ? lowcode_builder_1.HISTORY_TYPE.HASH : '';
|
|
1006
|
+
return !historyType || historyType === lowcode_builder_1.HISTORY_TYPE.BROWSER;
|
|
1049
1007
|
}
|
|
1050
1008
|
}
|
|
1051
1009
|
function resolveInputs(inputs, defaultInputs) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { IWebRuntimeAppData } from 'src/weapps-core';
|
|
2
1
|
export declare const CLOUD_FUNCTION_TYPE = "cloud-function";
|
|
3
2
|
export declare const EXTERNAL_FUNCTION_TYPE = "http";
|
|
4
3
|
export declare const DATABASE_TYPE = "database";
|
|
@@ -9,9 +8,6 @@ export declare function mergeDependencies(...pkgs: any[]): {};
|
|
|
9
8
|
export declare function lowercaseKey(obj: any, deep?: boolean): any;
|
|
10
9
|
export declare function standardizeDataSource(ds: any): any;
|
|
11
10
|
export declare function getDatasourceProfiles(datasources: any): any;
|
|
12
|
-
export declare function getDataVarProfiles(appData: IWebRuntimeAppData): {
|
|
13
|
-
$global: any[];
|
|
14
|
-
};
|
|
15
11
|
export declare function getDatasetProfiles(mainAppData: {
|
|
16
12
|
dataset?: any;
|
|
17
13
|
rootPath?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../src/utils/dataSource.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dataSource.d.ts","sourceRoot":"","sources":["../../src/utils/dataSource.ts"],"names":[],"mappings":"AAQA,eAAO,MAAM,mBAAmB,mBAAmB,CAAC;AACpD,eAAO,MAAM,sBAAsB,SAAS,CAAC;AAC7C,eAAO,MAAM,aAAa,aAAa,CAAC;AAMxC,wBAAgB,yBAAyB,CAAC,UAAU,KAAA,EAAE,IAAI,KAAA,UAGzD;AAED,wBAAgB,4BAA4B,CAAC,KAAK,KAAA,EAAE,UAAU,KAAA,EAAE,IAAI,KAAA,UAGnE;AAMD,wBAAgB,yBAAyB,CAAC,QAAQ,KAAA,EAAE,IAAI,KAAA,iBAEvD;AAMD,wBAAgB,iBAAiB,CAAC,GAAG,IAAI,OAAA,MAaxC;AAmBD,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,GAAG,CAU1D;AAOD,wBAAgB,qBAAqB,CAAC,EAAE,EAAE,GAAG,OA6C5C;AAOD,wBAAgB,qBAAqB,CAAC,WAAW,KAAA,OAehD;AA+BD,wBAAgB,kBAAkB,CAChC,WAAW,EAAE;IACX,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;CACxC,EACD,IAAI,CAAC,EAAE;IACL,OAAO,CAAC,EAAE,GAAG,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,GAAG,CAAA;KAAE,EAAE,CAAC;CACxC,EAAE,MAeJ"}
|