@cloudbase/framework-plugin-low-code 0.7.2-beta.0 → 0.7.2-beta.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/builder/config/common.js +1 -1
- package/lib/builder/config/index.js +2 -2
- package/lib/builder/config/mp.js +1 -1
- package/lib/builder/core/copy.js +3 -3
- package/lib/builder/core/generate.js +11 -11
- package/lib/builder/core/index.js +13 -13
- package/lib/builder/core/material.js +6 -6
- package/lib/builder/core/plugin.js +3 -3
- package/lib/builder/core/prepare.js +2 -2
- package/lib/builder/core/webpack.js +5 -5
- package/lib/builder/mp/index.d.ts.map +1 -1
- package/lib/builder/mp/index.js +50 -49
- package/lib/builder/mp/lowcode.js +4 -4
- package/lib/builder/mp/materials.js +16 -16
- package/lib/builder/mp/mixMode.js +12 -12
- package/lib/builder/mp/mp_config.js +11 -11
- package/lib/builder/mp/util.js +6 -6
- package/lib/builder/mp/wxml.js +4 -4
- package/lib/builder/service/builder/copy.js +11 -11
- package/lib/builder/service/builder/generate.js +56 -52
- package/lib/builder/service/builder/index.js +2 -2
- package/lib/builder/service/builder/plugin.js +2 -2
- package/lib/builder/service/builder/webpack.js +24 -23
- package/lib/builder/types/common.js +1 -0
- package/lib/builder/util/common.d.ts.map +1 -1
- package/lib/builder/util/common.js +8 -6
- package/lib/builder/util/console.js +1 -1
- package/lib/builder/util/generateFiles.js +2 -2
- package/lib/builder/util/index.js +1 -1
- package/lib/builder/util/junk.js +4 -2
- package/lib/builder/util/mp.js +1 -1
- package/lib/builder/util/net.js +1 -1
- package/lib/builder/util/style.js +1 -1
- package/lib/builder/util/weapp.js +1 -1
- package/lib/generate.js +2 -2
- package/lib/generator/config/index.js +2 -2
- package/lib/generator/core/generate.js +36 -34
- package/lib/generator/core/index.js +4 -4
- package/lib/generator/core/material.js +14 -14
- package/lib/generator/types/common.js +6 -3
- package/lib/generator/util/common.d.ts.map +1 -1
- package/lib/generator/util/common.js +1 -1
- package/lib/generator/util/index.js +1 -1
- package/lib/generator/util/style.js +2 -2
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +104 -66
- package/lib/utils/common.d.ts +1 -1
- package/lib/utils/common.d.ts.map +1 -1
- package/lib/utils/common.js +2 -2
- package/lib/utils/dataSource.js +2 -2
- package/lib/utils/index.js +1 -1
- package/lib/utils/postProcess.js +3 -3
- package/lib/weapps-core/config/index.js +1 -1
- package/lib/weapps-core/index.js +2 -2
- package/lib/weapps-core/types/index.js +1 -1
- package/lib/weapps-core/utils/appbuild.js +6 -3
- package/lib/weapps-core/utils/common.js +3 -2
- package/lib/weapps-core/utils/formily.js +37 -37
- package/lib/weapps-core/utils/index.js +1 -1
- package/lib/weapps-core/utils/style.js +15 -15
- package/package.json +1 -1
- package/template/mp/app/weapps-api.js +13 -5
- package/template/mp/app.js +59 -48
- package/template/mp/common/util.js +6 -4
- package/template/mp/common/weapp-page.js +2 -2
- package/template/src/app/global-api.js +15 -3
- package/template/src/handlers/utils/common.js +26 -20
- package/template/src/index.jsx +3 -2
package/lib/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAOA,OAAO,KAAK,SAAS,MAAM,wBAAwB,CAAC;AACpD,OAAW,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAUrE,OAAO,EACL,SAAS,EAET,cAAc,EAIf,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAYvD,OAAO,EAAE,WAAW,EAAE,OAAO,EAAgB,MAAM,SAAS,CAAC;AAM7D,eAAO,MAAM,SAAS,WAAW,CAAC;AAClC,eAAO,MAAM,2BAA2B,IAAK,CAAC;AAoB9C,QAAA,MAAM,cAAc;;;;;;;;;;;;;;;;;;;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,MAAM,CAAC;QACf,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;gBAEO,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,gBAAgB,EACrB,MAAM,EAAE,6BAA6B;IA8J9C,QAAQ;IAMR,qBAAqB,CAAC,aAAa,EAAE,cAAc;IAmGnD,eAAe;IAUf,KAAK,CAAC,KAAK,KAAA;IASX,QAAQ,CAAC,KAAK,KAAA;IAWR,IAAI;IAKJ,GAAG;IAKH,MAAM;IAKN,OAAO;IAKP,KAAK;IAqTL,OAAO;IA8GP,MAAM;IAqIN,qBAAqB,CAAC,OAAO,EAAE,MAAM;IA8CrC,mBAAmB,CAAC,KAAK,KAAA,EAAE,KAAK,GAAE,OAAe;IAgBjD,eAAe,CAAC,KAAK,KAAA,EAAE,KAAK,GAAE,OAAe;IAqBnD,eAAe,CAAC,OAAO,KAAA;IAIjB,gBAAgB;IA4HhB,2BAA2B;IAuE3B,UAAU;IAwBV,OAAO,CAAC,GAAG,KAAA,EAAE,IAAI,KAAA;IAejB,uBAAuB;IA4DvB,yBAAyB;IAgG/B,oBAAoB;CAOrB;AAgCD,eAAO,MAAM,MAAM,sBAAgB,CAAC"}
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -42,7 +42,7 @@ 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.PERSISTENT_DEPENDIENCES_MAP = exports.DIST_PATH = void 0;
|
|
45
|
+
exports.plugin = exports.PERSISTENT_DEPENDIENCES_MAP = exports.DIST_PATH = exports.generator = void 0;
|
|
46
46
|
exports.generator = __importStar(require("./generator/core/index"));
|
|
47
47
|
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
48
48
|
const path_1 = __importDefault(require("path"));
|
|
@@ -123,7 +123,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
123
123
|
if (this._checkIsVersion(this._resolvedInputs.calsVersion)) {
|
|
124
124
|
const cals = this._resolvedInputs.mainAppSerializeData;
|
|
125
125
|
if (!this._resolvedInputs.mainAppSerializeData.mpPkgUrl) {
|
|
126
|
-
this._resolvedInputs.mainAppSerializeData = cals_1.deserializePlatformApp(cals, { dependencies: this._resolvedInputs.dependencies });
|
|
126
|
+
this._resolvedInputs.mainAppSerializeData = (0, cals_1.deserializePlatformApp)(cals, { dependencies: this._resolvedInputs.dependencies });
|
|
127
127
|
if ((_a = cals.extra) === null || _a === void 0 ? void 0 : _a.miniprogramPlugins) {
|
|
128
128
|
this._resolvedInputs.mainAppSerializeData.miniprogramPlugins = cals.extra.miniprogramPlugins.map((plugin) => {
|
|
129
129
|
var _a;
|
|
@@ -153,23 +153,23 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
155
|
else {
|
|
156
|
-
this._resolvedInputs.mainAppSerializeData = common_1.processPkgUrlCals2WeappData(cals);
|
|
156
|
+
this._resolvedInputs.mainAppSerializeData = (0, common_1.processPkgUrlCals2WeappData)(cals);
|
|
157
157
|
}
|
|
158
158
|
}
|
|
159
159
|
if (!((_b = this._resolvedInputs.mainAppSerializeData) === null || _b === void 0 ? void 0 : _b.envId)) {
|
|
160
160
|
this._resolvedInputs.mainAppSerializeData.envId = envId;
|
|
161
161
|
}
|
|
162
|
-
if (common_2.buildAsWebByBuildType(this._resolvedInputs.buildTypeList)) {
|
|
162
|
+
if ((0, common_2.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList)) {
|
|
163
163
|
const { appId, mainAppSerializeData } = this._resolvedInputs;
|
|
164
164
|
let { appConfig = {} } = mainAppSerializeData;
|
|
165
165
|
let { window = {} } = appConfig;
|
|
166
166
|
let path = this._getWebRootPath();
|
|
167
167
|
window.publicPath = path;
|
|
168
|
-
window.basename = common_2.buildAsAdminPortalByBuildType(this._resolvedInputs.buildTypeList)
|
|
168
|
+
window.basename = (0, common_2.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)
|
|
169
169
|
? `app/${appId}${((_c = this._resolvedInputs.deployOptions) === null || _c === void 0 ? void 0 : _c.mode) !== types_1.DEPLOY_MODE.UPLOAD
|
|
170
170
|
? '-preview'
|
|
171
171
|
: ''}`
|
|
172
|
-
: common_2.buildAsXPageByBuildType(this._resolvedInputs.buildTypeList)
|
|
172
|
+
: (0, common_2.buildAsXPageByBuildType)(this._resolvedInputs.buildTypeList)
|
|
173
173
|
? '/'
|
|
174
174
|
: path;
|
|
175
175
|
appConfig.window = window;
|
|
@@ -253,7 +253,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
253
253
|
},
|
|
254
254
|
});
|
|
255
255
|
}
|
|
256
|
-
else if (common_2.buildAsWebByBuildType(buildTypeList)) {
|
|
256
|
+
else if ((0, common_2.buildAsWebByBuildType)(buildTypeList)) {
|
|
257
257
|
this._webPlugin = new framework_plugin_website_1.plugin('web', this.api, {
|
|
258
258
|
outputPath: exports.DIST_PATH,
|
|
259
259
|
cloudPath: this._getWebRootPath(),
|
|
@@ -310,12 +310,12 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
310
310
|
subAppSerializeDataList = subAppSerializeDataList === null || subAppSerializeDataList === void 0 ? void 0 : subAppSerializeDataList.map((item) => {
|
|
311
311
|
if (this._checkIsVersion(calsVersion)) {
|
|
312
312
|
return item.mpPkgUrl
|
|
313
|
-
? common_1.processPkgUrlCals2WeappData(item)
|
|
314
|
-
: cals_1.deserializePlatformApp(item, { dependencies });
|
|
313
|
+
? (0, common_1.processPkgUrlCals2WeappData)(item)
|
|
314
|
+
: (0, cals_1.deserializePlatformApp)(item, { dependencies });
|
|
315
315
|
}
|
|
316
316
|
return item;
|
|
317
317
|
});
|
|
318
|
-
const nodeModulesPath = common_1.getValidNodeModulesPath();
|
|
318
|
+
const nodeModulesPath = (0, common_1.getValidNodeModulesPath)();
|
|
319
319
|
let miniAppDir = '';
|
|
320
320
|
let webAppDir = '';
|
|
321
321
|
const h5url = `./${appId}/index.html`;
|
|
@@ -334,10 +334,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
334
334
|
throw e;
|
|
335
335
|
}
|
|
336
336
|
const domain = ((_b = this._website) === null || _b === void 0 ? void 0 : _b.cdnDomain) || ((_c = mainAppSerializeData.extra) === null || _c === void 0 ? void 0 : _c.domain);
|
|
337
|
-
if (common_2.buildAsWebByBuildType(buildTypeList)) {
|
|
337
|
+
if ((0, common_2.buildAsWebByBuildType)(buildTypeList)) {
|
|
338
338
|
let { appConfig = {} } = mainAppSerializeData;
|
|
339
339
|
let { window = {} } = appConfig;
|
|
340
|
-
if (common_2.buildAsXPageByBuildType(buildTypeList)) {
|
|
340
|
+
if ((0, common_2.buildAsXPageByBuildType)(buildTypeList)) {
|
|
341
341
|
window.publicPath =
|
|
342
342
|
((_d = this._resolvedInputs.deployOptions) === null || _d === void 0 ? void 0 : _d.publicPath) ||
|
|
343
343
|
`https://${domain}${this._getWebRootPath()}`;
|
|
@@ -359,7 +359,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
359
359
|
if (this._gatewayConfig) {
|
|
360
360
|
const path = this._gatewayConfig.Path;
|
|
361
361
|
window.publicPath = `https://${domain}${this._getWebRootPath()}`;
|
|
362
|
-
if (!common_2.buildAsAdminPortalByBuildType(buildTypeList)) {
|
|
362
|
+
if (!(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList)) {
|
|
363
363
|
window.basename = path;
|
|
364
364
|
}
|
|
365
365
|
}
|
|
@@ -383,7 +383,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
383
383
|
this._appPath = yield new Promise((resolve, reject) => __awaiter(this, void 0, void 0, function* () {
|
|
384
384
|
var _g, _h;
|
|
385
385
|
try {
|
|
386
|
-
yield core_1.default({
|
|
386
|
+
yield (0, core_1.default)({
|
|
387
387
|
mainAppSerializeData,
|
|
388
388
|
subAppSerializeDataList,
|
|
389
389
|
dependencies,
|
|
@@ -400,7 +400,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
400
400
|
isCleanDistDir: false,
|
|
401
401
|
plugins,
|
|
402
402
|
extraData,
|
|
403
|
-
isCrossAccount: this._resolvedInputs.mpAppId !==
|
|
403
|
+
isCrossAccount: this._resolvedInputs.mpAppId !==
|
|
404
|
+
((_h = this._resolvedInputs.deployOptions) === null || _h === void 0 ? void 0 : _h.targetMpAppId),
|
|
404
405
|
resourceAppid: this._resolvedInputs.mpAppId,
|
|
405
406
|
domain,
|
|
406
407
|
}, (err, result) => __awaiter(this, void 0, void 0, function* () {
|
|
@@ -413,27 +414,27 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
413
414
|
if (buildTypeList.includes("mp")) {
|
|
414
415
|
miniAppDir = outDir;
|
|
415
416
|
}
|
|
416
|
-
if (common_2.buildAsWebByBuildType(buildTypeList)) {
|
|
417
|
+
if ((0, common_2.buildAsWebByBuildType)(buildTypeList)) {
|
|
417
418
|
webAppDir = path_1.default.resolve(outDir, 'preview');
|
|
418
419
|
}
|
|
419
420
|
logger.debug(`=== Compilation finished at ${outDir}, elapsed time: ${timeElapsed / 1000}s.===\n`);
|
|
420
421
|
if (buildTypeList.includes("mp") && miniAppDir) {
|
|
421
422
|
let projectJsonPath = path_1.default.resolve(miniAppDir, 'project.config.json');
|
|
422
|
-
yield postProcess_1.postprocessProjectConfig(projectJsonPath, {
|
|
423
|
+
yield (0, postProcess_1.postprocessProjectConfig)(projectJsonPath, {
|
|
423
424
|
appid: this._resolvedInputs.deployOptions.mpAppId,
|
|
424
425
|
cloudfunctionRoot: undefined,
|
|
425
426
|
});
|
|
426
|
-
yield postProcess_1.postprocessDeployExtraJson(miniAppDir, this._resolvedInputs.deployOptions);
|
|
427
|
+
yield (0, postProcess_1.postprocessDeployExtraJson)(miniAppDir, this._resolvedInputs.deployOptions);
|
|
427
428
|
if (generateMpType === "app") {
|
|
428
429
|
fs_extra_1.default.removeSync(path_1.default.resolve(miniAppDir, 'miniprogram_npm'));
|
|
429
430
|
}
|
|
430
431
|
if (outDir) {
|
|
431
432
|
if (plugins) {
|
|
432
|
-
yield generate_1.handleMpPlugins(plugins, outDir);
|
|
433
|
+
yield (0, generate_1.handleMpPlugins)(plugins, outDir);
|
|
433
434
|
}
|
|
434
435
|
}
|
|
435
436
|
}
|
|
436
|
-
else if (common_2.buildAsWebByBuildType(buildTypeList) && webAppDir) {
|
|
437
|
+
else if ((0, common_2.buildAsWebByBuildType)(buildTypeList) && webAppDir) {
|
|
437
438
|
const staticAppDir = path_1.default.join(staticDir, publicPath);
|
|
438
439
|
fs_extra_1.default.ensureDirSync(staticAppDir);
|
|
439
440
|
}
|
|
@@ -443,8 +444,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
443
444
|
}
|
|
444
445
|
else if (webAppDir) {
|
|
445
446
|
fs_extra_1.default.copySync(webAppDir, distPath);
|
|
446
|
-
if (common_2.buildAsWebByBuildType(buildTypeList) &&
|
|
447
|
-
!common_2.buildAsAdminPortalByBuildType(buildTypeList) &&
|
|
447
|
+
if ((0, common_2.buildAsWebByBuildType)(buildTypeList) &&
|
|
448
|
+
!(0, common_2.buildAsAdminPortalByBuildType)(buildTypeList) &&
|
|
448
449
|
this._checkBroswerHisroty()) {
|
|
449
450
|
yield Promise.all((((_j = this._resolvedInputs.mainAppSerializeData) === null || _j === void 0 ? void 0 : _j.pageInstanceList) || []).map((page) => fs_extra_1.default.copy(path_1.default.join(distPath, 'index.html'), path_1.default.join(distPath, page.id, 'index.html'))));
|
|
450
451
|
}
|
|
@@ -543,9 +544,9 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
543
544
|
this.api.logger.error('设置登录配置失败', e);
|
|
544
545
|
}
|
|
545
546
|
if (this._miniprogramePlugin) {
|
|
546
|
-
res = lodash_1.merge(res, yield this._miniprogramePlugin.compile());
|
|
547
|
+
res = (0, lodash_1.merge)(res, yield this._miniprogramePlugin.compile());
|
|
547
548
|
}
|
|
548
|
-
else if (common_2.buildAsWebByBuildType(this._resolvedInputs.buildTypeList) &&
|
|
549
|
+
else if ((0, common_2.buildAsWebByBuildType)(this._resolvedInputs.buildTypeList) &&
|
|
549
550
|
this._webPlugin) {
|
|
550
551
|
try {
|
|
551
552
|
const HostingProvider = (_a = this.api.resourceProviders) === null || _a === void 0 ? void 0 : _a.hosting;
|
|
@@ -613,6 +614,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
613
614
|
});
|
|
614
615
|
}
|
|
615
616
|
deploy() {
|
|
617
|
+
var _a;
|
|
616
618
|
return __awaiter(this, void 0, void 0, function* () {
|
|
617
619
|
try {
|
|
618
620
|
this._time("DEPLOY");
|
|
@@ -621,29 +623,37 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
621
623
|
}
|
|
622
624
|
else if (this._webPlugin) {
|
|
623
625
|
yield this._webPlugin.deploy();
|
|
624
|
-
if (common_2.buildAsAdminPortalByBuildType(this._resolvedInputs.buildTypeList)) {
|
|
626
|
+
if ((0, common_2.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)) {
|
|
625
627
|
yield this._postProcessAdminPortal();
|
|
626
628
|
}
|
|
627
629
|
else {
|
|
628
630
|
yield this._postProcessWebsiteConfig();
|
|
629
631
|
}
|
|
630
|
-
|
|
631
|
-
.
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
632
|
+
try {
|
|
633
|
+
let publishAppCustomNavRes = yield this.api.cloudbaseManager
|
|
634
|
+
.commonService('lowcode', '2021-01-08')
|
|
635
|
+
.call({
|
|
636
|
+
Action: 'PublishAppCustomNav',
|
|
637
|
+
Param: {
|
|
638
|
+
WeAppId: this._resolvedInputs.appId,
|
|
639
|
+
EnvId: this.api.envId,
|
|
640
|
+
PublishType: this._resolvedInputs.deployOptions.mode === types_1.DEPLOY_MODE.UPLOAD
|
|
641
|
+
? 'product'
|
|
642
|
+
: 'preview',
|
|
643
|
+
},
|
|
644
|
+
});
|
|
645
|
+
this.api.logger.info(`${this.api.emoji('🚀')} custom publish success: ${JSON.stringify(publishAppCustomNavRes)}`);
|
|
646
|
+
}
|
|
647
|
+
catch (e) {
|
|
648
|
+
this.api.logger.error(`${this.api.emoji('🚀')} custom publish fail: ${JSON.stringify(e)}`);
|
|
649
|
+
if (((_a = e) === null || _a === void 0 ? void 0 : _a.code) !== 'ResourceNotFound') {
|
|
650
|
+
throw e;
|
|
651
|
+
}
|
|
652
|
+
}
|
|
643
653
|
try {
|
|
644
654
|
const { deployOptions, appId } = this._resolvedInputs;
|
|
645
655
|
const isPreview = (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === types_1.DEPLOY_MODE.PREVIEW;
|
|
646
|
-
const link = common_2.buildAsAdminPortalByBuildType(this._resolvedInputs.buildTypeList)
|
|
656
|
+
const link = (0, common_2.buildAsAdminPortalByBuildType)(this._resolvedInputs.buildTypeList)
|
|
647
657
|
? `https://${this._website.cdnDomain}/adminportal/#/app/${isPreview ? `${appId}-preview` : appId}?envType=${isPreview ? 'preview' : 'prod'}`
|
|
648
658
|
: this._gatewayConfig
|
|
649
659
|
? `https://${this._gatewayConfig.Domain + this._gatewayConfig.Path}`
|
|
@@ -723,7 +733,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
723
733
|
.filter((f) => {
|
|
724
734
|
var _a, _b;
|
|
725
735
|
if (codeExtensions.has(f.ext) &&
|
|
726
|
-
!f.moduleId &&
|
|
736
|
+
!f.moduleId &&
|
|
737
|
+
((_b = (_a = f.path) === null || _a === void 0 ? void 0 : _a.startsWith) === null || _b === void 0 ? void 0 : _b.call(_a, 'materials/'))) {
|
|
727
738
|
return true;
|
|
728
739
|
}
|
|
729
740
|
return false;
|
|
@@ -789,17 +800,18 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
789
800
|
const zipPath = path_1.default.resolve(this.api.projectPath, `${this._resolvedInputs.appId}.zip`);
|
|
790
801
|
yield this._zipDir(path_1.default.resolve(this.api.projectPath, exports.DIST_PATH), zipPath);
|
|
791
802
|
let { credential, storage } = this._resolvedInputs;
|
|
792
|
-
let cos = (credential === null || credential === void 0 ? void 0 : credential.token)
|
|
793
|
-
|
|
794
|
-
callback
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
+
let cos = (credential === null || credential === void 0 ? void 0 : credential.token)
|
|
804
|
+
? new cos_nodejs_sdk_v5_1.default({
|
|
805
|
+
getAuthorization: function (options, callback) {
|
|
806
|
+
callback({
|
|
807
|
+
TmpSecretId: (credential === null || credential === void 0 ? void 0 : credential.secretId) || '',
|
|
808
|
+
TmpSecretKey: (credential === null || credential === void 0 ? void 0 : credential.secretKey) || '',
|
|
809
|
+
XCosSecurityToken: (credential === null || credential === void 0 ? void 0 : credential.token) || '',
|
|
810
|
+
ExpiredTime: Math.floor(Date.now() / 1000) + 600,
|
|
811
|
+
StartTime: Math.floor(Date.now() / 1000),
|
|
812
|
+
});
|
|
813
|
+
},
|
|
814
|
+
})
|
|
803
815
|
: new cos_nodejs_sdk_v5_1.default({
|
|
804
816
|
SecretId: credential === null || credential === void 0 ? void 0 : credential.secretId,
|
|
805
817
|
SecretKey: credential === null || credential === void 0 ? void 0 : credential.secretKey,
|
|
@@ -885,17 +897,18 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
885
897
|
return __awaiter(this, void 0, void 0, function* () {
|
|
886
898
|
let promises = [];
|
|
887
899
|
let { credential } = this._resolvedInputs;
|
|
888
|
-
let cos = (credential === null || credential === void 0 ? void 0 : credential.token)
|
|
889
|
-
|
|
890
|
-
callback
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
900
|
+
let cos = (credential === null || credential === void 0 ? void 0 : credential.token)
|
|
901
|
+
? new cos_nodejs_sdk_v5_1.default({
|
|
902
|
+
getAuthorization: function (options, callback) {
|
|
903
|
+
callback({
|
|
904
|
+
TmpSecretId: (credential === null || credential === void 0 ? void 0 : credential.secretId) || '',
|
|
905
|
+
TmpSecretKey: (credential === null || credential === void 0 ? void 0 : credential.secretKey) || '',
|
|
906
|
+
XCosSecurityToken: (credential === null || credential === void 0 ? void 0 : credential.token) || '',
|
|
907
|
+
ExpiredTime: Math.floor(Date.now() / 1000) + 600,
|
|
908
|
+
StartTime: Math.floor(Date.now() / 1000),
|
|
909
|
+
});
|
|
910
|
+
},
|
|
911
|
+
})
|
|
899
912
|
: new cos_nodejs_sdk_v5_1.default({
|
|
900
913
|
SecretId: credential === null || credential === void 0 ? void 0 : credential.secretId,
|
|
901
914
|
SecretKey: credential === null || credential === void 0 ? void 0 : credential.secretKey,
|
|
@@ -950,7 +963,7 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
950
963
|
return __awaiter(this, void 0, void 0, function* () {
|
|
951
964
|
return new Promise((resolve, reject) => {
|
|
952
965
|
var output = fs_extra_1.default.createWriteStream(dist);
|
|
953
|
-
var archive = archiver_1.default('zip', {
|
|
966
|
+
var archive = (0, archiver_1.default)('zip', {
|
|
954
967
|
zlib: { level: 9 },
|
|
955
968
|
});
|
|
956
969
|
output.on('close', resolve);
|
|
@@ -962,9 +975,10 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
962
975
|
});
|
|
963
976
|
}
|
|
964
977
|
_postProcessAdminPortal() {
|
|
978
|
+
var _a, _b;
|
|
965
979
|
return __awaiter(this, void 0, void 0, function* () {
|
|
966
980
|
const { appId, buildTypeList, mainAppSerializeData, deployOptions, } = this._resolvedInputs;
|
|
967
|
-
if (common_2.buildAsAdminPortalByBuildType(buildTypeList)) {
|
|
981
|
+
if ((0, common_2.buildAsAdminPortalByBuildType)(buildTypeList)) {
|
|
968
982
|
try {
|
|
969
983
|
const isPreview = (deployOptions === null || deployOptions === void 0 ? void 0 : deployOptions.mode) === types_1.DEPLOY_MODE.PREVIEW;
|
|
970
984
|
const id = isPreview ? `${appId}-preview` : appId;
|
|
@@ -997,6 +1011,23 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
997
1011
|
catch (e) {
|
|
998
1012
|
this.api.logger.error('门户路由注册失败: ', e);
|
|
999
1013
|
}
|
|
1014
|
+
try {
|
|
1015
|
+
if (((_b = (_a = this._resolvedInputs) === null || _a === void 0 ? void 0 : _a.deployOptions) === null || _b === void 0 ? void 0 : _b.mode) === types_1.DEPLOY_MODE.UPLOAD) {
|
|
1016
|
+
yield this.api.cloudbaseManager
|
|
1017
|
+
.commonService('lowcode', '2021-01-08')
|
|
1018
|
+
.call({
|
|
1019
|
+
Action: 'PublishAppCustomUrl',
|
|
1020
|
+
Param: {
|
|
1021
|
+
EnvId: this.api.envId,
|
|
1022
|
+
WeAppId: this._resolvedInputs.appId,
|
|
1023
|
+
},
|
|
1024
|
+
});
|
|
1025
|
+
}
|
|
1026
|
+
this.api.logger.info('PublishAppCustomUrl成功');
|
|
1027
|
+
}
|
|
1028
|
+
catch (e) {
|
|
1029
|
+
this.api.logger.error('PublishAppCustomUrl失败: ', e);
|
|
1030
|
+
}
|
|
1000
1031
|
}
|
|
1001
1032
|
});
|
|
1002
1033
|
}
|
|
@@ -1068,6 +1099,12 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
1068
1099
|
WeAppId: this._resolvedInputs.appId,
|
|
1069
1100
|
IndexPath: this._getWebRootPath(),
|
|
1070
1101
|
},
|
|
1102
|
+
})
|
|
1103
|
+
.catch((e) => {
|
|
1104
|
+
this.api.logger.error('自定义域名发布失败: ', e);
|
|
1105
|
+
if ((e === null || e === void 0 ? void 0 : e.code) !== 'ResourceNotFound') {
|
|
1106
|
+
throw e;
|
|
1107
|
+
}
|
|
1071
1108
|
})
|
|
1072
1109
|
: Promise.resolve(),
|
|
1073
1110
|
hostingService.setWebsiteDocument({
|
|
@@ -1084,7 +1121,8 @@ class LowCodePlugin extends framework_core_1.Plugin {
|
|
|
1084
1121
|
}
|
|
1085
1122
|
_checkBroswerHisroty() {
|
|
1086
1123
|
var _a;
|
|
1087
|
-
let historyType = ((_a = this._resolvedInputs.mainAppSerializeData) === null || _a === void 0 ? void 0 : _a.historyType)
|
|
1124
|
+
let historyType = ((_a = this._resolvedInputs.mainAppSerializeData) === null || _a === void 0 ? void 0 : _a.historyType)
|
|
1125
|
+
? types_1.HISTORY_TYPE.HASH
|
|
1088
1126
|
: '';
|
|
1089
1127
|
return !historyType || historyType === types_1.HISTORY_TYPE.BROWSER;
|
|
1090
1128
|
}
|
package/lib/utils/common.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import * as childProcess from 'child_process';
|
|
3
|
-
export declare function setReadOnly(target: object, key: string, v: any, deep?: boolean):
|
|
3
|
+
export declare function setReadOnly(target: object, key: string, v: any, deep?: boolean): object;
|
|
4
4
|
export declare type PromiseResult<T> = Promise<[null, T] | [Error, null]>;
|
|
5
5
|
export declare function promiseWrapper<T>(p: Promise<T>): PromiseResult<T>;
|
|
6
6
|
export declare const isWindows: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":";AAMA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAU9C,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,UAAO,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../src/utils/common.ts"],"names":[],"mappings":";AAMA,OAAO,KAAK,YAAY,MAAM,eAAe,CAAC;AAU9C,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,EAAE,IAAI,UAAO,UAoB3E;AAED,oBAAY,aAAa,CAAC,CAAC,IAAI,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC;AAClE,wBAAgB,cAAc,CAAC,CAAC,EAAE,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,aAAa,CAAC,CAAC,CAAC,CAQjE;AAED,eAAO,MAAM,SAAS,SAA+B,CAAC;AACtD,eAAO,MAAM,KAAK,SAAgC,CAAC;AACnD,eAAO,MAAM,OAAO,SAA+B,CAAC;AAEpD,wBAAgB,cAAc,CAC5B,SAAS,EAAE,MAAM,EAAE,EACnB,QAAQ,EAAE,MAAM,EAChB,IAAI,KAAK,oBAgBV;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,YAAY,EAAE;QACZ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAAC;KACxB,CAAC;IACF,UAAU,EAAE;QACV,IAAI,EAAE,MAAM,CAAC;QACb,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;CACH;AACD,wBAAsB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAEvE;AAED,wBAAsB,MAAM,CAAC,GAAG,EAAE,MAAM,iBAEvC;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAKrD;AAKD,wBAAgB,aAAa,YAE5B;AAED,wBAAgB,QAAQ,CACtB,OAAO,EAAE,MAAM,EACf,IAAI,CAAC,EAAE,aAAa,CAAC,MAAM,CAAC,EAC5B,OAAO,CAAC,EAAE,YAAY,CAAC,YAAY,oBA2BpC;AAED,wBAAgB,uBAAuB,WAOtC;AAED,wBAAgB,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,SAAI,UAE7C;AAED,wBAAgB,WAAW,uBAe1B;AAED,wBAAgB,2BAA2B,CAAC,IAAI,KAAA,OAO/C"}
|
package/lib/utils/common.js
CHANGED
|
@@ -79,7 +79,7 @@ function compressingZip(entryList, distPath, opts = {}) {
|
|
|
79
79
|
zipStream.addEntry(entry, opts);
|
|
80
80
|
});
|
|
81
81
|
const destStream = fs_extra_1.default.createWriteStream(distPath);
|
|
82
|
-
pump_1.default(zipStream, destStream, (err) => {
|
|
82
|
+
(0, pump_1.default)(zipStream, destStream, (err) => {
|
|
83
83
|
if (err) {
|
|
84
84
|
console.error(err);
|
|
85
85
|
reject(err);
|
|
@@ -115,7 +115,7 @@ exports.isWinPlatform = isWinPlatform;
|
|
|
115
115
|
function spawnPro(command, args, options) {
|
|
116
116
|
return new Promise((resolve, reject) => {
|
|
117
117
|
var _a, _b;
|
|
118
|
-
const process = cross_spawn_1.default(command, args, options);
|
|
118
|
+
const process = (0, cross_spawn_1.default)(command, args, options);
|
|
119
119
|
let strOut = '';
|
|
120
120
|
let strErr = '';
|
|
121
121
|
(_a = process.stdout) === null || _a === void 0 ? void 0 : _a.on('data', (data) => {
|
package/lib/utils/dataSource.js
CHANGED
|
@@ -39,7 +39,7 @@ function mergeDependencies(...pkgs) {
|
|
|
39
39
|
? 'latest'
|
|
40
40
|
: formated.dependencies[key];
|
|
41
41
|
}
|
|
42
|
-
const merged = merge_package_json_1.default(formated, acc);
|
|
42
|
+
const merged = (0, merge_package_json_1.default)(formated, acc);
|
|
43
43
|
return JSON.parse(merged);
|
|
44
44
|
}, result);
|
|
45
45
|
return result.dependencies;
|
|
@@ -147,7 +147,7 @@ function _generateDynamicDataset(dataset) {
|
|
|
147
147
|
processed[paramKey] = `${config_1.REPLACE_SIGN}(app, $page) => (${typeof value === 'string' ? `'${value}'` : JSON.stringify(value)})${config_1.REPLACE_SIGN}`;
|
|
148
148
|
}
|
|
149
149
|
else {
|
|
150
|
-
let jsExp = util_1.generateDataBind(bind);
|
|
150
|
+
let jsExp = (0, util_1.generateDataBind)(bind);
|
|
151
151
|
processed[paramKey] = `${config_1.REPLACE_SIGN}(app, $page) => (\n${jsExp}\n)${config_1.REPLACE_SIGN}`;
|
|
152
152
|
}
|
|
153
153
|
}
|
package/lib/utils/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./common"), exports);
|
package/lib/utils/postProcess.js
CHANGED
|
@@ -14,7 +14,7 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
14
14
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
15
15
|
if (mod && mod.__esModule) return mod;
|
|
16
16
|
var result = {};
|
|
17
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
18
18
|
__setModuleDefault(result, mod);
|
|
19
19
|
return result;
|
|
20
20
|
};
|
|
@@ -28,7 +28,7 @@ const lodash_1 = require("lodash");
|
|
|
28
28
|
const path_1 = __importDefault(require("path"));
|
|
29
29
|
function postprocessProjectConfig(projectJsonPath, data) {
|
|
30
30
|
let projectJson = fs_extra_1.default.readJsonSync(projectJsonPath);
|
|
31
|
-
fs_extra_1.default.writeJsonSync(projectJsonPath, lodash_1.merge(projectJson, data), { spaces: 2 });
|
|
31
|
+
fs_extra_1.default.writeJsonSync(projectJsonPath, (0, lodash_1.merge)(projectJson, data), { spaces: 2 });
|
|
32
32
|
}
|
|
33
33
|
exports.postprocessProjectConfig = postprocessProjectConfig;
|
|
34
34
|
function postprocessDeployExtraJson(projectPath, deployOptions) {
|
|
@@ -37,7 +37,7 @@ function postprocessDeployExtraJson(projectPath, deployOptions) {
|
|
|
37
37
|
let projectJson = fs_extra_1.default.readJsonSync(path_1.default.resolve(projectPath, 'project.config.json'));
|
|
38
38
|
const miniprogramRoot = (projectJson === null || projectJson === void 0 ? void 0 : projectJson.miniprogramRoot) || './';
|
|
39
39
|
const extPaht = path_1.default.resolve(projectPath, miniprogramRoot, 'ext.json');
|
|
40
|
-
const extJson = Object.assign(Object.assign({}, (fs_extra_1.default.existsSync(extPaht) ? fs_extra_1.readJsonSync(extPaht) : {})), { extEnable: true, extAppid: targetMpAppId, directCommit: true });
|
|
40
|
+
const extJson = Object.assign(Object.assign({}, (fs_extra_1.default.existsSync(extPaht) ? (0, fs_extra_1.readJsonSync)(extPaht) : {})), { extEnable: true, extAppid: targetMpAppId, directCommit: true });
|
|
41
41
|
fs_extra_1.default.writeFileSync(extPaht, JSON.stringify(extJson, null, 2));
|
|
42
42
|
}
|
|
43
43
|
}
|
|
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./style"), exports);
|
package/lib/weapps-core/index.js
CHANGED
|
@@ -12,12 +12,12 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
12
12
|
o["default"] = v;
|
|
13
13
|
});
|
|
14
14
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
15
|
-
for (var p in m) if (p !== "default" && !
|
|
15
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
var __importStar = (this && this.__importStar) || function (mod) {
|
|
18
18
|
if (mod && mod.__esModule) return mod;
|
|
19
19
|
var result = {};
|
|
20
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
20
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
21
21
|
__setModuleDefault(result, mod);
|
|
22
22
|
return result;
|
|
23
23
|
};
|
|
@@ -7,7 +7,7 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
7
7
|
o[k2] = m[k];
|
|
8
8
|
}));
|
|
9
9
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
10
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
__exportStar(require("./material"), exports);
|
|
@@ -3,10 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getPublishAppId = exports.biggerThanVersion = exports.checkVersion = exports.INIT_VERSION = void 0;
|
|
4
4
|
const appbuild_1 = require("../types/appbuild");
|
|
5
5
|
exports.INIT_VERSION = '0.0.0';
|
|
6
|
-
|
|
6
|
+
const checkVersion = (value) => {
|
|
7
7
|
return /^\d+\.\d+(\.\d+){0,2}$/.test(value);
|
|
8
8
|
};
|
|
9
|
-
exports.
|
|
9
|
+
exports.checkVersion = checkVersion;
|
|
10
|
+
const biggerThanVersion = (value = '', lastVersion = '') => {
|
|
10
11
|
const nowVersions = value
|
|
11
12
|
.split('.')
|
|
12
13
|
.map((item) => (Number.isNaN(parseInt(item)) ? 0 : parseInt(item)));
|
|
@@ -28,10 +29,12 @@ exports.biggerThanVersion = (value = '', lastVersion = '') => {
|
|
|
28
29
|
}
|
|
29
30
|
return false;
|
|
30
31
|
};
|
|
31
|
-
exports.
|
|
32
|
+
exports.biggerThanVersion = biggerThanVersion;
|
|
33
|
+
const getPublishAppId = (codingPublishType, outputs) => {
|
|
32
34
|
return codingPublishType === appbuild_1.CodingPublishType.Android
|
|
33
35
|
? outputs.appid
|
|
34
36
|
: codingPublishType === appbuild_1.CodingPublishType.iOS
|
|
35
37
|
? outputs.iOSappId
|
|
36
38
|
: 'main';
|
|
37
39
|
};
|
|
40
|
+
exports.getPublishAppId = getPublishAppId;
|
|
@@ -36,7 +36,7 @@ function isPlainObject(src) {
|
|
|
36
36
|
return Object.prototype.toString.call(src) === '[object Object]';
|
|
37
37
|
}
|
|
38
38
|
exports.isPlainObject = isPlainObject;
|
|
39
|
-
|
|
39
|
+
const isEmptyObj = (obj) => {
|
|
40
40
|
if (!isPlainObject(obj)) {
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
@@ -47,6 +47,7 @@ exports.isEmptyObj = (obj) => {
|
|
|
47
47
|
}
|
|
48
48
|
return true;
|
|
49
49
|
};
|
|
50
|
+
exports.isEmptyObj = isEmptyObj;
|
|
50
51
|
function setValidValue(target, key, value) {
|
|
51
52
|
if (value === undefined || value === null) {
|
|
52
53
|
return;
|
|
@@ -54,7 +55,7 @@ function setValidValue(target, key, value) {
|
|
|
54
55
|
if (isArray(value) && value.length === 0) {
|
|
55
56
|
return;
|
|
56
57
|
}
|
|
57
|
-
if (isPlainObject(value) && exports.isEmptyObj(value)) {
|
|
58
|
+
if (isPlainObject(value) && (0, exports.isEmptyObj)(value)) {
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
if (!target) {
|