fix: support Korean project paths on Windows
This commit is contained in:
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "@kri/create-spring-app",
|
"name": "@kri/create-spring-app",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "@kri/create-spring-app",
|
"name": "@kri/create-spring-app",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"license": "UNLICENSED",
|
"license": "UNLICENSED",
|
||||||
"bin": {
|
"bin": {
|
||||||
"kri-create-spring-app": "dist/cli.js"
|
"kri-create-spring-app": "dist/cli.js"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@kri/create-spring-app",
|
"name": "@kri/create-spring-app",
|
||||||
"version": "0.1.4",
|
"version": "0.1.5",
|
||||||
"description": "Create a KRI standard Spring Boot application",
|
"description": "Create a KRI standard Spring Boot application",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
@@ -84,6 +84,14 @@ tasks.withType(JavaCompile).configureEach {
|
|||||||
options.generatedSourceOutputDirectory.set(file(querydslDir))
|
options.generatedSourceOutputDirectory.set(file(querydslDir))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
tasks.withType(Test).configureEach {
|
||||||
|
jvmArgs '-Dfile.encoding=UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.withType(JavaExec).configureEach {
|
||||||
|
jvmArgs '-Dfile.encoding=UTF-8'
|
||||||
|
}
|
||||||
|
|
||||||
tasks.named('test') {
|
tasks.named('test') {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
org.gradle.jvmargs=-Xmx2g -Dfile.encoding=UTF-8
|
# Keep the Gradle daemon on the platform charset so Windows JDK 17 can read
|
||||||
|
# worker classpath files containing non-ASCII project paths.
|
||||||
|
org.gradle.jvmargs=-Xmx2g
|
||||||
org.gradle.parallel=true
|
org.gradle.parallel=true
|
||||||
org.gradle.caching=true
|
org.gradle.caching=true
|
||||||
|
|||||||
@@ -8,9 +8,9 @@ import { parseArguments } from "../dist/args.js";
|
|||||||
import { composeAgentHarness } from "../dist/harness.js";
|
import { composeAgentHarness } from "../dist/harness.js";
|
||||||
|
|
||||||
async function createFixture(t) {
|
async function createFixture(t) {
|
||||||
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-spring-harness-"));
|
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-spring-한글 공백-"));
|
||||||
const harnessRoot = path.join(root, "_________AgentHarnessBase");
|
const harnessRoot = path.join(root, "_________Agent Harness 기준");
|
||||||
const targetDir = path.join(root, "sample-server");
|
const targetDir = path.join(root, "샘플 server");
|
||||||
const logPath = path.join(root, "calls.jsonl");
|
const logPath = path.join(root, "calls.jsonl");
|
||||||
await mkdir(path.join(harnessRoot, "dist"), { recursive: true });
|
await mkdir(path.join(harnessRoot, "dist"), { recursive: true });
|
||||||
await mkdir(targetDir, { recursive: true });
|
await mkdir(targetDir, { recursive: true });
|
||||||
@@ -52,7 +52,7 @@ test("registers shared, composes, and verifies in deterministic order", async (t
|
|||||||
.split("\n")
|
.split("\n")
|
||||||
.map((line) => JSON.parse(line));
|
.map((line) => JSON.parse(line));
|
||||||
assert.deepEqual(calls, [
|
assert.deepEqual(calls, [
|
||||||
["register", "--project", "sample-server", "--path", "sample-server", "--shared"],
|
["register", "--project", "sample-server", "--path", "샘플 server", "--shared"],
|
||||||
["compose", "--project", "sample-server"],
|
["compose", "--project", "sample-server"],
|
||||||
["verify", "--project", "sample-server"],
|
["verify", "--project", "sample-server"],
|
||||||
]);
|
]);
|
||||||
|
|||||||
44
tests/path-safety.test.mjs
Normal file
44
tests/path-safety.test.mjs
Normal file
@@ -0,0 +1,44 @@
|
|||||||
|
import assert from "node:assert/strict";
|
||||||
|
import { mkdtemp, mkdir, readFile, rm } from "node:fs/promises";
|
||||||
|
import os from "node:os";
|
||||||
|
import path from "node:path";
|
||||||
|
import test from "node:test";
|
||||||
|
import { fileURLToPath } from "node:url";
|
||||||
|
|
||||||
|
import { run } from "../dist/process.js";
|
||||||
|
|
||||||
|
const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
||||||
|
|
||||||
|
test("keeps Gradle worker paths compatible with Windows JDK 17", async () => {
|
||||||
|
const gradleProperties = await readFile(
|
||||||
|
path.join(repositoryRoot, "templates", "base", "gradle.properties"),
|
||||||
|
"utf8",
|
||||||
|
);
|
||||||
|
const buildGradle = await readFile(
|
||||||
|
path.join(repositoryRoot, "templates", "base", "build.gradle"),
|
||||||
|
"utf8",
|
||||||
|
);
|
||||||
|
|
||||||
|
assert.doesNotMatch(
|
||||||
|
gradleProperties,
|
||||||
|
/org\.gradle\.jvmargs=.*-Dfile\.encoding=/,
|
||||||
|
"Gradle daemon encoding must remain platform-compatible for worker classpath files",
|
||||||
|
);
|
||||||
|
assert.match(buildGradle, /tasks\.withType\(JavaCompile\)[\s\S]*options\.encoding = 'UTF-8'/);
|
||||||
|
assert.match(buildGradle, /tasks\.withType\(Test\)[\s\S]*jvmArgs '-Dfile\.encoding=UTF-8'/);
|
||||||
|
assert.match(buildGradle, /tasks\.withType\(JavaExec\)[\s\S]*jvmArgs '-Dfile\.encoding=UTF-8'/);
|
||||||
|
});
|
||||||
|
|
||||||
|
test("runs a child process from a Korean path containing spaces", async (t) => {
|
||||||
|
const root = await mkdtemp(path.join(os.tmpdir(), "kri-create-spring-한글 공백-"));
|
||||||
|
const targetDir = path.join(root, "생성 프로젝트");
|
||||||
|
await mkdir(targetDir, { recursive: true });
|
||||||
|
t.after(() => rm(root, { recursive: true, force: true }));
|
||||||
|
|
||||||
|
const markerName = "실행 결과.txt";
|
||||||
|
const script = `require("node:fs").writeFileSync(${JSON.stringify(markerName)}, process.cwd(), "utf8")`;
|
||||||
|
const nodeCommand = process.platform === "win32" ? path.basename(process.execPath) : process.execPath;
|
||||||
|
await run(nodeCommand, ["-e", script], targetDir);
|
||||||
|
|
||||||
|
assert.equal(await readFile(path.join(targetDir, markerName), "utf8"), targetDir);
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user