Files
Aislo/resources/tester/helper_506_3_b09_print.cjs
T
eomsangdonandClaude Opus 5.5 17e6500cf6 fix(506-3 B07 · CAD 작은 흠): 저장 길 · 죽은 길 걷음 · CAD 되돌리기 · B09 인쇄 미리보기 · M02 도움말
- 1-A 도면 GET · 저장 PUT 한도 60 s · 저장 중 미리받기 쉼 · 끊긴 저장 = 목록 confirmed 로 판정
- 2 CAD 자동백업 열쇠 = b07:{프로젝트}:{도면} · 도각 편집 = b07-frame:{프로젝트} · [초기화] 같은 열쇠
- 3-1 [초기화] 물음 글 = 프로젝트 도각 그대로 · [도각 편집] → [기본 도각 복원] 안내
- 3-2 풀린 장 저장본 json · 수량표 찌꺼기 걷음(_write_manifest 한 곳)
- 5-1 확정 풀기 · 배치 · 축척 = mark_stage(save)
- 7-3 start_stage 가 DEV_UNLOCK 표식 남김
- 6-a navigateDrawing · onNavigate · hasPrev · hasNext 걷음 · 6-b cad-host-save 토글 걷음 · 4-2 B08 안 쓰는 글 11 걷음
- 6-f 특성 판 색 끌기 = 되돌리기 한 칸(paintNowCommitLater 한 벌) · 6-g LAYMRG 사본 길
- 4-1 B09 [인쇄 미리보기] = 저장 뒤 이동 · 단계 그대로 · 6-e M02 카드 도움말 DWG 한 줄
- 시험 test_506_3_* 둘 · cad/undo-506-3 · test_298_2_b07_buttons 열쇠 맞춤

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 12:48:36 +09:00

34 lines
1.4 KiB
JavaScript

/* 506-3 4-1 헬퍼 — B09 초안 [인쇄 미리보기] 단추를 Node 로 눌러 저장(DRAFT.save) 뒤 이동인지 표준출력 JSON 으로. */
const fs = require("fs");
const path = require("path");
const ts = require(path.join(__dirname, "..", "..", "config", "node_modules", "typescript"));
const calls = [];
const DRAFT = { builders: {}, extend: [], panels: [], actions: [] };
const STUBS = {
"@ui/ui_template_elements": { createButton: (opts) => ({ dataset: {}, onClick: opts.onClick }) },
"../../A00_Common/router": { navigateTo: (to) => calls.push(`go:${to}`) },
"../B09_Estimation_UI_Tabs": { DRAFT },
"./B09_Draft_Print_Route": { ROUTE: { path: "/b09-print" } },
};
const file = path.join(__dirname, "..", "..", "B09_Estimation", "draft", "B09_Draft_Print_UI.ts");
const js = ts.transpileModule(fs.readFileSync(file, "utf8"), {
compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 },
}).outputText;
new Function("exports", "module", "require", js)({}, { exports: {} }, (r) => STUBS[r] ?? {});
const tick = () => new Promise((done) => setTimeout(done, 0));
(async () => {
const button = DRAFT.actions[0]();
const out = {};
DRAFT.save = async () => (calls.push("save"), true);
button.onClick();
await tick();
out.saved = calls.splice(0);
DRAFT.save = async () => (calls.push("save"), false);
button.onClick();
await tick();
out.failed = calls.splice(0);
process.stdout.write(JSON.stringify(out));
})();