Skip to content

Commit cd019cf

Browse files
authored
build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales (#84592)
* build: suppress rolldown-plugin-dts CommonJS dts warnings from bundled zod locales After bumping rolldown-plugin-dts to 0.25.1 (94ac563), every `pnpm build` emits a 'CommonJS dts' warning per zod `v4/locales/*.d.cts` file because zod is intentionally inlined for global pnpm install resolution (#78515) and tsdown's external option cannot be scoped to the dts pass only. Filter the warning in the existing onLog suppression list (same pattern as PLUGIN_TIMINGS / UNRESOLVED_IMPORT / EVAL) so other rolldown-plugin-dts warnings remain visible. * docs(changelog): move rolldown-dts entry into 2026.5.20 fixes
1 parent 5c4c6a4 commit cd019cf

3 files changed

Lines changed: 43 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ Docs: https://docs.openclaw.ai
1717
### Fixes
1818

1919
- WhatsApp: update Baileys to `7.0.0-rc12`.
20+
- 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.
2021
- Approvals: route manual `/approve` decisions through the trusted approval runtime so active exec and plugin approvals no longer look unknown or expired.
2122
- Mac app: update the About settings copyright year to 2026. (#84385) Thanks @pejmanjohn.
2223
- 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.

src/infra/tsdown-config.test.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ type TsdownLog = {
1818
message?: string;
1919
id?: string;
2020
importer?: string;
21+
plugin?: string;
2122
};
2223

2324
type TsdownOnLog = (
@@ -270,4 +271,36 @@ describe("tsdown config", () => {
270271

271272
expect(handled).toEqual([log]);
272273
});
274+
275+
it("suppresses rolldown-plugin-dts CommonJS dts warnings from bundled zod locales", () => {
276+
const configured = unifiedDistGraph()?.inputOptions?.({})?.onLog;
277+
const handled: TsdownLog[] = [];
278+
279+
configured?.(
280+
"warn",
281+
{
282+
code: "PLUGIN_WARNING",
283+
plugin: "rolldown-plugin-dts:fake-js",
284+
message:
285+
"/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.",
286+
},
287+
(_level, log) => handled.push(log),
288+
);
289+
290+
expect(handled).toStrictEqual([]);
291+
});
292+
293+
it("keeps other rolldown-plugin-dts warnings visible", () => {
294+
const configured = unifiedDistGraph()?.inputOptions?.({})?.onLog;
295+
const handled: TsdownLog[] = [];
296+
const log = {
297+
code: "PLUGIN_WARNING",
298+
plugin: "rolldown-plugin-dts:fake-js",
299+
message: "some other dts warning that should not be hidden",
300+
};
301+
302+
configured?.("warn", log, (_level, forwardedLog) => handled.push(forwardedLog));
303+
304+
expect(handled).toEqual([log]);
305+
});
273306
});

tsdown.config.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,13 +81,22 @@ function buildInputOptions(options: InputOptionsArg): InputOptionsReturn {
8181
message?: string;
8282
id?: string;
8383
importer?: string;
84+
plugin?: string;
8485
}) {
8586
if (log.code === "PLUGIN_TIMINGS") {
8687
return true;
8788
}
8889
if (log.code === "UNRESOLVED_IMPORT") {
8990
return normalizedLogHaystack(log).includes("extensions/");
9091
}
92+
if (
93+
log.code === "PLUGIN_WARNING" &&
94+
log.plugin === "rolldown-plugin-dts:fake-js" &&
95+
typeof log.message === "string" &&
96+
log.message.includes("uses CommonJS dts syntax")
97+
) {
98+
return true;
99+
}
91100
if (log.code !== "EVAL") {
92101
return false;
93102
}

0 commit comments

Comments
 (0)