@nocobase/cli 3.0.0-alpha.4 → 3.0.0-alpha.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.
- package/dist/commands/portal/config.js +16 -5
- package/dist/commands/portal/create.js +17 -26
- package/dist/commands/portal/destroy.js +28 -6
- package/dist/commands/portal/dev.js +2 -0
- package/dist/commands/portal/list.js +5 -5
- package/dist/commands/portal/pull.js +32 -3
- package/dist/lib/api-client.js +35 -9
- package/dist/lib/auth-store.js +51 -1
- package/dist/lib/env-auth.js +1 -1
- package/dist/lib/env-config.js +5 -0
- package/dist/lib/env-portal-config.js +30 -0
- package/dist/lib/portal-build-html.js +27 -0
- package/dist/lib/portal-config.js +6 -20
- package/dist/lib/portal-configure.js +49 -56
- package/dist/lib/portal-create.js +96 -14
- package/dist/lib/portal-deploy.js +17 -49
- package/dist/lib/portal-destroy.js +34 -20
- package/dist/lib/portal-dev.js +4 -5
- package/dist/lib/portal-env-files.js +2 -1
- package/dist/lib/portal-info.js +2 -5
- package/dist/lib/portal-list.js +20 -26
- package/dist/lib/portal-path-safety.js +76 -0
- package/dist/lib/portal-source.js +186 -54
- package/dist/lib/run-npm.js +46 -0
- package/dist/locale/en-US.json +45 -14
- package/dist/locale/zh-CN.json +45 -14
- package/package.json +2 -2
package/dist/locale/en-US.json
CHANGED
|
@@ -89,6 +89,9 @@
|
|
|
89
89
|
"lowerCaseTableNamesRequiresUnderscored": "MySQL lower_case_table_names=1 requires DB_UNDERSCORED=true."
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
+
"apiClient": {
|
|
93
|
+
"authRequiredHint": "Authentication failed or the saved session has expired. Run `{{command}}` to sign in again."
|
|
94
|
+
},
|
|
92
95
|
"commands": {
|
|
93
96
|
"envAdd": {
|
|
94
97
|
"prompts": {
|
|
@@ -185,14 +188,16 @@
|
|
|
185
188
|
"missingApiBaseUrl": "Cannot create a portal because the selected env has no apiBaseUrl.",
|
|
186
189
|
"outsideParent": "Refusing to modify a portal outside {{parentDir}}: {{portalDir}}",
|
|
187
190
|
"sshUnsupported": "Cannot create a portal for ssh envs in the first version.",
|
|
188
|
-
"workspaceExists": "Portal already exists: {{portalDir}}\nPass --force to delete it and create a new portal."
|
|
191
|
+
"workspaceExists": "Portal already exists: {{portalDir}}\nPass --force to delete it and create a new portal.",
|
|
192
|
+
"workspaceNotReplaceable": "Refusing to replace a non-portal directory: {{portalDir}}\nThe target directory must be empty or contain package.json with a nocobase field."
|
|
189
193
|
},
|
|
190
194
|
"messages": {
|
|
191
195
|
"skipInstall": "Skipped pnpm install because package.json was not found in {{portalDir}}.",
|
|
192
|
-
"created": "Portal \"{{portal}}\" created at {{portalDir}}
|
|
196
|
+
"created": "Portal \"{{portal}}\" created at {{portalDir}}",
|
|
193
197
|
"app": "App: {{app}}",
|
|
194
198
|
"base": "Base: {{base}}",
|
|
195
|
-
"sourceStorage": "Source storage: {{sourceStorage}}"
|
|
199
|
+
"sourceStorage": "Source storage: {{sourceStorage}}",
|
|
200
|
+
"installFailed": "Dependency installation did not finish successfully. Run `pnpm install` manually in {{portalDir}}."
|
|
196
201
|
}
|
|
197
202
|
},
|
|
198
203
|
"portalConfig": {
|
|
@@ -209,11 +214,12 @@
|
|
|
209
214
|
"errors": {
|
|
210
215
|
"envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
|
|
211
216
|
"noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
|
|
212
|
-
"noChanges": "No portal configuration changes were provided. Pass --source-storage or a --git-* flag.",
|
|
213
|
-
"
|
|
217
|
+
"noChanges": "No portal configuration changes were provided. Pass --path, --source-storage, or a --git-* flag.",
|
|
218
|
+
"notFound": "Portal \"{{portal}}\" was not found. Run `nb portal list` to see available portals."
|
|
214
219
|
},
|
|
215
220
|
"messages": {
|
|
216
|
-
"updated": "Portal \"{{portal}}\" configuration updated
|
|
221
|
+
"updated": "Portal \"{{portal}}\" configuration updated.",
|
|
222
|
+
"pathUpdated": "Development path: {{portalDir}}",
|
|
217
223
|
"remoteSynced": "Remote portal record: synced",
|
|
218
224
|
"remoteSkipped": "Remote portal record: not found; local config only"
|
|
219
225
|
}
|
|
@@ -254,9 +260,26 @@
|
|
|
254
260
|
"name": "Name",
|
|
255
261
|
"url": "URL",
|
|
256
262
|
"portalType": "Portal type",
|
|
257
|
-
"path": "
|
|
263
|
+
"path": "Development path",
|
|
258
264
|
"enabled": "Enabled",
|
|
259
|
-
"
|
|
265
|
+
"default": "Default"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"portalPull": {
|
|
269
|
+
"errors": {
|
|
270
|
+
"envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
|
|
271
|
+
"noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
|
|
272
|
+
"gitRepoRequiredForTemporaryPull": "--git-branch and --git-path require --git-repo for a temporary Git pull. To update the portal configuration, use `nb portal config`."
|
|
273
|
+
},
|
|
274
|
+
"messages": {
|
|
275
|
+
"noop": "No pull is needed.",
|
|
276
|
+
"pulled": "Pulled portal source \"{{portal}}\" into {{portalDir}}",
|
|
277
|
+
"installFailed": "Dependency installation did not finish successfully. Run `pnpm install` manually in {{portalDir}}."
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"portalSource": {
|
|
281
|
+
"errors": {
|
|
282
|
+
"workspaceNotReplaceable": "Refusing to replace a non-portal directory: {{portalDir}}\nThe target directory must be empty or contain package.json with a nocobase field."
|
|
260
283
|
}
|
|
261
284
|
},
|
|
262
285
|
"swagger": {
|
|
@@ -295,9 +318,9 @@
|
|
|
295
318
|
"name": "Name",
|
|
296
319
|
"url": "URL",
|
|
297
320
|
"portalType": "Portal type",
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
321
|
+
"developmentPath": "Development path",
|
|
322
|
+
"deploymentPath": "Deployment path",
|
|
323
|
+
"enabled": "Enabled"
|
|
301
324
|
}
|
|
302
325
|
},
|
|
303
326
|
"portalDestroy": {
|
|
@@ -306,12 +329,18 @@
|
|
|
306
329
|
"noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
|
|
307
330
|
"confirmationRequired": "Refusing to destroy a portal in non-interactive mode without --yes.",
|
|
308
331
|
"outsideParent": "Refusing to delete a portal outside {{parentDir}}: {{portalDir}}",
|
|
309
|
-
"workspaceMissing": "Portal does not exist: {{portalDir}}\nPass --force to ignore missing
|
|
332
|
+
"workspaceMissing": "Portal deployment path does not exist: {{portalDir}}\nPass --force to ignore missing deployment files.",
|
|
310
333
|
"unsupportedEnvKind": "Cannot destroy a portal for {{kind}} envs in the first version.",
|
|
334
|
+
"unsafeDevelopmentPath": "Refusing to delete an unsafe portal development path: {{portalDir}}",
|
|
311
335
|
"recordDestroyFailed": "Portal record destroy failed with status {{status}}\n{{details}}"
|
|
312
336
|
},
|
|
313
337
|
"prompts": {
|
|
314
|
-
"confirm": "Destroy portal \"{{portal}}\" and delete its
|
|
338
|
+
"confirm": "Destroy portal \"{{portal}}\" and delete its deployment directory?"
|
|
339
|
+
},
|
|
340
|
+
"statuses": {
|
|
341
|
+
"deleted": "deleted",
|
|
342
|
+
"missing": "missing",
|
|
343
|
+
"retained": "retained"
|
|
315
344
|
},
|
|
316
345
|
"messages": {
|
|
317
346
|
"destroyed": "Portal \"{{portal}}\" destroyed.",
|
|
@@ -319,7 +348,9 @@
|
|
|
319
348
|
"app": "App: {{app}}",
|
|
320
349
|
"base": "Base: {{base}}",
|
|
321
350
|
"record": "Record: {{status}}",
|
|
322
|
-
"
|
|
351
|
+
"deploymentPath": "Deployment path: {{status}} ({{dir}})",
|
|
352
|
+
"developmentPath": "Development path: {{status}} ({{dir}})",
|
|
353
|
+
"developmentPathMissing": "Development path: missing"
|
|
323
354
|
}
|
|
324
355
|
},
|
|
325
356
|
"portalDev": {
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -89,6 +89,9 @@
|
|
|
89
89
|
"lowerCaseTableNamesRequiresUnderscored": "当 MySQL 的 lower_case_table_names=1 时,必须设置 DB_UNDERSCORED=true。"
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
+
"apiClient": {
|
|
93
|
+
"authRequiredHint": "认证失败或已保存的登录状态已过期。请运行 `{{command}}` 重新认证。"
|
|
94
|
+
},
|
|
92
95
|
"commands": {
|
|
93
96
|
"envAdd": {
|
|
94
97
|
"prompts": {
|
|
@@ -185,14 +188,16 @@
|
|
|
185
188
|
"missingApiBaseUrl": "无法创建 Portal,因为当前 env 没有 apiBaseUrl。",
|
|
186
189
|
"outsideParent": "拒绝修改 {{parentDir}} 之外的 Portal:{{portalDir}}",
|
|
187
190
|
"sshUnsupported": "第一版暂不支持为 ssh env 创建 Portal。",
|
|
188
|
-
"workspaceExists": "Portal 已存在:{{portalDir}}\n如需删除并重新创建,请追加 --force。"
|
|
191
|
+
"workspaceExists": "Portal 已存在:{{portalDir}}\n如需删除并重新创建,请追加 --force。",
|
|
192
|
+
"workspaceNotReplaceable": "拒绝替换非 Portal 目录:{{portalDir}}\n目标目录必须为空,或包含带 nocobase 字段的 package.json。"
|
|
189
193
|
},
|
|
190
194
|
"messages": {
|
|
191
195
|
"skipInstall": "未找到 {{portalDir}}/package.json,已跳过 pnpm install。",
|
|
192
|
-
"created": "Portal \"{{portal}}\" 已创建:{{portalDir}}
|
|
196
|
+
"created": "Portal \"{{portal}}\" 已创建:{{portalDir}}",
|
|
193
197
|
"app": "App:{{app}}",
|
|
194
198
|
"base": "Base:{{base}}",
|
|
195
|
-
"sourceStorage": "源码存储:{{sourceStorage}}"
|
|
199
|
+
"sourceStorage": "源码存储:{{sourceStorage}}",
|
|
200
|
+
"installFailed": "依赖安装没有成功完成。请在 {{portalDir}} 中手动运行 `pnpm install`。"
|
|
196
201
|
}
|
|
197
202
|
},
|
|
198
203
|
"portalConfig": {
|
|
@@ -209,11 +214,12 @@
|
|
|
209
214
|
"errors": {
|
|
210
215
|
"envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
|
|
211
216
|
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
|
|
212
|
-
"noChanges": "没有提供 Portal 配置变更。请传入 --source-storage 或 --git-* 参数。",
|
|
213
|
-
"
|
|
217
|
+
"noChanges": "没有提供 Portal 配置变更。请传入 --path、--source-storage 或 --git-* 参数。",
|
|
218
|
+
"notFound": "Portal \"{{portal}}\" 不存在。请运行 `nb portal list` 查看可用 Portal。"
|
|
214
219
|
},
|
|
215
220
|
"messages": {
|
|
216
|
-
"updated": "Portal \"{{portal}}\"
|
|
221
|
+
"updated": "Portal \"{{portal}}\" 配置已更新。",
|
|
222
|
+
"pathUpdated": "开发路径:{{portalDir}}",
|
|
217
223
|
"remoteSynced": "远端 Portal 记录:已同步",
|
|
218
224
|
"remoteSkipped": "远端 Portal 记录:未找到,仅更新本地配置"
|
|
219
225
|
}
|
|
@@ -254,9 +260,26 @@
|
|
|
254
260
|
"name": "名称",
|
|
255
261
|
"url": "访问 URL",
|
|
256
262
|
"portalType": "Portal 类型",
|
|
257
|
-
"path": "
|
|
263
|
+
"path": "开发路径",
|
|
258
264
|
"enabled": "启用",
|
|
259
|
-
"
|
|
265
|
+
"default": "默认"
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"portalPull": {
|
|
269
|
+
"errors": {
|
|
270
|
+
"envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
|
|
271
|
+
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
|
|
272
|
+
"gitRepoRequiredForTemporaryPull": "--git-branch 和 --git-path 作为临时 Git pull 参数时必须同时提供 --git-repo。如需更新 Portal 配置,请使用 `nb portal config`。"
|
|
273
|
+
},
|
|
274
|
+
"messages": {
|
|
275
|
+
"noop": "无需执行 pull。",
|
|
276
|
+
"pulled": "Portal 源码 \"{{portal}}\" 已拉取到 {{portalDir}}",
|
|
277
|
+
"installFailed": "依赖安装没有成功完成。请在 {{portalDir}} 中手动运行 `pnpm install`。"
|
|
278
|
+
}
|
|
279
|
+
},
|
|
280
|
+
"portalSource": {
|
|
281
|
+
"errors": {
|
|
282
|
+
"workspaceNotReplaceable": "拒绝替换非 Portal 目录:{{portalDir}}\n目标目录必须为空,或包含带 nocobase 字段的 package.json。"
|
|
260
283
|
}
|
|
261
284
|
},
|
|
262
285
|
"swagger": {
|
|
@@ -295,9 +318,9 @@
|
|
|
295
318
|
"name": "名称",
|
|
296
319
|
"url": "访问 URL",
|
|
297
320
|
"portalType": "Portal 类型",
|
|
298
|
-
"
|
|
299
|
-
"
|
|
300
|
-
"
|
|
321
|
+
"developmentPath": "开发路径",
|
|
322
|
+
"deploymentPath": "部署路径",
|
|
323
|
+
"enabled": "启用"
|
|
301
324
|
}
|
|
302
325
|
},
|
|
303
326
|
"portalDestroy": {
|
|
@@ -306,12 +329,18 @@
|
|
|
306
329
|
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
|
|
307
330
|
"confirmationRequired": "非交互模式下拒绝删除 Portal。请追加 --yes 后重试。",
|
|
308
331
|
"outsideParent": "拒绝删除 {{parentDir}} 之外的 Portal:{{portalDir}}",
|
|
309
|
-
"workspaceMissing": "Portal
|
|
332
|
+
"workspaceMissing": "Portal 部署路径不存在:{{portalDir}}\n如需忽略部署文件缺失,请追加 --force。",
|
|
310
333
|
"unsupportedEnvKind": "第一版暂不支持为 {{kind}} env 删除 Portal。",
|
|
334
|
+
"unsafeDevelopmentPath": "拒绝删除不安全的 Portal 开发路径:{{portalDir}}",
|
|
311
335
|
"recordDestroyFailed": "Portal 记录删除失败,状态码 {{status}}\n{{details}}"
|
|
312
336
|
},
|
|
313
337
|
"prompts": {
|
|
314
|
-
"confirm": "删除 Portal \"{{portal}}\"
|
|
338
|
+
"confirm": "删除 Portal \"{{portal}}\" 并移除它的部署目录?"
|
|
339
|
+
},
|
|
340
|
+
"statuses": {
|
|
341
|
+
"deleted": "已删除",
|
|
342
|
+
"missing": "缺失",
|
|
343
|
+
"retained": "已保留"
|
|
315
344
|
},
|
|
316
345
|
"messages": {
|
|
317
346
|
"destroyed": "Portal \"{{portal}}\" 已删除。",
|
|
@@ -319,7 +348,9 @@
|
|
|
319
348
|
"app": "App:{{app}}",
|
|
320
349
|
"base": "Base:{{base}}",
|
|
321
350
|
"record": "记录:{{status}}",
|
|
322
|
-
"
|
|
351
|
+
"deploymentPath": "部署路径:{{status}}({{dir}})",
|
|
352
|
+
"developmentPath": "开发路径:{{status}}({{dir}})",
|
|
353
|
+
"developmentPathMissing": "开发路径:缺失"
|
|
323
354
|
}
|
|
324
355
|
},
|
|
325
356
|
"portalDev": {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.6",
|
|
4
4
|
"description": "NocoBase Command Line Tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/generated/command-registry.js",
|
|
@@ -147,5 +147,5 @@
|
|
|
147
147
|
"type": "git",
|
|
148
148
|
"url": "git+https://github.com/nocobase/nocobase.git"
|
|
149
149
|
},
|
|
150
|
-
"gitHead": "
|
|
150
|
+
"gitHead": "3508eabe683b9a47a28d0f3425098eb58873a9d7"
|
|
151
151
|
}
|