@cloudbase/cli 2.6.5 → 2.6.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.
@@ -396,31 +396,61 @@ let RunfRunCommand = class RunfRunCommand extends common_1.Command {
396
396
  options: [
397
397
  {
398
398
  flags: '--source <source>',
399
- desc: '目标函数文件所在目录路径,默认为当前路径'
399
+ desc: `目标函数文件所在目录路径,默认为当前路径
400
+ `
400
401
  },
401
402
  {
402
403
  flags: '--port <port>',
403
- desc: '监听的端口,默认为 3000'
404
+ desc: `监听的端口,默认为 3000
405
+ `
404
406
  },
405
407
  {
406
408
  flags: '-w, --watch',
407
- desc: '是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false'
409
+ desc: `是否启用热重启模式,如启用,将会在文件变更时自动重启服务,默认为 false
410
+ `
408
411
  },
409
412
  {
410
413
  flags: '--dry-run',
411
- desc: '是否不启动服务,只验证代码可以正常加载,默认为 false'
414
+ desc: `是否不启动服务,只验证代码可以正常加载,默认为 false
415
+ `
412
416
  },
413
417
  {
414
418
  flags: '--logDirname <logDirname>',
415
- desc: '日志文件目录,默认为 ./logs'
419
+ desc: `日志文件目录,默认为 ./logs
420
+ `
416
421
  },
417
422
  {
418
423
  flags: '--functionsConfigFile <functionsConfigFile>',
419
- desc: '多函数定义配置文件,默认为 ./cloudbase-functions.json'
424
+ desc: `多函数定义配置文件,默认为 ./cloudbase-functions.json
425
+ 环境变量: FUNCTIONS_CONFIG_FILE
426
+ `
420
427
  },
421
428
  {
422
429
  flags: '--loadAllFunctions',
423
- desc: '是否加载 "functionsRoot" 目录中的所有函数。默认为 false'
430
+ desc: `是否加载 "functionsRoot" 目录中的所有函数。默认为 false
431
+ `
432
+ },
433
+ {
434
+ flags: '--enableCors',
435
+ desc: `为已配置的源启用跨域资源共享(CORS),默认值为 false
436
+ 环境变量: ENABLE_CORS
437
+ `
438
+ },
439
+ {
440
+ flags: '--allowedOrigins <allowedOrigins>',
441
+ desc: `设置 CORS 允许的源。默认允许 localhost 和 127.0.0.1。
442
+ 支持通配符源,例如 ['.example.com']。
443
+ 多个源应该用逗号分隔。
444
+ 示例:--allowedOrigins .example.com,www.another.com
445
+ 环境变量:ALLOWED_ORIGINSS
446
+ `
447
+ },
448
+ {
449
+ flags: '--extendedContext <extendedContext>',
450
+ desc: `用于解析 context.extendedContext 的值。""表示该功能已关闭。默认值为 null
451
+ 示例:--extendedContext '{"a":1,"b":2}'
452
+ 环境变量:EXTENDED_CONTEXT
453
+ `
424
454
  }
425
455
  ],
426
456
  requiredEnvId: false,
@@ -495,13 +525,15 @@ function _inputServiceName(defaultVal = '') {
495
525
  {
496
526
  type: 'input',
497
527
  name: 'serviceName',
498
- message: '请输入服务名称(支持大小写字母、数字、-和_,但必须以字母开头、以字母和数字结尾,不支持以lcap、lowcode开头,最长45个字符)',
528
+ message: '请输入服务名称',
499
529
  default: defaultVal,
500
530
  validate: (val) => {
501
531
  const isValid = !val.startsWith('lcap') &&
502
532
  !val.startsWith('lowcode') &&
503
533
  /^[A-Za-z][\w-_]{0,43}[A-Za-z0-9]$/.test(val);
504
- return isValid ? true : '请输入正确的服务名称';
534
+ return isValid
535
+ ? true
536
+ : '支持大小写字母、数字、-和_,但必须以字母开头、以字母和数字结尾,不支持以lcap、lowcode开头,最长45个字符';
505
537
  }
506
538
  }
507
539
  ];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudbase/cli",
3
- "version": "2.6.5",
3
+ "version": "2.6.6",
4
4
  "description": "cli tool for cloudbase",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {