esa-cli 0.0.2-beta.2 → 0.0.2-beta.21
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/dist/commands/commit/index.js +45 -117
- package/dist/commands/commit/prodBuild.js +2 -3
- package/dist/commands/common/constant.js +0 -19
- package/dist/commands/common/utils.js +419 -0
- package/dist/commands/config.js +1 -1
- package/dist/commands/deploy/helper.js +51 -72
- package/dist/commands/deploy/index.js +48 -187
- package/dist/commands/deployments/delete.js +32 -22
- package/dist/commands/deployments/index.js +3 -3
- package/dist/commands/deployments/list.js +22 -38
- package/dist/commands/dev/build.js +3 -3
- package/dist/commands/dev/doProcess.js +5 -5
- package/dist/commands/dev/ew2/cacheService.js +33 -0
- package/dist/commands/dev/ew2/devEntry.js +2 -1
- package/dist/commands/dev/ew2/devPack.js +30 -34
- package/dist/commands/dev/ew2/kvService.js +46 -0
- package/dist/commands/dev/ew2/mock/cache.js +99 -15
- package/dist/commands/dev/ew2/mock/kv.js +142 -21
- package/dist/commands/dev/ew2/server.js +165 -28
- package/dist/commands/dev/index.js +16 -16
- package/dist/commands/dev/mockWorker/devPack.js +32 -21
- package/dist/commands/dev/mockWorker/server.js +7 -6
- package/dist/commands/domain/add.js +3 -3
- package/dist/commands/domain/delete.js +7 -7
- package/dist/commands/domain/index.js +3 -3
- package/dist/commands/domain/list.js +10 -10
- package/dist/commands/init/helper.js +761 -0
- package/dist/commands/init/index.js +88 -220
- package/dist/commands/init/snippets/nextjs/next.config.mjs +6 -0
- package/dist/commands/init/snippets/nextjs/next.config.ts +7 -0
- package/dist/commands/init/snippets/react-router/react-router.config.ts +7 -0
- package/dist/commands/init/template.jsonc +84 -0
- package/dist/commands/init/types.js +1 -0
- package/dist/commands/lang.js +2 -2
- package/dist/commands/login/index.js +74 -34
- package/dist/commands/logout.js +6 -6
- package/dist/commands/route/add.js +138 -49
- package/dist/commands/route/delete.js +33 -27
- package/dist/commands/route/helper.js +124 -0
- package/dist/commands/route/index.js +3 -3
- package/dist/commands/route/list.js +56 -17
- package/dist/commands/routine/delete.js +2 -2
- package/dist/commands/routine/index.js +3 -3
- package/dist/commands/routine/list.js +9 -21
- package/dist/commands/site/index.js +2 -2
- package/dist/commands/site/list.js +6 -7
- package/dist/commands/utils.js +55 -19
- package/dist/components/descriptionInput.js +1 -1
- package/dist/components/mutiLevelSelect.js +43 -55
- package/dist/components/mutiSelectTable.js +1 -1
- package/dist/components/selectInput.js +2 -3
- package/dist/components/selectItem.js +1 -1
- package/dist/docs/Commands_en.md +142 -131
- package/dist/docs/Commands_zh_CN.md +139 -127
- package/dist/i18n/index.js +2 -2
- package/dist/i18n/locales.json +401 -21
- package/dist/index.js +27 -20
- package/dist/libs/api.js +32 -9
- package/dist/libs/apiService.js +262 -84
- package/dist/libs/git/index.js +86 -9
- package/dist/libs/interface.js +0 -1
- package/dist/libs/logger.js +162 -10
- package/dist/libs/service.js +2 -2
- package/dist/libs/templates/index.js +3 -2
- package/dist/utils/checkAssetsExist.js +80 -0
- package/dist/utils/checkDevPort.js +3 -17
- package/dist/utils/checkEntryFileExist.js +10 -0
- package/dist/utils/checkIsRoutineCreated.js +27 -26
- package/dist/utils/checkVersion.js +119 -1
- package/dist/utils/command.js +149 -0
- package/dist/utils/compress.js +136 -0
- package/dist/utils/download.js +182 -0
- package/dist/utils/fileMd5.js +1 -1
- package/dist/utils/fileUtils/base.js +1 -1
- package/dist/utils/fileUtils/index.js +69 -28
- package/dist/utils/installDeno.js +8 -8
- package/dist/utils/installEw2.js +7 -7
- package/dist/utils/openInBrowser.js +1 -1
- package/dist/utils/prompt.js +97 -0
- package/package.json +20 -12
package/dist/i18n/locales.json
CHANGED
|
@@ -75,10 +75,6 @@
|
|
|
75
75
|
"en": "Production",
|
|
76
76
|
"zh_CN": "生产环境"
|
|
77
77
|
},
|
|
78
|
-
"deploy_env_canary": {
|
|
79
|
-
"en": "Canary",
|
|
80
|
-
"zh_CN": "灰度环境"
|
|
81
|
-
},
|
|
82
78
|
"deploy_description_routine": {
|
|
83
79
|
"en": "Enter the description of the routine",
|
|
84
80
|
"zh_CN": "请输入边缘函数的描述"
|
|
@@ -103,16 +99,12 @@
|
|
|
103
99
|
"en": "Do you want to create a formal version to deploy on production environment?",
|
|
104
100
|
"zh_CN": "是否创建正式版本以部署到生产环境?"
|
|
105
101
|
},
|
|
106
|
-
"deploy_select_canary": {
|
|
107
|
-
"en": "Please select the canary area(s) you want to deploy to",
|
|
108
|
-
"zh_CN": "请选择您要部署的灰度区域"
|
|
109
|
-
},
|
|
110
102
|
"deploy_success": {
|
|
111
103
|
"en": "Your code has been successfully deployed",
|
|
112
104
|
"zh_CN": "您的代码已成功部署"
|
|
113
105
|
},
|
|
114
106
|
"deploy_success_guide": {
|
|
115
|
-
"en": "
|
|
107
|
+
"en": "Add a custom domain",
|
|
116
108
|
"zh_CN": "运行此命令以添加域名"
|
|
117
109
|
},
|
|
118
110
|
"deploy_table_header_version": {
|
|
@@ -289,7 +281,7 @@
|
|
|
289
281
|
},
|
|
290
282
|
"init_input_name": {
|
|
291
283
|
"en": "Enter the name of edgeRoutine:",
|
|
292
|
-
"zh_CN": "输入 edgeRoutine
|
|
284
|
+
"zh_CN": "输入 edgeRoutine 的名称"
|
|
293
285
|
},
|
|
294
286
|
"init_skip_git": {
|
|
295
287
|
"en": "Git installation was skipped.",
|
|
@@ -367,6 +359,18 @@
|
|
|
367
359
|
"en": "The name of route to add",
|
|
368
360
|
"zh_CN": "要添加的路由名称"
|
|
369
361
|
},
|
|
362
|
+
"route_add_site_describe": {
|
|
363
|
+
"en": "The site to bind the route to. For example: example.com",
|
|
364
|
+
"zh_CN": "要绑定路由的站点"
|
|
365
|
+
},
|
|
366
|
+
"route_add_route_name_option": {
|
|
367
|
+
"en": "Route name (aliases)",
|
|
368
|
+
"zh_CN": "路由名称(别名)"
|
|
369
|
+
},
|
|
370
|
+
"route_add_route_value_option": {
|
|
371
|
+
"en": "The route value. For example: example.com/*",
|
|
372
|
+
"zh_CN": "路由值"
|
|
373
|
+
},
|
|
370
374
|
"route_add_invalid": {
|
|
371
375
|
"en": "The route does not correspond to the domain.",
|
|
372
376
|
"zh_CN": "该路由与域名不对应。"
|
|
@@ -476,8 +480,8 @@
|
|
|
476
480
|
"zh_CN": "route不合法"
|
|
477
481
|
},
|
|
478
482
|
"install_runtime_explain": {
|
|
479
|
-
"en": "
|
|
480
|
-
"zh_CN": "
|
|
483
|
+
"en": "Our runtime does not yet support this OS. We are temporarily using Deno as the local development runtime, which needs to be installed first.",
|
|
484
|
+
"zh_CN": "我们的Runtime还不支持此操作系统,我们暂时使用Deno作为本地开发runtime,需要先安装。"
|
|
481
485
|
},
|
|
482
486
|
"install_runtime_tip": {
|
|
483
487
|
"en": "🔔 Runtime must be installed to use esa dev. Installing...",
|
|
@@ -489,7 +493,7 @@
|
|
|
489
493
|
},
|
|
490
494
|
"route_validate": {
|
|
491
495
|
"en": "You can add an asterisk (*) as the prefix or suffix to match more URLs, such as \"*.example.com/*\".",
|
|
492
|
-
"zh_CN": "您可以通过添加前缀或后缀通配符(*)来匹配更多的URL,例如:
|
|
496
|
+
"zh_CN": "您可以通过添加前缀或后缀通配符(*)来匹配更多的URL,例如: \"*.example.com/*\"."
|
|
493
497
|
},
|
|
494
498
|
"domain_input": {
|
|
495
499
|
"en": "Enter the name of domain (Support fuzzy matching on tab press):",
|
|
@@ -513,20 +517,64 @@
|
|
|
513
517
|
},
|
|
514
518
|
"init_config_file": {
|
|
515
519
|
"en": "Generate a config file for your project",
|
|
516
|
-
"zh_CN": "
|
|
520
|
+
"zh_CN": "在您的项目中生成一个配置文件"
|
|
521
|
+
},
|
|
522
|
+
"init_config_format_select": {
|
|
523
|
+
"en": "Select configuration file format:",
|
|
524
|
+
"zh_CN": "选择配置文件格式:"
|
|
525
|
+
},
|
|
526
|
+
"init_config_format_jsonc": {
|
|
527
|
+
"en": "JSONC (.jsonc) - JSON with comments, recommended",
|
|
528
|
+
"zh_CN": "JSONC (.jsonc) - 带注释的JSON,推荐"
|
|
529
|
+
},
|
|
530
|
+
"init_config_format_toml": {
|
|
531
|
+
"en": "TOML (.toml) - Traditional format",
|
|
532
|
+
"zh_CN": "TOML (.toml) - 传统格式"
|
|
533
|
+
},
|
|
534
|
+
"init_language_select": {
|
|
535
|
+
"en": "Select programming language:",
|
|
536
|
+
"zh_CN": "选择编程语言:"
|
|
537
|
+
},
|
|
538
|
+
"init_language_typescript": {
|
|
539
|
+
"en": "TypeScript (.ts) - Type-safe JavaScript, recommended",
|
|
540
|
+
"zh_CN": "TypeScript (.ts) - 类型安全的JavaScript,推荐"
|
|
541
|
+
},
|
|
542
|
+
"init_language_javascript": {
|
|
543
|
+
"en": "JavaScript (.js) - Traditional JavaScript",
|
|
544
|
+
"zh_CN": "JavaScript (.js) - 传统JavaScript"
|
|
545
|
+
},
|
|
546
|
+
"init_language_selected": {
|
|
547
|
+
"en": "Language",
|
|
548
|
+
"zh_CN": "语言"
|
|
549
|
+
},
|
|
550
|
+
"init_project_name": {
|
|
551
|
+
"en": "Project name",
|
|
552
|
+
"zh_CN": "项目名称"
|
|
553
|
+
},
|
|
554
|
+
"init_template_name": {
|
|
555
|
+
"en": "Template name to use",
|
|
556
|
+
"zh_CN": "要使用的模板名称"
|
|
557
|
+
},
|
|
558
|
+
"init_template_not_found": {
|
|
559
|
+
"en": "Template \"${templateName}\" not found. Please check the template name and try again.",
|
|
560
|
+
"zh_CN": "未找到模板 \"${templateName}\"。请检查模板名称并重试。"
|
|
517
561
|
},
|
|
518
562
|
"generate_config_error": {
|
|
519
|
-
"en": "
|
|
520
|
-
"zh_CN": "
|
|
563
|
+
"en": "already exists",
|
|
564
|
+
"zh_CN": "配置文件已经存在"
|
|
521
565
|
},
|
|
522
566
|
"generate_config_success": {
|
|
523
|
-
"en": "Generated
|
|
524
|
-
"zh_CN": "
|
|
567
|
+
"en": "Generated ${path.basename(newFilePath)}",
|
|
568
|
+
"zh_CN": "配置文件生成成功"
|
|
525
569
|
},
|
|
526
570
|
"commit_option_minify": {
|
|
527
571
|
"en": "Minify code before committing",
|
|
528
572
|
"zh_CN": "上传前压缩代码"
|
|
529
573
|
},
|
|
574
|
+
"commit_option_description": {
|
|
575
|
+
"en": "Description for the routine/version (skip interactive input)",
|
|
576
|
+
"zh_CN": "函数/版本的描述(跳过交互式输入)"
|
|
577
|
+
},
|
|
530
578
|
"dev_entry_describe": {
|
|
531
579
|
"en": "Entry file of the Routine",
|
|
532
580
|
"zh_CN": "入口文件路径"
|
|
@@ -712,8 +760,8 @@
|
|
|
712
760
|
"zh_CN": "无权限:Access Key 或 Secret 错误,或没有必要的权限。"
|
|
713
761
|
},
|
|
714
762
|
"init_skip": {
|
|
715
|
-
"en": "
|
|
716
|
-
"zh_CN": "
|
|
763
|
+
"en": "Answer \"No\" to any prompts for new projects.",
|
|
764
|
+
"zh_CN": "回答 \"否\" 到所有提示。"
|
|
717
765
|
},
|
|
718
766
|
"quick_deploy_success": {
|
|
719
767
|
"en": "Your code has been successfully deployed",
|
|
@@ -727,6 +775,18 @@
|
|
|
727
775
|
"en": "Quick deploy failed",
|
|
728
776
|
"zh_CN": "快速部署失败。"
|
|
729
777
|
},
|
|
778
|
+
"quick_deploy_assets_detected": {
|
|
779
|
+
"en": "Static assets detected, deploying with assets support",
|
|
780
|
+
"zh_CN": "检测到静态资源,正在使用资源支持进行部署"
|
|
781
|
+
},
|
|
782
|
+
"quick_deploy_assets_success": {
|
|
783
|
+
"en": "A new version has been successfully generated",
|
|
784
|
+
"zh_CN": "您的代码和静态资源已成功部署"
|
|
785
|
+
},
|
|
786
|
+
"quick_deploy_assets_failed": {
|
|
787
|
+
"en": "Quick deploy with assets failed",
|
|
788
|
+
"zh_CN": "带静态资源的快速部署失败"
|
|
789
|
+
},
|
|
730
790
|
"auto_deploy": {
|
|
731
791
|
"en": "Do you want to deploy your project?",
|
|
732
792
|
"zh_CN": "您想要部署您的项目吗?"
|
|
@@ -740,7 +800,7 @@
|
|
|
740
800
|
"zh_CN": "未找到正式版本,您需要先创建一个版本。"
|
|
741
801
|
},
|
|
742
802
|
"init_deploy_success": {
|
|
743
|
-
"en": "
|
|
803
|
+
"en": "Deploy Success",
|
|
744
804
|
"zh_CN": "项目部署完成。访问:"
|
|
745
805
|
},
|
|
746
806
|
"show_default_url": {
|
|
@@ -763,6 +823,30 @@
|
|
|
763
823
|
"en": "The domain may take some time to take effect, please try again later.",
|
|
764
824
|
"zh_CN": "域名生效可能需要一段时间,请稍后再试。"
|
|
765
825
|
},
|
|
826
|
+
"deploy_quick_describe": {
|
|
827
|
+
"en": "Quick deploy the routine to production environment",
|
|
828
|
+
"zh_CN": "快速部署到生产环境"
|
|
829
|
+
},
|
|
830
|
+
"deploy_option_version": {
|
|
831
|
+
"en": "Version to deploy (skip interactive selection)",
|
|
832
|
+
"zh_CN": "要部署的版本(跳过交互式选择)"
|
|
833
|
+
},
|
|
834
|
+
"deploy_option_environment": {
|
|
835
|
+
"en": "Environment to deploy to: staging or production (skip interactive selection)",
|
|
836
|
+
"zh_CN": "部署环境:staging 或 production(跳过交互式选择)"
|
|
837
|
+
},
|
|
838
|
+
"deploy_version_not_found": {
|
|
839
|
+
"en": "Version '${argv.version}' not found",
|
|
840
|
+
"zh_CN": "版本 '${version}' 未找到"
|
|
841
|
+
},
|
|
842
|
+
"deploy_using_version": {
|
|
843
|
+
"en": "Using version",
|
|
844
|
+
"zh_CN": "使用版本"
|
|
845
|
+
},
|
|
846
|
+
"deploy_using_environment": {
|
|
847
|
+
"en": "Using environment",
|
|
848
|
+
"zh_CN": "使用环境"
|
|
849
|
+
},
|
|
766
850
|
"init_install_dependence": {
|
|
767
851
|
"en": "⌛️ Installing dependencies...",
|
|
768
852
|
"zh_CN": "⌛️ 正在安装依赖..."
|
|
@@ -894,5 +978,301 @@
|
|
|
894
978
|
"dev_url_invalid": {
|
|
895
979
|
"en": "Invalid URL: ${url}. Please enter a valid URL.",
|
|
896
980
|
"zh_CN": "不是正确的URL: ${url}. 请输入正确的URL."
|
|
981
|
+
},
|
|
982
|
+
"deno_download_failed": {
|
|
983
|
+
"en": "Download failed",
|
|
984
|
+
"zh_CN": "下载失败"
|
|
985
|
+
},
|
|
986
|
+
"deno_unzip_failed": {
|
|
987
|
+
"en": "Unzip failed",
|
|
988
|
+
"zh_CN": "解压失败"
|
|
989
|
+
},
|
|
990
|
+
"deno_add_path_failed": {
|
|
991
|
+
"en": "Add BinDir to Path failed",
|
|
992
|
+
"zh_CN": "添加环境变量失败"
|
|
993
|
+
},
|
|
994
|
+
"deno_install_success": {
|
|
995
|
+
"en": "Runtime install success!",
|
|
996
|
+
"zh_CN": "Runtime 安装成功!"
|
|
997
|
+
},
|
|
998
|
+
"deno_download_success": {
|
|
999
|
+
"en": "Download success",
|
|
1000
|
+
"zh_CN": "下载成功"
|
|
1001
|
+
},
|
|
1002
|
+
"deno_install_success_tips": {
|
|
1003
|
+
"en": "Please run ${dev} again",
|
|
1004
|
+
"zh_CN": "请重新运行 ${dev}"
|
|
1005
|
+
},
|
|
1006
|
+
"no_build_script": {
|
|
1007
|
+
"en": "No build script found in package.json, skipping build step.",
|
|
1008
|
+
"zh_CN": "在 package.json 中未找到构建脚本,跳过构建步骤。"
|
|
1009
|
+
},
|
|
1010
|
+
"init_cancel": {
|
|
1011
|
+
"en": "User canceled the operation.",
|
|
1012
|
+
"zh_CN": "用户取消了操作。"
|
|
1013
|
+
},
|
|
1014
|
+
"routine_create_success": {
|
|
1015
|
+
"en": "Routine created successfully.",
|
|
1016
|
+
"zh_CN": "边缘函数创建成功"
|
|
1017
|
+
},
|
|
1018
|
+
"routine_create_fail": {
|
|
1019
|
+
"en": "Routine created failed.",
|
|
1020
|
+
"zh_CN": "边缘函数创建失败"
|
|
1021
|
+
},
|
|
1022
|
+
"create_route_route": {
|
|
1023
|
+
"en": "Enter a Route (e.g., example.com/*):",
|
|
1024
|
+
"zh_CN": "输入路由:"
|
|
1025
|
+
},
|
|
1026
|
+
"route_name_input_required": {
|
|
1027
|
+
"en": "Route name is required",
|
|
1028
|
+
"zh_CN": "路由名称是必需的"
|
|
1029
|
+
},
|
|
1030
|
+
"create_route_mode": {
|
|
1031
|
+
"en": "Which mode of route do you want to use?",
|
|
1032
|
+
"zh_CN": "您想要使用哪种路由模式?"
|
|
1033
|
+
},
|
|
1034
|
+
"create_route_site": {
|
|
1035
|
+
"en": "Select a site that is active in your account:",
|
|
1036
|
+
"zh_CN": "选择您账户中已激活的站点:"
|
|
1037
|
+
},
|
|
1038
|
+
"route_input_required": {
|
|
1039
|
+
"en": "Route is required",
|
|
1040
|
+
"zh_CN": "路由是必需的"
|
|
1041
|
+
},
|
|
1042
|
+
"create_route_rule": {
|
|
1043
|
+
"en": "Enter a Rule Expression:",
|
|
1044
|
+
"zh_CN": "输入规则表达式:"
|
|
1045
|
+
},
|
|
1046
|
+
"rule_input_required": {
|
|
1047
|
+
"en": "Rule is required",
|
|
1048
|
+
"zh_CN": "规则是必需的"
|
|
1049
|
+
},
|
|
1050
|
+
"route_list_simple_title": {
|
|
1051
|
+
"en": "Related simple mode routes",
|
|
1052
|
+
"zh_CN": "相关简单模式路由"
|
|
1053
|
+
},
|
|
1054
|
+
"route_list_custom_title": {
|
|
1055
|
+
"en": "Related custom mode routes",
|
|
1056
|
+
"zh_CN": "相关自定义模式路由"
|
|
1057
|
+
},
|
|
1058
|
+
"create_route_route_name": {
|
|
1059
|
+
"en": "Enter a Route Name (Aliases):",
|
|
1060
|
+
"zh_CN": "输入路由名称(别名):"
|
|
1061
|
+
},
|
|
1062
|
+
"no_route_found": {
|
|
1063
|
+
"en": "No route found! Please check the route name.",
|
|
1064
|
+
"zh_CN": "未找到路由!请检查路由名称。"
|
|
1065
|
+
},
|
|
1066
|
+
"init_template_not_ready": {
|
|
1067
|
+
"en": "Template is not ready. We will install it for you now.",
|
|
1068
|
+
"zh_CN": "模版未准备好,我们为您安装模版。"
|
|
1069
|
+
},
|
|
1070
|
+
"login_option_access_key_id": {
|
|
1071
|
+
"en": "AccessKey ID (AK)",
|
|
1072
|
+
"zh_CN": "AccessKey ID (AK)"
|
|
1073
|
+
},
|
|
1074
|
+
"login_option_access_key_secret": {
|
|
1075
|
+
"en": "AccessKey Secret (SK)",
|
|
1076
|
+
"zh_CN": "AccessKey Secret (SK)"
|
|
1077
|
+
},
|
|
1078
|
+
"login_option_skip_login": {
|
|
1079
|
+
"en": "Skip login",
|
|
1080
|
+
"zh_CN": "跳过登录"
|
|
1081
|
+
},
|
|
1082
|
+
"check_and_update_package_error": {
|
|
1083
|
+
"en": "Error: An error occurred while checking and updating the package, skipping template update",
|
|
1084
|
+
"zh_CN": "检测和更新包时发生错误,跳过更新模版"
|
|
1085
|
+
},
|
|
1086
|
+
"init_yes": {
|
|
1087
|
+
"en": "Answer \"Yes\" to all prompts.",
|
|
1088
|
+
"zh_CN": "回答 \"是\" 到所有提示。"
|
|
1089
|
+
},
|
|
1090
|
+
"init_no_templates": {
|
|
1091
|
+
"en": "No templates available.",
|
|
1092
|
+
"zh_CN": "没有可用的模版。"
|
|
1093
|
+
},
|
|
1094
|
+
"no_active_sites": {
|
|
1095
|
+
"en": "No active sites found in your account",
|
|
1096
|
+
"zh_CN": "没有找到已激活的站点"
|
|
1097
|
+
},
|
|
1098
|
+
"route_format_invalid": {
|
|
1099
|
+
"en": "Invalid route format",
|
|
1100
|
+
"zh_CN": "无效的路由格式"
|
|
1101
|
+
},
|
|
1102
|
+
"creating_route": {
|
|
1103
|
+
"en": "Creating route...",
|
|
1104
|
+
"zh_CN": "创建路由..."
|
|
1105
|
+
},
|
|
1106
|
+
"site_not_found": {
|
|
1107
|
+
"en": "Site \"${siteName}\" not found in your account",
|
|
1108
|
+
"zh_CN": "站点 \"${siteName}\" 未找到"
|
|
1109
|
+
},
|
|
1110
|
+
"commit_assets_exist": {
|
|
1111
|
+
"en": "This is a routine with assets project",
|
|
1112
|
+
"zh_CN": "这是一个带静态资源的边缘函数项目"
|
|
1113
|
+
},
|
|
1114
|
+
"commit_routine_with_assets_success": {
|
|
1115
|
+
"en": "Routine with assets code version committed successfully.",
|
|
1116
|
+
"zh_CN": "带静态资源的边缘函数代码版本提交成功。"
|
|
1117
|
+
},
|
|
1118
|
+
"commit_routine_with_assets_fail": {
|
|
1119
|
+
"en": "An error occurred while trying to commit your routine with assets.",
|
|
1120
|
+
"zh_CN": "提交带静态资源的边缘函数时发生错误。"
|
|
1121
|
+
},
|
|
1122
|
+
"commit_option_assets": {
|
|
1123
|
+
"en": "Assets directory",
|
|
1124
|
+
"zh_CN": "静态资源目录"
|
|
1125
|
+
},
|
|
1126
|
+
"commit_option_name": {
|
|
1127
|
+
"en": "Edge Routine name",
|
|
1128
|
+
"zh_CN": "边缘函数名称"
|
|
1129
|
+
},
|
|
1130
|
+
"deploy_option_name": {
|
|
1131
|
+
"en": "Name of the routine",
|
|
1132
|
+
"zh_CN": "边缘函数名称"
|
|
1133
|
+
},
|
|
1134
|
+
"deploy_option_assets": {
|
|
1135
|
+
"en": "Deploy assets",
|
|
1136
|
+
"zh_CN": "部署静态资源"
|
|
1137
|
+
},
|
|
1138
|
+
"deploy_invalid_environment": {
|
|
1139
|
+
"en": "Invalid environment",
|
|
1140
|
+
"zh_CN": "无效的环境"
|
|
1141
|
+
},
|
|
1142
|
+
"deploy_success_guide_2": {
|
|
1143
|
+
"en": "Add routes for a site",
|
|
1144
|
+
"zh_CN": "运行此命令以添加路由"
|
|
1145
|
+
},
|
|
1146
|
+
"login_get_from_env": {
|
|
1147
|
+
"en": "Get AccessKey ID and AccessKey Secret from environment variables.",
|
|
1148
|
+
"zh_CN": "从环境变量中获取 AccessKey ID 和 AccessKey Secret。"
|
|
1149
|
+
},
|
|
1150
|
+
"deploy_option_description": {
|
|
1151
|
+
"en": "Description of the version",
|
|
1152
|
+
"zh_CN": "版本描述"
|
|
1153
|
+
},
|
|
1154
|
+
"deploy_option_minify": {
|
|
1155
|
+
"en": "Minify the code",
|
|
1156
|
+
"zh_CN": "压缩代码"
|
|
1157
|
+
},
|
|
1158
|
+
"error_reading_project_config_file": {
|
|
1159
|
+
"en": "Error reading project configuration file.",
|
|
1160
|
+
"zh_CN": "读取项目配置文件错误"
|
|
1161
|
+
},
|
|
1162
|
+
"checking_template_update": {
|
|
1163
|
+
"en": "Checking esa-template updates...",
|
|
1164
|
+
"zh_CN": "检查 esa-template 更新..."
|
|
1165
|
+
},
|
|
1166
|
+
"template_updating": {
|
|
1167
|
+
"en": "Updating templates to latest...",
|
|
1168
|
+
"zh_CN": "正在更新模板到最新版本..."
|
|
1169
|
+
},
|
|
1170
|
+
"template_updated_to_latest": {
|
|
1171
|
+
"en": "Templates updated to latest.",
|
|
1172
|
+
"zh_CN": "模板已更新到最新版本。"
|
|
1173
|
+
},
|
|
1174
|
+
"checking_esa_template_finished": {
|
|
1175
|
+
"en": "Checking esa-template finished.",
|
|
1176
|
+
"zh_CN": "检查 esa-template 完成。"
|
|
1177
|
+
},
|
|
1178
|
+
"git_installed_success": {
|
|
1179
|
+
"en": "Git has been installed successfully.",
|
|
1180
|
+
"zh_CN": "Git 已成功安装。"
|
|
1181
|
+
},
|
|
1182
|
+
"compress_not_specified": {
|
|
1183
|
+
"en": "Not specified",
|
|
1184
|
+
"zh_CN": "未指定"
|
|
1185
|
+
},
|
|
1186
|
+
"compress_not_configured": {
|
|
1187
|
+
"en": "Not configured",
|
|
1188
|
+
"zh_CN": "未配置"
|
|
1189
|
+
},
|
|
1190
|
+
"compress_check_file_exists": {
|
|
1191
|
+
"en": "(Check if file exists)",
|
|
1192
|
+
"zh_CN": "(检查文件是否存在)"
|
|
1193
|
+
},
|
|
1194
|
+
"compress_check_directory_exists": {
|
|
1195
|
+
"en": "(Check if directory exists)",
|
|
1196
|
+
"zh_CN": "(检查目录是否存在)"
|
|
1197
|
+
},
|
|
1198
|
+
"deploy_success_cd": {
|
|
1199
|
+
"en": "Enter project directory",
|
|
1200
|
+
"zh_CN": ""
|
|
1201
|
+
},
|
|
1202
|
+
"init_abort": {
|
|
1203
|
+
"en": "Initialization aborted",
|
|
1204
|
+
"zh_CN": ""
|
|
1205
|
+
},
|
|
1206
|
+
"reason": {
|
|
1207
|
+
"en": "Reason:",
|
|
1208
|
+
"zh_CN": ""
|
|
1209
|
+
},
|
|
1210
|
+
"dir_already_exists": {
|
|
1211
|
+
"en": "Target directory already exists",
|
|
1212
|
+
"zh_CN": ""
|
|
1213
|
+
},
|
|
1214
|
+
"path": {
|
|
1215
|
+
"en": "Path:",
|
|
1216
|
+
"zh_CN": ""
|
|
1217
|
+
},
|
|
1218
|
+
"try": {
|
|
1219
|
+
"en": "Try one of the following:",
|
|
1220
|
+
"zh_CN": ""
|
|
1221
|
+
},
|
|
1222
|
+
"try_diff_name": {
|
|
1223
|
+
"en": "Choose a different project name",
|
|
1224
|
+
"zh_CN": ""
|
|
1225
|
+
},
|
|
1226
|
+
"try_remove": {
|
|
1227
|
+
"en": "Remove the directory:",
|
|
1228
|
+
"zh_CN": ""
|
|
1229
|
+
},
|
|
1230
|
+
"try_another_dir": {
|
|
1231
|
+
"en": "Run the command in another directory",
|
|
1232
|
+
"zh_CN": ""
|
|
1233
|
+
},
|
|
1234
|
+
"step": {
|
|
1235
|
+
"en": "Step:",
|
|
1236
|
+
"zh_CN": ""
|
|
1237
|
+
},
|
|
1238
|
+
"version_title_update_available": {
|
|
1239
|
+
"en": "ESA CLI Update Available",
|
|
1240
|
+
"zh_CN": "ESA CLI 有新版本可用"
|
|
1241
|
+
},
|
|
1242
|
+
"version_current": {
|
|
1243
|
+
"en": "Current",
|
|
1244
|
+
"zh_CN": "当前版本"
|
|
1245
|
+
},
|
|
1246
|
+
"version_latest": {
|
|
1247
|
+
"en": "Latest",
|
|
1248
|
+
"zh_CN": "最新版本"
|
|
1249
|
+
},
|
|
1250
|
+
"version_note": {
|
|
1251
|
+
"en": "Note",
|
|
1252
|
+
"zh_CN": "提示"
|
|
1253
|
+
},
|
|
1254
|
+
"version_note_incompatible": {
|
|
1255
|
+
"en": "This version may have incompatibilities, please upgrade soon.",
|
|
1256
|
+
"zh_CN": "当前版本可能存在不兼容,建议尽快升级至最新版本。"
|
|
1257
|
+
},
|
|
1258
|
+
"version_update": {
|
|
1259
|
+
"en": "Update",
|
|
1260
|
+
"zh_CN": "升级"
|
|
1261
|
+
},
|
|
1262
|
+
"version_continue": {
|
|
1263
|
+
"en": "You can continue using the current version; commands will proceed.",
|
|
1264
|
+
"zh_CN": "你可以继续使用当前版本;命令将继续执行。"
|
|
1265
|
+
},
|
|
1266
|
+
"version_prompt_update_now": {
|
|
1267
|
+
"en": "Update now to the latest version?",
|
|
1268
|
+
"zh_CN": "是否立即更新到最新版本?"
|
|
1269
|
+
},
|
|
1270
|
+
"version_update_failed": {
|
|
1271
|
+
"en": "Global update failed. You may need elevated permissions (sudo) or use yarn/pnpm:",
|
|
1272
|
+
"zh_CN": "全局更新失败。你可能需要更高权限(sudo)或使用 yarn/pnpm:"
|
|
1273
|
+
},
|
|
1274
|
+
"kv_parse_failed": {
|
|
1275
|
+
"en": "kv.json parse failed, use empty local kv store.",
|
|
1276
|
+
"zh_CN": ""
|
|
897
1277
|
}
|
|
898
1278
|
}
|
package/dist/index.js
CHANGED
|
@@ -7,26 +7,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import chalk from 'chalk';
|
|
10
11
|
import yargs from 'yargs';
|
|
11
12
|
import { hideBin } from 'yargs/helpers';
|
|
12
|
-
import
|
|
13
|
-
import login from './commands/login/index.js';
|
|
13
|
+
import commit from './commands/commit/index.js';
|
|
14
14
|
import config from './commands/config.js';
|
|
15
|
-
import dev from './commands/dev/index.js';
|
|
16
|
-
import init from './commands/init/index.js';
|
|
17
|
-
import routine from './commands/routine/index.js';
|
|
18
15
|
import deploy from './commands/deploy/index.js';
|
|
19
|
-
import commit from './commands/commit/index.js';
|
|
20
16
|
import deployments from './commands/deployments/index.js';
|
|
17
|
+
import dev from './commands/dev/index.js';
|
|
21
18
|
import domainCommand from './commands/domain/index.js';
|
|
22
|
-
import
|
|
23
|
-
import logout from './commands/logout.js';
|
|
19
|
+
import init from './commands/init/index.js';
|
|
24
20
|
import lang from './commands/lang.js';
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
21
|
+
import login from './commands/login/index.js';
|
|
22
|
+
import logout from './commands/logout.js';
|
|
23
|
+
import routeCommand from './commands/route/index.js';
|
|
24
|
+
import routine from './commands/routine/index.js';
|
|
28
25
|
import site from './commands/site/index.js';
|
|
29
|
-
import
|
|
26
|
+
import t from './i18n/index.js';
|
|
27
|
+
import { handleCheckVersion, checkCLIVersion } from './utils/checkVersion.js';
|
|
28
|
+
import { getCliConfig } from './utils/fileUtils/index.js';
|
|
30
29
|
const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
31
30
|
const argv = hideBin(process.argv);
|
|
32
31
|
const cliConfig = getCliConfig();
|
|
@@ -39,7 +38,17 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
39
38
|
.locale((cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.lang) || 'en')
|
|
40
39
|
.version(false)
|
|
41
40
|
.wrap(null)
|
|
42
|
-
.help(
|
|
41
|
+
.help()
|
|
42
|
+
.middleware((argv) => __awaiter(void 0, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
// Pass current command (first positional) so version check can decide prompting behavior
|
|
45
|
+
yield checkCLIVersion((argv._ && argv._[0] ? String(argv._[0]) : ''));
|
|
46
|
+
}
|
|
47
|
+
catch (e) {
|
|
48
|
+
console.log(e);
|
|
49
|
+
console.log('error');
|
|
50
|
+
}
|
|
51
|
+
}))
|
|
43
52
|
.epilogue(`${t('main_epilogue').d('For more information, visit ESA')}: ${chalk.underline.blue('https://www.aliyun.com/product/esa')}`)
|
|
44
53
|
.options('version', {
|
|
45
54
|
describe: t('main_version_describe').d('Show version'),
|
|
@@ -51,11 +60,16 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
51
60
|
});
|
|
52
61
|
esa.command('*', false, () => { }, (args) => {
|
|
53
62
|
if (args._.length > 0) {
|
|
63
|
+
// Unknown command
|
|
64
|
+
console.error(t('common_sub_command_fail').d('Use esa <command> -h to see help'));
|
|
54
65
|
}
|
|
55
66
|
else {
|
|
56
67
|
if (args.v) {
|
|
57
68
|
handleCheckVersion();
|
|
58
69
|
}
|
|
70
|
+
else if (args.h || args.help) {
|
|
71
|
+
esa.showHelp('log');
|
|
72
|
+
}
|
|
59
73
|
else {
|
|
60
74
|
esa.showHelp('log');
|
|
61
75
|
}
|
|
@@ -74,13 +88,6 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
74
88
|
esa.command(logout);
|
|
75
89
|
esa.command(config);
|
|
76
90
|
esa.command(lang);
|
|
77
|
-
esa.command('t', false, () => { }, (args) => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
-
const res = yield quickDeployRoutine({
|
|
79
|
-
name: 'test',
|
|
80
|
-
code: 'test'
|
|
81
|
-
});
|
|
82
|
-
// console.log(res);
|
|
83
|
-
}));
|
|
84
91
|
esa.group(['help', 'version'], 'Options:');
|
|
85
92
|
esa.parse();
|
|
86
93
|
});
|
package/dist/libs/api.js
CHANGED
|
@@ -103,16 +103,13 @@ class Client {
|
|
|
103
103
|
getMatchSite(params) {
|
|
104
104
|
return this.callOpenApi('getMatchSite', params);
|
|
105
105
|
}
|
|
106
|
-
listRoutineCanaryAreas() {
|
|
107
|
-
return this.callApi(this.client.listRoutineCanaryAreasWithOptions.bind(this.client));
|
|
108
|
-
}
|
|
109
|
-
getRoutineUserInfo() {
|
|
110
|
-
return this.callApi(this.client.getRoutineUserInfoWithOptions.bind(this.client));
|
|
111
|
-
}
|
|
112
106
|
deleteRoutine(params) {
|
|
113
107
|
const request = new $ESA.DeleteRoutineRequest(params);
|
|
114
108
|
return this.callApi(this.client.deleteRoutineWithOptions.bind(this.client), request);
|
|
115
109
|
}
|
|
110
|
+
listUserRoutines(params) {
|
|
111
|
+
return this.callApi(this.client.listUserRoutinesWithOptions.bind(this.client), new $ESA.ListUserRoutinesRequest(params));
|
|
112
|
+
}
|
|
116
113
|
deleteRoutineCodeVersion(params) {
|
|
117
114
|
const request = new $ESA.DeleteRoutineCodeVersionRequest(params);
|
|
118
115
|
return this.callApi(this.client.deleteRoutineCodeVersionWithOptions.bind(this.client), request);
|
|
@@ -140,9 +137,6 @@ class Client {
|
|
|
140
137
|
const request = new $ESA.CreateRoutineRequest(params);
|
|
141
138
|
return this.callApi(this.client.createRoutineWithOptions.bind(this.client), request);
|
|
142
139
|
}
|
|
143
|
-
listRoutineOptionalSpecs() {
|
|
144
|
-
return this.callApi(this.client.listRoutineOptionalSpecsWithOptions.bind(this.client));
|
|
145
|
-
}
|
|
146
140
|
createRoutineRelatedRecord(params) {
|
|
147
141
|
const request = new $ESA.CreateRoutineRelatedRecordRequest(params);
|
|
148
142
|
return this.callApi(this.client.createRoutineRelatedRecordWithOptions.bind(this.client), request);
|
|
@@ -151,5 +145,34 @@ class Client {
|
|
|
151
145
|
const request = new $ESA.DeleteRoutineRelatedRecordRequest(params);
|
|
152
146
|
return this.callApi(this.client.deleteRoutineRelatedRecordWithOptions.bind(this.client), request);
|
|
153
147
|
}
|
|
148
|
+
createRoutineRoute(params) {
|
|
149
|
+
const request = new $ESA.CreateRoutineRouteRequest(params);
|
|
150
|
+
const newRequest = Object.assign(request, { mode: 'simple' });
|
|
151
|
+
return this.callApi(this.client.createRoutineRouteWithOptions.bind(this.client), newRequest);
|
|
152
|
+
}
|
|
153
|
+
deleteRoutineRoute(params) {
|
|
154
|
+
const request = new $ESA.DeleteRoutineRouteRequest(params);
|
|
155
|
+
return this.callApi(this.client.deleteRoutineRouteWithOptions.bind(this.client), request);
|
|
156
|
+
}
|
|
157
|
+
getRoutineRoute(params) {
|
|
158
|
+
const request = new $ESA.GetRoutineRouteRequest(params);
|
|
159
|
+
return this.callApi(this.client.getRoutineRouteWithOptions.bind(this.client), request);
|
|
160
|
+
}
|
|
161
|
+
listSiteRoutes(params) {
|
|
162
|
+
const request = new $ESA.ListSiteRoutesRequest(params);
|
|
163
|
+
return this.callApi(this.client.listSiteRoutes.bind(this.client), request);
|
|
164
|
+
}
|
|
165
|
+
listRoutineRoutes(params) {
|
|
166
|
+
const request = new $ESA.ListRoutineRoutesRequest(params);
|
|
167
|
+
return this.callApi(this.client.listRoutineRoutes.bind(this.client), request);
|
|
168
|
+
}
|
|
169
|
+
updateRoutineRoute(params) {
|
|
170
|
+
const request = new $ESA.UpdateRoutineRouteRequest(params);
|
|
171
|
+
return this.callApi(this.client.updateRoutineRoute.bind(this.client), request);
|
|
172
|
+
}
|
|
173
|
+
listRoutineCodeVersions(params) {
|
|
174
|
+
const request = new $ESA.ListRoutineCodeVersionsRequest(params);
|
|
175
|
+
return this.callApi(this.client.listRoutineCodeVersions.bind(this.client), request);
|
|
176
|
+
}
|
|
154
177
|
}
|
|
155
178
|
export default new Client();
|