()
| 443 | } |
| 444 | |
| 445 | export async function promptVisualAssets() { |
| 446 | const icon = await input({ |
| 447 | message: "Icon file path (optional, relative to manifest):", |
| 448 | validate: (value) => { |
| 449 | if (!value.trim()) return true; |
| 450 | if (value.includes("..")) return "Relative paths cannot include '..'"; |
| 451 | return true; |
| 452 | }, |
| 453 | }); |
| 454 | |
| 455 | const addIconVariants = await confirm({ |
| 456 | message: "Add theme/size-specific icons array?", |
| 457 | default: false, |
| 458 | }); |
| 459 | |
| 460 | const icons: Array<{ |
| 461 | src: string; |
| 462 | size: string; |
| 463 | theme?: string; |
| 464 | }> = []; |
| 465 | |
| 466 | if (addIconVariants) { |
| 467 | let addMoreIcons = true; |
| 468 | while (addMoreIcons) { |
| 469 | const iconSrc = await input({ |
| 470 | message: "Icon source path (relative to manifest):", |
| 471 | validate: (value) => { |
| 472 | if (!value.trim()) return "Icon path is required"; |
| 473 | if (value.includes("..")) return "Relative paths cannot include '..'"; |
| 474 | return true; |
| 475 | }, |
| 476 | }); |
| 477 | |
| 478 | const iconSize = await input({ |
| 479 | message: "Icon size (e.g., 16x16):", |
| 480 | validate: (value) => { |
| 481 | if (!value.trim()) return "Icon size is required"; |
| 482 | if (!/^\d+x\d+$/.test(value)) { |
| 483 | return "Icon size must be in WIDTHxHEIGHT format (e.g., 128x128)"; |
| 484 | } |
| 485 | return true; |
| 486 | }, |
| 487 | }); |
| 488 | |
| 489 | const iconTheme = await input({ |
| 490 | message: "Icon theme (light, dark, or custom - optional):", |
| 491 | default: "", |
| 492 | }); |
| 493 | |
| 494 | icons.push({ |
| 495 | src: iconSrc, |
| 496 | size: iconSize, |
| 497 | ...(iconTheme.trim() ? { theme: iconTheme.trim() } : {}), |
| 498 | }); |
| 499 | |
| 500 | addMoreIcons = await confirm({ |
| 501 | message: "Add another icon entry?", |
| 502 | default: false, |
no outgoing calls
no test coverage detected
searching dependent graphs…