@cloudbase/cli 2.6.2 → 2.6.4

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/bin/tcb.js CHANGED
@@ -41,8 +41,8 @@ async function main() {
41
41
  const currentMajorVersion = +semver.major(process.version)
42
42
 
43
43
  // 定义最小版本和推荐版本
44
- const NODE_MIN_VERSION = 14
45
- const NODE_RECOMMENDED_VERSIONS = [16, 18]
44
+ const NODE_MIN_VERSION = 18
45
+ const NODE_RECOMMENDED_VERSIONS = [18]
46
46
 
47
47
  // 检查当前版本是否满足最小版本要求
48
48
  if (NODE_MIN_VERSION > currentMajorVersion) {
@@ -388,7 +388,7 @@ RunfDownloadCommand = __decorate([
388
388
  (0, common_1.ICommand)()
389
389
  ], RunfDownloadCommand);
390
390
  exports.RunfDownloadCommand = RunfDownloadCommand;
391
- class RunfRunCommand extends common_1.Command {
391
+ let RunfRunCommand = class RunfRunCommand extends common_1.Command {
392
392
  get options() {
393
393
  return {
394
394
  cmd: 'cloudrunfunction',
@@ -417,10 +417,14 @@ class RunfRunCommand extends common_1.Command {
417
417
  {
418
418
  flags: '--functionsConfigFile <functionsConfigFile>',
419
419
  desc: '多函数定义配置文件,默认为 ./cloudbase-functions.json'
420
+ },
421
+ {
422
+ flags: '--loadAllFunctions',
423
+ desc: '是否加载 "functionsRoot" 目录中的所有函数。默认为 false'
420
424
  }
421
425
  ],
422
426
  requiredEnvId: false,
423
- desc: '本地运行函数式托管代码'
427
+ desc: '本地运行云函数 2.0 代码'
424
428
  };
425
429
  }
426
430
  execute(logger) {
@@ -468,7 +472,7 @@ class RunfRunCommand extends common_1.Command {
468
472
  }
469
473
  });
470
474
  }
471
- }
475
+ };
472
476
  __decorate([
473
477
  (0, decorators_1.InjectParams)(),
474
478
  __param(0, (0, decorators_1.Log)()),
@@ -476,6 +480,9 @@ __decorate([
476
480
  __metadata("design:paramtypes", [decorators_1.Logger]),
477
481
  __metadata("design:returntype", Promise)
478
482
  ], RunfRunCommand.prototype, "execute", null);
483
+ RunfRunCommand = __decorate([
484
+ (0, common_1.ICommand)()
485
+ ], RunfRunCommand);
479
486
  exports.RunfRunCommand = RunfRunCommand;
480
487
  function _selectEnv() {
481
488
  return __awaiter(this, void 0, void 0, function* () {
@@ -488,10 +495,13 @@ function _inputServiceName(defaultVal = '') {
488
495
  {
489
496
  type: 'input',
490
497
  name: 'serviceName',
491
- message: '请输入服务名称(只能包含数字、小写字母和-,只能以小写字母开头,最多 20字符)',
498
+ message: '请输入服务名称(支持大小写字母、数字、-和_,但必须以字母开头、以字母和数字结尾,不支持以lcap、lowcode开头,最长45个字符)',
492
499
  default: defaultVal,
493
500
  validate: (val) => {
494
- return /^[a-z][a-z0-9-]{0,19}$/.test(val) ? true : '请输入正确的服务名称';
501
+ const isValid = !val.startsWith('lcap') &&
502
+ !val.startsWith('lowcode') &&
503
+ /^[A-Za-z][\w-_]{0,43}[A-Za-z0-9]$/.test(val);
504
+ return isValid ? true : '请输入正确的服务名称';
495
505
  }
496
506
  }
497
507
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.6.2",
3
+ "version": "2.6.4",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {