diff --git a/CHANGELOG.md b/CHANGELOG.md index 3337366935db..dede923e08e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ Docs: https://docs.openclaw.ai ### Fixes - WhatsApp: update Baileys to `7.0.0-rc12`. +- Build: suppress per-locale `rolldown-plugin-dts:fake-js` CommonJS dts warnings emitted while bundling the intentionally-inlined `zod/v4/locales/*.d.cts` files, so `pnpm build` output stays readable after the 0.25.1 plugin bump. Thanks @romneyda. - Approvals: route manual `/approve` decisions through the trusted approval runtime so active exec and plugin approvals no longer look unknown or expired. - Mac app: update the About settings copyright year to 2026. (#84385) Thanks @pejmanjohn. - Dependencies: update `@openclaw/fs-safe` to `0.2.7` so OpenClaw's default Python-helper-off policy keeps best-effort Node write fallbacks for private stores, secret writes, run logs, and media attachments on Linux/macOS. diff --git a/src/infra/tsdown-config.test.ts b/src/infra/tsdown-config.test.ts index d5aa1e4fcb65..ac1a8c872724 100644 --- a/src/infra/tsdown-config.test.ts +++ b/src/infra/tsdown-config.test.ts @@ -18,6 +18,7 @@ type TsdownLog = { message?: string; id?: string; importer?: string; + plugin?: string; }; type TsdownOnLog = ( @@ -270,4 +271,36 @@ describe("tsdown config", () => { expect(handled).toEqual([log]); }); + + it("suppresses rolldown-plugin-dts CommonJS dts warnings from bundled zod locales", () => { + const configured = unifiedDistGraph()?.inputOptions?.({})?.onLog; + const handled: TsdownLog[] = []; + + configured?.( + "warn", + { + code: "PLUGIN_WARNING", + plugin: "rolldown-plugin-dts:fake-js", + message: + "/abs/path/node_modules/zod/v4/locales/ur.d.cts uses CommonJS dts syntax. CommonJS dts modules cannot be reliably bundled by rolldown-plugin-dts. Please mark this module as external in your Rolldown config.", + }, + (_level, log) => handled.push(log), + ); + + expect(handled).toStrictEqual([]); + }); + + it("keeps other rolldown-plugin-dts warnings visible", () => { + const configured = unifiedDistGraph()?.inputOptions?.({})?.onLog; + const handled: TsdownLog[] = []; + const log = { + code: "PLUGIN_WARNING", + plugin: "rolldown-plugin-dts:fake-js", + message: "some other dts warning that should not be hidden", + }; + + configured?.("warn", log, (_level, forwardedLog) => handled.push(forwardedLog)); + + expect(handled).toEqual([log]); + }); }); diff --git a/tsdown.config.ts b/tsdown.config.ts index ed45819f3f27..89b5c69309e4 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -81,6 +81,7 @@ function buildInputOptions(options: InputOptionsArg): InputOptionsReturn { message?: string; id?: string; importer?: string; + plugin?: string; }) { if (log.code === "PLUGIN_TIMINGS") { return true; @@ -88,6 +89,14 @@ function buildInputOptions(options: InputOptionsArg): InputOptionsReturn { if (log.code === "UNRESOLVED_IMPORT") { return normalizedLogHaystack(log).includes("extensions/"); } + if ( + log.code === "PLUGIN_WARNING" && + log.plugin === "rolldown-plugin-dts:fake-js" && + typeof log.message === "string" && + log.message.includes("uses CommonJS dts syntax") + ) { + return true; + } if (log.code !== "EVAL") { return false; }