esa-cli 0.0.2-beta.21 → 0.0.2-beta.23

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.
Files changed (43) hide show
  1. package/README.md +31 -149
  2. package/dist/commands/commit/index.js +7 -2
  3. package/dist/commands/common/constant.js +4 -4
  4. package/dist/commands/common/utils.js +89 -89
  5. package/dist/commands/config.js +1 -1
  6. package/dist/commands/deploy/index.js +3 -2
  7. package/dist/commands/deployments/delete.js +2 -2
  8. package/dist/commands/deployments/index.js +1 -1
  9. package/dist/commands/dev/ew2/devPack.js +9 -9
  10. package/dist/commands/dev/ew2/kvService.js +5 -1
  11. package/dist/commands/dev/ew2/mock/kv.js +1 -1
  12. package/dist/commands/dev/ew2/server.js +1 -2
  13. package/dist/commands/dev/index.js +3 -3
  14. package/dist/commands/dev/mockWorker/devPack.js +3 -3
  15. package/dist/commands/domain/add.js +2 -2
  16. package/dist/commands/domain/index.js +2 -2
  17. package/dist/commands/init/helper.js +7 -9
  18. package/dist/commands/init/template.jsonc +1 -1
  19. package/dist/commands/route/add.js +19 -52
  20. package/dist/commands/route/helper.js +9 -10
  21. package/dist/commands/route/index.js +2 -2
  22. package/dist/commands/routine/delete.js +7 -6
  23. package/dist/commands/routine/index.js +4 -3
  24. package/dist/commands/routine/list.js +40 -22
  25. package/dist/commands/site/index.js +1 -1
  26. package/dist/commands/utils.js +5 -5
  27. package/dist/components/filterSelector.js +1 -1
  28. package/dist/components/routeBuilder.js +68 -0
  29. package/dist/docs/Commands_en.md +110 -74
  30. package/dist/docs/Commands_zh_CN.md +110 -74
  31. package/dist/i18n/locales.json +94 -58
  32. package/dist/index.js +2 -2
  33. package/dist/libs/apiService.js +7 -6
  34. package/dist/libs/logger.js +7 -7
  35. package/dist/utils/checkDevPort.js +2 -2
  36. package/dist/utils/checkIsRoutineCreated.js +2 -2
  37. package/dist/utils/compress.js +5 -5
  38. package/dist/utils/download.js +3 -3
  39. package/dist/utils/fileUtils/index.js +69 -18
  40. package/dist/utils/installDeno.js +1 -1
  41. package/dist/utils/installEw2.js +2 -2
  42. package/package.json +3 -2
  43. package/zh_CN.md +28 -154
@@ -4,11 +4,11 @@
4
4
  "zh_CN": "提交代码,保存为一个版本"
5
5
  },
6
6
  "commit_er_not_exist": {
7
- "en": "No routine found, creating a new one",
7
+ "en": "No Functions& Pages found, creating a new one",
8
8
  "zh_CN": "没有找到任何函数,正在创建新函数"
9
9
  },
10
10
  "commit_er_description": {
11
- "en": "Enter a description for the routine",
11
+ "en": "Enter a description for Functions& Pages",
12
12
  "zh_CN": "请输入函数的描述"
13
13
  },
14
14
  "commit_version_description": {
@@ -20,8 +20,8 @@
20
20
  "zh_CN": "发生错误"
21
21
  },
22
22
  "commit_create_er_success": {
23
- "en": "Routine created successfully.",
24
- "zh_CN": "Routine 创建成功。"
23
+ "en": "Functions& Pages created successfully.",
24
+ "zh_CN": "函数和Pages创建成功。"
25
25
  },
26
26
  "commit_upload_success": {
27
27
  "en": "Code uploaded successfully.",
@@ -36,8 +36,8 @@
36
36
  "zh_CN": "提交代码时发生错误。"
37
37
  },
38
38
  "summery_cd": {
39
- "en": "Enter your routine project folder",
40
- "zh_CN": "进入您的 routine 项目文件夹"
39
+ "en": "Enter your project folder",
40
+ "zh_CN": "进入您的项目文件夹"
41
41
  },
42
42
  "summery_commit": {
43
43
  "en": "Save a new version of code",
@@ -76,8 +76,8 @@
76
76
  "zh_CN": "生产环境"
77
77
  },
78
78
  "deploy_description_routine": {
79
- "en": "Enter the description of the routine",
80
- "zh_CN": "请输入边缘函数的描述"
79
+ "en": "Enter the description of Functions& Pages",
80
+ "zh_CN": "请输入函数和Pages的描述"
81
81
  },
82
82
  "deploy_description_version": {
83
83
  "en": "Enter the description of the code version",
@@ -92,7 +92,7 @@
92
92
  "zh_CN": "请选择您要发布的版本"
93
93
  },
94
94
  "deploy_spec_select": {
95
- "en": "Please select the spec of the routine you want to create",
95
+ "en": "Please select the spec of Functions& Pages you want to create",
96
96
  "zh_CN": "请选择您要创建的函数规格"
97
97
  },
98
98
  "deploy_create_formal_version_ques": {
@@ -136,8 +136,8 @@
136
136
  "zh_CN": "显示帮助"
137
137
  },
138
138
  "commit_create_er_fail": {
139
- "en": "An error occurred while trying to create a routine",
140
- "zh_CN": "创建边缘函数时发生错误"
139
+ "en": "An error occurred while trying to create Functions& Pages",
140
+ "zh_CN": "创建函数和Pages时发生错误"
141
141
  },
142
142
  "commit_upload_fail": {
143
143
  "en": "An error occurred while trying to upload your code",
@@ -164,8 +164,8 @@
164
164
  "zh_CN": "帮助"
165
165
  },
166
166
  "common_sub_command_fail": {
167
- "en": "Use esa <command> -h to see help",
168
- "zh_CN": "使用 esa <command> -h 查看帮助"
167
+ "en": "Use esa-cli <command> -h to see help",
168
+ "zh_CN": "使用 esa-cli <command> -h 查看帮助"
169
169
  },
170
170
  "deployments_delete_describe": {
171
171
  "en": "Delete one or more deployment versions",
@@ -192,7 +192,7 @@
192
192
  "zh_CN": "构建完成"
193
193
  },
194
194
  "dev_describe": {
195
- "en": "Start a local server for developing your routine",
195
+ "en": "Start a local server for developing your project",
196
196
  "zh_CN": "启动本地调试"
197
197
  },
198
198
  "dev_port_describe": {
@@ -204,8 +204,8 @@
204
204
  "zh_CN": "读取 CLI 配置错误"
205
205
  },
206
206
  "dev_error_no_project_config": {
207
- "en": "Error reading project configuration esa.toml file.",
208
- "zh_CN": "读取项目配置 esa.toml 文件错误"
207
+ "en": "Error reading project configuration esa.jsonc (recommended) or esa.toml file.",
208
+ "zh_CN": "读取项目配置 esa.jsonc (推荐) 或 esa.toml 文件错误"
209
209
  },
210
210
  "dev_build_start": {
211
211
  "en": "Starting build process",
@@ -224,20 +224,20 @@
224
224
  "zh_CN": "Worker server 已重启"
225
225
  },
226
226
  "domain_add_describe": {
227
- "en": "Bind a domain to a routine",
228
- "zh_CN": "绑定域名到边缘函数"
227
+ "en": "Bind a domain to your project",
228
+ "zh_CN": "绑定域名到函数和Pages"
229
229
  },
230
230
  "domain_describe": {
231
- "en": "Manage the domain names bound to your routine",
232
- "zh_CN": "管理绑定到边缘函数的域名"
231
+ "en": "Manage the domain names bound to your project",
232
+ "zh_CN": "管理绑定到函数和Pages的域名"
233
233
  },
234
234
  "delete_describe": {
235
- "en": "Delete a routine",
236
- "zh_CN": "删除一个边缘函数"
235
+ "en": "Delete a project",
236
+ "zh_CN": "删除一个函数和Pages"
237
237
  },
238
238
  "delete_routineName_positional_describe": {
239
- "en": "The name of the routine to delete",
240
- "zh_CN": "要删除的边缘函数名称"
239
+ "en": "The name of the project to delete",
240
+ "zh_CN": "要删除的函数和Pages名称"
241
241
  },
242
242
  "delete_success": {
243
243
  "en": "Delete success!",
@@ -281,7 +281,7 @@
281
281
  },
282
282
  "init_input_name": {
283
283
  "en": "Enter the name of edgeRoutine:",
284
- "zh_CN": "输入 edgeRoutine 的名称"
284
+ "zh_CN": "输入项目的名称"
285
285
  },
286
286
  "init_skip_git": {
287
287
  "en": "Git installation was skipped.",
@@ -292,8 +292,8 @@
292
292
  "zh_CN": "切换为中文"
293
293
  },
294
294
  "list_describe": {
295
- "en": "List all your routines",
296
- "zh_CN": "查看所有边缘函数"
295
+ "en": "List all your projects",
296
+ "zh_CN": "查看所有函数和Pages"
297
297
  },
298
298
  "list_deployment_positional_describe": {
299
299
  "en": "(Optional) ID or URL of the deployment to tail. Specify by environment if deployment ID is unknown.",
@@ -308,8 +308,8 @@
308
308
  "zh_CN": "查看所有站点名称"
309
309
  },
310
310
  "list_routine_name_title": {
311
- "en": "List all of routine",
312
- "zh_CN": "查看所有边缘函数"
311
+ "en": "List all of Functions& Pages",
312
+ "zh_CN": "查看所有函数和Pages项目"
313
313
  },
314
314
  "login_describe": {
315
315
  "en": "Login to the server",
@@ -353,7 +353,7 @@
353
353
  },
354
354
  "route_add_describe": {
355
355
  "en": "Bind a Route to a routine",
356
- "zh_CN": "将路由绑定到边缘函数"
356
+ "zh_CN": "将路由绑定到函数和Pages"
357
357
  },
358
358
  "route_add_route_describe": {
359
359
  "en": "The name of route to add",
@@ -404,8 +404,8 @@
404
404
  "zh_CN": "路由删除失败!"
405
405
  },
406
406
  "route_describe": {
407
- "en": "Manage the routes bound to your routine",
408
- "zh_CN": "管理绑定到边缘函数的路由"
407
+ "en": "Manage the routes bound to your project",
408
+ "zh_CN": "管理绑定到函数和Pages的路由"
409
409
  },
410
410
  "route_list_describe": {
411
411
  "en": "List all related routes",
@@ -468,8 +468,8 @@
468
468
  "zh_CN": "用这个命令登录:${namedCommand}"
469
469
  },
470
470
  "routine_describe": {
471
- "en": "Manage your routine",
472
- "zh_CN": "管理边缘函数"
471
+ "en": "Manage your project",
472
+ "zh_CN": "管理函数和Pages"
473
473
  },
474
474
  "route_input": {
475
475
  "en": "Enter a Route:",
@@ -484,8 +484,8 @@
484
484
  "zh_CN": "我们的Runtime还不支持此操作系统,我们暂时使用Deno作为本地开发runtime,需要先安装。"
485
485
  },
486
486
  "install_runtime_tip": {
487
- "en": "🔔 Runtime must be installed to use esa dev. Installing...",
488
- "zh_CN": "必须安装Runtime才能使用 esa dev。正在安装..."
487
+ "en": "🔔 Runtime must be installed to use esa-cli dev. Installing...",
488
+ "zh_CN": "必须安装Runtime才能使用 esa-cli dev。正在安装..."
489
489
  },
490
490
  "install_runtime_success": {
491
491
  "en": "Runtime installed.",
@@ -505,7 +505,7 @@
505
505
  },
506
506
  "deploy_first_time": {
507
507
  "en": "This is first time to deploy. Let's create a version first!",
508
- "zh_CN": "这是您第一次部署此边缘函数,请先创建一个版本"
508
+ "zh_CN": "这是您第一次部署此函数和Pages,请先创建一个版本"
509
509
  },
510
510
  "deploy_select_version": {
511
511
  "en": "Select which version you'd like to deploy",
@@ -572,11 +572,11 @@
572
572
  "zh_CN": "上传前压缩代码"
573
573
  },
574
574
  "commit_option_description": {
575
- "en": "Description for the routine/version (skip interactive input)",
575
+ "en": "Description for Functions& Pages/version (skip interactive input)",
576
576
  "zh_CN": "函数/版本的描述(跳过交互式输入)"
577
577
  },
578
578
  "dev_entry_describe": {
579
- "en": "Entry file of the Routine",
579
+ "en": "Entry file of Functions& Pages",
580
580
  "zh_CN": "入口文件路径"
581
581
  },
582
582
  "dev_option_minify": {
@@ -732,7 +732,7 @@
732
732
  "zh_CN": " 版本ID 版本描述"
733
733
  },
734
734
  "commit_er_exist": {
735
- "en": "Routine exists, updating the code",
735
+ "en": "Functions& Pages exists, updating the code",
736
736
  "zh_CN": "边缘函数已存在,已更新代码"
737
737
  },
738
738
  "domain_add_invalid_name": {
@@ -792,7 +792,7 @@
792
792
  "zh_CN": "您想要部署您的项目吗?"
793
793
  },
794
794
  "first_deploy": {
795
- "en": "This is the first time to deploy, we will create a new routine for you.",
795
+ "en": "This is the first time to deploy, we will create a new project for you.",
796
796
  "zh_CN": "这是第一次部署,我们将为您创建一个新的函数。"
797
797
  },
798
798
  "no_formal_version_found": {
@@ -809,7 +809,7 @@
809
809
  },
810
810
  "routine_not_exist": {
811
811
  "en": "Routine does not exist, please create a new one. Run command:",
812
- "zh_CN": "函数不存在,请创建一个新函数。运行命令:"
812
+ "zh_CN": "函数和Pages不存在,请创建一个新函数和Pages项目。运行命令:"
813
813
  },
814
814
  "dev_input_inspect_tip1": {
815
815
  "en": "👉 Please visit ${inspectLink} in the Chrome browser",
@@ -824,7 +824,7 @@
824
824
  "zh_CN": "域名生效可能需要一段时间,请稍后再试。"
825
825
  },
826
826
  "deploy_quick_describe": {
827
- "en": "Quick deploy the routine to production environment",
827
+ "en": "Quick deploy Functions& Pages to production environment",
828
828
  "zh_CN": "快速部署到生产环境"
829
829
  },
830
830
  "deploy_option_version": {
@@ -968,8 +968,8 @@
968
968
  "zh_CN": "输出debug日志"
969
969
  },
970
970
  "install_runtime_update_tip": {
971
- "en": "🔔 Runtime must be update to use esa dev. Installing...",
972
- "zh_CN": "必须更新Runtime才能使用 esa dev。正在安装..."
971
+ "en": "🔔 Runtime must be update to use esa-cli dev. Installing...",
972
+ "zh_CN": "必须更新Runtime才能使用 esa-cli dev。正在安装..."
973
973
  },
974
974
  "dev_ip_not_allowed": {
975
975
  "en": "Direct access to IP addresses is not allowed when setting local-upstream: ${url}",
@@ -1012,12 +1012,12 @@
1012
1012
  "zh_CN": "用户取消了操作。"
1013
1013
  },
1014
1014
  "routine_create_success": {
1015
- "en": "Routine created successfully.",
1016
- "zh_CN": "边缘函数创建成功"
1015
+ "en": "Project created successfully.",
1016
+ "zh_CN": "函数和Pages创建成功"
1017
1017
  },
1018
1018
  "routine_create_fail": {
1019
- "en": "Routine created failed.",
1020
- "zh_CN": "边缘函数创建失败"
1019
+ "en": "Project created failed.",
1020
+ "zh_CN": "函数和Pages创建失败"
1021
1021
  },
1022
1022
  "create_route_route": {
1023
1023
  "en": "Enter a Route (e.g., example.com/*):",
@@ -1108,27 +1108,27 @@
1108
1108
  "zh_CN": "站点 \"${siteName}\" 未找到"
1109
1109
  },
1110
1110
  "commit_assets_exist": {
1111
- "en": "This is a routine with assets project",
1112
- "zh_CN": "这是一个带静态资源的边缘函数项目"
1111
+ "en": "This is a Functions& Pages with assets project",
1112
+ "zh_CN": "这是一个带静态资源的函数和Pages项目"
1113
1113
  },
1114
1114
  "commit_routine_with_assets_success": {
1115
- "en": "Routine with assets code version committed successfully.",
1116
- "zh_CN": "带静态资源的边缘函数代码版本提交成功。"
1115
+ "en": "Functions& Pages with assets code version committed successfully.",
1116
+ "zh_CN": "带静态资源的函数和Pages代码版本提交成功。"
1117
1117
  },
1118
1118
  "commit_routine_with_assets_fail": {
1119
- "en": "An error occurred while trying to commit your routine with assets.",
1120
- "zh_CN": "提交带静态资源的边缘函数时发生错误。"
1119
+ "en": "An error occurred while trying to commit your Functions& Pages with assets.",
1120
+ "zh_CN": "提交带静态资源的函数和Pages时发生错误。"
1121
1121
  },
1122
1122
  "commit_option_assets": {
1123
1123
  "en": "Assets directory",
1124
1124
  "zh_CN": "静态资源目录"
1125
1125
  },
1126
1126
  "commit_option_name": {
1127
- "en": "Edge Routine name",
1127
+ "en": "Functions& Pages name",
1128
1128
  "zh_CN": "边缘函数名称"
1129
1129
  },
1130
1130
  "deploy_option_name": {
1131
- "en": "Name of the routine",
1131
+ "en": "Name of Functions& Pages",
1132
1132
  "zh_CN": "边缘函数名称"
1133
1133
  },
1134
1134
  "deploy_option_assets": {
@@ -1271,8 +1271,44 @@
1271
1271
  "en": "Global update failed. You may need elevated permissions (sudo) or use yarn/pnpm:",
1272
1272
  "zh_CN": "全局更新失败。你可能需要更高权限(sudo)或使用 yarn/pnpm:"
1273
1273
  },
1274
+ "deploy_option_keyword": {
1275
+ "en": "Keyword to search for projects",
1276
+ "zh_CN": ""
1277
+ },
1278
+ "route_input_method": {
1279
+ "en": "How would you like to input the route?",
1280
+ "zh_CN": "您希望如何输入路由?"
1281
+ },
1282
+ "route_input_builder": {
1283
+ "en": "Use route builder (prefix + suffix)",
1284
+ "zh_CN": "使用路由构建器(前缀 + 后缀)"
1285
+ },
1286
+ "route_input_manual": {
1287
+ "en": "Enter route manually",
1288
+ "zh_CN": "手动输入路由"
1289
+ },
1290
+ "route_build_cancelled": {
1291
+ "en": "Route building cancelled",
1292
+ "zh_CN": "路由构建已取消"
1293
+ },
1294
+ "route_builder_prefix_prompt": {
1295
+ "en": "Enter route prefix for ${siteName} (e.g., api, v1):",
1296
+ "zh_CN": "为 ${siteName} 输入路由前缀(例如:api, v1):"
1297
+ },
1298
+ "route_builder_suffix_prompt": {
1299
+ "en": "Enter route suffix for ${siteName} (e.g., *, users/*):",
1300
+ "zh_CN": "为 ${siteName} 输入路由后缀(例如:*, users/*):"
1301
+ },
1302
+ "route_builder_preview": {
1303
+ "en": "Preview: ${siteName}${prefix}${suffix}",
1304
+ "zh_CN": "预览:{route}"
1305
+ },
1306
+ "route_builder_instructions": {
1307
+ "en": "Press Enter to continue, Ctrl+C to cancel",
1308
+ "zh_CN": "按回车键继续,Ctrl+C 取消"
1309
+ },
1274
1310
  "kv_parse_failed": {
1275
1311
  "en": "kv.json parse failed, use empty local kv store.",
1276
- "zh_CN": ""
1312
+ "zh_CN": "kv.json 解析失败,使用空本地 kv 存储。"
1277
1313
  }
1278
1314
  }
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
34
34
  .fail((msg, err) => {
35
35
  console.error(msg, err);
36
36
  })
37
- .scriptName('esa')
37
+ .scriptName('esa-cli')
38
38
  .locale((cliConfig === null || cliConfig === void 0 ? void 0 : cliConfig.lang) || 'en')
39
39
  .version(false)
40
40
  .wrap(null)
@@ -61,7 +61,7 @@ const main = () => __awaiter(void 0, void 0, void 0, function* () {
61
61
  esa.command('*', false, () => { }, (args) => {
62
62
  if (args._.length > 0) {
63
63
  // Unknown command
64
- console.error(t('common_sub_command_fail').d('Use esa <command> -h to see help'));
64
+ console.error(t('common_sub_command_fail').d('Use esa-cli <command> -h to see help'));
65
65
  }
66
66
  else {
67
67
  if (args.v) {
@@ -90,7 +90,6 @@ export class ApiService {
90
90
  }
91
91
  }
92
92
  catch (error) {
93
- console.log('error', error);
94
93
  return {
95
94
  success: false,
96
95
  message: t('login_failed').d('An error occurred while trying to log in.')
@@ -101,15 +100,15 @@ export class ApiService {
101
100
  quickDeployRoutine(edgeRoutine) {
102
101
  return __awaiter(this, void 0, void 0, function* () {
103
102
  try {
104
- // 上传代码到unstable版本
103
+ // Upload code to unstable version
105
104
  const stagingRes = yield this.getRoutineStagingCodeUploadInfo(edgeRoutine);
106
105
  if (stagingRes) {
107
- // 生产版本
106
+ // Production version
108
107
  const commitRes = yield this.commitRoutineStagingCode({
109
108
  Name: edgeRoutine.name,
110
109
  CodeDescription: edgeRoutine.description
111
110
  });
112
- // 发布到生产环境
111
+ // Deploy to production environment
113
112
  if (commitRes) {
114
113
  const deployRes = yield this.publishRoutineCodeVersion({
115
114
  Name: edgeRoutine.name,
@@ -219,7 +218,7 @@ export class ApiService {
219
218
  return null;
220
219
  });
221
220
  }
222
- listUserRoutines() {
221
+ listUserRoutines(requestParams) {
223
222
  return __awaiter(this, void 0, void 0, function* () {
224
223
  try {
225
224
  let params = {
@@ -236,7 +235,9 @@ export class ApiService {
236
235
  return this;
237
236
  }
238
237
  };
239
- let request = new $OpenApi.OpenApiRequest();
238
+ let request = new $OpenApi.OpenApiRequest({
239
+ query: requestParams || {}
240
+ });
240
241
  let runtime = {
241
242
  toMap: function () {
242
243
  return this;
@@ -179,8 +179,8 @@ class Logger {
179
179
  this.error('Missing ESA project configuration (esa.jsonc or esa.toml)');
180
180
  this.block();
181
181
  this.log('If there is code to deploy, you can either:');
182
- this.subLog(`- Specify an entry-point to your Routine via the command line (ex: ${chalk.green('esa deploy src/index.ts')})`);
183
- this.subLog('- Or add the following to your "esa.jsonc" file:');
182
+ this.subLog(`- Specify an entry-point to your Routine via the command line (ex: ${chalk.green('esa-cli deploy src/index.ts')})`);
183
+ this.subLog('- Or create an "esa.jsonc" file (recommended):');
184
184
  console.log('```jsonc\n' +
185
185
  '{\n' +
186
186
  ' "name": "my-routine",\n' +
@@ -188,7 +188,7 @@ class Logger {
188
188
  ' "dev": { "port": 18080 }\n' +
189
189
  '}\n' +
190
190
  '```');
191
- this.subLog('- Or, if you prefer TOML, add to your "esa.toml":');
191
+ this.subLog('- Or, if you prefer TOML, create an "esa.toml" file:');
192
192
  console.log('```toml\n' +
193
193
  'name = "my-routine"\n' +
194
194
  'entry = "src/index.ts"\n' +
@@ -197,7 +197,7 @@ class Logger {
197
197
  'port = 18080\n' +
198
198
  '```\n');
199
199
  this.log('If you are deploying a directory of static assets, you can either:');
200
- this.subLog(`- Add the assets directory to your "esa.jsonc" and run ${chalk.green('esa deploy -a ./dist')}`);
200
+ this.subLog(`- Create an "esa.jsonc" file (recommended) and run ${chalk.green('esa-cli deploy -a ./dist')}`);
201
201
  console.log('```jsonc\n' +
202
202
  '{\n' +
203
203
  ' "name": "my-routine",\n' +
@@ -206,7 +206,7 @@ class Logger {
206
206
  ' }\n' +
207
207
  '}\n' +
208
208
  '```');
209
- this.subLog(`- Or add to your "esa.toml" and run ${chalk.green('esa deploy -a ./dist')}`);
209
+ this.subLog(`- Or create an "esa.toml" file and run ${chalk.green('esa-cli deploy -a ./dist')}`);
210
210
  console.log('```toml\n' +
211
211
  'name = "my-routine"\n' +
212
212
  '\n' +
@@ -214,14 +214,14 @@ class Logger {
214
214
  'directory = "./dist"\n' +
215
215
  '```\n');
216
216
  this.log('Alternatively, initialize a new ESA project:');
217
- this.log(chalk.green('$ esa init my-routine'));
217
+ this.log(chalk.green('$ esa-cli init my-project'));
218
218
  this.block();
219
219
  }
220
220
  pathEacces(localPath) {
221
221
  this.block();
222
222
  this.log(chalk.yellow(t('common_eacces_intro', { localPath }).d(`You do not have permission to ${localPath}, please use`)));
223
223
  this.block();
224
- this.log(chalk.green(`$ ${chalk.red('sudo')} esa <Command>`));
224
+ this.log(chalk.green(`$ ${chalk.red('sudo')} esa-cli <Command>`));
225
225
  this.block();
226
226
  this.subLog(chalk.yellow('OR'));
227
227
  this.block();
@@ -62,7 +62,7 @@ const checkAndInputPort = (port, inspectPort) => __awaiter(void 0, void 0, void
62
62
  }
63
63
  }
64
64
  catch (_) {
65
- const option = chalk.green('esa dev --port <port>');
65
+ const option = chalk.green('esa-cli dev --port <port>');
66
66
  logger.log(t('dev_port_used_advice', { option }).d(`You can use ${option} to specify another port.`));
67
67
  throw new Error('Specified port already in use.');
68
68
  }
@@ -88,7 +88,7 @@ const checkAndInputPort = (port, inspectPort) => __awaiter(void 0, void 0, void
88
88
  ])).port;
89
89
  }
90
90
  catch (_) {
91
- const option = chalk.green('esa dev --inspect-port <port>');
91
+ const option = chalk.green('esa-cli dev --inspect-port <port>');
92
92
  logger.log(t('dev_port_used_advice', { option }).d(`You can use ${option} to specify another port.`));
93
93
  throw new Error('Inspect port already in use.');
94
94
  }
@@ -25,8 +25,8 @@ export function validRoutine(name) {
25
25
  return __awaiter(this, void 0, void 0, function* () {
26
26
  const isCreatedRoutine = yield isRoutineExist(name);
27
27
  if (!isCreatedRoutine) {
28
- logger.warn(`${t('routine_not_exist').d('Routine does not exist, please create a new one. Run command:')} ${chalk.greenBright('esa deploy')}`);
29
- exit(0);
28
+ logger.warn(`${t('routine_not_exist').d('Routine does not exist, please create a new one. Run command:')} ${chalk.greenBright('esa-cli deploy')}`);
29
+ exit(1);
30
30
  }
31
31
  });
32
32
  }
@@ -43,10 +43,10 @@ const compress = (scriptEntry_1, assetsDir_1, ...args_1) => __awaiter(void 0, [s
43
43
  let assetsDirectory = assetsDir || ((_a = projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.assets) === null || _a === void 0 ? void 0 : _a.directory);
44
44
  const routineType = checkEdgeRoutineType(scriptEntry, assetsDir, projectPath);
45
45
  if (!projectConfig && !scriptEntry && !assetsDir) {
46
- logger.error('esa.jsonc or esa.toml is not found and script entry or assets directory is not provided by command line');
47
- exit(0);
46
+ logger.error('esa.jsonc (recommended) or esa.toml is not found and script entry or assets directory is not provided by command line');
47
+ exit(1);
48
48
  }
49
- // 参数优先:如果有参数则使用参数,否则使用配置文件中的值
49
+ // Parameter priority: use parameters if available, otherwise use values from config file
50
50
  const entry = scriptEntry || (projectConfig === null || projectConfig === void 0 ? void 0 : projectConfig.entry);
51
51
  if (routineType === EDGE_ROUTINE_TYPE.NOT_EXIST) {
52
52
  const errorMessage = [
@@ -61,7 +61,7 @@ const compress = (scriptEntry_1, assetsDir_1, ...args_1) => __awaiter(void 0, [s
61
61
  chalk.cyan('🔍 Possible issue causes:'),
62
62
  chalk.white(' 1. Entry file path is incorrect or file does not exist'),
63
63
  chalk.white(' 2. Assets directory path is incorrect or directory does not exist'),
64
- chalk.white(` 3. Project configuration file ${chalk.yellow('esa.jsonc')} or ${chalk.yellow('esa.toml')} format error`),
64
+ chalk.white(` 3. Project configuration file ${chalk.yellow('esa.jsonc')} (recommended) or ${chalk.yellow('esa.toml')} format error`),
65
65
  chalk.white(` 4. Relative path format error, please use ${chalk.yellow('./xxx')} format`),
66
66
  '',
67
67
  chalk.yellow.bold(`📍 Please check if the following ${chalk.red('absolute paths')} are correct:`),
@@ -83,7 +83,7 @@ const compress = (scriptEntry_1, assetsDir_1, ...args_1) => __awaiter(void 0, [s
83
83
  ''
84
84
  ].join('\n');
85
85
  logger.error(errorMessage);
86
- exit(0);
86
+ exit(1);
87
87
  }
88
88
  if (routineType === EDGE_ROUTINE_TYPE.JS_ONLY ||
89
89
  routineType === EDGE_ROUTINE_TYPE.JS_AND_ASSETS) {
@@ -92,8 +92,8 @@ function isBinDirInPath(binDir) {
92
92
  */
93
93
  function addBinDirToPath(binDir) {
94
94
  return __awaiter(this, void 0, void 0, function* () {
95
- // 使用 setx 添加到 PATH
96
- // setx PATH 的长度有2047字符的限制
95
+ // Use setx to add to PATH
96
+ // setx has a 2047 character limit for PATH
97
97
  const command = `setx Path "%Path%;${binDir}"`;
98
98
  try {
99
99
  yield execAsync(command);
@@ -169,7 +169,7 @@ export function downloadRuntimeAndUnzipForWindows() {
169
169
  }
170
170
  logger.success(t('deno_install_success').d('Runtime install success!'));
171
171
  logger.block();
172
- const dev = chalk.green('esa dev');
172
+ const dev = chalk.green('esa-cli dev');
173
173
  logger.log(t('deno_install_success_tips', { dev }).d(`Please run ${dev} again`));
174
174
  }
175
175
  catch (error) {