openyida 2026.4.2-beta.2 → 2026.4.2-beta.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.
@@ -439,10 +439,10 @@ class ProjectInitChecker {
439
439
  id: 'project-init',
440
440
  label: passed ? 'project/ 工作目录已初始化' : 'project/ 工作目录检测',
441
441
  passed,
442
- severity: passed ? Severity.INFO : Severity.WARNING,
443
- message: passed ? null : 'project/ 目录未初始化,将自动执行 openyida copy',
444
- fixType: passed ? null : FixType.COMMAND,
445
- fixCommand: passed ? null : 'openyida copy',
442
+ severity: passed ? Severity.INFO : Severity.ERROR,
443
+ message: passed ? null : 'project/ 目录未初始化,将自动初始化',
444
+ fixType: passed ? null : FixType.AUTO,
445
+ fixAction: passed ? null : 'init-project',
446
446
  }];
447
447
  }
448
448
  }
@@ -662,7 +662,7 @@ class FixEngine {
662
662
 
663
663
  for (const issue of issues) {
664
664
  if (issue.fixType === FixType.AUTO) {
665
- const result = this.applyAutoFix(issue);
665
+ const result = await this.applyAutoFix(issue);
666
666
  this.fixResults.push(result);
667
667
  } else if (issue.fixType === FixType.COMMAND) {
668
668
  this.fixResults.push({
@@ -685,9 +685,9 @@ class FixEngine {
685
685
  /**
686
686
  * 执行自动修复动作。
687
687
  * @param {object} issue
688
- * @returns {object}
688
+ * @returns {Promise<object>}
689
689
  */
690
- applyAutoFix(issue) {
690
+ async applyAutoFix(issue) {
691
691
  switch (issue.fixAction) {
692
692
  case 'create-config': {
693
693
  const configPath = path.join(this.projectRoot, 'config.json');
@@ -715,6 +715,24 @@ class FixEngine {
715
715
  };
716
716
  }
717
717
 
718
+ case 'init-project': {
719
+ try {
720
+ const copy = require('./copy');
721
+ await copy([]);
722
+ return {
723
+ id: issue.id,
724
+ fixed: true,
725
+ message: '已自动初始化 project/ 工作目录',
726
+ };
727
+ } catch (error) {
728
+ return {
729
+ id: issue.id,
730
+ fixed: false,
731
+ message: `project/ 初始化失败,请手动运行:openyida copy(${error.message})`,
732
+ };
733
+ }
734
+ }
735
+
718
736
  default:
719
737
  return {
720
738
  id: issue.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openyida",
3
- "version": "2026.04.02-beta.2",
3
+ "version": "2026.04.02-beta.3",
4
4
  "description": "OpenYida CLI - 宜搭低代码 AI 开发工具(安装即用,零配置)",
5
5
  "bin": {
6
6
  "openyida": "./bin/yida.js",
@@ -4,7 +4,7 @@ description: >
4
4
  宜搭低代码平台 AI 开发入口。一句话生成完整应用:创建应用、表单设计、自定义页面、流程配置、数据管理。
5
5
  当用户提到"宜搭"、"yida"、"低代码"、"创建应用"、"创建表单"、"发布页面"、"搭建"、"系统"、"应用"时触发。
6
6
  metadata:
7
- version: 2026.04.02-beta.2
7
+ version: 2026.04.02-beta.3
8
8
  ---
9
9
 
10
10
  # 宜搭 AI 应用开发指南