Package release 0.4.167 from the current workspace snapshot

Constraint: Windows and Linux artifacts are built on native GitHub runners from a temporary snapshot branch
Rejected: Build Windows/Linux locally on Apple Silicon | docker/wine packaging is not stable on this host
Confidence: medium
Scope-risk: moderate
Directive: This snapshot branch is transport-only and should be deleted after the release completes
Tested: local verify/build stages before snapshot creation
Not-tested: remote packaging before workflow execution
This commit is contained in:
ZacharyZhang-NY committed 2026-04-11 02:11:07 -04:00
1 parent 9779c4d1ca
commit 237db05e37
29 files changed
+1193 -85

No files matched your search

@@ -35,6 +35,8 @@ interface SpawnTarget {
args: string[];
}
const WINDOWS_CMD_SCRIPT_EXTENSIONS = new Set([".bat", ".cmd"]);
type ChildProcessWithEvents = ChildProcess & {
on(event: "error", listener: (err: Error) => void): ChildProcess;
on(
@@ -105,7 +107,23 @@ function quoteForCmd(arg: string) {
return /[\s"&<>|^()]/.test(escaped) ? `"${escaped}"` : escaped;
}
async function resolveSpawnTarget(
export function buildWindowsSpawnTarget(
executable: string,
args: string[],
shell: string,
): SpawnTarget {
const extension = path.extname(executable).toLowerCase();
if (!WINDOWS_CMD_SCRIPT_EXTENSIONS.has(extension)) {
return { command: executable, args };
}
const commandLine = [quoteForCmd(executable), ...args.map(quoteForCmd)].join(" ");
return {
command: shell,
args: ["/d", "/c", `chcp 65001 >nul && ${commandLine}`],
};
}
export async function resolveSpawnTarget(
command: string,
args: string[],
cwd: string,
@@ -123,11 +141,7 @@ async function resolveSpawnTarget(
// Chinese/CJK character corruption. The default Windows code page (e.g. 936/GBK)
// corrupts multi-byte UTF-8 characters passed through cmd.exe, curl, etc.
const shell = env.ComSpec || process.env.ComSpec || "cmd.exe";
const commandLine = [quoteForCmd(executable), ...args.map(quoteForCmd)].join(" ");
return {
command: shell,
args: ["/d", "/s", "/c", `chcp 65001 >nul && ${commandLine}`],
};
return buildWindowsSpawnTarget(executable, args, shell);
}
export function ensurePathInEnv(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {