diff --git a/package-lock.json b/package-lock.json index e8c308a..b57cecf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@kri/create-next-app", - "version": "0.1.3", + "version": "0.1.5", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@kri/create-next-app", - "version": "0.1.3", + "version": "0.1.5", "license": "UNLICENSED", "bin": { "kri-create-next-app": "dist/cli.js" diff --git a/package.json b/package.json index 4e93cc7..599da7c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@kri/create-next-app", - "version": "0.1.4", + "version": "0.1.5", "description": "Create a KRI standard Next.js application", "type": "module", "bin": { diff --git a/tests/harness.test.mjs b/tests/harness.test.mjs index edfa9dd..f762123 100644 --- a/tests/harness.test.mjs +++ b/tests/harness.test.mjs @@ -8,9 +8,9 @@ import { parseArguments } from "../dist/args.js"; import { composeAgentHarness } from "../dist/harness.js"; async function createFixture(t) { - const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-next-harness-")); - const harnessRoot = path.join(root, "_________AgentHarnessBase"); - const targetDir = path.join(root, "sample-front"); + const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-next-한글 공백-")); + const harnessRoot = path.join(root, "_________Agent Harness 기준"); + const targetDir = path.join(root, "샘플 front"); const logPath = path.join(root, "calls.jsonl"); await mkdir(path.join(harnessRoot, "dist"), { recursive: true }); await mkdir(targetDir, { recursive: true }); @@ -52,7 +52,7 @@ test("registers shared, composes, and verifies in deterministic order", async (t .split("\n") .map((line) => JSON.parse(line)); assert.deepEqual(calls, [ - ["register", "--project", "sample-front", "--path", "sample-front", "--shared"], + ["register", "--project", "sample-front", "--path", "샘플 front", "--shared"], ["compose", "--project", "sample-front"], ["verify", "--project", "sample-front"], ]); diff --git a/tests/path-safety.test.mjs b/tests/path-safety.test.mjs new file mode 100644 index 0000000..9d1f0f4 --- /dev/null +++ b/tests/path-safety.test.mjs @@ -0,0 +1,30 @@ +import assert from "node:assert/strict"; +import { mkdtemp, mkdir, readFile, rm, writeFile } from "node:fs/promises"; +import os from "node:os"; +import path from "node:path"; +import test from "node:test"; + +import { run } from "../dist/process.js"; + +test("runs npm scripts from a Korean path containing spaces", async (t) => { + const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-next-한글 공백-")); + const targetDir = path.join(root, "생성 프로젝트"); + const markerName = "실행 결과.txt"; + await mkdir(targetDir, { recursive: true }); + await writeFile( + path.join(targetDir, "package.json"), + `${JSON.stringify({ + name: "unicode-path-check", + private: true, + scripts: { + "path-check": `node -e "require('node:fs').writeFileSync('${markerName}', process.cwd(), 'utf8')"`, + }, + }, null, 2)}\n`, + "utf8", + ); + t.after(() => rm(root, { recursive: true, force: true })); + + await run("npm", ["run", "path-check"], targetDir); + + assert.equal(await readFile(path.join(targetDir, markerName), "utf8"), targetDir); +});