diff --git a/scripts/defines.ts b/scripts/defines.ts index d339b0eb3..097a6d217 100644 --- a/scripts/defines.ts +++ b/scripts/defines.ts @@ -7,7 +7,7 @@ */ export function getMacroDefines(): Record { return { - "MACRO.VERSION": JSON.stringify("4.0.1"), + "MACRO.VERSION": JSON.stringify("4.0.3"), "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()), "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""), "MACRO.ISSUES_EXPLAINER": JSON.stringify(""), diff --git a/scripts/dev.ts b/scripts/dev.ts index 0b35f4bc8..d0aeae49b 100644 --- a/scripts/dev.ts +++ b/scripts/dev.ts @@ -53,8 +53,12 @@ const inspectArgs = process.env.BUN_INSPECT ? ["--inspect-wait=" + process.env.BUN_INSPECT] : []; +// Use the bun executable from PATH - on Windows, Bun CLI registers 'bun' command +// which resolves to bun.exe. Using 'bun' directly works on all platforms. +const bunCmd = process.platform === 'win32' ? 'bun.exe' : 'bun'; + const result = Bun.spawnSync( - ["bun", ...inspectArgs, "run", ...defineArgs, ...featureArgs, cliPath, ...process.argv.slice(2)], + [bunCmd, ...inspectArgs, "run", ...defineArgs, ...featureArgs, cliPath, ...process.argv.slice(2)], { stdio: ["inherit", "inherit", "inherit"], cwd: projectRoot }, ); diff --git a/scripts/health-check.ts b/scripts/health-check.ts index 458420989..dd3b7ec3d 100644 --- a/scripts/health-check.ts +++ b/scripts/health-check.ts @@ -57,6 +57,7 @@ async function checkCodeSize() { // --------------------------------------------------------------------------- async function checkLint() { try { + // Use 'bunx' which resolves to bunx.exe on Windows const result = await $`bunx biome check src/ 2>&1`.quiet().nothrow().text(); const errorMatch = result.match(/Found (\d+) errors?/); const warnMatch = result.match(/Found (\d+) warnings?/); @@ -74,6 +75,7 @@ async function checkLint() { // --------------------------------------------------------------------------- async function checkTests() { try { + // Use 'bun test' which resolves correctly on Windows const result = await $`bun test 2>&1`.quiet().nothrow().text(); const passMatch = result.match(/(\d+) pass/); const failMatch = result.match(/(\d+) fail/); @@ -91,6 +93,7 @@ async function checkTests() { // --------------------------------------------------------------------------- async function checkUnused() { try { + // Use 'bunx knip-bun' which resolves correctly on Windows const result = await $`bunx knip-bun 2>&1`.quiet().nothrow().text(); const unusedFiles = result.match(/Unused files \((\d+)\)/); const unusedExports = result.match(/Unused exports \((\d+)\)/); @@ -108,6 +111,7 @@ async function checkUnused() { // --------------------------------------------------------------------------- async function checkBuild() { try { + // Use 'bun run build' which resolves correctly on Windows const result = await $`bun run build 2>&1`.quiet().nothrow(); if (result.exitCode === 0) { // 获取产物大小