fix(scripts): final review Critical+Important fixes (Widget alignment, full readLayerXml, Label _string, atlas selection, hard-coded paths, exit code, dead code removal)

This commit is contained in:
2026-09-02 09:11:51 +08:00
parent 7e0a8b79a4
commit cb3bd54175
19 changed files with 5076 additions and 186 deletions
@@ -7,15 +7,16 @@
// - 单个 target 失败 (例如 ImgResID 未导入 sprite) 不阻塞后续 target, 日志记录后继续.
// - per "下游不兜底" 原则: CLI 本身必须 throw 让错误暴露; batch 仅负责捕获 + 汇总, 不做修补.
import { execSync } from 'node:child_process';
import { join } from 'node:path';
import { ROOT } from './lib/paths.mjs';
const ROOT = process.cwd(); // assume run from cocoscreator_projects/
const OUT_DIR = `${ROOT}/YouleNexus/out/legacy-migration`;
const SOURCE = `${ROOT}/../projects/Game_Surface_3/save`;
const OUT_DIR = join(ROOT, 'YouleNexus', 'out', 'legacy-migration');
const SOURCE = join(ROOT, '..', 'projects', 'Game_Surface_3', 'save');
// 按 spec 已核实映射表 (11 个 prefab). Layer10_Protocol + Login_Layer + Layer619_BackOtherGame 三个 PoC 已存在,
// 但 batch 仍会重新生成它们 (idempotent — 覆盖 out/legacy-migration/*.prefab + .diff).
const targets = [
{ xml: 'Layer00002.xml', prefab: 'YouleNexus/assets/framework/ui/prefabs/views/Login_Layer.prefab', name: 'Login_Layer', note: 'PoC 3 (Layer00002)' },
{ xml: 'Layer00002.xml', prefab: 'YouleNexus/assets/framework/ui/prefabs/Login_Layer.prefab', name: 'Login_Layer', note: 'PoC 3 (Layer00002)' },
{ xml: 'Layer00017.xml', prefab: 'YouleNexus/assets/framework/ui/prefabs/views/PlayerInfoView.prefab', name: 'MenuPlayerInfo_Layer', note: '拍板 A (Layer00017)' },
{ xml: 'Layer00029.xml', prefab: 'YouleNexus/assets/framework/ui/prefabs/widgets/Group106_PhoneVerify.prefab', name: 'phoneInfo' },
{ xml: 'Layer00010.xml', prefab: 'YouleNexus/assets/framework/ui/prefabs/widgets/Layer10_Protocol.prefab', name: 'Protol_Layer', note: 'PoC 2 (Layer00010)' },
@@ -57,4 +58,5 @@ if (results.failed.length > 0) {
console.log(` - ${f.name} (${f.xml}): ${f.error}`);
}
}
console.log('\nNext step: human reviews each .diff and decides whether to overwrite YouleNexus original prefabs.');
console.log('\nNext step: human reviews each .diff and decides whether to overwrite YouleNexus original prefabs.');
process.exitCode = results.failed.length > 0 ? 1 : 0;