openxiangda 1.0.94 → 1.0.95

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 CHANGED
@@ -466,7 +466,7 @@ async function doctor(args) {
466
466
  return;
467
467
  }
468
468
  const config = loadConfig();
469
- const profileName = flags.profile || config.currentProfile;
469
+ const profileName = resolveDoctorProfileName(config, flags);
470
470
  const result = {
471
471
  cli: {
472
472
  version: CURRENT_VERSION,
@@ -561,6 +561,24 @@ async function doctor(args) {
561
561
  printDoctorReport(result);
562
562
  }
563
563
 
564
+ function resolveDoctorProfileName(config, flags) {
565
+ if (flags.profile) return flags.profile;
566
+ const state = loadProjectState();
567
+ const boundEntries = Object.entries(state.profiles || {}).filter(([, bound]) => bound?.appType);
568
+ const requestedAppType = flags['app-type'];
569
+ if (requestedAppType) {
570
+ const matched = boundEntries.find(([, bound]) => bound.appType === requestedAppType);
571
+ if (matched) return matched[0];
572
+ }
573
+ if (config.currentProfile && state.profiles?.[config.currentProfile]?.appType) {
574
+ return config.currentProfile;
575
+ }
576
+ if (boundEntries.length === 1) {
577
+ return boundEntries[0][0];
578
+ }
579
+ return config.currentProfile;
580
+ }
581
+
564
582
  function printDoctorReport(result) {
565
583
  const lines = [
566
584
  `OpenXiangda doctor v${result.cli.version}`,
@@ -4025,6 +4043,7 @@ async function commands(args) {
4025
4043
  'permission form-group-list|form-group-create|form-group-update|form-group-delete|form-group-bind|form-summary|menu-permissions',
4026
4044
  'settings get|save|indexes|indexes-save|data-management|data-management-save|public-access|public-access-save|public-access-delete',
4027
4045
  'resource validate|plan|publish|pull|typegen|explain',
4046
+ 'runtime deploy|releases|activate',
4028
4047
  'inspect app|form|workflow|automation|permissions',
4029
4048
  'feedback preview|submit',
4030
4049
  'skill install|status|bootstrap',
@@ -5047,6 +5066,9 @@ function validateWorkspaceResources(manifest) {
5047
5066
  const errors = [];
5048
5067
  const warnings = [];
5049
5068
  const counts = {};
5069
+ if (!fs.existsSync(manifest.baseDir)) {
5070
+ warnings.push('未发现 src/resources;多资源正式开发请在该目录声明资源,或使用一等 CLI 子命令进行只读诊断/小步维护');
5071
+ }
5050
5072
  for (const spec of RESOURCE_SPECS) {
5051
5073
  const items = manifest[spec.key] || [];
5052
5074
  counts[spec.key] = items.length;
@@ -219,15 +219,77 @@ const DESIGN_GATE_TOPICS = [
219
219
  },
220
220
  ];
221
221
 
222
+ const DESIGN_GATE_TOPIC_ALIASES = {
223
+ app: 'new-app',
224
+ application: 'new-app',
225
+ dashboard: 'complex-page',
226
+ page: 'complex-page',
227
+ pages: 'complex-page',
228
+ login: 'auth',
229
+ register: 'auth',
230
+ registration: 'auth',
231
+ sso: 'auth',
232
+ public: 'public-access',
233
+ guest: 'public-access',
234
+ visitor: 'public-access',
235
+ visitors: 'public-access',
236
+ permission: 'permissions',
237
+ role: 'permissions',
238
+ roles: 'permissions',
239
+ workflow: 'workflow-automation',
240
+ automation: 'workflow-automation',
241
+ function: 'workflow-automation',
242
+ functions: 'workflow-automation',
243
+ 'app-function': 'workflow-automation',
244
+ js_code: 'workflow-automation',
245
+ jscode: 'workflow-automation',
246
+ connector: 'connector-notification',
247
+ connectors: 'connector-notification',
248
+ notification: 'connector-notification',
249
+ notifications: 'connector-notification',
250
+ integration: 'connector-notification',
251
+ integrations: 'connector-notification',
252
+ webhook: 'connector-notification',
253
+ resource: 'resource-maintenance',
254
+ resources: 'resource-maintenance',
255
+ maintenance: 'resource-maintenance',
256
+ };
257
+
258
+ function resolveTopicSelection(topicCode) {
259
+ if (!topicCode || topicCode === 'all') {
260
+ return { requested: ['all'], wanted: null, unknown: [] };
261
+ }
262
+ const knownCodes = new Set(DESIGN_GATE_TOPICS.map(topic => topic.code));
263
+ const requested = String(topicCode)
264
+ .split(/[,/|+\s]+/)
265
+ .map(item => item.trim())
266
+ .filter(Boolean);
267
+ const wanted = new Set();
268
+ const unknown = [];
269
+ for (const item of requested) {
270
+ const normalized = item.toLowerCase();
271
+ const code = DESIGN_GATE_TOPIC_ALIASES[normalized] || normalized;
272
+ if (knownCodes.has(code)) {
273
+ wanted.add(code);
274
+ } else {
275
+ unknown.push(item);
276
+ }
277
+ }
278
+ return { requested, wanted, unknown };
279
+ }
280
+
222
281
  function selectTopics(topicCode) {
223
- if (!topicCode || topicCode === 'all') return DESIGN_GATE_TOPICS;
224
- const wanted = new Set(String(topicCode).split(',').map(item => item.trim()).filter(Boolean));
225
- return DESIGN_GATE_TOPICS.filter(topic => wanted.has(topic.code));
282
+ const selection = resolveTopicSelection(topicCode);
283
+ if (!selection.wanted) return DESIGN_GATE_TOPICS;
284
+ return DESIGN_GATE_TOPICS.filter(topic => selection.wanted.has(topic.code));
226
285
  }
227
286
 
228
287
  function getDesignGates(topicCode) {
288
+ const selection = resolveTopicSelection(topicCode);
229
289
  return {
230
290
  hardRule: DESIGN_GATE_HARD_RULE,
291
+ requestedTopics: selection.requested,
292
+ unknownTopics: selection.unknown,
231
293
  topics: selectTopics(topicCode),
232
294
  };
233
295
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openxiangda",
3
- "version": "1.0.94",
3
+ "version": "1.0.95",
4
4
  "description": "OpenXiangda CLI, workspace build tools, runtime SDK, and form components.",
5
5
  "private": false,
6
6
  "bin": {