build: suppress rolldown-plugin-dts CommonJS dts warnings from bundle… · openclaw/openclaw@cd019cf
RomneyDa
·
2026-05-21
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -17,6 +17,7 @@ Docs: https://docs.openclaw.ai
|
17 | 17 | ### Fixes |
18 | 18 | |
19 | 19 | - 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. |
20 | 21 | - Approvals: route manual `/approve` decisions through the trusted approval runtime so active exec and plugin approvals no longer look unknown or expired. |
21 | 22 | - Mac app: update the About settings copyright year to 2026. (#84385) Thanks @pejmanjohn. |
22 | 23 | - 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. |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -18,6 +18,7 @@ type TsdownLog = {
|
18 | 18 | message?: string; |
19 | 19 | id?: string; |
20 | 20 | importer?: string; |
| 21 | +plugin?: string; |
21 | 22 | }; |
22 | 23 | |
23 | 24 | type TsdownOnLog = ( |
@@ -270,4 +271,36 @@ describe("tsdown config", () => {
|
270 | 271 | |
271 | 272 | expect(handled).toEqual([log]); |
272 | 273 | }); |
| 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 | +}); |
273 | 306 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -81,13 +81,22 @@ function buildInputOptions(options: InputOptionsArg): InputOptionsReturn {
|
81 | 81 | message?: string; |
82 | 82 | id?: string; |
83 | 83 | importer?: string; |
| 84 | +plugin?: string; |
84 | 85 | }) { |
85 | 86 | if (log.code === "PLUGIN_TIMINGS") { |
86 | 87 | return true; |
87 | 88 | } |
88 | 89 | if (log.code === "UNRESOLVED_IMPORT") { |
89 | 90 | return normalizedLogHaystack(log).includes("extensions/"); |
90 | 91 | } |
| 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 | +} |
91 | 100 | if (log.code !== "EVAL") { |
92 | 101 | return false; |
93 | 102 | } |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。