openxiangda 1.0.95 → 1.0.96
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/lib/cli.js +30 -1
- package/lib/design-gates.js +34 -0
- package/package.json +1 -1
package/lib/cli.js
CHANGED
|
@@ -24,7 +24,9 @@ const { assertCanInitializeWorkspace, initWorkspace } = require('./workspace-ini
|
|
|
24
24
|
const { bootstrapWorkspace } = require('./workspace-bootstrap');
|
|
25
25
|
const {
|
|
26
26
|
getDesignGates,
|
|
27
|
+
getDesignTopicCatalog,
|
|
27
28
|
getResourceExplain,
|
|
29
|
+
renderDesignHelp,
|
|
28
30
|
renderDesignGatesText,
|
|
29
31
|
renderDesignTemplate,
|
|
30
32
|
renderResourceExplain,
|
|
@@ -49,6 +51,9 @@ const RUNTIME_UPLOAD_CONCURRENCY = 3;
|
|
|
49
51
|
|
|
50
52
|
async function main(argv) {
|
|
51
53
|
const [command, ...rest] = argv;
|
|
54
|
+
if (command === 'version' || command === '--version' || command === '-v') {
|
|
55
|
+
return version(rest);
|
|
56
|
+
}
|
|
52
57
|
if (!command || command === 'help' || command === '--help' || command === '-h') {
|
|
53
58
|
printHelp();
|
|
54
59
|
return;
|
|
@@ -91,6 +96,7 @@ function printHelp() {
|
|
|
91
96
|
print(`OpenXiangda CLI
|
|
92
97
|
|
|
93
98
|
Usage:
|
|
99
|
+
openxiangda version [--json]
|
|
94
100
|
openxiangda login <platform-url> [--profile name]
|
|
95
101
|
openxiangda update check|install [--json] [--registry https://registry.npmjs.org]
|
|
96
102
|
openxiangda platform add <name> <platform-url>
|
|
@@ -153,6 +159,7 @@ Usage:
|
|
|
153
159
|
|
|
154
160
|
OpenXiangda 使用普通用户登录 token,不需要 AK/SK。
|
|
155
161
|
表单页、流程表单页和代码页的主链路是 sy-lowcode-app-workspace + openxiangda workspace publish。
|
|
162
|
+
新 React SPA 公开访问使用 public-access 命令和 src/resources/public-access;settings public-access 仅用于旧表单公开设置兼容/修复。
|
|
156
163
|
JS_CODE V2 使用 trusted_node;AI 源码必须写在 src/js-code-nodes/<scriptCode>/index.ts,代码自动化源码写在 src/automations/<resourceCode>/index.ts。definition-json 中的 sourceFile.localPath 会在 validate/create/publish 时先 TS 校验、再构建并上传为快照。`);
|
|
157
164
|
}
|
|
158
165
|
|
|
@@ -233,6 +240,17 @@ function wantsSubcommandHelp(subcommand, flags) {
|
|
|
233
240
|
);
|
|
234
241
|
}
|
|
235
242
|
|
|
243
|
+
async function version(args) {
|
|
244
|
+
const { flags } = parseArgs(args);
|
|
245
|
+
const result = {
|
|
246
|
+
name: NPM_PACKAGE_NAME,
|
|
247
|
+
version: CURRENT_VERSION,
|
|
248
|
+
updateCheckCommand: 'openxiangda update check --json',
|
|
249
|
+
};
|
|
250
|
+
if (flags.json) return writeJson(result);
|
|
251
|
+
print(CURRENT_VERSION);
|
|
252
|
+
}
|
|
253
|
+
|
|
236
254
|
async function update(args) {
|
|
237
255
|
const requestedSubcommand = args[0] && !args[0].startsWith('--') ? args[0] : 'check';
|
|
238
256
|
const parsedArgs = requestedSubcommand === args[0] ? args.slice(1) : args;
|
|
@@ -435,7 +453,8 @@ async function design(args) {
|
|
|
435
453
|
const { flags, positional } = parseArgs(rest);
|
|
436
454
|
const topic = flags.topic || positional[0];
|
|
437
455
|
if (wantsSubcommandHelp(subcommand, flags)) {
|
|
438
|
-
|
|
456
|
+
if (flags.json) return writeJson(getDesignTopicCatalog());
|
|
457
|
+
print(renderDesignHelp());
|
|
439
458
|
return;
|
|
440
459
|
}
|
|
441
460
|
|
|
@@ -4016,7 +4035,9 @@ async function commands(args) {
|
|
|
4016
4035
|
const { flags } = parseArgs(args);
|
|
4017
4036
|
const manifest = {
|
|
4018
4037
|
name: 'openxiangda',
|
|
4038
|
+
version: CURRENT_VERSION,
|
|
4019
4039
|
commands: [
|
|
4040
|
+
'version [--json]',
|
|
4020
4041
|
'login <platform-url> [--profile name]',
|
|
4021
4042
|
'update check|install',
|
|
4022
4043
|
'platform add|list|use|remove',
|
|
@@ -4048,6 +4069,14 @@ async function commands(args) {
|
|
|
4048
4069
|
'feedback preview|submit',
|
|
4049
4070
|
'skill install|status|bootstrap',
|
|
4050
4071
|
],
|
|
4072
|
+
designTopics: getDesignTopicCatalog(),
|
|
4073
|
+
resourceNotes: [
|
|
4074
|
+
'For formal multi-resource development, prefer src/resources/** + openxiangda resource validate|plan|publish.',
|
|
4075
|
+
'Use first-class route/public-access/auth-config/function/connector/notification/data-view/menu/permission commands for discovery, diagnosis, dry-run, and small live fixes.',
|
|
4076
|
+
'public-access is the new React SPA public policy resource for /view/:appType/public/* routes.',
|
|
4077
|
+
'settings public-access is legacy form public-access compatibility/repair and should not be used for new React SPA apps.',
|
|
4078
|
+
'Direct live mutation commands should use --dry-run first and --write-manifest when the repository should remain source of truth.',
|
|
4079
|
+
],
|
|
4051
4080
|
};
|
|
4052
4081
|
if (flags.json) return writeJson(manifest);
|
|
4053
4082
|
print(JSON.stringify(manifest, null, 2));
|
package/lib/design-gates.js
CHANGED
|
@@ -294,6 +294,37 @@ function getDesignGates(topicCode) {
|
|
|
294
294
|
};
|
|
295
295
|
}
|
|
296
296
|
|
|
297
|
+
function getDesignTopicCatalog() {
|
|
298
|
+
return {
|
|
299
|
+
hardRule: DESIGN_GATE_HARD_RULE,
|
|
300
|
+
topics: DESIGN_GATE_TOPICS.map(topic => ({
|
|
301
|
+
code: topic.code,
|
|
302
|
+
title: topic.title,
|
|
303
|
+
triggers: topic.triggers,
|
|
304
|
+
})),
|
|
305
|
+
aliases: DESIGN_GATE_TOPIC_ALIASES,
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
function renderDesignHelp() {
|
|
310
|
+
const catalog = getDesignTopicCatalog();
|
|
311
|
+
const lines = [
|
|
312
|
+
'用法: openxiangda design gates|template [--topic code[,code...]] [--json]',
|
|
313
|
+
'',
|
|
314
|
+
catalog.hardRule,
|
|
315
|
+
'',
|
|
316
|
+
'Topics:',
|
|
317
|
+
];
|
|
318
|
+
for (const topic of catalog.topics) {
|
|
319
|
+
lines.push(`- ${topic.code}: ${topic.title} (${topic.triggers.join('、')})`);
|
|
320
|
+
}
|
|
321
|
+
lines.push('', 'Aliases:');
|
|
322
|
+
for (const [alias, code] of Object.entries(catalog.aliases).sort()) {
|
|
323
|
+
lines.push(`- ${alias} -> ${code}`);
|
|
324
|
+
}
|
|
325
|
+
return lines.join('\n');
|
|
326
|
+
}
|
|
327
|
+
|
|
297
328
|
function renderDesignGatesText(topicCode) {
|
|
298
329
|
const gates = getDesignGates(topicCode);
|
|
299
330
|
const lines = [gates.hardRule, ''];
|
|
@@ -503,8 +534,11 @@ function renderResourceExplain(type) {
|
|
|
503
534
|
module.exports = {
|
|
504
535
|
DESIGN_GATE_HARD_RULE,
|
|
505
536
|
DESIGN_GATE_TOPICS,
|
|
537
|
+
DESIGN_GATE_TOPIC_ALIASES,
|
|
506
538
|
getDesignGates,
|
|
539
|
+
getDesignTopicCatalog,
|
|
507
540
|
getResourceExplain,
|
|
541
|
+
renderDesignHelp,
|
|
508
542
|
renderDesignGatesText,
|
|
509
543
|
renderDesignTemplate,
|
|
510
544
|
renderResourceExplain,
|