diff --git a/common_util/common_util_sheet_recalc.py b/common_util/common_util_sheet_recalc.py index e65db0c5..31d23382 100644 --- a/common_util/common_util_sheet_recalc.py +++ b/common_util/common_util_sheet_recalc.py @@ -13,9 +13,10 @@ from typing import Any from common_util.common_util_node_bundle import ROOT, build_bundle, run_bundle_json -BUNDLE = ROOT / "config" / "formula_node" / "ui_template_sheet_node.js" +BUNDLE = ROOT / "config" / "formula_node" / "common_util_sheet_recalc_node.js" NPM_SCRIPT = "build:formula" SOURCE_DIR = ROOT / "ui_template" / "sheet" +ENTRY = ROOT / "common_util" / "common_util_sheet_recalc_node.ts" def _stale() -> bool: @@ -23,7 +24,7 @@ def _stale() -> bool: if not BUNDLE.is_file(): return True built_at = BUNDLE.stat().st_mtime - return any(p.stat().st_mtime > built_at for p in SOURCE_DIR.glob("*.ts")) + return any(p.stat().st_mtime > built_at for p in [ENTRY, *SOURCE_DIR.glob("*.ts")]) def recalc_sheets(docs: list[dict[str, Any]]) -> list[dict[str, Any]] | None: diff --git a/common_util/common_util_sheet_recalc_node.ts b/common_util/common_util_sheet_recalc_node.ts index 368d5033..bd2b13a1 100644 --- a/common_util/common_util_sheet_recalc_node.ts +++ b/common_util/common_util_sheet_recalc_node.ts @@ -1,19 +1,20 @@ /* ============================================================================= - * ui_template_sheet_node.ts + * common_util_sheet_recalc_node.ts * 표 문서 풀이를 **서버가** 돌리는 진입점 — [저장] 때 정본으로 다시 풂. * * 풀이는 화면이 쓰는 `ui_template_sheet_recalc.ts` 그대로 — 여기에는 계산이 없음. - * 파이썬 껍데기 = `common_util/common_util_sheet_recalc.py` · 번들 = `npm run build:formula`. + * 파이썬 껍데기 = `common_util_sheet_recalc.py` · 번들 = `npm run build:formula`. * * 실행: node <번들> <입력.json> <출력.json> * 입력 { docs: SheetDoc[] } * 출력 { results: SheetResult[] } — 입력 차례 그대로 * 끝 코드: 0 성공 / 2 인자 오류 + * ⚠ `ui_template/sheet/` 밖에 둠 — M02 화면이 그 폴더를 통째로 훑어 불러옴(node:fs 가 브라우저로 새지 않게). * ========================================================================== */ import { readFileSync, writeFileSync } from "node:fs"; -import { recalcSheet } from "./ui_template_sheet_recalc"; -import type { SheetDoc } from "./ui_template_sheet_types"; +import { recalcSheet } from "@ui/sheet/ui_template_sheet_recalc"; +import type { SheetDoc } from "@ui/sheet/ui_template_sheet_types"; const [inputPath, outputPath] = process.argv.slice(2); if (!inputPath || !outputPath) { diff --git a/package.json b/package.json index 4fff73b7..16499d54 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "build": "node ./config/node_modules/typescript/bin/tsc --noEmit && node ./config/node_modules/vite/bin/vite.js build --configLoader runner && npm run build:corridor && npm run build:server-calc && npm run build:formula && npm run build:b07-cad", "build:corridor": "node ./config/node_modules/vite/bin/vite.js build --configLoader runner --ssr ../B05_Profile/B05_Profile_Corridor_Node.ts --outDir ../config/corridor_node", "build:server-calc": "node ./config/node_modules/vite/bin/vite.js build --configLoader runner --ssr ../B06_Section/B06_Section_Server_Calc_Node.ts --outDir ../config/server_calc_node", - "build:formula": "node ./config/node_modules/vite/bin/vite.js build --configLoader runner --ssr ../ui_template/sheet/ui_template_sheet_node.ts --outDir ../config/formula_node", + "build:formula": "node ./config/node_modules/vite/bin/vite.js build --configLoader runner --ssr ../common_util/common_util_sheet_recalc_node.ts --outDir ../config/formula_node", "install:b07-cad": "npm --prefix B07_DesignDetail/openwebcad install", "build:b07-cad": "npm run install:b07-cad && npm --prefix B07_DesignDetail/openwebcad run build", "preview": "node ./config/node_modules/vite/bin/vite.js preview --configLoader runner", diff --git a/ui_template/sheet/ui_template_sheet_recalc.ts b/ui_template/sheet/ui_template_sheet_recalc.ts index b4e8cd2a..a19e1026 100644 --- a/ui_template/sheet/ui_template_sheet_recalc.ts +++ b/ui_template/sheet/ui_template_sheet_recalc.ts @@ -2,7 +2,7 @@ * ui_template_sheet_recalc.ts * 표 문서 한 벌 풀이 — 계산 열 · 한 칸만 다른 식(`줄.식`) · 합계 줄(열마다 다른 식) · 변수. * - * 화면(조작 중 즉시)과 서버(`ui_template_sheet_node.ts` — [저장] 때 정본 재계산)가 + * 화면(조작 중 즉시)과 서버(`common_util_sheet_recalc_node.ts` — [저장] 때 정본 재계산)가 * **이 파일 하나**를 같이 씀(CLAUDE.md 5장 ②). 두 벌로 짜면 끝수가 조용히 갈림. * 순환은 풀면서 잡음 — 풀고 있는 칸을 다시 부르면 그 고리의 칸마다 오류. * 오류 칸은 값 없이 `오류` 에 까닭과 함께 — 나머지 칸은 계속 풂.