- 구조물정의.json → resources/master_data/구조물정의/구조물정의.json(git mv · 내용 그대로) - 구조물정의_이력/판_1 ~ 22 → resources/master_data/구조물정의/이력/(git mv · 내용 그대로) - 읽는 자리 = B05 Structures_Schema DEFINITION_PATH · HISTORY_DIRNAME · M01_SO_Definition HISTORY - M01 요소 로더 · check_master 는 첫 층 *.json 만 읽음 — 새 폴더는 요소로 안 읽힘(수식문서/ 와 같은 대접) - 시험 · 도우미 · ui_checks 경로 글 고침(파일 이름 그대로) - resources/master_template 에 구조물 정의 자료 남지 않음 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.3 KiB
JavaScript
24 lines
1.3 KiB
JavaScript
/* PLAN 322-1 — 옛 도움 파일들이 함께 쓰는 구조물 표(catalog) 모듈 한 벌.
|
|
* 진짜 `common_util_structure_catalog.ts` + 부품 상자 JSON · 실제 정의(마스터 읽기만)로 세운 표(화면이 종류
|
|
* 레지스트리를 받은 뒤와 같음). 각 도움 파일 로더가 `…common_util_structure_catalog` 요청을 이것으로 갈음함.
|
|
*/
|
|
const fs = require("fs");
|
|
const path = require("path");
|
|
const ROOT = path.join(__dirname, "..", "..");
|
|
const ts = require(path.join(ROOT, "config", "node_modules", "typescript"));
|
|
const read = (...parts) => JSON.parse(fs.readFileSync(path.join(ROOT, ...parts), "utf8"));
|
|
|
|
const js = ts.transpileModule(
|
|
fs.readFileSync(path.join(ROOT, "common_util", "common_util_structure_catalog.ts"), "utf8"),
|
|
{ compilerOptions: { module: ts.ModuleKind.CommonJS, target: ts.ScriptTarget.ES2020 } },
|
|
).outputText;
|
|
const box = { exports: {} };
|
|
new Function("exports", "module", "require", js)(box.exports, box, () =>
|
|
read("common_util", "common_util_structure_parts.json"),
|
|
);
|
|
box.exports.useCatalogDefinition(read("resources", "master_data", "구조물정의", "구조물정의.json"));
|
|
|
|
/** 로더 요청이 구조물 표 모듈인가. */
|
|
box.exports.isCatalogRequest = (request) => /common_util_structure_catalog(\.js)?$/.test(request);
|
|
module.exports = box.exports;
|