Files
Aislo/resources/tester/helper_717_1_logic_api_paths.cjs
T
eomsangdonandClaude Opus 5.5 604ab2cb73 refactor(853-1): M01 화면 죽은 것 걷음 — 묶음 ①
- 지움: UI_Logic_Pick.ts(부르는 곳 0) · UI_Logic_Edit.ts(buildEditor · qtyKind 죽음 · 남은 formatNumber 는 공용 다시 내보내기뿐) · UI_Tree.ts(공용 트리 다시 내보내기 껍데기)
- Logic_Note: buildNote 와 그것만 쓰던 relatedFinds · matchRow · tableView 등 걷음(살아 있는 loadTable · explain 남김)
- LogicLab_Foot.FOOT_OF · Draft.fileCount 걷음(부르는 곳 0)
- 글 키: Logic_Text 62 · LogicLab_Text 11 걷음(정적 · 동적 부름 0 · typecheck 가 지킴)
- import 를 본래 자리로: formatNumber · formatMoney 등 → common_util_money · renderTree → @ui/ui_template_tree
- UI_Logic_Money.ts 는 남김 — M02 네 파일이 import(sub2 몫)
- 시험: test_782_1 소유 선택지 시험 지움(죽은 buildEditor 글만 봄) · test_208_1 · test_modal_top 경로 목록에서 Logic_Pick 줄 뺌 · helper_717_1 의 Logic_Edit 가짜 모듈 뺌

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-17 11:35:53 +09:00

48 lines
1.6 KiB
JavaScript

/* 717-1 헬퍼 — 상세 부품 길 주입 · 가짜 fetch 로 부른 주소만 모음. 짝 = `test_717_1_logic_lib.py`. */
const path = require("path");
const { makeLoader } = require("./helper_ts_stub_loader.cjs");
const ROOT = path.join(__dirname, "..", "..");
const { load } = makeLoader({
root: ROOT,
stubs: { M01_MasterData_UI_Logic_Text: {} },
});
const urls = [];
global.fetch = async (url) => {
urls.push(String(url).replace("http://fake", ""));
return {
ok: true,
status: 200,
statusText: "",
json: async () => ({ logics: [], subs: [], items: [], rows: [] }),
};
};
const api = load("M01_MasterData", "M01_MasterData_UI_Logic_Api.ts");
const rows = load("M01_MasterData", "M01_MasterData_Api_Fetch.ts");
const note = load("M01_MasterData", "M01_MasterData_UI_Logic_Note.ts");
async function round(tag) {
await api.fetchLogic("K");
await api.fetchAuto("K");
await api.searchElements("재료", "q");
await api.fetchMaterials({ sub: "s" });
await api.runCalc({ key: "K", inputs: {} });
await api.runText({ key: "K", inputs: {} });
await rows.fetchRows("기계.json", 1, 5, "q");
await rows.fetchPick("price", "q");
await note.loadTable(`T-${tag}`);
await rows.fetchGroups(); // 관리자 길 — 늘 /m01
await api.saveFiles([]); // 저장 — 늘 /m01
return urls.splice(0).map((u) => u.split("?")[0]);
}
(async () => {
const out = { before: await round("a") };
api.setLogicApiPaths({ read: "/m02/logic-lib", calc: "/m02/calc-x" });
out.injected = await round("b");
api.setLogicApiPaths();
out.after = await round("c");
process.stdout.write(JSON.stringify(out));
})();