@cloudbase/cli 2.1.1-alpha.0 → 2.1.2-alpha.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/commands/lowcode/app.js +1 -1
- package/lib/commands/lowcode/comps.js +3 -49
- package/lowcode-cli.trace.json +1 -0
- package/package.json +2 -2
- package/tcb-cli.trace.json +1 -0
- package/.history/.gitignore_20220624162613 +0 -84
- package/.history/.gitignore_20220627114054 +0 -86
- package/.history/package_20220711204706.json +0 -88
- package/.history/package_20220711204818.json +0 -88
- package/.history/package_20220712151717.json +0 -88
- package/.history/package_20220712212537.json +0 -88
- package/.history/package_20220722205058.json +0 -88
- package/.history/package_20220726110155.json +0 -88
- package/.history/package_20220726110201.json +0 -88
- package/.history/package_20220728110905.json +0 -88
- package/.history/package_20220728110936.json +0 -88
- package/.history/package_20220728111531.json +0 -89
- package/.history/package_20220728111810.json +0 -89
- package/.history/package_20220729165237.json +0 -89
- package/.history/package_20220729165240.json +0 -89
- package/.history/src/commands/lowcode/app_20220728111717.ts +0 -52
- package/.history/src/commands/lowcode/app_20220728112031.ts +0 -34
- package/.history/src/index_20220624162613.ts +0 -13
- package/.history/src/index_20220627113609.ts +0 -15
- package/.history/src/index_20220627114102.ts +0 -13
|
@@ -43,22 +43,16 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
43
43
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
44
44
|
});
|
|
45
45
|
};
|
|
46
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
47
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
48
|
-
};
|
|
49
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
47
|
exports.LowCodePublishVersionComps = exports.LowCodePublishComps = exports.LowCodeDebugComps = exports.LowCodeBuildComps = exports.LowCodeCreateComps = void 0;
|
|
51
|
-
const path_1 = __importDefault(require("path"));
|
|
52
48
|
const common_1 = require("../common");
|
|
53
49
|
const decorators_1 = require("../../decorators");
|
|
54
50
|
const utils_1 = require("../../utils");
|
|
55
51
|
const error_1 = require("../../error");
|
|
56
52
|
const lowcode_cli_1 = require("@cloudbase/lowcode-cli");
|
|
57
53
|
const enquirer_1 = require("enquirer");
|
|
58
|
-
const fs_extra_1 = __importDefault(require("fs-extra"));
|
|
59
54
|
const semver = __importStar(require("semver"));
|
|
60
55
|
const cloudService = utils_1.CloudApiService.getInstance('lowcode');
|
|
61
|
-
const DEFAULE_TEMPLATE_PATH = 'https://comp-public-1303824488.cos.ap-shanghai.myqcloud.com/lcc/template.zip';
|
|
62
56
|
let LowCodeCreateComps = class LowCodeCreateComps extends common_1.Command {
|
|
63
57
|
get options() {
|
|
64
58
|
return {
|
|
@@ -138,8 +132,7 @@ let LowCodeBuildComps = class LowCodeBuildComps extends common_1.Command {
|
|
|
138
132
|
yield (0, lowcode_cli_1.graceBuildComps)(Object.assign(Object.assign({}, config), { context: config.context || process.cwd(), logger: log }));
|
|
139
133
|
return;
|
|
140
134
|
}
|
|
141
|
-
|
|
142
|
-
yield _build(compsPath);
|
|
135
|
+
throw new error_1.CloudBaseError('请参考文档填写 cloudbaserc 配置: https://docs.cloudbase.net/lowcode/custom-components/config/config-comps');
|
|
143
136
|
});
|
|
144
137
|
}
|
|
145
138
|
};
|
|
@@ -185,8 +178,7 @@ let LowCodeDebugComps = class LowCodeDebugComps extends common_1.Command {
|
|
|
185
178
|
yield (0, lowcode_cli_1.graceDebugComps)(Object.assign(Object.assign({}, config), { context: config.context || process.cwd(), debugPort: (options === null || options === void 0 ? void 0 : options.debugPort) || 8388, logger: log, wxDevtoolPath: options === null || options === void 0 ? void 0 : options.wxDevtoolPath }));
|
|
186
179
|
return;
|
|
187
180
|
}
|
|
188
|
-
|
|
189
|
-
yield (0, lowcode_cli_1.debug)(compsPath, (options === null || options === void 0 ? void 0 : options.debugPort) || 8388);
|
|
181
|
+
throw new error_1.CloudBaseError('请参考文档填写 cloudbaserc 配置: https://docs.cloudbase.net/lowcode/custom-components/config/config-comps');
|
|
190
182
|
});
|
|
191
183
|
}
|
|
192
184
|
};
|
|
@@ -231,25 +223,7 @@ let LowCodePublishComps = class LowCodePublishComps extends common_1.Command {
|
|
|
231
223
|
log.success('组件库 - 已同步到云端,请到低码控制台发布该组件库!');
|
|
232
224
|
return;
|
|
233
225
|
}
|
|
234
|
-
|
|
235
|
-
const compsName = fs_extra_1.default.readJSONSync(path_1.default.resolve(compsPath, 'package.json')).name;
|
|
236
|
-
const res = yield cloudService.request('ListUserCompositeGroups');
|
|
237
|
-
const comps = res === null || res === void 0 ? void 0 : res.data;
|
|
238
|
-
if (!(comps === null || comps === void 0 ? void 0 : comps.count)) {
|
|
239
|
-
throw new error_1.CloudBaseError(`云端不存在组件库 ${compsName},请到低码控制台新建该组件库!`);
|
|
240
|
-
}
|
|
241
|
-
const comp = comps.rows.find((row) => row.groupName === compsName);
|
|
242
|
-
if (!comp) {
|
|
243
|
-
throw new error_1.CloudBaseError(`云端不存在组件库 ${compsName},请到低码控制台新建该组件库!`);
|
|
244
|
-
}
|
|
245
|
-
yield _build(compsPath);
|
|
246
|
-
yield _publish({
|
|
247
|
-
id: comp.id,
|
|
248
|
-
name: compsName,
|
|
249
|
-
path: compsPath,
|
|
250
|
-
log,
|
|
251
|
-
});
|
|
252
|
-
log.info('\n👉 组件库已经同步到云端,请到低码控制台发布该组件库!');
|
|
226
|
+
throw new error_1.CloudBaseError('请参考文档填写 cloudbaserc 配置: https://docs.cloudbase.net/lowcode/custom-components/config/config-comps');
|
|
253
227
|
});
|
|
254
228
|
}
|
|
255
229
|
};
|
|
@@ -351,23 +325,3 @@ LowCodePublishVersionComps = __decorate([
|
|
|
351
325
|
(0, common_1.ICommand)()
|
|
352
326
|
], LowCodePublishVersionComps);
|
|
353
327
|
exports.LowCodePublishVersionComps = LowCodePublishVersionComps;
|
|
354
|
-
function _build(compsPath) {
|
|
355
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
356
|
-
yield (0, utils_1.execWithLoading)(() => __awaiter(this, void 0, void 0, function* () {
|
|
357
|
-
yield (0, lowcode_cli_1.build)(compsPath);
|
|
358
|
-
}), {
|
|
359
|
-
startTip: '组件库 - 构建中',
|
|
360
|
-
successTip: '组件库 - 构建成功'
|
|
361
|
-
});
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
function _publish(info) {
|
|
365
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
366
|
-
yield (0, utils_1.execWithLoading)(() => __awaiter(this, void 0, void 0, function* () {
|
|
367
|
-
yield (0, lowcode_cli_1.publishComps)(info);
|
|
368
|
-
}), {
|
|
369
|
-
startTip: '组件库 - 发布中',
|
|
370
|
-
successTip: '组件库 - 发布成功'
|
|
371
|
-
});
|
|
372
|
-
});
|
|
373
|
-
}
|