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.
- package/lib/core/doctor.js +25 -7
- package/package.json +1 -1
- package/yida-skills/SKILL.md +1 -1
package/lib/core/doctor.js
CHANGED
|
@@ -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.
|
|
443
|
-
message: passed ? null : 'project/
|
|
444
|
-
fixType: passed ? null : FixType.
|
|
445
|
-
|
|
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
package/yida-skills/SKILL.md
CHANGED