feat: 新增 fix-borders —— 修复 Cocos 重启把九宫格 border 重置成 0 的 meta

Cocos 重启/重新导入有时把已设九宫格的图 meta 里 subMetas.*.userData.border*
重置成 0(九宫格丢失)。新增功能扫 git 改动的 .meta,把「git 有值、工作区被
清 0」的 border 还原成 git 的正确值,只动 border 字段、保留 meta 其它改动。

- cli/src/editor/fix-borders.js: 核心(git 对比 + 精准还原)
- cli fix-borders 命令(main.js 注册)
- MCP tool meta_fix_reset_border(main.js wrapper + server/tools.js)
- 跨平台纯 JS + git,带 dry-run

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
furao
2026-06-07 18:34:53 +08:00
parent 803a09517f
commit fc93911d31
5 changed files with 177 additions and 1 deletions
+4
View File
@@ -488,6 +488,10 @@ function buildToolCtx() {
cleanDevDir: function () { return exports.methods.cleanDevDir(); },
getStatus: function () { return exports.methods.getStatus(); },
reloadPackage: doRestartSelf,
fixResetBorders: function (opts) {
var mod = require('./cli/src/editor/fix-borders.js');
return mod.fixResetBorders(Editor.Project.path, opts || {});
},
},
};
}