@nocobase/cli 3.0.0-alpha.5 → 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 +13 -25
- package/dist/commands/portal/destroy.js +28 -6
- package/dist/commands/portal/list.js +5 -5
- package/dist/commands/portal/pull.js +28 -2
- 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-config.js +0 -17
- package/dist/lib/portal-configure.js +46 -54
- package/dist/lib/portal-create.js +21 -5
- package/dist/lib/portal-deploy.js +5 -42
- package/dist/lib/portal-destroy.js +27 -9
- package/dist/lib/portal-dev.js +2 -3
- package/dist/lib/portal-info.js +2 -5
- package/dist/lib/portal-list.js +16 -23
- package/dist/lib/portal-path-safety.js +76 -0
- package/dist/lib/portal-source.js +60 -43
- package/dist/locale/en-US.json +34 -15
- package/dist/locale/zh-CN.json +34 -15
- package/package.json +2 -2
|
@@ -15,9 +15,11 @@ import * as tar from 'tar';
|
|
|
15
15
|
import { executeApiRequest } from './api-client.js';
|
|
16
16
|
import { translateCli } from './cli-locale.js';
|
|
17
17
|
import { ensurePortalBuildHtmlReadsEnvOnly } from './portal-build-html.js';
|
|
18
|
-
import { buildPortalConfig, buildPortalConfigFromOptions, DEFAULT_PORTAL_GIT_PATH,
|
|
18
|
+
import { buildPortalConfig, buildPortalConfigFromOptions, DEFAULT_PORTAL_GIT_PATH, } from './portal-config.js';
|
|
19
19
|
import { buildPortalCommandEnv } from './portal-command-env.js';
|
|
20
|
-
import {
|
|
20
|
+
import { canReplacePortalDirectory } from './portal-path-safety.js';
|
|
21
|
+
import { updatePortalEnvFiles } from './portal-env-files.js';
|
|
22
|
+
import { buildPortalBasePath, resolvePortalAppContext, resolvePortalDeployPath, resolvePortalSourcePath, resolveSavedPortalSourcePath, resolvePortalStoragePath, validatePortalSlug, } from './portal-create.js';
|
|
21
23
|
import { listPortalWorkspaces } from './portal-list.js';
|
|
22
24
|
import { findPortalListItem } from './portal-info.js';
|
|
23
25
|
import { resolvePnpmInstallCommand, run, runPnpmInstallCommand } from './run-npm.js';
|
|
@@ -144,10 +146,10 @@ async function replaceExistingPortalDirectory(params) {
|
|
|
144
146
|
await rm(params.sourceDir, { recursive: true, force: true });
|
|
145
147
|
}
|
|
146
148
|
async function replacePortalSourceFromArchive(params) {
|
|
147
|
-
const targetExists = await
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
149
|
+
const targetExists = await assertPortalDirectoryCanBeReplaced({
|
|
150
|
+
portalDir: params.portalDir,
|
|
151
|
+
force: params.force,
|
|
152
|
+
});
|
|
151
153
|
const parentDir = path.dirname(params.portalDir);
|
|
152
154
|
const tempDir = await mkdtemp(path.join(parentDir, `.${path.basename(params.portalDir)}-pull-`));
|
|
153
155
|
try {
|
|
@@ -172,10 +174,10 @@ async function replacePortalSourceFromArchive(params) {
|
|
|
172
174
|
}
|
|
173
175
|
}
|
|
174
176
|
async function replacePortalSourceFromDirectory(params) {
|
|
175
|
-
const targetExists = await
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
}
|
|
177
|
+
const targetExists = await assertPortalDirectoryCanBeReplaced({
|
|
178
|
+
portalDir: params.portalDir,
|
|
179
|
+
force: params.force,
|
|
180
|
+
});
|
|
179
181
|
const parentDir = path.dirname(params.portalDir);
|
|
180
182
|
const tempDir = await mkdtemp(path.join(parentDir, `.${path.basename(params.portalDir)}-pull-`));
|
|
181
183
|
try {
|
|
@@ -202,6 +204,9 @@ async function assertPortalDirectoryCanBeReplaced(params) {
|
|
|
202
204
|
if (targetExists && !params.force) {
|
|
203
205
|
throw new Error(portalSourceText('errors.workspaceExists', { portalDir: params.portalDir }, `Portal already exists: ${params.portalDir}\nPass --force to delete it and pull again.`));
|
|
204
206
|
}
|
|
207
|
+
if (targetExists && params.force && !(await canReplacePortalDirectory(params.portalDir))) {
|
|
208
|
+
throw new Error(portalSourceText('errors.workspaceNotReplaceable', { portalDir: params.portalDir }, `Refusing to replace a non-portal directory: ${params.portalDir}`));
|
|
209
|
+
}
|
|
205
210
|
return targetExists;
|
|
206
211
|
}
|
|
207
212
|
async function runGit(args, cwd) {
|
|
@@ -265,7 +270,11 @@ async function resolvePortalSourceContext(options) {
|
|
|
265
270
|
const mode = options.env.kind;
|
|
266
271
|
const appContext = await resolvePortalAppContext(options);
|
|
267
272
|
const { app, appPublicPath, portalBaseApp } = appContext;
|
|
268
|
-
const
|
|
273
|
+
const portalDeployDir = resolvePortalDeployPath({ storagePath, app, portal });
|
|
274
|
+
const portalDir = options.sourcePath
|
|
275
|
+
? resolvePortalSourcePath(portal, options.sourcePath)
|
|
276
|
+
: resolveSavedPortalSourcePath(options.env, portal) ??
|
|
277
|
+
(options.defaultSourcePath ? resolvePortalSourcePath(portal) : portalDeployDir);
|
|
269
278
|
const portalBase = buildPortalBasePath({ app: portalBaseApp ?? app, appPublicPath, portal });
|
|
270
279
|
if (mode !== 'local' && mode !== 'docker' && mode !== 'http') {
|
|
271
280
|
throw new Error(portalSourceText('errors.unsupportedEnvKind', { kind: mode }, `Cannot sync portal source for ${mode} envs in the first version.`));
|
|
@@ -286,6 +295,7 @@ async function resolvePortalSourceContext(options) {
|
|
|
286
295
|
portal,
|
|
287
296
|
portalDir,
|
|
288
297
|
portalBase,
|
|
298
|
+
apiBaseUrl,
|
|
289
299
|
mode,
|
|
290
300
|
sourceStorage: item.sourceStorage || 'nocobase',
|
|
291
301
|
gitRepo: item.gitRepo,
|
|
@@ -316,6 +326,25 @@ function applyPortalConfigToContext(context, config) {
|
|
|
316
326
|
gitPath: config.git?.path ?? DEFAULT_PORTAL_GIT_PATH,
|
|
317
327
|
};
|
|
318
328
|
}
|
|
329
|
+
function getTemporaryGitPortalConfig(options) {
|
|
330
|
+
const gitRepo = trimValue(options.gitRepo);
|
|
331
|
+
if (!gitRepo) {
|
|
332
|
+
if (trimValue(options.gitBranch) || trimValue(options.gitPath)) {
|
|
333
|
+
throw new Error(portalSourceText('errors.gitRepoRequiredForTemporaryPull', undefined, [
|
|
334
|
+
'--git-branch and --git-path require --git-repo for a temporary Git pull.',
|
|
335
|
+
'To update the portal configuration, use `nb portal config`.',
|
|
336
|
+
].join(' ')));
|
|
337
|
+
}
|
|
338
|
+
return undefined;
|
|
339
|
+
}
|
|
340
|
+
return buildPortalConfig({
|
|
341
|
+
portal: options.portal,
|
|
342
|
+
sourceStorage: 'git',
|
|
343
|
+
gitRepo,
|
|
344
|
+
gitBranch: options.gitBranch,
|
|
345
|
+
gitPath: options.gitPath,
|
|
346
|
+
});
|
|
347
|
+
}
|
|
319
348
|
function assertGitSourceConfig(context) {
|
|
320
349
|
if (!context.gitRepo) {
|
|
321
350
|
throw new Error(portalSourceText('errors.gitRepoMissing', { portal: context.portal }, `Portal "${context.portal}" uses Git source storage, but gitRepo is missing.`));
|
|
@@ -495,8 +524,11 @@ async function pushGitPortalSource(params) {
|
|
|
495
524
|
}
|
|
496
525
|
}
|
|
497
526
|
export async function pullPortalSource(options) {
|
|
498
|
-
const context = await resolvePortalSourceContext(
|
|
499
|
-
|
|
527
|
+
const context = await resolvePortalSourceContext({
|
|
528
|
+
...options,
|
|
529
|
+
defaultSourcePath: true,
|
|
530
|
+
});
|
|
531
|
+
const portalConfig = getTemporaryGitPortalConfig(options) ?? buildPortalConfigFromContext(context);
|
|
500
532
|
const sourceContext = applyPortalConfigToContext(context, portalConfig);
|
|
501
533
|
if (sourceContext.sourceStorage === 'git') {
|
|
502
534
|
await pullGitPortalSource({
|
|
@@ -504,7 +536,11 @@ export async function pullPortalSource(options) {
|
|
|
504
536
|
force: options.force,
|
|
505
537
|
});
|
|
506
538
|
await ensurePortalBuildHtmlReadsEnvOnly(sourceContext.portalDir);
|
|
507
|
-
await
|
|
539
|
+
await updatePortalEnvFiles({
|
|
540
|
+
portalDir: sourceContext.portalDir,
|
|
541
|
+
apiBaseUrl: sourceContext.apiBaseUrl,
|
|
542
|
+
portalBase: sourceContext.portalBase,
|
|
543
|
+
});
|
|
508
544
|
const installResult = await installPortalDependencies({
|
|
509
545
|
portalDir: sourceContext.portalDir,
|
|
510
546
|
installDependencies: options.installDependencies,
|
|
@@ -519,15 +555,6 @@ export async function pullPortalSource(options) {
|
|
|
519
555
|
if (sourceContext.sourceStorage !== 'nocobase') {
|
|
520
556
|
throw new Error(portalSourceText('errors.unsupportedSourceStorage', { sourceStorage: sourceContext.sourceStorage }, `Unsupported portal source storage: ${sourceContext.sourceStorage}`));
|
|
521
557
|
}
|
|
522
|
-
if (sourceContext.mode === 'local' || sourceContext.mode === 'docker') {
|
|
523
|
-
return {
|
|
524
|
-
...sourceContext,
|
|
525
|
-
changed: false,
|
|
526
|
-
noopReason: sourceContext.mode === 'local'
|
|
527
|
-
? portalSourceText('messages.localPullNoop', undefined, 'Portal source is already local.')
|
|
528
|
-
: portalSourceText('messages.dockerPullNoop', undefined, 'Portal source is already available through the Docker volume.'),
|
|
529
|
-
};
|
|
530
|
-
}
|
|
531
558
|
const tempDir = await mkdtemp(path.join(os.tmpdir(), 'nocobase-cli-portal-pull-'));
|
|
532
559
|
const archivePath = path.join(tempDir, 'source.tar.gz');
|
|
533
560
|
const apiRequest = options.apiRequest ?? executeApiRequest;
|
|
@@ -552,7 +579,11 @@ export async function pullPortalSource(options) {
|
|
|
552
579
|
force: options.force,
|
|
553
580
|
});
|
|
554
581
|
await ensurePortalBuildHtmlReadsEnvOnly(sourceContext.portalDir);
|
|
555
|
-
await
|
|
582
|
+
await updatePortalEnvFiles({
|
|
583
|
+
portalDir: sourceContext.portalDir,
|
|
584
|
+
apiBaseUrl: sourceContext.apiBaseUrl,
|
|
585
|
+
portalBase: sourceContext.portalBase,
|
|
586
|
+
});
|
|
556
587
|
const installResult = await installPortalDependencies({
|
|
557
588
|
portalDir: sourceContext.portalDir,
|
|
558
589
|
installDependencies: options.installDependencies,
|
|
@@ -569,19 +600,14 @@ export async function pullPortalSource(options) {
|
|
|
569
600
|
}
|
|
570
601
|
}
|
|
571
602
|
export async function pushPortalSource(options) {
|
|
572
|
-
const context = await resolvePortalSourceContext(
|
|
603
|
+
const context = await resolvePortalSourceContext({
|
|
604
|
+
...options,
|
|
605
|
+
defaultSourcePath: true,
|
|
606
|
+
});
|
|
573
607
|
if (!(await pathExists(context.portalDir))) {
|
|
574
608
|
throw new Error(portalSourceText('errors.workspaceMissing', { portalDir: context.portalDir, portal: context.portal }, `Portal does not exist: ${context.portalDir}\nRun \`nb portal create ${context.portal}\` first.`));
|
|
575
609
|
}
|
|
576
|
-
const portalConfig =
|
|
577
|
-
await syncPortalConfigToRemote({
|
|
578
|
-
portal: context.portal,
|
|
579
|
-
config: portalConfig,
|
|
580
|
-
currentOptions: context.options,
|
|
581
|
-
envName: options.envName,
|
|
582
|
-
cliVersion: options.cliVersion,
|
|
583
|
-
apiRequest: options.apiRequest,
|
|
584
|
-
});
|
|
610
|
+
const portalConfig = buildPortalConfigFromContext(context);
|
|
585
611
|
const sourceContext = applyPortalConfigToContext(context, portalConfig);
|
|
586
612
|
if (sourceContext.sourceStorage === 'git') {
|
|
587
613
|
const revision = await pushGitPortalSource({
|
|
@@ -600,15 +626,6 @@ export async function pushPortalSource(options) {
|
|
|
600
626
|
if (sourceContext.sourceStorage !== 'nocobase') {
|
|
601
627
|
throw new Error(portalSourceText('errors.unsupportedSourceStorage', { sourceStorage: sourceContext.sourceStorage }, `Unsupported portal source storage: ${sourceContext.sourceStorage}`));
|
|
602
628
|
}
|
|
603
|
-
if (sourceContext.mode === 'local' || sourceContext.mode === 'docker') {
|
|
604
|
-
return {
|
|
605
|
-
...sourceContext,
|
|
606
|
-
changed: false,
|
|
607
|
-
noopReason: sourceContext.mode === 'local'
|
|
608
|
-
? portalSourceText('messages.localPushNoop', undefined, 'Portal source is already local.')
|
|
609
|
-
: portalSourceText('messages.dockerPushNoop', undefined, 'Portal source is already available through the Docker volume.'),
|
|
610
|
-
};
|
|
611
|
-
}
|
|
612
629
|
const archive = await packPortalSource(sourceContext.portalDir);
|
|
613
630
|
const apiRequest = options.apiRequest ?? executeApiRequest;
|
|
614
631
|
try {
|
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,11 +188,12 @@
|
|
|
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
199
|
"sourceStorage": "Source storage: {{sourceStorage}}",
|
|
@@ -210,11 +214,12 @@
|
|
|
210
214
|
"errors": {
|
|
211
215
|
"envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
|
|
212
216
|
"noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
|
|
213
|
-
"noChanges": "No portal configuration changes were provided. Pass --source-storage or a --git-* flag.",
|
|
214
|
-
"
|
|
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."
|
|
215
219
|
},
|
|
216
220
|
"messages": {
|
|
217
|
-
"updated": "Portal \"{{portal}}\" configuration updated
|
|
221
|
+
"updated": "Portal \"{{portal}}\" configuration updated.",
|
|
222
|
+
"pathUpdated": "Development path: {{portalDir}}",
|
|
218
223
|
"remoteSynced": "Remote portal record: synced",
|
|
219
224
|
"remoteSkipped": "Remote portal record: not found; local config only"
|
|
220
225
|
}
|
|
@@ -255,22 +260,28 @@
|
|
|
255
260
|
"name": "Name",
|
|
256
261
|
"url": "URL",
|
|
257
262
|
"portalType": "Portal type",
|
|
258
|
-
"path": "
|
|
263
|
+
"path": "Development path",
|
|
259
264
|
"enabled": "Enabled",
|
|
260
|
-
"
|
|
265
|
+
"default": "Default"
|
|
261
266
|
}
|
|
262
267
|
},
|
|
263
268
|
"portalPull": {
|
|
264
269
|
"errors": {
|
|
265
270
|
"envNotConfigured": "Env \"{{envName}}\" is not configured. Run `nb env add {{envName}} --api-base-url <url>` first.",
|
|
266
|
-
"noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one 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`."
|
|
267
273
|
},
|
|
268
274
|
"messages": {
|
|
269
275
|
"noop": "No pull is needed.",
|
|
270
|
-
"pulled": "Pulled portal source \"{{portal}}\" into {{portalDir}}
|
|
276
|
+
"pulled": "Pulled portal source \"{{portal}}\" into {{portalDir}}",
|
|
271
277
|
"installFailed": "Dependency installation did not finish successfully. Run `pnpm install` manually in {{portalDir}}."
|
|
272
278
|
}
|
|
273
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."
|
|
283
|
+
}
|
|
284
|
+
},
|
|
274
285
|
"swagger": {
|
|
275
286
|
"errors": {
|
|
276
287
|
"pluginDisabled": "The API documentation plugin is not enabled. Enable it before requesting Swagger documents.",
|
|
@@ -307,9 +318,9 @@
|
|
|
307
318
|
"name": "Name",
|
|
308
319
|
"url": "URL",
|
|
309
320
|
"portalType": "Portal type",
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
321
|
+
"developmentPath": "Development path",
|
|
322
|
+
"deploymentPath": "Deployment path",
|
|
323
|
+
"enabled": "Enabled"
|
|
313
324
|
}
|
|
314
325
|
},
|
|
315
326
|
"portalDestroy": {
|
|
@@ -318,12 +329,18 @@
|
|
|
318
329
|
"noEnvConfigured": "No NocoBase env is configured yet. Run `nb init --ui` to create one first.",
|
|
319
330
|
"confirmationRequired": "Refusing to destroy a portal in non-interactive mode without --yes.",
|
|
320
331
|
"outsideParent": "Refusing to delete a portal outside {{parentDir}}: {{portalDir}}",
|
|
321
|
-
"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.",
|
|
322
333
|
"unsupportedEnvKind": "Cannot destroy a portal for {{kind}} envs in the first version.",
|
|
334
|
+
"unsafeDevelopmentPath": "Refusing to delete an unsafe portal development path: {{portalDir}}",
|
|
323
335
|
"recordDestroyFailed": "Portal record destroy failed with status {{status}}\n{{details}}"
|
|
324
336
|
},
|
|
325
337
|
"prompts": {
|
|
326
|
-
"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"
|
|
327
344
|
},
|
|
328
345
|
"messages": {
|
|
329
346
|
"destroyed": "Portal \"{{portal}}\" destroyed.",
|
|
@@ -331,7 +348,9 @@
|
|
|
331
348
|
"app": "App: {{app}}",
|
|
332
349
|
"base": "Base: {{base}}",
|
|
333
350
|
"record": "Record: {{status}}",
|
|
334
|
-
"
|
|
351
|
+
"deploymentPath": "Deployment path: {{status}} ({{dir}})",
|
|
352
|
+
"developmentPath": "Development path: {{status}} ({{dir}})",
|
|
353
|
+
"developmentPathMissing": "Development path: missing"
|
|
335
354
|
}
|
|
336
355
|
},
|
|
337
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,11 +188,12 @@
|
|
|
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
199
|
"sourceStorage": "源码存储:{{sourceStorage}}",
|
|
@@ -210,11 +214,12 @@
|
|
|
210
214
|
"errors": {
|
|
211
215
|
"envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
|
|
212
216
|
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
|
|
213
|
-
"noChanges": "没有提供 Portal 配置变更。请传入 --source-storage 或 --git-* 参数。",
|
|
214
|
-
"
|
|
217
|
+
"noChanges": "没有提供 Portal 配置变更。请传入 --path、--source-storage 或 --git-* 参数。",
|
|
218
|
+
"notFound": "Portal \"{{portal}}\" 不存在。请运行 `nb portal list` 查看可用 Portal。"
|
|
215
219
|
},
|
|
216
220
|
"messages": {
|
|
217
|
-
"updated": "Portal \"{{portal}}\"
|
|
221
|
+
"updated": "Portal \"{{portal}}\" 配置已更新。",
|
|
222
|
+
"pathUpdated": "开发路径:{{portalDir}}",
|
|
218
223
|
"remoteSynced": "远端 Portal 记录:已同步",
|
|
219
224
|
"remoteSkipped": "远端 Portal 记录:未找到,仅更新本地配置"
|
|
220
225
|
}
|
|
@@ -255,22 +260,28 @@
|
|
|
255
260
|
"name": "名称",
|
|
256
261
|
"url": "访问 URL",
|
|
257
262
|
"portalType": "Portal 类型",
|
|
258
|
-
"path": "
|
|
263
|
+
"path": "开发路径",
|
|
259
264
|
"enabled": "启用",
|
|
260
|
-
"
|
|
265
|
+
"default": "默认"
|
|
261
266
|
}
|
|
262
267
|
},
|
|
263
268
|
"portalPull": {
|
|
264
269
|
"errors": {
|
|
265
270
|
"envNotConfigured": "env \"{{envName}}\" 尚未配置。请先运行 `nb env add {{envName}} --api-base-url <url>`。",
|
|
266
|
-
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。"
|
|
271
|
+
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
|
|
272
|
+
"gitRepoRequiredForTemporaryPull": "--git-branch 和 --git-path 作为临时 Git pull 参数时必须同时提供 --git-repo。如需更新 Portal 配置,请使用 `nb portal config`。"
|
|
267
273
|
},
|
|
268
274
|
"messages": {
|
|
269
275
|
"noop": "无需执行 pull。",
|
|
270
|
-
"pulled": "Portal 源码 \"{{portal}}\" 已拉取到 {{portalDir}}
|
|
276
|
+
"pulled": "Portal 源码 \"{{portal}}\" 已拉取到 {{portalDir}}",
|
|
271
277
|
"installFailed": "依赖安装没有成功完成。请在 {{portalDir}} 中手动运行 `pnpm install`。"
|
|
272
278
|
}
|
|
273
279
|
},
|
|
280
|
+
"portalSource": {
|
|
281
|
+
"errors": {
|
|
282
|
+
"workspaceNotReplaceable": "拒绝替换非 Portal 目录:{{portalDir}}\n目标目录必须为空,或包含带 nocobase 字段的 package.json。"
|
|
283
|
+
}
|
|
284
|
+
},
|
|
274
285
|
"swagger": {
|
|
275
286
|
"errors": {
|
|
276
287
|
"pluginDisabled": "API 文档插件尚未启用。请先启用该插件,再获取 Swagger 文档。",
|
|
@@ -307,9 +318,9 @@
|
|
|
307
318
|
"name": "名称",
|
|
308
319
|
"url": "访问 URL",
|
|
309
320
|
"portalType": "Portal 类型",
|
|
310
|
-
"
|
|
311
|
-
"
|
|
312
|
-
"
|
|
321
|
+
"developmentPath": "开发路径",
|
|
322
|
+
"deploymentPath": "部署路径",
|
|
323
|
+
"enabled": "启用"
|
|
313
324
|
}
|
|
314
325
|
},
|
|
315
326
|
"portalDestroy": {
|
|
@@ -318,12 +329,18 @@
|
|
|
318
329
|
"noEnvConfigured": "还没有配置 NocoBase env。请先运行 `nb init --ui` 创建一个。",
|
|
319
330
|
"confirmationRequired": "非交互模式下拒绝删除 Portal。请追加 --yes 后重试。",
|
|
320
331
|
"outsideParent": "拒绝删除 {{parentDir}} 之外的 Portal:{{portalDir}}",
|
|
321
|
-
"workspaceMissing": "Portal
|
|
332
|
+
"workspaceMissing": "Portal 部署路径不存在:{{portalDir}}\n如需忽略部署文件缺失,请追加 --force。",
|
|
322
333
|
"unsupportedEnvKind": "第一版暂不支持为 {{kind}} env 删除 Portal。",
|
|
334
|
+
"unsafeDevelopmentPath": "拒绝删除不安全的 Portal 开发路径:{{portalDir}}",
|
|
323
335
|
"recordDestroyFailed": "Portal 记录删除失败,状态码 {{status}}\n{{details}}"
|
|
324
336
|
},
|
|
325
337
|
"prompts": {
|
|
326
|
-
"confirm": "删除 Portal \"{{portal}}\"
|
|
338
|
+
"confirm": "删除 Portal \"{{portal}}\" 并移除它的部署目录?"
|
|
339
|
+
},
|
|
340
|
+
"statuses": {
|
|
341
|
+
"deleted": "已删除",
|
|
342
|
+
"missing": "缺失",
|
|
343
|
+
"retained": "已保留"
|
|
327
344
|
},
|
|
328
345
|
"messages": {
|
|
329
346
|
"destroyed": "Portal \"{{portal}}\" 已删除。",
|
|
@@ -331,7 +348,9 @@
|
|
|
331
348
|
"app": "App:{{app}}",
|
|
332
349
|
"base": "Base:{{base}}",
|
|
333
350
|
"record": "记录:{{status}}",
|
|
334
|
-
"
|
|
351
|
+
"deploymentPath": "部署路径:{{status}}({{dir}})",
|
|
352
|
+
"developmentPath": "开发路径:{{status}}({{dir}})",
|
|
353
|
+
"developmentPathMissing": "开发路径:缺失"
|
|
335
354
|
}
|
|
336
355
|
},
|
|
337
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
|
}
|