@nocobase/cli 2.2.0-alpha.1 → 2.2.0-alpha.10

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 (78) hide show
  1. package/assets/env-proxy/nginx/snippets/proxy-location.conf +1 -0
  2. package/assets/env-proxy/nginx/snippets/uploads-location.conf +4 -1
  3. package/bin/early-locale.js +89 -0
  4. package/bin/node-version.js +35 -0
  5. package/bin/run.js +9 -0
  6. package/bin/windows-admin.js +60 -0
  7. package/dist/commands/app/destroy.js +4 -3
  8. package/dist/commands/app/restart.js +38 -0
  9. package/dist/commands/app/shared.js +49 -3
  10. package/dist/commands/app/start.js +95 -0
  11. package/dist/commands/app/upgrade.js +11 -0
  12. package/dist/commands/config/set.js +1 -0
  13. package/dist/commands/env/info.js +11 -1
  14. package/dist/commands/examples/prompts-stages.js +2 -2
  15. package/dist/commands/examples/prompts-test.js +2 -2
  16. package/dist/commands/init.js +152 -14
  17. package/dist/commands/install.js +256 -109
  18. package/dist/commands/license/activate.js +4 -1
  19. package/dist/commands/license/shared.js +24 -15
  20. package/dist/commands/portal/config.js +88 -0
  21. package/dist/commands/portal/create.js +104 -0
  22. package/dist/commands/portal/deploy.js +81 -0
  23. package/dist/commands/portal/destroy.js +104 -0
  24. package/dist/commands/portal/dev.js +71 -0
  25. package/dist/commands/portal/index.js +20 -0
  26. package/dist/commands/portal/info.js +82 -0
  27. package/dist/commands/portal/list.js +98 -0
  28. package/dist/commands/portal/pull.js +84 -0
  29. package/dist/commands/portal/push.js +79 -0
  30. package/dist/commands/proxy/caddy/generate.js +93 -7
  31. package/dist/commands/proxy/nginx/generate.js +98 -7
  32. package/dist/commands/revision/create.js +1 -1
  33. package/dist/commands/self/check.js +1 -1
  34. package/dist/commands/self/update.js +4 -4
  35. package/dist/commands/skills/check.js +4 -5
  36. package/dist/commands/skills/install.js +18 -1
  37. package/dist/commands/skills/update.js +19 -4
  38. package/dist/commands/source/dev.js +10 -6
  39. package/dist/commands/source/download.js +85 -16
  40. package/dist/lib/api-command-compat.js +51 -8
  41. package/dist/lib/app-managed-resources.js +104 -5
  42. package/dist/lib/auth-store.js +105 -13
  43. package/dist/lib/cli-config.js +93 -2
  44. package/dist/lib/docker-image.js +94 -6
  45. package/dist/lib/env-auth.js +291 -45
  46. package/dist/lib/env-config.js +14 -0
  47. package/dist/lib/env-proxy-config.js +48 -0
  48. package/dist/lib/env-proxy.js +266 -61
  49. package/dist/lib/hook-script.js +160 -0
  50. package/dist/lib/managed-init-env.js +6 -1
  51. package/dist/lib/portal-command-env.js +31 -0
  52. package/dist/lib/portal-config.js +133 -0
  53. package/dist/lib/portal-configure.js +117 -0
  54. package/dist/lib/portal-create.js +433 -0
  55. package/dist/lib/portal-deploy.js +283 -0
  56. package/dist/lib/portal-destroy.js +100 -0
  57. package/dist/lib/portal-dev.js +79 -0
  58. package/dist/lib/portal-env-files.js +53 -0
  59. package/dist/lib/portal-info.js +31 -0
  60. package/dist/lib/portal-list.js +211 -0
  61. package/dist/lib/portal-source.js +523 -0
  62. package/dist/lib/prompt-catalog-terminal.js +32 -19
  63. package/dist/lib/prompt-validators.js +1 -1
  64. package/dist/lib/prompt-web-ui.js +20 -13
  65. package/dist/lib/proxy-caddy.js +77 -9
  66. package/dist/lib/proxy-nginx.js +71 -11
  67. package/dist/lib/run-npm.js +21 -16
  68. package/dist/lib/self-manager.js +254 -46
  69. package/dist/lib/skills-manager.js +116 -23
  70. package/dist/lib/source-publish.js +2 -2
  71. package/dist/lib/startup-update.js +1 -1
  72. package/dist/lib/ui.js +28 -1
  73. package/dist/locale/en-US.json +227 -43
  74. package/dist/locale/zh-CN.json +227 -43
  75. package/package.json +11 -2
  76. package/scripts/build.mjs +0 -34
  77. package/scripts/clean.mjs +0 -9
  78. package/tsconfig.json +0 -19
@@ -1,4 +1,10 @@
1
1
  {
2
+ "entry": {
3
+ "windowsAdministratorRequired": {
4
+ "message": "Windows 上运行 NocoBase CLI 必须使用管理员模式。",
5
+ "hint": "请以管理员身份打开终端,然后重新执行命令。"
6
+ }
7
+ },
2
8
  "promptCatalog": {
3
9
  "common": {
4
10
  "cancelled": "已取消。",
@@ -62,7 +68,7 @@
62
68
  "unreachable": "无法连接到该 API 地址,请检查地址是否正确,并确认服务可访问。详情:{{details}}"
63
69
  },
64
70
  "envKey": {
65
- "invalid": "仅支持字母和数字。"
71
+ "invalid": "仅支持字母、数字、中划线和下划线。"
66
72
  },
67
73
  "appPublicPath": {
68
74
  "invalid": "请输入 /,或类似 /nocobase/、/foo-bar/baz_2/ 这样的路径。每个路径段仅支持字母、数字、中划线和下划线。"
@@ -87,20 +93,20 @@
87
93
  "envAdd": {
88
94
  "prompts": {
89
95
  "name": {
90
- "message": "你想如何命名这个环境?",
96
+ "message": "应用环境标识",
91
97
  "placeholder": "default"
92
98
  },
93
99
  "scope": {
94
- "message": "这个连接要保存到哪里?",
100
+ "message": "连接保存位置",
95
101
  "globalLabel": "全局",
96
102
  "globalHint": "保存在用户级配置中"
97
103
  },
98
104
  "apiBaseUrl": {
99
- "message": "API 基础地址是什么?",
105
+ "message": "API 基础地址",
100
106
  "placeholder": "https://demo.example.com/api 或 https://demo.example.com/api/__app/<subapp>"
101
107
  },
102
108
  "authType": {
103
- "message": "你想使用哪种认证方式?",
109
+ "message": "认证方式",
104
110
  "basicLabel": "Basic 认证(用户名 + 密码)",
105
111
  "basicHint": "保存后会用用户名和密码换取 Token",
106
112
  "oauthLabel": "OAuth(浏览器认证)",
@@ -108,14 +114,14 @@
108
114
  "tokenLabel": "API Token / API Key"
109
115
  },
110
116
  "username": {
111
- "message": "请输入 Basic 登录用户名",
117
+ "message": "Basic 登录用户名",
112
118
  "placeholder": "admin"
113
119
  },
114
120
  "password": {
115
- "message": "请输入 Basic 登录密码"
121
+ "message": "Basic 登录密码"
116
122
  },
117
123
  "accessToken": {
118
- "message": "请输入 API Token 或 API Key",
124
+ "message": "API Token 或 API Key",
119
125
  "placeholder": "请输入你的 API Token / API Key"
120
126
  }
121
127
  }
@@ -162,6 +168,150 @@
162
168
  "refusal": "拒绝对 env \"{{requestedEnv}}\" 执行该命令,因为当前 env 是 \"{{currentEnv}}\",且当前 agent 会话无法进行交互确认。\n\n出于安全考虑,agent 不会自动切换 env,也不会替你自动补上 --yes。\n\n如果要继续:\n- 请先自行执行 `nb env use {{requestedEnv}}`,然后重新运行该命令,或\n- 使用相同命令并追加 `--env {{requestedEnv}} --yes`,以确认这是一次性的跨 env 操作。"
163
169
  }
164
170
  },
171
+ "portalCreate": {
172
+ "errors": {
173
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
174
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
175
+ "templateInvalidDirectory": "Portal 模板 \"{{source}}\" 无效:需要是一个目录。",
176
+ "localTemplateMissing": "Portal 模板目录不存在:{{source}}",
177
+ "templateUnresolved": "无法解析 Portal 模板 \"{{source}}\"。{{details}}",
178
+ "templateDownloadFailed": "无法通过 npm pack 下载 Portal 模板 \"{{source}}\"。{{details}}",
179
+ "templateExtractFailed": "解压 Portal 模板 \"{{source}}\" 失败:{{details}}",
180
+ "templateMissingPackageJson": "Portal 模板 \"{{source}}\" 无效:缺少 package.json。",
181
+ "npmPackNoTarball": "npm pack 没有为 {{source}} 生成本地 tarball。",
182
+ "npmPackMultipleTarballs": "npm pack 为 {{source}} 生成了多个 tarball。",
183
+ "invalidPortalName": "Portal 名称 \"{{value}}\" 无效。请使用小写字母、数字、下划线或连字符,并以小写字母或数字开头。",
184
+ "invalidPortalAppName": "从 apiBaseUrl 解析出的 Portal app 名称 \"{{value}}\" 无效。请使用字母、数字、下划线或连字符,并以字母或数字开头。",
185
+ "missingApiBaseUrl": "无法创建 Portal,因为当前 env 没有 apiBaseUrl。",
186
+ "outsideParent": "拒绝修改 {{parentDir}} 之外的 Portal:{{portalDir}}",
187
+ "sshUnsupported": "第一版暂不支持为 ssh env 创建 Portal。",
188
+ "workspaceExists": "Portal 已存在:{{portalDir}}\n如需删除并重新创建,请追加 --force。"
189
+ },
190
+ "messages": {
191
+ "skipInstall": "未找到 {{portalDir}}/package.json,已跳过 pnpm install。",
192
+ "created": "Portal \"{{portal}}\" 已创建:{{portalDir}}。",
193
+ "app": "App:{{app}}",
194
+ "base": "Base:{{base}}",
195
+ "sourceStorage": "源码存储:{{sourceStorage}}"
196
+ }
197
+ },
198
+ "portalConfig": {
199
+ "errors": {
200
+ "invalidSourceStorage": "源码存储 \"{{value}}\" 无效。请使用 \"nocobase\" 或 \"git\"。",
201
+ "invalidGitPath": "--git-path 必须是 Git 仓库内的相对路径。",
202
+ "gitOptionsForNocobaseStorage": "--git-repo、--git-branch 和 --git-path 只能与 --source-storage git 一起使用。",
203
+ "gitRepoRequired": "--source-storage 为 git 时必须提供 --git-repo。",
204
+ "gitRepoInvalid": "--git-repo 必须是完整的 Git remote URL。",
205
+ "updateFailed": "Portal 配置更新失败,状态码 {{status}}\n{{details}}"
206
+ }
207
+ },
208
+ "portalConfigure": {
209
+ "errors": {
210
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
211
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
212
+ "noChanges": "没有提供 Portal 配置变更。请传入 --source-storage 或 --git-* 参数。",
213
+ "workspaceMissing": "Portal 不存在:{{portalDir}}\n请先运行 `nb portal create {{portal}}` 或 `nb portal pull {{portal}}`。"
214
+ },
215
+ "messages": {
216
+ "updated": "Portal \"{{portal}}\" 配置已更新:{{portalDir}}/portal.config.json。",
217
+ "remoteSynced": "远端 Portal 记录:已同步",
218
+ "remoteSkipped": "远端 Portal 记录:未找到,仅更新本地配置"
219
+ }
220
+ },
221
+ "portalDeploy": {
222
+ "errors": {
223
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
224
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
225
+ "workspaceMissing": "Portal 不存在:{{portalDir}}\n请先运行 `nb portal create {{portal}}`。",
226
+ "packageJsonMissing": "Portal 无效:{{portalDir}} 中缺少 package.json。",
227
+ "distMissing": "Portal build 没有生成 {{distDir}}/index.html。",
228
+ "unsupportedEnvKind": "第一版暂不支持为 {{kind}} env 部署 Portal。",
229
+ "uploadFailed": "Portal dist 上传失败,状态码 {{status}}\n{{details}}",
230
+ "recordSyncFailed": "Portal 记录同步失败,状态码 {{status}}\n{{details}}"
231
+ },
232
+ "messages": {
233
+ "deployed": "Portal \"{{portal}}\" 已部署。",
234
+ "mode": "Mode:{{mode}}",
235
+ "app": "App:{{app}}",
236
+ "base": "Base:{{base}}",
237
+ "record": "记录:已同步",
238
+ "dist": "Dist:{{dist}}",
239
+ "localDist": "本地 dist:{{dist}}",
240
+ "serverDist": "服务端 dist:{{dist}}"
241
+ }
242
+ },
243
+ "portalList": {
244
+ "errors": {
245
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
246
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
247
+ "unsupportedEnvKind": "第一版暂不支持为 {{kind}} env 列出 Portal。",
248
+ "listFailed": "Portal 列表获取失败,状态码 {{status}}\n{{details}}"
249
+ },
250
+ "messages": {
251
+ "empty": "没有找到 Portal 记录。"
252
+ },
253
+ "table": {
254
+ "name": "名称",
255
+ "url": "访问 URL",
256
+ "portalType": "Portal 类型",
257
+ "path": "本地路径",
258
+ "enabled": "启用",
259
+ "localSynced": "本地已同步"
260
+ }
261
+ },
262
+ "portalInfo": {
263
+ "errors": {
264
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
265
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
266
+ "notFound": "Portal \"{{portal}}\" 不存在。"
267
+ },
268
+ "fields": {
269
+ "name": "名称",
270
+ "url": "访问 URL",
271
+ "portalType": "Portal 类型",
272
+ "path": "本地路径",
273
+ "enabled": "启用",
274
+ "localSynced": "本地已同步"
275
+ }
276
+ },
277
+ "portalDestroy": {
278
+ "errors": {
279
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
280
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
281
+ "confirmationRequired": "非交互模式下拒绝删除 Portal。请追加 --yes 后重试。",
282
+ "outsideParent": "拒绝删除 {{parentDir}} 之外的 Portal:{{portalDir}}",
283
+ "workspaceMissing": "Portal 不存在:{{portalDir}}\n如需忽略本地文件缺失,请追加 --force。",
284
+ "unsupportedEnvKind": "第一版暂不支持为 {{kind}} env 删除 Portal。",
285
+ "recordDestroyFailed": "Portal 记录删除失败,状态码 {{status}}\n{{details}}"
286
+ },
287
+ "prompts": {
288
+ "confirm": "删除 Portal \"{{portal}}\" 并移除它的 storage 目录?"
289
+ },
290
+ "messages": {
291
+ "destroyed": "Portal \"{{portal}}\" 已删除。",
292
+ "mode": "Mode:{{mode}}",
293
+ "app": "App:{{app}}",
294
+ "base": "Base:{{base}}",
295
+ "record": "记录:{{status}}",
296
+ "workspace": "Portal:{{status}}({{dir}})"
297
+ }
298
+ },
299
+ "portalDev": {
300
+ "errors": {
301
+ "envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
302
+ "noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
303
+ "workspaceMissing": "Portal 不存在:{{portalDir}}\n请先运行 `nb portal create {{portal}}`。",
304
+ "packageJsonMissing": "Portal 无效:{{portalDir}} 中缺少 package.json。",
305
+ "sshUnsupported": "第一版暂不支持为 ssh env 启动 Portal 开发服务。"
306
+ },
307
+ "messages": {
308
+ "starting": "正在启动 Portal \"{{portal}}\"...",
309
+ "mode": "Mode:{{mode}}",
310
+ "app": "App:{{app}}",
311
+ "base": "Base:{{base}}",
312
+ "dir": "目录:{{dir}}"
313
+ }
314
+ },
165
315
  "license": {
166
316
  "activate": {
167
317
  "interactive": {
@@ -173,7 +323,7 @@
173
323
  },
174
324
  "prompts": {
175
325
  "provideMethod": {
176
- "message": "你想通过哪种方式提供 license key?",
326
+ "message": "License key 提供方式",
177
327
  "keyOption": "直接粘贴 license key",
178
328
  "fileOption": "从文件读取 key"
179
329
  },
@@ -246,7 +396,7 @@
246
396
  },
247
397
  "prompts": {
248
398
  "source": {
249
- "message": "你想通过哪种方式获取 NocoBase?",
399
+ "message": "NocoBase 获取方式",
250
400
  "dockerLabel": "Docker 安装(推荐)",
251
401
  "dockerHint": "适合无代码或低维护成本场景。后续升级时,拉取新镜像并重启应用即可。",
252
402
  "npmLabel": "create-nocobase-app 安装",
@@ -255,9 +405,9 @@
255
405
  "gitHint": "适合体验最新未发布版本、参与贡献,或直接修改和调试 NocoBase 源码。这个方式更偏向开发者使用。"
256
406
  },
257
407
  "version": {
258
- "message": "你想使用哪个版本?",
408
+ "message": "NocoBase 版本",
259
409
  "latestLabel": "latest",
260
- "latestHint": "稳定版。适合生产环境和希望获得稳定体验的场景。当前暂不可用。",
410
+ "latestHint": "稳定版。适合生产环境和希望获得稳定体验的场景。",
261
411
  "betaLabel": "beta",
262
412
  "betaHint": "测试版。包含即将发布的新功能,适合提前体验和反馈。",
263
413
  "alphaLabel": "alpha",
@@ -266,15 +416,15 @@
266
416
  "otherHint": "手动填写其他版本号、Docker tag 或 Git ref,例如分支名。"
267
417
  },
268
418
  "otherVersion": {
269
- "message": "请输入你想使用的版本号、Docker tag 或 Git ref",
419
+ "message": "自定义版本号、Docker tag 或 Git ref",
270
420
  "placeholder": "例如:fix/cli-v2"
271
421
  },
272
422
  "dockerRegistry": {
273
- "message": "你想使用哪个 Docker registry?镜像 tag 请单独在 Version 中填写。",
423
+ "message": "Docker registry(镜像 tag 在版本中单独设置)",
274
424
  "placeholder": "registry.cn-shanghai.aliyuncs.com/nocobase/nocobase"
275
425
  },
276
426
  "dockerPlatform": {
277
- "message": "要使用哪个 Docker 镜像平台?",
427
+ "message": "架构",
278
428
  "autoLabel": "自动",
279
429
  "autoHint": "由 Docker 根据当前机器自动选择"
280
430
  },
@@ -317,79 +467,94 @@
317
467
  },
318
468
  "prompts": {
319
469
  "env": {
320
- "message": "你想如何命名这个应用?",
470
+ "message": "应用环境标识",
321
471
  "placeholder": "local"
322
472
  },
323
473
  "lang": {
324
- "message": "你希望应用使用哪种语言?"
474
+ "message": "应用语言"
325
475
  },
326
476
  "appPath": {
327
- "message": "应用要放到哪里?(相对路径基于 {{root}})",
477
+ "message": "应用目录(相对路径基于 {{root}})",
328
478
  "placeholder": "./<env>/"
329
479
  },
330
480
  "appPort": {
331
- "message": "应用要使用哪个端口?",
481
+ "message": "应用端口",
332
482
  "placeholder": "13000"
333
483
  },
334
484
  "appPublicPath": {
335
- "message": "应用的子路径是什么?(例如 /nocobase/)",
485
+ "message": "应用子路径(例如 /nocobase/)",
336
486
  "placeholder": "/ 或 /nocobase/"
337
487
  },
488
+ "portalType": {
489
+ "message": "Portal 类型",
490
+ "noCodeLabel": "无代码 Portal",
491
+ "noCodeHint": "通过可视化配置创建,AI 可以协助调整配置。访问路径:/v/<name>",
492
+ "aiLabel": "AI Portal",
493
+ "aiHint": "通过 AI Agent 和代码创建,可用自然语言提出修改要求。访问路径:/x/<name>"
494
+ },
495
+ "portalName": {
496
+ "message": "Portal 名称",
497
+ "placeholder": "admin"
498
+ },
499
+ "portalTemplate": {
500
+ "message": "起始模板(将复制到 ./storage/portals/)",
501
+ "placeholder": "git@github.com:nocobase/admin-starter.git"
502
+ },
338
503
  "storagePath": {
339
- "message": "上传文件和本地存储目录要放到哪里?",
504
+ "message": "上传文件和本地存储目录",
340
505
  "placeholder": "./<env>/storage/"
341
506
  },
342
507
  "dbDialect": {
343
- "message": "你想使用哪种数据库?"
508
+ "message": "数据库类型"
344
509
  },
345
510
  "builtinDb": {
346
- "message": "是否使用内置数据库?"
511
+ "message": "使用内置数据库"
347
512
  },
348
513
  "builtinDbImage": {
349
- "message": "内置数据库要使用哪个 Docker 镜像?",
514
+ "message": "内置数据库 Docker 镜像",
350
515
  "placeholder": "postgres:16"
351
516
  },
352
517
  "dbHost": {
353
- "message": "数据库主机地址是什么?",
518
+ "message": "数据库主机地址",
354
519
  "placeholder": "127.0.0.1"
355
520
  },
356
521
  "dbPort": {
357
- "message": "数据库端口是什么?",
522
+ "message": "数据库端口",
358
523
  "placeholder": "5432"
359
524
  },
360
525
  "dbDatabase": {
361
- "message": "数据库名称是什么?"
526
+ "message": "数据库名称"
362
527
  },
363
528
  "dbUser": {
364
- "message": "数据库用户名是什么?"
529
+ "message": "数据库用户名"
365
530
  },
366
531
  "dbPassword": {
367
- "message": "数据库密码是什么?"
532
+ "message": "数据库密码"
368
533
  },
369
534
  "dbSchema": {
370
- "message": "数据库 schema 是什么?(仅 PostgreSQL,可选)",
535
+ "message": "数据库 schema(仅 PostgreSQL/KingbaseES,可选)",
371
536
  "placeholder": "留空则使用默认 schema"
372
537
  },
373
538
  "dbTablePrefix": {
374
- "message": "要使用什么数据表前缀?(可选)",
539
+ "message": "数据表前缀(可选)",
375
540
  "placeholder": "例如:nb_"
376
541
  },
377
542
  "dbUnderscored": {
378
- "message": "数据库表名和字段名是否使用下划线风格?"
543
+ "message": "数据库表名和字段名使用下划线风格"
379
544
  },
380
545
  "rootUsername": {
381
- "message": "设置初始管理员用户名",
546
+ "message": "初始管理员用户名",
382
547
  "placeholder": "nocobase"
383
548
  },
384
549
  "rootEmail": {
385
- "message": "初始管理员邮箱是什么?",
550
+ "message": "初始管理员邮箱",
386
551
  "placeholder": "admin@nocobase.com"
387
552
  },
388
553
  "rootPassword": {
389
- "message": "设置初始管理员密码"
554
+ "message": "初始管理员密码"
390
555
  },
391
556
  "rootNickname": {
392
- "message": "初始管理员显示名称是什么?",
557
+ "message": "初始管理员显示名称",
393
558
  "placeholder": "Super Admin"
394
559
  }
395
560
  }
@@ -399,7 +564,7 @@
399
564
  "envExists": "Env \"{{envName}}\" 已存在,请换一个 env name。"
400
565
  },
401
566
  "messages": {
402
- "title": "配置供 Coding Agents 使用的 NocoBase",
567
+ "title": "配置 NocoBase",
403
568
  "appNameRequiredWhenSkipped": "跳过 prompts 时必须提供 Env name。",
404
569
  "appNameEnvHelp": "请使用 `nb init --yes --env <envName>` 继续。",
405
570
  "resumeEnvRequired": "恢复安装时必须提供 Env name。",
@@ -413,11 +578,11 @@
413
578
  },
414
579
  "prompts": {
415
580
  "appName": {
416
- "message": "这个环境要使用什么 `--env` 标识?",
581
+ "message": "应用环境唯一标识(CLI 将通过该标识定位并操作对应环境)",
417
582
  "placeholder": "local"
418
583
  },
419
584
  "setupMode": {
420
- "message": "你想用哪种方式配置这个环境?",
585
+ "message": "应用环境配置方式",
421
586
  "installNewLabel": "新安装",
422
587
  "installNewHint": "从零安装一个新的应用,适合首次部署、试用或新建本地开发环境。",
423
588
  "manageLocalLabel": "本机接管",
@@ -426,7 +591,7 @@
426
591
  "connectRemoteHint": "只保存远程应用的连接信息,不在本机安装或接管应用。"
427
592
  },
428
593
  "installSkills": {
429
- "message": "是否安装 NocoBase AI coding skills(nocobase/skills)?"
594
+ "message": "安装 NocoBase AI coding skills(nocobase/skills"
430
595
  },
431
596
  "apiBaseUrl": {
432
597
  "message": "API 基础地址",
@@ -434,12 +599,27 @@
434
599
  },
435
600
  "skipDownload": {
436
601
  "message": "跳过下载 NocoBase,直接复用已有的本地应用文件或 Docker 镜像"
602
+ },
603
+ "portalType": {
604
+ "message": "Portal 类型",
605
+ "noCodeLabel": "无代码 Portal",
606
+ "noCodeHint": "通过可视化配置创建,AI 可以协助调整配置。访问路径:/v/<name>",
607
+ "aiLabel": "AI Portal",
608
+ "aiHint": "通过 AI Agent 和代码创建,可用自然语言提出修改要求。访问路径:/x/<name>"
609
+ },
610
+ "portalName": {
611
+ "message": "Portal 名称",
612
+ "placeholder": "admin"
613
+ },
614
+ "portalTemplate": {
615
+ "message": "起始模板(将复制到 ./storage/portals/)",
616
+ "placeholder": "git@github.com:nocobase/admin-starter.git"
437
617
  }
438
618
  },
439
619
  "webUi": {
440
- "pageTitle": "配置供 Coding Agents 使用的 NocoBase",
441
- "documentHeading": "配置供 Coding Agents 使用的 NocoBase",
442
- "documentHint": "安装一个新的应用、接管本机已有应用,或连接远程应用,让 Coding Agents 可以在当前工作区中访问和操作 NocoBase。",
620
+ "pageTitle": "配置 NocoBase",
621
+ "documentHeading": "配置 NocoBase",
622
+ "documentHint": "安装一个新的应用、管理已有应用,或连接远程应用。你可以直接使用它,也可以稍后让 coding agent 访问它。",
443
623
  "gettingStarted": {
444
624
  "title": "开始设置",
445
625
  "description": "选择新安装、本机接管,或远程连接。"
@@ -456,6 +636,10 @@
456
636
  "title": "应用来源和版本",
457
637
  "description": "选择应用的获取方式,以及要使用的来源和版本。"
458
638
  },
639
+ "portalType": {
640
+ "title": "配置 Portal",
641
+ "description": "设置默认 Portal 的标识和类型。"
642
+ },
459
643
  "configureDatabase": {
460
644
  "title": "配置数据库",
461
645
  "description": "选择内置数据库或自定义数据库。"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "2.2.0-alpha.1",
3
+ "version": "2.2.0-alpha.10",
4
4
  "description": "NocoBase Command Line Tool",
5
5
  "type": "module",
6
6
  "main": "dist/generated/command-registry.js",
@@ -12,6 +12,12 @@
12
12
  "keywords": [],
13
13
  "author": "",
14
14
  "license": "Apache-2.0",
15
+ "files": [
16
+ "assets",
17
+ "bin",
18
+ "dist",
19
+ "nocobase-ctl.config.json"
20
+ ],
15
21
  "bin": {
16
22
  "nb": "./bin/run.js"
17
23
  },
@@ -65,6 +71,9 @@
65
71
  "backup": {
66
72
  "description": "Create and restore NocoBase backups."
67
73
  },
74
+ "portal": {
75
+ "description": "Manage portals."
76
+ },
68
77
  "skills": {
69
78
  "description": "Inspect or synchronize NocoBase AI coding skills for the current workspace."
70
79
  },
@@ -138,5 +147,5 @@
138
147
  "type": "git",
139
148
  "url": "git+https://github.com/nocobase/nocobase.git"
140
149
  },
141
- "gitHead": "303663aba6c6eefa27e6a6435b4c0352074ec40f"
150
+ "gitHead": "b5a3f131bb0a4a2fbfd96852896bccadc933d834"
142
151
  }
package/scripts/build.mjs DELETED
@@ -1,34 +0,0 @@
1
- import { copyFileSync, mkdirSync, readdirSync, rmSync } from 'node:fs';
2
- import { createRequire } from 'node:module';
3
- import path from 'node:path';
4
- import { spawnSync } from 'node:child_process';
5
- import { fileURLToPath } from 'node:url';
6
-
7
- const require = createRequire(import.meta.url);
8
- const scriptsDir = path.dirname(fileURLToPath(import.meta.url));
9
- const packageRoot = path.resolve(scriptsDir, '..');
10
- const distDir = path.join(packageRoot, 'dist');
11
- const srcLocaleDir = path.join(packageRoot, 'src', 'locale');
12
- const distLocaleDir = path.join(distDir, 'locale');
13
- const tscBin = require.resolve('typescript/bin/tsc');
14
-
15
- rmSync(distDir, { recursive: true, force: true });
16
-
17
- const compile = spawnSync(process.execPath, [tscBin, '-p', path.join(packageRoot, 'tsconfig.json')], {
18
- cwd: packageRoot,
19
- stdio: 'inherit',
20
- });
21
-
22
- if (compile.status !== 0) {
23
- process.exit(compile.status ?? 1);
24
- }
25
-
26
- mkdirSync(distLocaleDir, { recursive: true });
27
-
28
- for (const entry of readdirSync(srcLocaleDir, { withFileTypes: true })) {
29
- if (!entry.isFile() || !entry.name.endsWith('.json')) {
30
- continue;
31
- }
32
-
33
- copyFileSync(path.join(srcLocaleDir, entry.name), path.join(distLocaleDir, entry.name));
34
- }
package/scripts/clean.mjs DELETED
@@ -1,9 +0,0 @@
1
- import { rmSync } from 'node:fs';
2
- import path from 'node:path';
3
- import { fileURLToPath } from 'node:url';
4
-
5
- const scriptsDir = path.dirname(fileURLToPath(import.meta.url));
6
- const packageRoot = path.resolve(scriptsDir, '..');
7
- const distDir = path.join(packageRoot, 'dist');
8
-
9
- rmSync(distDir, { recursive: true, force: true });
package/tsconfig.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "target": "ES2022",
4
- "module": "NodeNext",
5
- "moduleResolution": "NodeNext",
6
- "rewriteRelativeImportExtensions": true,
7
- "rootDir": "src",
8
- "outDir": "dist",
9
- "declaration": false,
10
- "resolveJsonModule": true,
11
- "esModuleInterop": true,
12
- "allowSyntheticDefaultImports": true,
13
- "types": ["node"],
14
- "skipLibCheck": true,
15
- "strict": false
16
- },
17
- "include": ["src/**/*.ts"],
18
- "exclude": ["src/**/__tests__/**"]
19
- }