From 0108085e423c1ba280000cba7c1f59b4c6d8c84d Mon Sep 17 00:00:00 2001 From: Kaoru0822 <208281322+kaoru0822-kitauji@users.noreply.github.com> Date: Mon, 12 Oct 2026 05:10:30 +0000 Subject: [PATCH] fix(cli): restore import-map option descriptions in trace-web-module-imports help 48c352b6b built --import-map-path and --import-map-base-url as `shape..describe(...).optional()`. In Zod 4 the description stays on the inner schema while .optional() returns a new wrapper, and CLI help reads the wrapper, so both options printed without text and cliOptionAliases failed on main. Describe the optional wrapper instead. Fixes #2053 Co-Authored-By: Claude Opus 5.5 --- src/cli/webModuleCommands.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/cli/webModuleCommands.ts b/src/cli/webModuleCommands.ts index b14f23da5..f1e55c751 100644 --- a/src/cli/webModuleCommands.ts +++ b/src/cli/webModuleCommands.ts @@ -31,14 +31,15 @@ export const registerWebModuleCommands = ( }), options: z.object({ importerUrl: webModuleTraceInputSchema.shape.importer_url, + // Describe the optional wrapper: help reads the outer schema's metadata. importMapPath: importMapInputSchema.shape.path + .optional() .describe( "Absolute local import-map JSON path; requires --import-map-base-url", - ) - .optional(), + ), importMapBaseUrl: importMapInputSchema.shape.base_url - .describe("HTTP(S) import-map base URL; requires --import-map-path") - .optional(), + .optional() + .describe("HTTP(S) import-map base URL; requires --import-map-path"), }), run: ({ args, options }) => withCommandCancellation(async (signal) => {