@cloudbase/cli 2.9.5 → 2.9.6

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.
Binary file
@@ -79,6 +79,10 @@ const AccessType = {
79
79
  MINIAPP: 'MINIAPP',
80
80
  VPC: 'VPC'
81
81
  };
82
+ const ResourceTitle = {
83
+ container: '容器型云托管',
84
+ function: '函数型云托管'
85
+ };
82
86
  function getCloudrunService(envId) {
83
87
  return __awaiter(this, void 0, void 0, function* () {
84
88
  const region = yield (0, toolbox_1.getRegion)();
@@ -598,12 +602,17 @@ let CloudRunDeployCommand = class CloudRunDeployCommand extends common_1.Command
598
602
  }
599
603
  serviceName = yield _inputServiceName(defaultName);
600
604
  }
605
+ const containerConfigFile = 'container.config.json';
606
+ const containerConfigPath = path_1.default.join(targetDir, containerConfigFile);
607
+ if (yield fs_extra_1.default.pathExists(containerConfigPath)) {
608
+ log.warn(`CLI 中 ${containerConfigFile} 文件将不会生效,请通过命令行参数进行配置!`);
609
+ }
601
610
  if (!force) {
602
611
  const answers = yield inquirer_1.default.prompt([
603
612
  {
604
613
  type: 'confirm',
605
614
  name: 'confirm',
606
- message: `即将开始部署,是否确认继续?`,
615
+ message: '即将开始部署,是否确认继续?',
607
616
  default: true
608
617
  }
609
618
  ]);
@@ -643,29 +652,25 @@ let CloudRunDeployCommand = class CloudRunDeployCommand extends common_1.Command
643
652
  function _runDeploy() {
644
653
  return __awaiter(this, void 0, void 0, function* () {
645
654
  try {
646
- const res = serverType === 'function'
647
- ? yield iac_core_1.IAC.FunctionV2.apply({
648
- cwd: targetDir,
649
- envId: envId,
650
- name: serviceName
651
- }, function (message) {
652
- (0, utils_2.trackCallback)(message, log);
653
- })
654
- : yield iac_core_1.IAC.Cloudrun.apply({
655
- cwd: targetDir,
656
- envId: envId,
657
- name: serviceName,
658
- port: port ? Number(port) : undefined
659
- }, function (message) {
660
- (0, utils_2.trackCallback)(message, log);
661
- });
655
+ utils_2.trackCallback === null || utils_2.trackCallback === void 0 ? void 0 : (0, utils_2.trackCallback)({
656
+ details: `正在提交${ResourceTitle[serverType]} ${serviceName} 中,请稍候...`,
657
+ status: 'progress'
658
+ }, log);
659
+ yield cloudrunService.deploy({
660
+ serverName: serviceName,
661
+ targetPath: targetDir,
662
+ serverConfig: Object.assign({}, (port ? { Port: Number(port) } : {}))
663
+ });
664
+ utils_2.trackCallback === null || utils_2.trackCallback === void 0 ? void 0 : (0, utils_2.trackCallback)({
665
+ details: `提交${ResourceTitle[serverType]} ${serviceName} 已完成!`,
666
+ status: 'done'
667
+ }, log);
662
668
  yield (0, utils_2.upsertCloudbaserc)(targetDir, {
663
669
  envId,
664
670
  cloudrun: { name: serviceName }
665
671
  });
666
- const { envId: _envId, name, resourceType: _resourceType } = res === null || res === void 0 ? void 0 : res.data;
667
672
  (0, utils_2.trackCallback)({
668
- details: `请打开链接查看部署状态: https://tcb.cloud.tencent.com/dev?envId=${_envId}#/platform-run/service/detail?serverName=${name}&tabId=deploy&envId=${_envId}`
673
+ details: `请打开链接查看部署状态: https://tcb.cloud.tencent.com/dev?envId=${envId}#/platform-run/service/detail?serverName=${serviceName}&tabId=deploy&envId=${envId}`
669
674
  }, log);
670
675
  }
671
676
  catch (e) {
@@ -675,7 +680,7 @@ let CloudRunDeployCommand = class CloudRunDeployCommand extends common_1.Command
675
680
  {
676
681
  type: 'confirm',
677
682
  name: 'confirm',
678
- message: `平台当前有部署发布任务正在运行中。确认继续部署,正在执行的部署任务将被取消,并立即部署最新的代码`,
683
+ message: '平台当前有部署发布任务正在运行中。确认继续部署,正在执行的部署任务将被取消,并立即部署最新的代码',
679
684
  default: true
680
685
  }
681
686
  ])
@@ -743,11 +748,11 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
743
748
  options: [
744
749
  {
745
750
  flags: '--runMode <runMode>',
746
- desc: `运行模式,可选值: normal(普通函数) | agent(函数式 Agent),默认值: normal`
751
+ desc: '运行模式,可选值: normal(普通函数) | agent(函数式 Agent),默认值: normal'
747
752
  },
748
753
  {
749
754
  flags: '--agentId <agentId>',
750
- desc: `在 agent 模式下需要提供 Agent ID 进行调试`
755
+ desc: '在 agent 模式下需要提供 Agent ID 进行调试'
751
756
  },
752
757
  {
753
758
  flags: '-e, --envId <envId>',
@@ -793,7 +798,7 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
793
798
  },
794
799
  {
795
800
  flags: '--open-debug-panel <openDebugPanel>',
796
- desc: `是否打开调试面板,默认为 'true'`
801
+ desc: '是否打开调试面板,默认为 \'true\''
797
802
  }
798
803
  ],
799
804
  requiredEnvId: false,
@@ -828,7 +833,7 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
828
833
  {
829
834
  type: 'input',
830
835
  name: 'agentId',
831
- message: `请输入 Agent ID(如没有请填写任意值):`,
836
+ message: '请输入 Agent ID(如没有请填写任意值):',
832
837
  validate: (val) => {
833
838
  return val.trim() ? true : 'Agent ID 不能为空';
834
839
  }
@@ -895,7 +900,7 @@ let CloudRunRunCommand = class CloudRunRunCommand extends common_1.Command {
895
900
  logger.info(`[nodemon ${e.type}] ${e.message}`);
896
901
  })
897
902
  .on('crash', () => {
898
- logger.error(`Server crashed.`);
903
+ logger.error('Server crashed.');
899
904
  process.exit(1);
900
905
  })
901
906
  .on('exit', (e) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.9.5",
3
+ "version": "2.9.6",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
@@ -53,7 +53,7 @@
53
53
  "@cloudbase/functions-framework": "1.16.0",
54
54
  "@cloudbase/iac-core": "0.0.3-alpha.11",
55
55
  "@cloudbase/lowcode-cli": "^0.22.2",
56
- "@cloudbase/manager-node": "4.6.1",
56
+ "@cloudbase/manager-node": "4.6.3",
57
57
  "@cloudbase/toolbox": "^0.7.9",
58
58
  "@dotenvx/dotenvx": "^1.48.3",
59
59
  "@musistudio/claude-code-router": "1.0.36",