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.<field>.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 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3bdc8730bd
commit
0108085e42
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user