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 (94ac563399), 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
This commit is contained in:
Dallin Romney
2026-05-20 17:20:47 -07:00
committed by GitHub
parent 5c4c6a4207
commit cd019cfa41
3 changed files with 43 additions and 0 deletions

View File

@@ -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.

View File

@@ -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]);
});
});

View File

@@ -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;
}