From 69f34413c9ee6f85c4f870a0882d67163c45b704 Mon Sep 17 00:00:00 2001 From: commilitia Date: Tue, 26 May 2026 17:26:30 +0800 Subject: [PATCH] =?UTF-8?q?CHANGELOG=EF=BC=9A=E8=A3=9C=20ESM=20export?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 對應 main 之 a5faec5。檔尾加 `export { createCjkAutospace }` 讓 Vite / Rollup / TS 之 ESM 消費端可 named import;IIFE 串接端 sed 剝最後一行即可。 --- CHANGELOG.html | 30 ++++++++++++++++++++++++++++-- CHANGELOG.src.html | 11 +++++++++++ 2 files changed, 39 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.html b/CHANGELOG.html index 79440d9..1c43d5b 100644 --- a/CHANGELOG.html +++ b/CHANGELOG.html @@ -1,4 +1,4 @@ - + @@ -2250,6 +2250,12 @@ main > *:nth-child(n+6) { animation-delay: 0.46s; }
+

2026-05-26 — 補 ESM export(四種消費形式並存)

+ +

下游 Vite / Rollup / TypeScript 之靜態 ESM 解析需要真正之 export 關鍵字;原 UMD-ish(module.exports + globalThis)對 ESM 消費端仍須走「副作用導入 + 從 global 取 factory」之 workaround。檔尾在既有 CJS / globalThis 兩塊後加 export { createCjkAutospace },順序刻意如此 —— 讓 IIFE 串接端(Claude 模板 build.sh / Nvim peek build hook)只需以 sed '/^export {/d' 剝最後一行。

+ +

四種消費形式並存:ESM import / CommonJS require / browser globalThis / IIFE 串接(後者需剝 export 行)。

+

2026-05-26 — Pass C:長英文段 lang 包裝(預設啟用)

解決 CJK 兩端對齊正文中行末長英文詞之斷行問題。原模板於 runtime 端用 <wbr> 每 6 字元亂插斷詞機會,產生兩個觀感問題:(1)位置與音節邊界無關,斷在怪位;(2)<wbr> 為 zero-width,斷處不顯連字符,讀者無法辨認「上行末是被斷開的詞」。

@@ -2330,6 +2336,11 @@ main > *:nth-child(n+6) { animation-delay: 0.46s; }