fix: complete TechLog migration evidence

This commit is contained in:
DongHyeonka
2026-08-16 04:55:52 +09:00
parent 6c2780b7a7
commit 3a7c5deca0
81 changed files with 1492 additions and 345 deletions
+27
View File
@@ -0,0 +1,27 @@
import { mkdir, readFile, writeFile } from "node:fs/promises";
import path from "node:path";
import type { TechLogServingContract } from "./tech-log-serving-contract.ts";
type ServingArtifactOptions = Readonly<{
distRoot: string;
contract: TechLogServingContract;
serverSourcePath?: string;
}>;
export async function writeTechLogServingArtifact({
distRoot,
contract,
serverSourcePath = "scripts/lib/tech-log-production-server.ts",
}: ServingArtifactOptions): Promise<void> {
const absoluteDistRoot = path.resolve(distRoot);
const serverSource = await readFile(path.resolve(serverSourcePath), "utf8");
await mkdir(absoluteDistRoot, { recursive: true });
await Promise.all([
writeFile(
path.join(absoluteDistRoot, "tech-log-serving-contract.json"),
`${JSON.stringify(contract, null, 2)}\n`,
),
writeFile(path.join(absoluteDistRoot, "server.mjs"), serverSource),
]);
}