From 79548c324ea142f3ae24f6cd16093e70151070b8 Mon Sep 17 00:00:00 2001 From: y574444354 <574444354@qq.com> Date: Tue, 12 May 2026 15:22:34 +0800 Subject: [PATCH] chore: bump version to 4.0.16 and clean up source maps in build output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 版本号 4.0.15 → 4.0.16 (package.json + MACRO.VERSION) - build.ts: 新增 Step 6,构建完成后清理 .map 文件(约 64MB) 解决 npm mirror 80MB 包体积限制的同步失败问题 --- build.ts | 13 +++++++++++++ package.json | 2 +- scripts/defines.ts | 2 +- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/build.ts b/build.ts index 5ebc1e95f..cb28fd106 100644 --- a/build.ts +++ b/build.ts @@ -136,3 +136,16 @@ chmodSync(cliBun, 0o755) chmodSync(cliNode, 0o755) console.log(`Generated ${cliBun} (shebang: bun) and ${cliNode} (shebang: node)`) + +// Step 6: Clean up source maps — they add ~64MB to the package, exceeding +// npmmirror's 80MB size limit. Source maps are only useful for local +// debugging, not for package consumers. +const { unlinkSync } = await import('fs') +let mapCount = 0 +for (const file of files) { + if (file.endsWith('.map')) { + unlinkSync(join(outdir, file)) + mapCount++ + } +} +console.log(`Cleaned ${mapCount} source map files from ${outdir}/ (saved ~64MB)`) diff --git a/package.json b/package.json index b9491cfc2..e5d1ec370 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@costrict/csc", - "version": "4.0.15", + "version": "4.0.16", "description": "costrict", "type": "module", "author": "costrict", diff --git a/scripts/defines.ts b/scripts/defines.ts index 3f731fbd6..c8bc60c9f 100644 --- a/scripts/defines.ts +++ b/scripts/defines.ts @@ -14,7 +14,7 @@ export function getMacroDefines(): Record { // ignore git errors } return { - "MACRO.VERSION": JSON.stringify("4.0.15"), + "MACRO.VERSION": JSON.stringify("4.0.16"), "MACRO.BUILD_TIME": JSON.stringify(new Date().toISOString()), "MACRO.COMMIT": JSON.stringify(commit), "MACRO.FEEDBACK_CHANNEL": JSON.stringify(""),