@nocobase/cli 2.2.0-alpha.1 → 2.2.0-alpha.3
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/bin/early-locale.js +89 -0
- package/bin/node-version.js +35 -0
- package/bin/run.js +9 -0
- package/bin/windows-admin.js +60 -0
- package/dist/commands/app/destroy.js +4 -3
- package/dist/commands/app/restart.js +38 -0
- package/dist/commands/app/shared.js +49 -3
- package/dist/commands/app/start.js +92 -0
- package/dist/commands/app/upgrade.js +11 -0
- package/dist/commands/examples/prompts-stages.js +2 -2
- package/dist/commands/examples/prompts-test.js +2 -2
- package/dist/commands/init.js +22 -10
- package/dist/commands/install.js +135 -4
- package/dist/commands/license/activate.js +4 -1
- package/dist/commands/license/shared.js +24 -15
- package/dist/commands/self/check.js +1 -1
- package/dist/commands/self/update.js +4 -4
- package/dist/commands/skills/check.js +4 -5
- package/dist/commands/skills/install.js +18 -1
- package/dist/commands/skills/update.js +19 -4
- package/dist/commands/source/dev.js +9 -5
- package/dist/commands/source/download.js +67 -2
- package/dist/lib/api-command-compat.js +51 -8
- package/dist/lib/app-managed-resources.js +101 -1
- package/dist/lib/auth-store.js +34 -12
- package/dist/lib/cli-config.js +19 -0
- package/dist/lib/env-auth.js +291 -45
- package/dist/lib/env-config.js +6 -0
- package/dist/lib/hook-script.js +160 -0
- package/dist/lib/prompt-validators.js +1 -1
- package/dist/lib/prompt-web-ui.js +7 -11
- package/dist/lib/run-npm.js +4 -0
- package/dist/lib/self-manager.js +254 -46
- package/dist/lib/skills-manager.js +116 -23
- package/dist/lib/source-publish.js +2 -2
- package/dist/lib/startup-update.js +1 -1
- package/dist/locale/en-US.json +11 -5
- package/dist/locale/zh-CN.json +11 -5
- package/package.json +7 -2
- package/assets/env-proxy/nginx/app.conf.tpl +0 -23
- package/assets/env-proxy/nginx/nocobase.conf.tpl +0 -5
- package/assets/env-proxy/nginx/snippets/dist-location.conf +0 -5
- package/assets/env-proxy/nginx/snippets/gzip.conf +0 -17
- package/assets/env-proxy/nginx/snippets/log-format-http.conf +0 -13
- package/assets/env-proxy/nginx/snippets/maps-http.conf +0 -14
- package/assets/env-proxy/nginx/snippets/mime-types.conf +0 -98
- package/assets/env-proxy/nginx/snippets/proxy-location.conf +0 -17
- package/assets/env-proxy/nginx/snippets/spa-location.conf +0 -6
- package/assets/env-proxy/nginx/snippets/uploads-location.conf +0 -21
- package/scripts/build.mjs +0 -34
- package/scripts/clean.mjs +0 -9
- package/tsconfig.json +0 -19
|
@@ -21,8 +21,8 @@ const NOCOBASE_SKILLS_NAME_PREFIX = 'nocobase-';
|
|
|
21
21
|
// resolves and boots the package, even when the local skills installation is healthy.
|
|
22
22
|
const SKILLS_LIST_TIMEOUT_MS = 15000;
|
|
23
23
|
const SKILLS_NPM_VIEW_TIMEOUT_MS = 3000;
|
|
24
|
-
const SKILLS_PACK_TIMEOUT_MS =
|
|
25
|
-
const SKILLS_ADD_TIMEOUT_MS =
|
|
24
|
+
const SKILLS_PACK_TIMEOUT_MS = 120000;
|
|
25
|
+
const SKILLS_ADD_TIMEOUT_MS = 120000;
|
|
26
26
|
const NPM_REGISTRY_UNAVAILABLE_PATTERNS = [
|
|
27
27
|
'enotfound',
|
|
28
28
|
'eai_again',
|
|
@@ -154,10 +154,13 @@ export async function listGlobalSkills(options = {}) {
|
|
|
154
154
|
export async function listProjectSkills(options = {}) {
|
|
155
155
|
return await listGlobalSkills(options);
|
|
156
156
|
}
|
|
157
|
-
function pickInstalledNocoBaseSkillNames(installedSkills, state) {
|
|
157
|
+
function pickInstalledNocoBaseSkillNames(installedSkills, state, sourceSkillNames = []) {
|
|
158
158
|
const installedNames = new Set(installedSkills.map((skill) => String(skill.name ?? '').trim()).filter(Boolean));
|
|
159
|
-
|
|
160
|
-
|
|
159
|
+
const managedNames = new Set([...sourceSkillNames, ...(state?.skillNames ?? [])]);
|
|
160
|
+
if (managedNames.size > 0) {
|
|
161
|
+
return Array.from(managedNames)
|
|
162
|
+
.filter((name) => installedNames.has(name))
|
|
163
|
+
.sort();
|
|
161
164
|
}
|
|
162
165
|
return Array.from(installedNames)
|
|
163
166
|
.filter((name) => name.startsWith(NOCOBASE_SKILLS_NAME_PREFIX))
|
|
@@ -194,6 +197,31 @@ async function readCachedSkillsVersion(cacheRoot) {
|
|
|
194
197
|
return undefined;
|
|
195
198
|
}
|
|
196
199
|
}
|
|
200
|
+
async function readCachedPackageSkillNames(globalRoot) {
|
|
201
|
+
const skillsDir = path.join(getCachedSkillsPackageDir(getSkillsCacheRoot(globalRoot)), 'skills');
|
|
202
|
+
try {
|
|
203
|
+
const entries = await fsp.readdir(skillsDir, { withFileTypes: true });
|
|
204
|
+
const skillNames = await Promise.all(entries
|
|
205
|
+
.filter((entry) => entry.isDirectory())
|
|
206
|
+
.map(async (entry) => {
|
|
207
|
+
const skillName = entry.name.trim();
|
|
208
|
+
if (!skillName) {
|
|
209
|
+
return undefined;
|
|
210
|
+
}
|
|
211
|
+
try {
|
|
212
|
+
await fsp.access(path.join(skillsDir, skillName, 'SKILL.md'));
|
|
213
|
+
return skillName;
|
|
214
|
+
}
|
|
215
|
+
catch {
|
|
216
|
+
return undefined;
|
|
217
|
+
}
|
|
218
|
+
}));
|
|
219
|
+
return skillNames.filter((name) => Boolean(name)).sort();
|
|
220
|
+
}
|
|
221
|
+
catch {
|
|
222
|
+
return [];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
197
225
|
async function resolvePackedSkillsTarball(packRoot) {
|
|
198
226
|
const entries = await fsp.readdir(packRoot, { withFileTypes: true });
|
|
199
227
|
const tarballs = entries
|
|
@@ -251,6 +279,7 @@ async function prepareLocalSkillsPackage(globalRoot, options = {}, targetVersion
|
|
|
251
279
|
const cachedVersion = await readCachedSkillsVersion(cacheRoot);
|
|
252
280
|
await fsp.mkdir(cacheRoot, { recursive: true });
|
|
253
281
|
if (targetVersion && cachedVersion && compareVersions(cachedVersion, targetVersion) === 0) {
|
|
282
|
+
options.onProgress?.(`Using cached ${NOCOBASE_SKILLS_PACKAGE_NAME}@${targetVersion}...`);
|
|
254
283
|
return {
|
|
255
284
|
packageDir,
|
|
256
285
|
cleanup: async () => undefined,
|
|
@@ -259,12 +288,14 @@ async function prepareLocalSkillsPackage(globalRoot, options = {}, targetVersion
|
|
|
259
288
|
await fsp.rm(packRoot, { recursive: true, force: true });
|
|
260
289
|
await fsp.mkdir(packRoot, { recursive: true });
|
|
261
290
|
try {
|
|
262
|
-
|
|
291
|
+
options.onProgress?.(`Downloading ${packageSpec}...`);
|
|
292
|
+
await (options.runFn ?? run)('npm', ['pack', ...(options.verbose ? [] : ['--silent']), packageSpec], {
|
|
263
293
|
cwd: packRoot,
|
|
264
294
|
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
265
295
|
errorName: 'npm pack',
|
|
266
296
|
timeoutMs: SKILLS_PACK_TIMEOUT_MS,
|
|
267
297
|
});
|
|
298
|
+
options.onProgress?.(`Extracting ${NOCOBASE_SKILLS_PACKAGE_NAME}...`);
|
|
268
299
|
const tarballPath = await resolvePackedSkillsTarball(packRoot);
|
|
269
300
|
await extractPackedSkillsTarball(tarballPath, cacheRoot, targetVersion);
|
|
270
301
|
}
|
|
@@ -279,14 +310,16 @@ async function prepareLocalSkillsPackage(globalRoot, options = {}, targetVersion
|
|
|
279
310
|
export async function inspectSkillsStatus(options = {}) {
|
|
280
311
|
const globalRoot = resolveSkillsRoot(options);
|
|
281
312
|
const stateFile = getManagedSkillsStateFile(globalRoot);
|
|
282
|
-
const [installedSkills, managedState] = await Promise.all([
|
|
313
|
+
const [installedSkills, managedState, cachedSkillNames] = await Promise.all([
|
|
283
314
|
listGlobalSkills({
|
|
284
315
|
globalRoot,
|
|
285
316
|
commandOutputFn: options.commandOutputFn,
|
|
286
317
|
}),
|
|
287
318
|
readManagedSkillsState(globalRoot),
|
|
319
|
+
readCachedPackageSkillNames(globalRoot),
|
|
288
320
|
]);
|
|
289
|
-
const installedSkillNames = pickInstalledNocoBaseSkillNames(installedSkills, managedState);
|
|
321
|
+
const installedSkillNames = pickInstalledNocoBaseSkillNames(installedSkills, managedState, cachedSkillNames);
|
|
322
|
+
const packageSkillNames = cachedSkillNames;
|
|
290
323
|
const managedByNb = managedState?.packageName === NOCOBASE_SKILLS_PACKAGE_NAME;
|
|
291
324
|
let latestVersion;
|
|
292
325
|
let registryError;
|
|
@@ -312,6 +345,7 @@ export async function inspectSkillsStatus(options = {}) {
|
|
|
312
345
|
managedByNb,
|
|
313
346
|
sourcePackage: managedState?.sourcePackage ?? NOCOBASE_SKILLS_SOURCE,
|
|
314
347
|
npmPackageName: managedState?.packageName ?? NOCOBASE_SKILLS_PACKAGE_NAME,
|
|
348
|
+
packageSkillNames,
|
|
315
349
|
installedSkillNames,
|
|
316
350
|
latestVersion,
|
|
317
351
|
installedVersion,
|
|
@@ -321,13 +355,18 @@ export async function inspectSkillsStatus(options = {}) {
|
|
|
321
355
|
registryError,
|
|
322
356
|
};
|
|
323
357
|
}
|
|
324
|
-
async function persistManagedSkillsState(globalRoot, options = {}) {
|
|
325
|
-
const installedSkills = await
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
358
|
+
async function persistManagedSkillsState(globalRoot, options = {}, installedVersion) {
|
|
359
|
+
const [installedSkills, managedState, cachedSkillNames] = await Promise.all([
|
|
360
|
+
listGlobalSkills({
|
|
361
|
+
globalRoot,
|
|
362
|
+
commandOutputFn: options.commandOutputFn,
|
|
363
|
+
}),
|
|
364
|
+
readManagedSkillsState(globalRoot),
|
|
365
|
+
readCachedPackageSkillNames(globalRoot),
|
|
366
|
+
]);
|
|
367
|
+
const installedSkillNames = pickInstalledNocoBaseSkillNames(installedSkills, managedState, cachedSkillNames);
|
|
368
|
+
const packageSkillNames = cachedSkillNames.length ? cachedSkillNames : installedSkillNames;
|
|
369
|
+
const cachedVersion = await readCachedSkillsVersion(getSkillsCacheRoot(globalRoot));
|
|
331
370
|
const published = await readPublishedSkillsVersion({
|
|
332
371
|
globalRoot,
|
|
333
372
|
commandOutputFn: options.commandOutputFn,
|
|
@@ -338,8 +377,8 @@ async function persistManagedSkillsState(globalRoot, options = {}) {
|
|
|
338
377
|
sourcePackage: NOCOBASE_SKILLS_SOURCE,
|
|
339
378
|
installedAt: managedState?.installedAt ?? now,
|
|
340
379
|
updatedAt: now,
|
|
341
|
-
installedVersion: published.version,
|
|
342
|
-
skillNames:
|
|
380
|
+
installedVersion: installedVersion ?? cachedVersion ?? published.version,
|
|
381
|
+
skillNames: packageSkillNames,
|
|
343
382
|
});
|
|
344
383
|
return await inspectSkillsStatus({
|
|
345
384
|
globalRoot,
|
|
@@ -349,7 +388,8 @@ async function persistManagedSkillsState(globalRoot, options = {}) {
|
|
|
349
388
|
async function reinstallManagedSkills(globalRoot, options = {}, targetVersion) {
|
|
350
389
|
const prepared = await prepareLocalSkillsPackage(globalRoot, options, targetVersion);
|
|
351
390
|
try {
|
|
352
|
-
|
|
391
|
+
options.onProgress?.('Installing NocoBase AI coding skills globally...');
|
|
392
|
+
await (options.runFn ?? run)('npx', ['-y', 'skills', 'add', prepared.packageDir, '-g', '-y', '--skill', '*'], {
|
|
353
393
|
cwd: globalRoot,
|
|
354
394
|
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
355
395
|
errorName: 'skills add',
|
|
@@ -360,31 +400,66 @@ async function reinstallManagedSkills(globalRoot, options = {}, targetVersion) {
|
|
|
360
400
|
await prepared.cleanup();
|
|
361
401
|
}
|
|
362
402
|
}
|
|
403
|
+
function pickObsoleteManagedSkillNames(installedSkillNames, packageSkillNames) {
|
|
404
|
+
if (!packageSkillNames.length) {
|
|
405
|
+
return [];
|
|
406
|
+
}
|
|
407
|
+
const packageSkillNameSet = new Set(packageSkillNames);
|
|
408
|
+
return installedSkillNames.filter((skillName) => !packageSkillNameSet.has(skillName)).sort();
|
|
409
|
+
}
|
|
410
|
+
async function removeObsoleteManagedSkills(globalRoot, installedSkillNames, options = {}) {
|
|
411
|
+
const packageSkillNames = await readCachedPackageSkillNames(globalRoot);
|
|
412
|
+
const obsoleteSkillNames = pickObsoleteManagedSkillNames(installedSkillNames, packageSkillNames);
|
|
413
|
+
for (const skillName of obsoleteSkillNames) {
|
|
414
|
+
options.onProgress?.(`Removing obsolete skill ${skillName}...`);
|
|
415
|
+
await (options.runFn ?? run)('npx', ['-y', 'skills', 'remove', skillName, '-g', '-y'], {
|
|
416
|
+
cwd: globalRoot,
|
|
417
|
+
stdio: options.verbose ? 'inherit' : 'ignore',
|
|
418
|
+
errorName: 'skills remove',
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
}
|
|
363
422
|
export async function installNocoBaseSkills(options = {}) {
|
|
364
423
|
const globalRoot = resolveSkillsRoot(options);
|
|
424
|
+
options.onProgress?.('Checking installed NocoBase AI coding skills...');
|
|
365
425
|
const status = await inspectSkillsStatus({
|
|
366
426
|
globalRoot,
|
|
367
427
|
commandOutputFn: options.commandOutputFn,
|
|
368
428
|
});
|
|
369
|
-
|
|
429
|
+
const cachedSkillNames = await readCachedPackageSkillNames(globalRoot);
|
|
430
|
+
const missingCachedSkillNames = cachedSkillNames.filter((name) => !status.installedSkillNames.includes(name));
|
|
431
|
+
const obsoleteSkillNames = pickObsoleteManagedSkillNames(status.installedSkillNames, cachedSkillNames);
|
|
432
|
+
const targetVersion = String(options.targetVersion ?? '').trim() || undefined;
|
|
433
|
+
const targetVersionMatches = !targetVersion || status.installedVersion === targetVersion;
|
|
434
|
+
if (status.installed && targetVersionMatches && missingCachedSkillNames.length === 0 && obsoleteSkillNames.length === 0) {
|
|
370
435
|
return {
|
|
371
436
|
action: 'noop',
|
|
372
437
|
status,
|
|
373
438
|
};
|
|
374
439
|
}
|
|
375
440
|
await ensureSkillsWorkspaceRoot(globalRoot);
|
|
376
|
-
|
|
441
|
+
if (!status.installed || !targetVersionMatches || missingCachedSkillNames.length > 0) {
|
|
442
|
+
const installVersion = targetVersion ?? status.latestVersion;
|
|
443
|
+
await reinstallManagedSkills(globalRoot, options, installVersion);
|
|
444
|
+
}
|
|
445
|
+
await removeObsoleteManagedSkills(globalRoot, status.installedSkillNames, options);
|
|
446
|
+
options.onProgress?.('Verifying installed NocoBase AI coding skills...');
|
|
377
447
|
return {
|
|
378
448
|
action: 'installed',
|
|
379
|
-
status: await persistManagedSkillsState(globalRoot, options),
|
|
449
|
+
status: await persistManagedSkillsState(globalRoot, options, targetVersion),
|
|
380
450
|
};
|
|
381
451
|
}
|
|
382
452
|
export async function updateNocoBaseSkills(options = {}) {
|
|
383
453
|
const globalRoot = resolveSkillsRoot(options);
|
|
454
|
+
options.onProgress?.('Checking installed NocoBase AI coding skills...');
|
|
384
455
|
const status = await inspectSkillsStatus({
|
|
385
456
|
globalRoot,
|
|
386
457
|
commandOutputFn: options.commandOutputFn,
|
|
387
458
|
});
|
|
459
|
+
const cachedSkillNames = await readCachedPackageSkillNames(globalRoot);
|
|
460
|
+
const missingCachedSkillNames = cachedSkillNames.filter((name) => !status.installedSkillNames.includes(name));
|
|
461
|
+
const obsoleteSkillNames = pickObsoleteManagedSkillNames(status.installedSkillNames, cachedSkillNames);
|
|
462
|
+
const targetVersion = String(options.targetVersion ?? '').trim() || undefined;
|
|
388
463
|
if (!status.installed) {
|
|
389
464
|
return {
|
|
390
465
|
action: 'noop',
|
|
@@ -393,8 +468,11 @@ export async function updateNocoBaseSkills(options = {}) {
|
|
|
393
468
|
};
|
|
394
469
|
}
|
|
395
470
|
if (status.managedByNb &&
|
|
471
|
+
!targetVersion &&
|
|
396
472
|
status.latestVersion &&
|
|
397
473
|
status.installedVersion &&
|
|
474
|
+
missingCachedSkillNames.length === 0 &&
|
|
475
|
+
obsoleteSkillNames.length === 0 &&
|
|
398
476
|
compareVersions(status.latestVersion, status.installedVersion) <= 0) {
|
|
399
477
|
return {
|
|
400
478
|
action: 'noop',
|
|
@@ -402,10 +480,25 @@ export async function updateNocoBaseSkills(options = {}) {
|
|
|
402
480
|
status,
|
|
403
481
|
};
|
|
404
482
|
}
|
|
405
|
-
|
|
483
|
+
if (targetVersion &&
|
|
484
|
+
status.installedVersion === targetVersion &&
|
|
485
|
+
missingCachedSkillNames.length === 0 &&
|
|
486
|
+
obsoleteSkillNames.length === 0) {
|
|
487
|
+
return {
|
|
488
|
+
action: 'noop',
|
|
489
|
+
reason: 'up-to-date',
|
|
490
|
+
status,
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
if (!targetVersion || status.installedVersion !== targetVersion || missingCachedSkillNames.length > 0) {
|
|
494
|
+
const installVersion = targetVersion ?? status.latestVersion;
|
|
495
|
+
await reinstallManagedSkills(globalRoot, options, installVersion);
|
|
496
|
+
}
|
|
497
|
+
await removeObsoleteManagedSkills(globalRoot, status.installedSkillNames, options);
|
|
498
|
+
options.onProgress?.('Verifying installed NocoBase AI coding skills...');
|
|
406
499
|
return {
|
|
407
500
|
action: 'updated',
|
|
408
|
-
status: await persistManagedSkillsState(globalRoot, options),
|
|
501
|
+
status: await persistManagedSkillsState(globalRoot, options, targetVersion),
|
|
409
502
|
};
|
|
410
503
|
}
|
|
411
504
|
export async function removeNocoBaseSkills(options = {}) {
|
|
@@ -232,7 +232,7 @@ export async function publishSourceSnapshot(params) {
|
|
|
232
232
|
version,
|
|
233
233
|
stdio,
|
|
234
234
|
});
|
|
235
|
-
await run('yarn', ['lerna', 'publish', 'from-package', '--registry', npmRegistry, '--dist-tag', 'local', '--yes', '--no-verify-access', '--git-head', gitSha], {
|
|
235
|
+
await run('yarn', ['lerna', 'publish', 'from-package', '--registry', npmRegistry, '--dist-tag', 'local', '--yes', '--no-verify-access', '--no-git-reset', '--git-head', gitSha], {
|
|
236
236
|
cwd: projectRoot,
|
|
237
237
|
errorName: 'lerna publish',
|
|
238
238
|
stdio,
|
|
@@ -319,7 +319,7 @@ export function buildSuggestedInitCommand(result) {
|
|
|
319
319
|
const normalizedRegistry = result.npmRegistry || `http://${host}:${port || DEFAULT_SOURCE_REGISTRY_PORT}`;
|
|
320
320
|
const suggestedEnv = ['snapshot', sanitizeEnvSegment(result.gitSha)].filter(Boolean).join('');
|
|
321
321
|
return [
|
|
322
|
-
`nb init --
|
|
322
|
+
`nb init --env ${suggestedEnv} --yes --source npm`,
|
|
323
323
|
`--version ${result.version}`,
|
|
324
324
|
`--npm-registry=${normalizedRegistry}`,
|
|
325
325
|
].join(' ');
|
|
@@ -151,7 +151,7 @@ export async function shouldRunStartupUpdateCheck(argv, now = new Date()) {
|
|
|
151
151
|
return readCurrentInstallLastCheckedDate(state) !== todayStamp(now);
|
|
152
152
|
}
|
|
153
153
|
export function shouldEnableStartupUpdateForInstallMethod(installMethod) {
|
|
154
|
-
return installMethod === 'npm-global';
|
|
154
|
+
return installMethod === 'npm-global' || installMethod === 'pnpm-global' || installMethod === 'yarn-global';
|
|
155
155
|
}
|
|
156
156
|
function hasPendingUpdates(selfStatus, skillsStatus) {
|
|
157
157
|
return Boolean(selfStatus.updateAvailable || skillsStatus.updateAvailable === true);
|
package/dist/locale/en-US.json
CHANGED
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
{
|
|
2
|
+
"entry": {
|
|
3
|
+
"windowsAdministratorRequired": {
|
|
4
|
+
"message": "NocoBase CLI must be run as Administrator on Windows.",
|
|
5
|
+
"hint": "Open your terminal as Administrator, then run the command again."
|
|
6
|
+
}
|
|
7
|
+
},
|
|
2
8
|
"promptCatalog": {
|
|
3
9
|
"common": {
|
|
4
10
|
"cancelled": "Cancelled.",
|
|
@@ -62,7 +68,7 @@
|
|
|
62
68
|
"unreachable": "Unable to connect to the API base URL. Check the address and make sure the server is reachable. Details: {{details}}"
|
|
63
69
|
},
|
|
64
70
|
"envKey": {
|
|
65
|
-
"invalid": "Use letters and
|
|
71
|
+
"invalid": "Use letters, numbers, hyphens, and underscores only."
|
|
66
72
|
},
|
|
67
73
|
"appPublicPath": {
|
|
68
74
|
"invalid": "Use / or a slash-separated path like /nocobase/ or /foo-bar/baz_2/. Each path segment may contain letters, numbers, hyphens, and underscores only."
|
|
@@ -399,7 +405,7 @@
|
|
|
399
405
|
"envExists": "Env \"{{envName}}\" already exists. Choose another env name."
|
|
400
406
|
},
|
|
401
407
|
"messages": {
|
|
402
|
-
"title": "Set up NocoBase
|
|
408
|
+
"title": "Set up NocoBase",
|
|
403
409
|
"appNameRequiredWhenSkipped": "Env name is required when prompts are skipped.",
|
|
404
410
|
"appNameEnvHelp": "Use `nb init --yes --env <envName>` to continue.",
|
|
405
411
|
"resumeEnvRequired": "Env name is required when resuming setup.",
|
|
@@ -437,9 +443,9 @@
|
|
|
437
443
|
}
|
|
438
444
|
},
|
|
439
445
|
"webUi": {
|
|
440
|
-
"pageTitle": "Set up NocoBase
|
|
441
|
-
"documentHeading": "Set up NocoBase
|
|
442
|
-
"documentHint": "Install a new app, manage
|
|
446
|
+
"pageTitle": "Set up NocoBase",
|
|
447
|
+
"documentHeading": "Set up NocoBase",
|
|
448
|
+
"documentHint": "Install a new app, manage an existing one, or connect a remote app. You can use it directly or let a coding agent access it later.",
|
|
443
449
|
"gettingStarted": {
|
|
444
450
|
"title": "Getting started",
|
|
445
451
|
"description": "Choose whether to install a new app, manage a local app, or connect a remote app."
|
package/dist/locale/zh-CN.json
CHANGED
|
@@ -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/ 这样的路径。每个路径段仅支持字母、数字、中划线和下划线。"
|
|
@@ -399,7 +405,7 @@
|
|
|
399
405
|
"envExists": "Env \"{{envName}}\" 已存在,请换一个 env name。"
|
|
400
406
|
},
|
|
401
407
|
"messages": {
|
|
402
|
-
"title": "
|
|
408
|
+
"title": "配置 NocoBase",
|
|
403
409
|
"appNameRequiredWhenSkipped": "跳过 prompts 时必须提供 Env name。",
|
|
404
410
|
"appNameEnvHelp": "请使用 `nb init --yes --env <envName>` 继续。",
|
|
405
411
|
"resumeEnvRequired": "恢复安装时必须提供 Env name。",
|
|
@@ -437,9 +443,9 @@
|
|
|
437
443
|
}
|
|
438
444
|
},
|
|
439
445
|
"webUi": {
|
|
440
|
-
"pageTitle": "
|
|
441
|
-
"documentHeading": "
|
|
442
|
-
"documentHint": "
|
|
446
|
+
"pageTitle": "配置 NocoBase",
|
|
447
|
+
"documentHeading": "配置 NocoBase",
|
|
448
|
+
"documentHint": "安装一个新的应用、管理已有应用,或连接远程应用。你可以直接使用它,也可以稍后让 coding agent 访问它。",
|
|
443
449
|
"gettingStarted": {
|
|
444
450
|
"title": "开始设置",
|
|
445
451
|
"description": "选择新安装、本机接管,或远程连接。"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli",
|
|
3
|
-
"version": "2.2.0-alpha.
|
|
3
|
+
"version": "2.2.0-alpha.3",
|
|
4
4
|
"description": "NocoBase Command Line Tool",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/generated/command-registry.js",
|
|
@@ -12,6 +12,11 @@
|
|
|
12
12
|
"keywords": [],
|
|
13
13
|
"author": "",
|
|
14
14
|
"license": "Apache-2.0",
|
|
15
|
+
"files": [
|
|
16
|
+
"bin",
|
|
17
|
+
"dist",
|
|
18
|
+
"nocobase-ctl.config.json"
|
|
19
|
+
],
|
|
15
20
|
"bin": {
|
|
16
21
|
"nb": "./bin/run.js"
|
|
17
22
|
},
|
|
@@ -138,5 +143,5 @@
|
|
|
138
143
|
"type": "git",
|
|
139
144
|
"url": "git+https://github.com/nocobase/nocobase.git"
|
|
140
145
|
},
|
|
141
|
-
"gitHead": "
|
|
146
|
+
"gitHead": "e3ec19361fd7981af9fe2a7f24ad335025cbefcd"
|
|
142
147
|
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Rendered by `nb env proxy`.
|
|
2
|
-
# Context:
|
|
3
|
-
# publicBasePath={{publicBasePath}}
|
|
4
|
-
# apiBasePath={{apiBasePath}}
|
|
5
|
-
# wsPath={{wsPath}}
|
|
6
|
-
# v2PublicPath={{v2PublicPath}}
|
|
7
|
-
# backendUrl={{backendUrl}}
|
|
8
|
-
# snippetsDir={{snippetsDir}}
|
|
9
|
-
# uploadsDir={{uploadsDir}}
|
|
10
|
-
# distRootDir={{distRootDir}}
|
|
11
|
-
# entryDir={{entryDir}}
|
|
12
|
-
# publicDir={{publicDir}}
|
|
13
|
-
|
|
14
|
-
server {
|
|
15
|
-
listen 80;
|
|
16
|
-
server_name _;
|
|
17
|
-
|
|
18
|
-
# Add custom directives or locations above the managed block as needed.
|
|
19
|
-
|
|
20
|
-
{{managedConfigBlock}}
|
|
21
|
-
|
|
22
|
-
# Add custom directives or locations below the managed block as needed.
|
|
23
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
gzip on;
|
|
2
|
-
gzip_types
|
|
3
|
-
text/plain
|
|
4
|
-
text/css
|
|
5
|
-
text/xml
|
|
6
|
-
text/markdown
|
|
7
|
-
text/javascript
|
|
8
|
-
application/javascript
|
|
9
|
-
application/json
|
|
10
|
-
application/manifest+json
|
|
11
|
-
application/atom+xml
|
|
12
|
-
application/rss+xml
|
|
13
|
-
application/xml
|
|
14
|
-
application/xml+rss
|
|
15
|
-
application/xhtml+xml
|
|
16
|
-
application/wasm
|
|
17
|
-
image/svg+xml;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
log_format apm '"$time_local" client=$remote_addr '
|
|
2
|
-
'method=$request_method request="$request" '
|
|
3
|
-
'request_length=$request_length '
|
|
4
|
-
'status=$status bytes_sent=$bytes_sent '
|
|
5
|
-
'body_bytes_sent=$body_bytes_sent '
|
|
6
|
-
'referer=$http_referer '
|
|
7
|
-
'user_agent="$http_user_agent" '
|
|
8
|
-
'upstream_addr=$upstream_addr '
|
|
9
|
-
'upstream_status=$upstream_status '
|
|
10
|
-
'request_time=$request_time '
|
|
11
|
-
'upstream_response_time=$upstream_response_time '
|
|
12
|
-
'upstream_connect_time=$upstream_connect_time '
|
|
13
|
-
'upstream_header_time=$upstream_header_time';
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
map $http_upgrade $connection_upgrade {
|
|
2
|
-
default upgrade;
|
|
3
|
-
"" close;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
map $http_x_forwarded_proto $upstream_x_forwarded_proto {
|
|
7
|
-
default $http_x_forwarded_proto;
|
|
8
|
-
"" $scheme;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
map $http_host $final_host {
|
|
12
|
-
default $http_host;
|
|
13
|
-
"" $host;
|
|
14
|
-
}
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
types {
|
|
2
|
-
text/html html htm shtml;
|
|
3
|
-
text/css css;
|
|
4
|
-
text/xml xml;
|
|
5
|
-
image/gif gif;
|
|
6
|
-
image/jpeg jpeg jpg;
|
|
7
|
-
application/javascript js mjs;
|
|
8
|
-
application/atom+xml atom;
|
|
9
|
-
application/rss+xml rss;
|
|
10
|
-
|
|
11
|
-
text/mathml mml;
|
|
12
|
-
text/plain txt;
|
|
13
|
-
text/vnd.sun.j2me.app-descriptor jad;
|
|
14
|
-
text/vnd.wap.wml wml;
|
|
15
|
-
text/x-component htc;
|
|
16
|
-
|
|
17
|
-
image/avif avif;
|
|
18
|
-
image/png png;
|
|
19
|
-
image/svg+xml svg svgz;
|
|
20
|
-
image/tiff tif tiff;
|
|
21
|
-
image/vnd.wap.wbmp wbmp;
|
|
22
|
-
image/webp webp;
|
|
23
|
-
image/x-icon ico;
|
|
24
|
-
image/x-jng jng;
|
|
25
|
-
image/x-ms-bmp bmp;
|
|
26
|
-
|
|
27
|
-
font/woff woff;
|
|
28
|
-
font/woff2 woff2;
|
|
29
|
-
|
|
30
|
-
application/java-archive jar war ear;
|
|
31
|
-
application/json json;
|
|
32
|
-
application/mac-binhex40 hqx;
|
|
33
|
-
application/msword doc;
|
|
34
|
-
application/pdf pdf;
|
|
35
|
-
application/postscript ps eps ai;
|
|
36
|
-
application/rtf rtf;
|
|
37
|
-
application/vnd.apple.mpegurl m3u8;
|
|
38
|
-
application/vnd.google-earth.kml+xml kml;
|
|
39
|
-
application/vnd.google-earth.kmz kmz;
|
|
40
|
-
application/vnd.ms-excel xls;
|
|
41
|
-
application/vnd.ms-fontobject eot;
|
|
42
|
-
application/vnd.ms-powerpoint ppt;
|
|
43
|
-
application/vnd.oasis.opendocument.graphics odg;
|
|
44
|
-
application/vnd.oasis.opendocument.presentation odp;
|
|
45
|
-
application/vnd.oasis.opendocument.spreadsheet ods;
|
|
46
|
-
application/vnd.oasis.opendocument.text odt;
|
|
47
|
-
application/vnd.openxmlformats-officedocument.presentationml.presentation
|
|
48
|
-
pptx;
|
|
49
|
-
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
|
|
50
|
-
xlsx;
|
|
51
|
-
application/vnd.openxmlformats-officedocument.wordprocessingml.document
|
|
52
|
-
docx;
|
|
53
|
-
application/vnd.wap.wmlc wmlc;
|
|
54
|
-
application/wasm wasm;
|
|
55
|
-
application/x-7z-compressed 7z;
|
|
56
|
-
application/x-cocoa cco;
|
|
57
|
-
application/x-java-archive-diff jardiff;
|
|
58
|
-
application/x-java-jnlp-file jnlp;
|
|
59
|
-
application/x-makeself run;
|
|
60
|
-
application/x-perl pl pm;
|
|
61
|
-
application/x-pilot prc pdb;
|
|
62
|
-
application/x-rar-compressed rar;
|
|
63
|
-
application/x-redhat-package-manager rpm;
|
|
64
|
-
application/x-sea sea;
|
|
65
|
-
application/x-shockwave-flash swf;
|
|
66
|
-
application/x-stuffit sit;
|
|
67
|
-
application/x-tcl tcl tk;
|
|
68
|
-
application/x-x509-ca-cert der pem crt;
|
|
69
|
-
application/x-xpinstall xpi;
|
|
70
|
-
application/xhtml+xml xhtml;
|
|
71
|
-
application/xspf+xml xspf;
|
|
72
|
-
application/zip zip;
|
|
73
|
-
|
|
74
|
-
application/octet-stream bin exe dll;
|
|
75
|
-
application/octet-stream deb;
|
|
76
|
-
application/octet-stream dmg;
|
|
77
|
-
application/octet-stream iso img;
|
|
78
|
-
application/octet-stream msi msp msm;
|
|
79
|
-
|
|
80
|
-
audio/midi mid midi kar;
|
|
81
|
-
audio/mpeg mp3;
|
|
82
|
-
audio/ogg ogg;
|
|
83
|
-
audio/x-m4a m4a;
|
|
84
|
-
audio/x-realaudio ra;
|
|
85
|
-
|
|
86
|
-
video/3gpp 3gpp 3gp;
|
|
87
|
-
video/mp2t ts;
|
|
88
|
-
video/mp4 mp4;
|
|
89
|
-
video/mpeg mpeg mpg;
|
|
90
|
-
video/quicktime mov;
|
|
91
|
-
video/webm webm;
|
|
92
|
-
video/x-flv flv;
|
|
93
|
-
video/x-m4v m4v;
|
|
94
|
-
video/x-mng mng;
|
|
95
|
-
video/x-ms-asf asx asf;
|
|
96
|
-
video/x-ms-wmv wmv;
|
|
97
|
-
video/x-msvideo avi;
|
|
98
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
proxy_http_version 1.1;
|
|
2
|
-
|
|
3
|
-
proxy_set_header Upgrade $http_upgrade;
|
|
4
|
-
proxy_set_header Connection $connection_upgrade;
|
|
5
|
-
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
6
|
-
proxy_set_header X-Forwarded-Proto $upstream_x_forwarded_proto;
|
|
7
|
-
proxy_set_header Host $final_host;
|
|
8
|
-
proxy_set_header Referer $http_referer;
|
|
9
|
-
proxy_set_header User-Agent $http_user_agent;
|
|
10
|
-
|
|
11
|
-
add_header Cache-Control "no-cache, no-store" always;
|
|
12
|
-
proxy_cache_bypass $http_upgrade;
|
|
13
|
-
|
|
14
|
-
proxy_connect_timeout 600;
|
|
15
|
-
proxy_send_timeout 600;
|
|
16
|
-
proxy_read_timeout 600;
|
|
17
|
-
send_timeout 600;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
add_header Cache-Control "public" always;
|
|
2
|
-
add_header X-Content-Type-Options "nosniff" always;
|
|
3
|
-
|
|
4
|
-
access_log off;
|
|
5
|
-
autoindex off;
|
|
6
|
-
|
|
7
|
-
# Force potentially renderable uploaded files to download.
|
|
8
|
-
location ~* \.(?:htm|html|svg|svgz|xhtml)$ {
|
|
9
|
-
add_header Cache-Control "public" always;
|
|
10
|
-
add_header X-Content-Type-Options "nosniff" always;
|
|
11
|
-
add_header Content-Disposition "attachment" always;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
# Let Markdown files render as plain Markdown text.
|
|
15
|
-
location ~* \.md$ {
|
|
16
|
-
default_type text/markdown;
|
|
17
|
-
|
|
18
|
-
add_header Cache-Control "public" always;
|
|
19
|
-
add_header X-Content-Type-Options "nosniff" always;
|
|
20
|
-
add_header Content-Disposition "inline" always;
|
|
21
|
-
}
|